Run over elements in the list.
210 {
211
213 KspCtx::KspCtxImpl *ksp_ctx = static_cast<KspCtx *>(ctx)->kspCtxImpl.get();
214 PetscLogEventBegin(ksp_ctx->MOFEM_EVENT_KspMat, 0, 0, 0, 0);
215
216 ksp_ctx->matAssembleSwitch = boost::movelib::make_unique<bool>(true);
217 auto cache_ptr = boost::make_shared<CacheTuple>();
218 CHKERR ksp_ctx->mField.cache_problem_entities(ksp_ctx->problemName,
219 cache_ptr);
220
221 auto set = [&](auto &fe) {
222 fe.ksp = ksp;
225 fe.ksp_ctx = KspMethod::CTX_OPERATORS;
226 fe.data_ctx = PetscData::CtxSetA | PetscData::CtxSetB;
227 fe.cacheWeakPtr = cache_ptr;
228 };
229
230 auto unset = [&](auto &fe) {
231 fe.ksp_ctx = KspMethod::CTX_KSPNONE;
232 fe.data_ctx = PetscData::CtxSetNone;
233 };
234
235 auto ent_data_cache = boost::make_shared<std::vector<EntityCacheDofs>>();
236 auto ent_row_cache =
237 boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
238 auto ent_col_cache =
239 boost::make_shared<std::vector<EntityCacheNumeredDofs>>();
240
241
242 for (
auto &
bit : ksp_ctx->preProcessOperator) {
243 bit->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
245 CHKERR ksp_ctx->mField.problem_basic_method_preProcess(ksp_ctx->problemName,
248 ksp_ctx->matAssembleSwitch = boost::move(
bit->matAssembleSwitch);
249 }
250
251
252 for (auto &lit : ksp_ctx->loopsOperator) {
253 lit.second->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
254 set(*lit.second);
255 CHKERR ksp_ctx->mField.loop_finite_elements(ksp_ctx->problemName, lit.first,
256 *(lit.second), nullptr,
257 ksp_ctx->bH, cache_ptr);
258 unset(*lit.second);
259 ksp_ctx->matAssembleSwitch = boost::move(lit.second->matAssembleSwitch);
260 }
261
262
263 for (
auto &
bit : ksp_ctx->postProcessOperator) {
264 bit->matAssembleSwitch = boost::move(ksp_ctx->matAssembleSwitch);
266 CHKERR ksp_ctx->mField.problem_basic_method_postProcess(
267 ksp_ctx->problemName, *
bit);
269 ksp_ctx->matAssembleSwitch = boost::move(
bit->matAssembleSwitch);
270 }
271
272 if (ksp_ctx->matAssembleSwitch) {
273 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
274 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
275 }
276 PetscLogEventEnd(ksp_ctx->MOFEM_EVENT_KspMat, 0, 0, 0, 0);
278}
#define CHKERR
Inline error check.