| 98 | } // ~SCLaplaceOperator() |
| 99 | |
| 100 | void |
| 101 | SCLaplaceOperator::apply(SAMRAIVectorReal<NDIM, double>& x, SAMRAIVectorReal<NDIM, double>& y) |
| 102 | { |
| 103 | IBTK_TIMER_START(t_apply); |
| 104 | |
| 105 | #if !defined(NDEBUG) |
| 106 | TBOX_ASSERT(d_is_initialized); |
| 107 | TBOX_ASSERT(d_bc_coefs.size() == NDIM); |
| 108 | for (int comp = 0; comp < d_ncomp; ++comp) |
| 109 | { |
| 110 | Pointer<SideVariable<NDIM, double>> x_sc_var = x.getComponentVariable(comp); |
| 111 | Pointer<SideVariable<NDIM, double>> y_sc_var = y.getComponentVariable(comp); |
| 112 | if (!x_sc_var || !y_sc_var) |
| 113 | { |
| 114 | TBOX_ERROR(d_object_name << "::apply()\n" |
| 115 | << " encountered non-side centered vector components" << std::endl); |
| 116 | } |
| 117 | Pointer<SideDataFactory<NDIM, double>> x_factory = x_sc_var->getPatchDataFactory(); |
| 118 | Pointer<SideDataFactory<NDIM, double>> y_factory = y_sc_var->getPatchDataFactory(); |
| 119 | TBOX_ASSERT(x_factory); |
| 120 | TBOX_ASSERT(y_factory); |
| 121 | const unsigned int x_depth = x_factory->getDefaultDepth(); |
| 122 | const unsigned int y_depth = y_factory->getDefaultDepth(); |
| 123 | TBOX_ASSERT(x_depth == y_depth); |
| 124 | if (x_depth != 1 || y_depth != 1) |
| 125 | { |
| 126 | TBOX_ERROR(d_object_name << "::apply()\n" |
| 127 | << " each vector component must have data depth == 1" << std::endl); |
| 128 | } |
| 129 | } |
| 130 | #endif |
| 131 | |
| 132 | // Simultaneously fill ghost cell values for all components. |
| 133 | using InterpolationTransactionComponent = HierarchyGhostCellInterpolation::InterpolationTransactionComponent; |
| 134 | std::vector<InterpolationTransactionComponent> transaction_comps; |
| 135 | for (int comp = 0; comp < d_ncomp; ++comp) |
| 136 | { |
| 137 | InterpolationTransactionComponent x_component(x.getComponentDescriptorIndex(comp), |
| 138 | d_data_refine_type, |
| 139 | d_use_cf_interpolation, |
| 140 | d_data_coarsen_type, |
| 141 | d_bdry_extrap_type, |
| 142 | d_use_consistent_type_2_bdry, |
| 143 | d_bc_coefs, |
| 144 | d_fill_pattern); |
| 145 | transaction_comps.push_back(x_component); |
| 146 | } |
| 147 | d_hier_bdry_fill->resetTransactionComponents(transaction_comps); |
| 148 | d_hier_bdry_fill->setHomogeneousBc(d_homogeneous_bc); |
| 149 | d_hier_bdry_fill->fillData(d_solution_time); |
| 150 | d_hier_bdry_fill->resetTransactionComponents(d_transaction_comps); |
| 151 | |
| 152 | // Compute the action of the operator. |
| 153 | for (int comp = 0; comp < d_ncomp; ++comp) |
| 154 | { |
| 155 | Pointer<SideVariable<NDIM, double>> x_sc_var = x.getComponentVariable(comp); |
| 156 | Pointer<SideVariable<NDIM, double>> y_sc_var = y.getComponentVariable(comp); |
| 157 | const int x_idx = x.getComponentDescriptorIndex(comp); |
nothing calls this directly
no test coverage detected