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