| 233 | } // apply |
| 234 | |
| 235 | void |
| 236 | CIBStaggeredStokesOperator::initializeOperatorState(const SAMRAIVectorReal<NDIM, double>& in, |
| 237 | const SAMRAIVectorReal<NDIM, double>& /*out*/) |
| 238 | { |
| 239 | IBAMR_TIMER_START(t_initialize_operator_state); |
| 240 | |
| 241 | // Deallocate the operator state if the operator is already initialized. |
| 242 | if (d_is_initialized) deallocateOperatorState(); |
| 243 | |
| 244 | // Setup the interpolation transaction information. |
| 245 | // |
| 246 | // NOTE: This will ensure that all ghost cell values are filled in communication. The default communication |
| 247 | // patterns setup by StaggeredStokesOperator will omit corners and (in 3D) edges. |
| 248 | d_U_fill_pattern = nullptr; |
| 249 | d_P_fill_pattern = nullptr; |
| 250 | using InterpolationTransactionComponent = HierarchyGhostCellInterpolation::InterpolationTransactionComponent; |
| 251 | d_transaction_comps.resize(2); |
| 252 | d_transaction_comps[0] = InterpolationTransactionComponent(in.getComponentDescriptorIndex(0), |
| 253 | d_refine_type, |
| 254 | d_use_cf_interpolation, |
| 255 | d_coarsen_type, |
| 256 | d_bdry_extrap_type, |
| 257 | d_consistent_type_2_bdry, |
| 258 | d_U_bc_coefs, |
| 259 | d_U_fill_pattern, |
| 260 | d_bdry_interp_type); |
| 261 | d_transaction_comps[1] = InterpolationTransactionComponent(in.getComponentDescriptorIndex(1), |
| 262 | d_refine_type, |
| 263 | d_use_cf_interpolation, |
| 264 | d_coarsen_type, |
| 265 | d_bdry_extrap_type, |
| 266 | d_consistent_type_2_bdry, |
| 267 | d_P_bc_coef, |
| 268 | d_P_fill_pattern, |
| 269 | d_bdry_interp_type); |
| 270 | |
| 271 | // Initialize the interpolation operators. |
| 272 | d_hier_bdry_fill = new HierarchyGhostCellInterpolation(); |
| 273 | d_hier_bdry_fill->initializeOperatorState(d_transaction_comps, in.getPatchHierarchy()); |
| 274 | |
| 275 | // Initialize hierarchy math ops object. |
| 276 | if (!d_hier_math_ops_external) |
| 277 | { |
| 278 | d_hier_math_ops = new HierarchyMathOps(d_object_name + "::HierarchyMathOps", |
| 279 | in.getPatchHierarchy(), |
| 280 | in.getCoarsestLevelNumber(), |
| 281 | in.getFinestLevelNumber()); |
| 282 | } |
| 283 | #if !defined(NDEBUG) |
| 284 | else |
| 285 | { |
| 286 | TBOX_ASSERT(d_hier_math_ops); |
| 287 | } |
| 288 | #endif |
| 289 | |
| 290 | // Indicate the operator is initialized. |
| 291 | d_is_initialized = true; |
| 292 |
no test coverage detected