v0.15.0
Loading...
Searching...
No Matches
TSPrePostProc Struct Reference

Set of functions called by PETSc solver used to refine and update mesh. More...

Collaboration diagram for TSPrePostProc:
[legend]

Public Member Functions

 TSPrePostProc ()=default
 
virtual ~TSPrePostProc ()=default
 
MoFEMErrorCode tsSetUp (TS ts)
 Used to setup TS solver.
 
 TSPrePostProc ()=default
 
virtual ~TSPrePostProc ()=default
 
MoFEMErrorCode tsSetUp (TS ts)
 Used to setup TS solver.
 
SmartPetscObj< VecScatter > getScatter (Vec x, Vec y, enum FR fr)
 
SmartPetscObj< Vec > getSubVector ()
 

Static Public Member Functions

static MoFEMErrorCode tsPostStage (TS ts, PetscReal stagetime, PetscInt stageindex, Vec *Y)
 [Boundary condition]
 
static MoFEMErrorCode tsPostStep (TS ts)
 
static MoFEMErrorCode tsPreStep (TS ts)
 

Public Attributes

ExamplefsRawPtr
 
SmartPetscObj< DM > solverSubDM
 
SmartPetscObj< Vec > globSol
 
FreeSurfacefsRawPtr
 

Static Private Member Functions

static MoFEMErrorCode tsPreProc (TS ts)
 Pre process time step.
 
static MoFEMErrorCode tsPostProc (TS ts)
 Post process time step.
 
static MoFEMErrorCode tsPreStage (TS ts)
 
static MoFEMErrorCode tsSetIFunction (TS ts, PetscReal t, Vec u, Vec u_t, Vec f, void *ctx)
 
static MoFEMErrorCode tsSetIJacobian (TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
 Wrapper for SNES Lhs.
 
static MoFEMErrorCode tsMonitor (TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
 Wrapper for TS monitor.
 
static MoFEMErrorCode pcSetup (PC pc)
 
static MoFEMErrorCode pcApply (PC pc, Vec pc_f, Vec pc_x)
 

Private Attributes

SmartPetscObj< Vec > globRes
 
SmartPetscObj< Mat > subB
 
SmartPetscObj< KSP > subKSP
 
boost::shared_ptr< SnesCtxsnesCtxPtr
 
boost::shared_ptr< TsCtxtsCtxPtr
 

Detailed Description

Set of functions called by PETSc solver used to refine and update mesh.

Note
Currently theta method is only handled by this code.
Examples
dynamic_first_order_con_law.cpp, and free_surface.cpp.

Definition at line 383 of file dynamic_first_order_con_law.cpp.

Constructor & Destructor Documentation

◆ TSPrePostProc() [1/2]

TSPrePostProc::TSPrePostProc ( )
default

◆ ~TSPrePostProc() [1/2]

virtual TSPrePostProc::~TSPrePostProc ( )
virtualdefault

◆ TSPrePostProc() [2/2]

TSPrePostProc::TSPrePostProc ( )
default

◆ ~TSPrePostProc() [2/2]

virtual TSPrePostProc::~TSPrePostProc ( )
virtualdefault

Member Function Documentation

◆ getScatter()

SmartPetscObj< VecScatter > TSPrePostProc::getScatter ( Vec x,
Vec y,
enum FR fr )
Examples
free_surface.cpp.

Definition at line 3107 of file free_surface.cpp.

3107 {
3108 if (auto ptr = tsPrePostProc.lock()) {
3109 auto prb_ptr = ptr->fsRawPtr->mField.get_problem("SUB_SOLVER");
3110 if (auto sub_data = prb_ptr->getSubData()) {
3111 auto is = sub_data->getSmartColIs();
3112 VecScatter s;
3113 if (fr == R) {
3114 CHK_THROW_MESSAGE(VecScatterCreate(x, PETSC_NULLPTR, y, is, &s),
3115 "crate scatter");
3116 } else {
3117 CHK_THROW_MESSAGE(VecScatterCreate(x, is, y, PETSC_NULLPTR, &s),
3118 "crate scatter");
3119 }
3120 return SmartPetscObj<VecScatter>(s);
3121 }
3122 }
3125}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
static boost::weak_ptr< TSPrePostProc > tsPrePostProc
@ R
intrusive_ptr for managing petsc objects

◆ getSubVector()

SmartPetscObj< Vec > TSPrePostProc::getSubVector ( )
Examples
free_surface.cpp.

Definition at line 3127 of file free_surface.cpp.

3127 {
3129}
auto createDMVector(DM dm)
Get smart vector from DM.
Definition DMMoFEM.hpp:1102
SmartPetscObj< DM > solverSubDM

◆ pcApply()

MoFEMErrorCode TSPrePostProc::pcApply ( PC pc,
Vec pc_f,
Vec pc_x )
staticprivate
Examples
free_surface.cpp.

Definition at line 3087 of file free_surface.cpp.

3087 {
3089 if (auto ptr = tsPrePostProc.lock()) {
3090 auto sub_x = ptr->getSubVector();
3091 auto sub_f = vectorDuplicate(sub_x);
3092 auto scatter = ptr->getScatter(sub_x, pc_x, R);
3093 CHKERR VecScatterBegin(scatter, pc_f, sub_f, INSERT_VALUES,
3094 SCATTER_REVERSE);
3095 CHKERR VecScatterEnd(scatter, pc_f, sub_f, INSERT_VALUES, SCATTER_REVERSE);
3096 CHKERR KSPSetOperators(ptr->subKSP, ptr->subB, ptr->subB);
3097 MOFEM_LOG("FS", Sev::verbose) << "PCShell solve";
3098 CHKERR KSPSolve(ptr->subKSP, sub_f, sub_x);
3099 MOFEM_LOG("FS", Sev::verbose) << "PCShell solve <- done";
3100 CHKERR VecScatterBegin(scatter, sub_x, pc_x, INSERT_VALUES,
3101 SCATTER_FORWARD);
3102 CHKERR VecScatterEnd(scatter, sub_x, pc_x, INSERT_VALUES, SCATTER_FORWARD);
3103 }
3105};
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MOFEM_LOG(channel, severity)
Log.
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.

◆ pcSetup()

MoFEMErrorCode TSPrePostProc::pcSetup ( PC pc)
staticprivate
Examples
free_surface.cpp.

Definition at line 3077 of file free_surface.cpp.

3077 {
3079 if (auto ptr = tsPrePostProc.lock()) {
3080 MOFEM_LOG("FS", Sev::verbose) << "SetUP sub PC";
3081 ptr->subKSP = createKSP(ptr->fsRawPtr->mField.get_comm());
3082 CHKERR KSPSetFromOptions(ptr->subKSP);
3083 }
3085};
auto createKSP(MPI_Comm comm)

◆ tsMonitor()

MoFEMErrorCode TSPrePostProc::tsMonitor ( TS ts,
PetscInt step,
PetscReal t,
Vec u,
void * ctx )
staticprivate

Wrapper for TS monitor.

Examples
free_surface.cpp.

Definition at line 3052 of file free_surface.cpp.

3053 {
3055 if (auto ptr = tsPrePostProc.lock()) {
3056 auto get_norm = [&](auto x) {
3057 double nrm;
3058 CHKERR VecNorm(x, NORM_2, &nrm);
3059 return nrm;
3060 };
3061
3062 auto sub_u = ptr->getSubVector();
3063 auto scatter = ptr->getScatter(sub_u, u, R);
3064 CHKERR VecScatterBegin(scatter, u, sub_u, INSERT_VALUES, SCATTER_REVERSE);
3065 CHKERR VecScatterEnd(scatter, u, sub_u, INSERT_VALUES, SCATTER_REVERSE);
3066 CHKERR VecGhostUpdateBegin(sub_u, INSERT_VALUES, SCATTER_FORWARD);
3067 CHKERR VecGhostUpdateEnd(sub_u, INSERT_VALUES, SCATTER_FORWARD);
3068
3069 MOFEM_LOG("FS", Sev::verbose)
3070 << "u norm " << get_norm(u) << " u sub nom " << get_norm(sub_u);
3071
3072 CHKERR TsMonitorSet(ts, step, t, sub_u, ptr->tsCtxPtr.get());
3073 }
3075}
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
Definition TsCtx.cpp:263
constexpr double t
plate stiffness
Definition plate.cpp:58

◆ tsPostProc()

MoFEMErrorCode TSPrePostProc::tsPostProc ( TS ts)
staticprivate

Post process time step.

Currently that function do not make anything major

Parameters
ts
Returns
MoFEMErrorCode
Examples
free_surface.cpp.

Definition at line 2987 of file free_surface.cpp.

2987 {
2988 if (auto ptr = tsPrePostProc.lock()) {
2989 auto &m_field = ptr->fsRawPtr->mField;
2990 MOFEM_LOG_CHANNEL("SYNC");
2991 MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "FS") << "PostProc done";
2992 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
2993 }
2994 return 0;
2995}
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.

◆ tsPostStage()

MoFEMErrorCode TSPrePostProc::tsPostStage ( TS ts,
PetscReal stagetime,
PetscInt stageindex,
Vec * Y )
static

[Boundary condition]

Examples
dynamic_first_order_con_law.cpp.

Definition at line 580 of file dynamic_first_order_con_law.cpp.

581 {
583 // cerr << "tsPostStage " <<"\n";
584 if (auto ptr = tsPrePostProc.lock()) {
585 auto &m_field = ptr->fsRawPtr->mField;
586
587 auto fb = m_field.getInterface<FieldBlas>();
588 double dt;
589 CHKERR TSGetTimeStep(ts, &dt);
590 double time;
591 CHKERR TSGetTime(ts, &time);
592 PetscInt num_stages;
593 Vec *stage_solutions;
594
595 CHKERR TSGetStages(ts, &num_stages, &stage_solutions);
596 PetscPrintf(PETSC_COMM_WORLD, "Check timestep %d time %e dt %e\n",
597 num_stages, time, dt);
598
599 const double inv_num_step = (double)num_stages;
600 CHKERR fb->fieldCopy(1., "x_1", "x_2");
601 CHKERR fb->fieldAxpy(dt, "V", "x_2");
602 CHKERR fb->fieldCopy(1., "x_2", "x_1");
603
604 CHKERR fb->fieldCopy(-inv_num_step / dt, "F_0", "F_dot");
605 CHKERR fb->fieldAxpy(inv_num_step / dt, "F", "F_dot");
606 CHKERR fb->fieldCopy(1., "F", "F_0");
607 }
609}
double dt
Basic algebra on fields.
Definition FieldBlas.hpp:21

◆ tsPostStep()

MoFEMErrorCode TSPrePostProc::tsPostStep ( TS ts)
static
Examples
dynamic_first_order_con_law.cpp.

Definition at line 611 of file dynamic_first_order_con_law.cpp.

611 {
613
614 if (auto ptr = tsPrePostProc.lock()) {
615 auto &m_field = ptr->fsRawPtr->mField;
616 double dt;
617 CHKERR TSGetTimeStep(ts, &dt);
618 double time;
619 CHKERR TSGetTime(ts, &time);
620 }
622}

◆ tsPreProc()

MoFEMErrorCode TSPrePostProc::tsPreProc ( TS ts)
staticprivate

Pre process time step.

Refine mesh and update fields

Parameters
ts
Returns
MoFEMErrorCode

cut-off values at nodes, i.e. abs("H") <= 1

Examples
free_surface.cpp.

Definition at line 2872 of file free_surface.cpp.

2872 {
2874
2875 if (auto ptr = tsPrePostProc.lock()) {
2876
2877 /**
2878 * @brief cut-off values at nodes, i.e. abs("H") <= 1
2879 *
2880 */
2881 auto cut_off_dofs = [&]() {
2883
2884 auto &m_field = ptr->fsRawPtr->mField;
2885
2886 Range current_verts;
2887 auto bit_mng = m_field.getInterface<BitRefManager>();
2889 bit(get_current_bit()), BitRefLevel().set(), MBVERTEX, current_verts);
2890
2891 auto cut_off_verts = [&](boost::shared_ptr<FieldEntity> ent_ptr) {
2893 for (auto &h : ent_ptr->getEntFieldData()) {
2894 h = cut_off(h);
2895 }
2897 };
2898
2899 auto field_blas = m_field.getInterface<FieldBlas>();
2900 CHKERR field_blas->fieldLambdaOnEntities(cut_off_verts, "H",
2901 &current_verts);
2903 };
2904
2905 CHKERR cut_off_dofs();
2906 }
2907
2908 if (auto ptr = tsPrePostProc.lock()) {
2909 MOFEM_LOG("FS", Sev::inform) << "Run step pre proc";
2910
2911 auto &m_field = ptr->fsRawPtr->mField;
2912 auto simple = m_field.getInterface<Simple>();
2913
2914 // get vector norm
2915 auto get_norm = [&](auto x) {
2916 double nrm;
2917 CHKERR VecNorm(x, NORM_2, &nrm);
2918 return nrm;
2919 };
2920
2921 // refine problem and project data, including theta data
2922 auto refine_problem = [&]() {
2924 MOFEM_LOG("FS", Sev::inform) << "Refine problem";
2925 CHKERR ptr->fsRawPtr->refineMesh(refine_overlap);
2926 CHKERR ptr->fsRawPtr->projectData();
2928 };
2929
2930 // set new jacobin operator, since problem and thus tangent matrix size has
2931 // changed
2932 auto set_jacobian_operators = [&]() {
2934 ptr->subB = createDMMatrix(ptr->solverSubDM);
2935 CHKERR KSPReset(ptr->subKSP);
2937 };
2938
2939 // set new solution
2940 auto set_solution = [&]() {
2942 MOFEM_LOG("FS", Sev::inform) << "Set solution";
2943
2944 PetscObjectState state;
2945
2946 // Record the state, and set it again. This is to fool PETSc that solution
2947 // vector is not updated. Otherwise PETSc will treat every step as a first
2948 // step.
2949
2950 // globSol is updated as result mesh refinement - this is not really set
2951 // a new solution.
2952
2953 CHKERR PetscObjectStateGet(getPetscObject(ptr->globSol.get()), &state);
2954 CHKERR DMoFEMMeshToLocalVector(simple->getDM(), ptr->globSol,
2955 INSERT_VALUES, SCATTER_FORWARD);
2956 CHKERR PetscObjectStateSet(getPetscObject(ptr->globSol.get()), state);
2957 MOFEM_LOG("FS", Sev::verbose)
2958 << "Set solution, vector norm " << get_norm(ptr->globSol);
2960 };
2961
2962 PetscBool is_theta;
2963 PetscObjectTypeCompare((PetscObject)ts, TSTHETA, &is_theta);
2964 if (is_theta) {
2965
2966 CHKERR refine_problem(); // refine problem
2967 CHKERR set_jacobian_operators(); // set new jacobian
2968 CHKERR set_solution(); // set solution
2969
2970 } else {
2971 SETERRQ(PETSC_COMM_WORLD, MOFEM_NOT_IMPLEMENTED,
2972 "Sorry, only TSTheta handling is implemented");
2973 }
2974
2975 // Need barriers, somme functions in TS solver need are called collectively
2976 // and requite the same state of variables
2977 PetscBarrier((PetscObject)ts);
2978
2979 MOFEM_LOG_CHANNEL("SYNC");
2980 MOFEM_TAG_AND_LOG("SYNC", Sev::verbose, "FS") << "PreProc done";
2981 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
2982 }
2983
2985}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
double h
int refine_overlap
auto cut_off
auto get_current_bit
dofs bit used to do calculations
auto bit
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition DMMoFEM.cpp:514
auto createDMMatrix(DM dm)
Get smart matrix from DM.
Definition DMMoFEM.hpp:1059
MoFEMErrorCode getEntitiesByTypeAndRefLevel(const BitRefLevel bit, const BitRefLevel mask, const EntityType type, const EntityHandle meshset, int verb=0) const
add all ents from ref level given by bit to meshset
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
PetscObject getPetscObject(T obj)
Managing BitRefLevels.
MoFEMErrorCode fieldLambdaOnEntities(OneFieldFunctionOnEntities lambda, const std::string field_name, Range *ents_ptr=nullptr)
field lambda
Definition FieldBlas.cpp:50
Simple interface for fast problem set-up.
Definition Simple.hpp:27

◆ tsPreStage()

static MoFEMErrorCode TSPrePostProc::tsPreStage ( TS ts)
staticprivate
Examples
free_surface.cpp.

◆ tsPreStep()

MoFEMErrorCode TSPrePostProc::tsPreStep ( TS ts)
static
Examples
dynamic_first_order_con_law.cpp.

Definition at line 624 of file dynamic_first_order_con_law.cpp.

624 {
626
627 if (auto ptr = tsPrePostProc.lock()) {
628 auto &m_field = ptr->fsRawPtr->mField;
629 double dt;
630 CHKERR TSGetTimeStep(ts, &dt);
631 double time;
632 CHKERR TSGetTime(ts, &time);
633 int step_num;
634 CHKERR TSGetStepNumber(ts, &step_num);
635 }
637}

◆ tsSetIFunction()

MoFEMErrorCode TSPrePostProc::tsSetIFunction ( TS ts,
PetscReal t,
Vec u,
Vec u_t,
Vec f,
void * ctx )
staticprivate
Examples
free_surface.cpp.

Definition at line 2997 of file free_surface.cpp.

2998 {
3000 if (auto ptr = tsPrePostProc.lock()) {
3001 auto sub_u = ptr->getSubVector();
3002 auto sub_u_t = vectorDuplicate(sub_u);
3003 auto sub_f = vectorDuplicate(sub_u);
3004 auto scatter = ptr->getScatter(sub_u, u, R);
3005
3006 auto apply_scatter_and_update = [&](auto x, auto sub_x) {
3008 CHKERR VecScatterBegin(scatter, x, sub_x, INSERT_VALUES, SCATTER_REVERSE);
3009 CHKERR VecScatterEnd(scatter, x, sub_x, INSERT_VALUES, SCATTER_REVERSE);
3010 CHKERR VecGhostUpdateBegin(sub_x, INSERT_VALUES, SCATTER_FORWARD);
3011 CHKERR VecGhostUpdateEnd(sub_x, INSERT_VALUES, SCATTER_FORWARD);
3013 };
3014
3015 CHKERR apply_scatter_and_update(u, sub_u);
3016 CHKERR apply_scatter_and_update(u_t, sub_u_t);
3017
3018 CHKERR TsSetIFunction(ts, t, sub_u, sub_u_t, sub_f, ptr->tsCtxPtr.get());
3019 CHKERR VecScatterBegin(scatter, sub_f, f, INSERT_VALUES, SCATTER_FORWARD);
3020 CHKERR VecScatterEnd(scatter, sub_f, f, INSERT_VALUES, SCATTER_FORWARD);
3021 }
3023}
PetscErrorCode TsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
Set IFunction for TS solver.
Definition TsCtx.cpp:56

◆ tsSetIJacobian()

MoFEMErrorCode TSPrePostProc::tsSetIJacobian ( TS ts,
PetscReal t,
Vec u,
Vec u_t,
PetscReal a,
Mat A,
Mat B,
void * ctx )
staticprivate

Wrapper for SNES Lhs.

Examples
free_surface.cpp.

Definition at line 3025 of file free_surface.cpp.

3027 {
3029 if (auto ptr = tsPrePostProc.lock()) {
3030 auto sub_u = ptr->getSubVector();
3031 auto sub_u_t = vectorDuplicate(sub_u);
3032 auto scatter = ptr->getScatter(sub_u, u, R);
3033
3034 auto apply_scatter_and_update = [&](auto x, auto sub_x) {
3036 CHKERR VecScatterBegin(scatter, x, sub_x, INSERT_VALUES, SCATTER_REVERSE);
3037 CHKERR VecScatterEnd(scatter, x, sub_x, INSERT_VALUES, SCATTER_REVERSE);
3038 CHKERR VecGhostUpdateBegin(sub_x, INSERT_VALUES, SCATTER_FORWARD);
3039 CHKERR VecGhostUpdateEnd(sub_x, INSERT_VALUES, SCATTER_FORWARD);
3041 };
3042
3043 CHKERR apply_scatter_and_update(u, sub_u);
3044 CHKERR apply_scatter_and_update(u_t, sub_u_t);
3045
3046 CHKERR TsSetIJacobian(ts, t, sub_u, sub_u_t, a, ptr->subB, ptr->subB,
3047 ptr->tsCtxPtr.get());
3048 }
3050}
constexpr double a
PetscErrorCode TsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Set function evaluating jacobian in TS solver.
Definition TsCtx.cpp:169

◆ tsSetUp() [1/2]

MoFEMErrorCode TSPrePostProc::tsSetUp ( TS ts)

Used to setup TS solver.

Parameters
ts
Returns
MoFEMErrorCode
Examples
dynamic_first_order_con_law.cpp, and free_surface.cpp.

Definition at line 3131 of file free_surface.cpp.

3131 {
3132
3133 auto &m_field = fsRawPtr->mField;
3134 auto simple = m_field.getInterface<Simple>();
3135
3137
3138 auto dm = simple->getDM();
3139
3141 CHKERR TSSetIFunction(ts, globRes, tsSetIFunction, nullptr);
3142 CHKERR TSSetIJacobian(ts, PETSC_NULLPTR, PETSC_NULLPTR, tsSetIJacobian, nullptr);
3143 CHKERR TSMonitorSet(ts, tsMonitor, fsRawPtr, PETSC_NULLPTR);
3144
3145 SNES snes;
3146 CHKERR TSGetSNES(ts, &snes);
3147 auto snes_ctx_ptr = getDMSnesCtx(dm);
3148
3149 auto set_section_monitor = [&](auto snes) {
3151 CHKERR SNESMonitorSet(snes,
3152 (MoFEMErrorCode(*)(SNES, PetscInt, PetscReal,
3153 void *))MoFEMSNESMonitorFields,
3154 (void *)(snes_ctx_ptr.get()), nullptr);
3156 };
3157
3158 CHKERR set_section_monitor(snes);
3159
3160 auto ksp = createKSP(m_field.get_comm());
3161 CHKERR KSPSetType(ksp, KSPPREONLY); // Run KSP internally in ShellPC
3162 auto sub_pc = createPC(fsRawPtr->mField.get_comm());
3163 CHKERR PCSetType(sub_pc, PCSHELL);
3164 CHKERR PCShellSetSetUp(sub_pc, pcSetup);
3165 CHKERR PCShellSetApply(sub_pc, pcApply);
3166 CHKERR KSPSetPC(ksp, sub_pc);
3167 CHKERR SNESSetKSP(snes, ksp);
3168
3171
3172 CHKERR TSSetPreStep(ts, tsPreProc);
3173 CHKERR TSSetPostStep(ts, tsPostProc);
3174
3176}
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
auto getDMTsCtx(DM dm)
Get TS context data structure used by DM.
Definition DMMoFEM.hpp:1144
MoFEMErrorCode MoFEMSNESMonitorFields(SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *ctx)
Sens monitor printing residual field by field.
Definition SnesCtx.cpp:592
auto createPC(MPI_Comm comm)
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
Definition DMMoFEM.hpp:1130
MoFEM::Interface & mField
Definition plastic.cpp:226
virtual MPI_Comm & get_comm() const =0
MoFEMErrorCode getDM(DM *dm)
Get DM.
Definition Simple.cpp:800
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
boost::shared_ptr< TsCtx > tsCtxPtr
SmartPetscObj< Vec > globRes
SmartPetscObj< Vec > globSol
static MoFEMErrorCode tsMonitor(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Wrapper for TS monitor.
static MoFEMErrorCode pcApply(PC pc, Vec pc_f, Vec pc_x)
static MoFEMErrorCode tsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Wrapper for SNES Lhs.
boost::shared_ptr< SnesCtx > snesCtxPtr
static MoFEMErrorCode tsPreProc(TS ts)
Pre process time step.
static MoFEMErrorCode tsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec f, void *ctx)
static MoFEMErrorCode pcSetup(PC pc)
static MoFEMErrorCode tsPostProc(TS ts)
Post process time step.

◆ tsSetUp() [2/2]

MoFEMErrorCode TSPrePostProc::tsSetUp ( TS ts)

Used to setup TS solver.

Parameters
ts
Returns
MoFEMErrorCode

Member Data Documentation

◆ fsRawPtr [1/2]

Example* TSPrePostProc::fsRawPtr

◆ fsRawPtr [2/2]

FreeSurface* TSPrePostProc::fsRawPtr

Definition at line 423 of file free_surface.cpp.

◆ globRes

SmartPetscObj<Vec> TSPrePostProc::globRes
private
Examples
free_surface.cpp.

Definition at line 459 of file free_surface.cpp.

◆ globSol

SmartPetscObj<Vec> TSPrePostProc::globSol
Examples
free_surface.cpp.

Definition at line 422 of file free_surface.cpp.

◆ snesCtxPtr

boost::shared_ptr<SnesCtx> TSPrePostProc::snesCtxPtr
private
Examples
free_surface.cpp.

Definition at line 464 of file free_surface.cpp.

◆ solverSubDM

SmartPetscObj<DM> TSPrePostProc::solverSubDM
Examples
free_surface.cpp.

Definition at line 421 of file free_surface.cpp.

◆ subB

SmartPetscObj<Mat> TSPrePostProc::subB
private
Examples
free_surface.cpp.

Definition at line 460 of file free_surface.cpp.

◆ subKSP

SmartPetscObj<KSP> TSPrePostProc::subKSP
private
Examples
free_surface.cpp.

Definition at line 461 of file free_surface.cpp.

◆ tsCtxPtr

boost::shared_ptr<TsCtx> TSPrePostProc::tsCtxPtr
private
Examples
free_surface.cpp.

Definition at line 466 of file free_surface.cpp.


The documentation for this struct was generated from the following files: