That is explicitly use use Simple DM to create solver for DM. Pipeline menage by default creat copy of DM, in case several solvers are used the same DM.
Alternatively you can get dm directly from the solver, i.e.
300 {
302
305
306 auto create_post_process_element = [&]() {
307 auto post_proc_fe = boost::make_shared<PostProcEle>(
mField);
308 auto det_ptr = boost::make_shared<VectorDouble>();
309 auto jac_ptr = boost::make_shared<MatrixDouble>();
310 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
312 post_proc_fe->getOpPtrVector().push_back(
314 post_proc_fe->getOpPtrVector().push_back(
316
317 auto u_ptr = boost::make_shared<VectorDouble>();
318 post_proc_fe->getOpPtrVector().push_back(
320
322
323 post_proc_fe->getOpPtrVector().push_back(
324
325 new OpPPMap(post_proc_fe->getPostProcMesh(),
326 post_proc_fe->getMapGaussPts(),
327
328 {{"U", u_ptr}},
329
330 {}, {}, {}
331
332 )
333
334 );
335
336 return post_proc_fe;
337 };
338
339 auto set_time_monitor = [&](auto dm, auto solver) {
341 boost::shared_ptr<Monitor> monitor_ptr(
342 new Monitor(dm, create_post_process_element()));
343 boost::shared_ptr<ForcesAndSourcesCore> null;
345 monitor_ptr, null, null);
347 };
348
349 auto set_fieldsplit_preconditioner = [&](auto solver) {
351 SNES snes;
352 CHKERR TSGetSNES(solver, &snes);
353 KSP ksp;
354 CHKERR SNESGetKSP(snes, &ksp);
355 PC pc;
356 CHKERR KSPGetPC(ksp, &pc);
357 PetscBool is_pcfs = PETSC_FALSE;
358 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
359
360 if (is_pcfs == PETSC_TRUE) {
362 auto name_prb =
simple->getProblemName();
363 auto is_all_bc = bc_mng->getBlockIS(name_prb, "ESSENTIAL", "U", 0, 0);
364 int is_all_bc_size;
365 CHKERR ISGetSize(is_all_bc, &is_all_bc_size);
367 << "Field split block size " << is_all_bc_size;
368 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL,
369 is_all_bc);
370 }
372 };
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391 auto set_user_ts_jacobian = [&](auto dm) {
395 };
396
397 auto dm =
simple->getDM();
400
401 auto solver = pipeline_mng->createTSIM(
403
404 CHKERR set_user_ts_jacobian(dm);
405 CHKERR set_time_monitor(dm, solver);
406 CHKERR TSSetSolution(solver,
D);
407 CHKERR TSSetFromOptions(solver);
408 CHKERR set_fieldsplit_preconditioner(solver);
410
412
414}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
auto createDMVector(DM dm)
Get smart vector from DM.
#define MOFEM_LOG(channel, severity)
Log.
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Post post-proc data at points from hash maps.
Set inverse jacobian to base functions.