MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / apply

Method apply

ibtk/src/solvers/impls/CCLaplaceOperator.cpp:88–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86} // ~CCLaplaceOperator()
87
88void
89CCLaplaceOperator::apply(SAMRAIVectorReal<NDIM, double>& x, SAMRAIVectorReal<NDIM, double>& y)
90{
91 IBTK_TIMER_START(t_apply);
92
93#if !defined(NDEBUG)
94 TBOX_ASSERT(d_is_initialized);
95 for (int comp = 0; comp < d_ncomp; ++comp)
96 {
97 Pointer<CellVariable<NDIM, double>> x_cc_var = x.getComponentVariable(comp);
98 Pointer<CellVariable<NDIM, double>> y_cc_var = y.getComponentVariable(comp);
99 if (!x_cc_var || !y_cc_var)
100 {
101 TBOX_ERROR(d_object_name << "::apply()\n"
102 << " encountered non-cell centered vector components" << std::endl);
103 }
104 Pointer<CellDataFactory<NDIM, double>> x_factory = x_cc_var->getPatchDataFactory();
105 Pointer<CellDataFactory<NDIM, double>> y_factory = y_cc_var->getPatchDataFactory();
106 TBOX_ASSERT(x_factory);
107 TBOX_ASSERT(y_factory);
108 const unsigned int x_depth = x_factory->getDefaultDepth();
109 const unsigned int y_depth = y_factory->getDefaultDepth();
110 TBOX_ASSERT(x_depth == y_depth);
111 if (x_depth != d_bc_coefs.size() || y_depth != d_bc_coefs.size())
112 {
113 TBOX_ERROR(d_object_name << "::apply()\n"
114 << " each vector component must have data depth == " << d_bc_coefs.size() << "\n"
115 << " since d_bc_coefs.size() == " << d_bc_coefs.size() << std::endl);
116 }
117 }
118#endif
119
120 // Simultaneously fill ghost cell values for all components.
121 using InterpolationTransactionComponent = HierarchyGhostCellInterpolation::InterpolationTransactionComponent;
122 std::vector<InterpolationTransactionComponent> transaction_comps;
123 for (int comp = 0; comp < d_ncomp; ++comp)
124 {
125 InterpolationTransactionComponent x_component(x.getComponentDescriptorIndex(comp),
126 d_data_refine_type,
127 d_use_cf_interpolation,
128 d_data_coarsen_type,
129 d_bdry_extrap_type,
130 d_use_consistent_type_2_bdry,
131 d_bc_coefs,
132 d_fill_pattern);
133 transaction_comps.push_back(x_component);
134 }
135 d_hier_bdry_fill->resetTransactionComponents(transaction_comps);
136 d_hier_bdry_fill->setHomogeneousBc(d_homogeneous_bc);
137 d_hier_bdry_fill->fillData(d_solution_time);
138 d_hier_bdry_fill->resetTransactionComponents(d_transaction_comps);
139
140 // Compute the action of the operator.
141 for (int comp = 0; comp < d_ncomp; ++comp)
142 {
143 Pointer<CellVariable<NDIM, double>> x_cc_var = x.getComponentVariable(comp);
144 Pointer<CellVariable<NDIM, double>> y_cc_var = y.getComponentVariable(comp);
145 const int x_idx = x.getComponentDescriptorIndex(comp);

Callers 8

FormFunction_SAMRAIMethod · 0.45
MatVecMult_SAMRAIMethod · 0.45
MatVecMult_SAMRAIMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 6

fillDataMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45
setHomogeneousBcMethod · 0.45
laplaceMethod · 0.45

Tested by

no test coverage detected