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