30 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
31 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
32 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
33 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
37 auto zero_ghost_vec = [](Vec
g) {
45 for (
int i = 0;
i != s; ++
i)
48 CHKERR VecGhostRestoreLocalForm(
g, &
l);
56#if PETSC_VERSION_GE(3, 8, 0)
57 CHKERR TSGetStepNumber(ts, &step);
59 CHKERR TSGetTimeStepNumber(ts, &step);
62 auto set = [&](
auto &fe) {
77 auto unset = [&](
auto &fe) {
94 auto cache_ptr = boost::make_shared<CacheTuple>();
102 *(lit.second),
nullptr,
119 CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
120 CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
121 CHKERR VecAssemblyBegin(F);
130 Mat
A, Mat
B,
void *ctx) {
135 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
136 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
137 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
138 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
145#if PETSC_VERSION_GE(3, 8, 0)
146 CHKERR TSGetStepNumber(ts, &step);
148 CHKERR TSGetTimeStepNumber(ts, &step);
154 auto set = [&](
auto &fe) {
171 auto unset = [&](
auto &fe) {
188 auto cache_ptr = boost::make_shared<CacheTuple>();
195 *(lit.second),
nullptr,
212 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
213 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
224 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
225 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
229 auto set = [&](
auto &fe) {
234 fe.ts_F = PETSC_NULL;
242 auto unset = [&](
auto &fe) {
255 auto cache_ptr = boost::make_shared<CacheTuple>();
261 *(lit.second),
nullptr,
282 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
283 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
287 auto zero_ghost_vec = [](Vec
g) {
295 for (
int i = 0;
i != s; ++
i)
298 CHKERR VecGhostRestoreLocalForm(
g, &
l);
306#if PETSC_VERSION_GE(3, 8, 0)
307 CHKERR TSGetStepNumber(ts, &step);
309 CHKERR TSGetTimeStepNumber(ts, &step);
312 auto set = [&](
auto &fe) {
326 auto unset = [&](
auto &fe) {
342 auto cache_ptr = boost::make_shared<CacheTuple>();
350 *(lit.second),
nullptr,
367 CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
368 CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
369 CHKERR VecAssemblyBegin(F);
382 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
383 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
395#if PETSC_VERSION_GE(3, 8, 0)
396 CHKERR TSGetStepNumber(ts, &step);
398 CHKERR TSGetTimeStepNumber(ts, &step);
401 auto set = [&](
auto &fe) {
416 auto unset = [&](
auto &fe) {
433 auto cache_ptr = boost::make_shared<CacheTuple>();
441 *(lit.second),
nullptr,
458 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
459 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
467 PetscReal
a, PetscReal aa, Mat
A, Mat
B,
473 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
474 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
475 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
476 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
477 CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
478 CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
485#if PETSC_VERSION_GE(3, 8, 0)
486 CHKERR TSGetStepNumber(ts, &step);
488 CHKERR TSGetTimeStepNumber(ts, &step);
494 auto set = [&](
auto &fe) {
515 auto unset = [&](
auto &fe) {
532 auto cache_ptr = boost::make_shared<CacheTuple>();
539 *(lit.second),
nullptr,
556 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
557 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
568 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
569 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
570 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
571 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
572 CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
573 CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
577 auto zero_ghost_vec = [](Vec
g) {
585 for (
int i = 0;
i != s; ++
i)
588 CHKERR VecGhostRestoreLocalForm(
g, &
l);
596#if PETSC_VERSION_GE(3, 8, 0)
597 CHKERR TSGetStepNumber(ts, &step);
599 CHKERR TSGetTimeStepNumber(ts, &step);
602 auto set = [&](
auto &fe) {
619 auto unset = [&](
auto &fe) {
636 auto cache_ptr = boost::make_shared<CacheTuple>();
644 *(lit.second),
nullptr,
661 CHKERR VecGhostUpdateBegin(F, ADD_VALUES, SCATTER_REVERSE);
662 CHKERR VecGhostUpdateEnd(F, ADD_VALUES, SCATTER_REVERSE);
663 CHKERR VecAssemblyBegin(F);
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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 MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
virtual MoFEMErrorCode problem_basic_method_postProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
virtual MoFEMErrorCode loop_finite_elements(const std::string problem_name, const std::string &fe_name, FEMethod &method, boost::shared_ptr< NumeredEntFiniteElement_multiIndex > fe_ptr=nullptr, MoFEMTypes bh=MF_EXIST, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr(), int verb=DEFAULT_VERBOSITY)=0
Make a loop over finite elements.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'l', 3 > l
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode TsSetIJacobian(TS ts, PetscReal t, Vec u, Vec u_t, PetscReal a, Mat A, Mat B, void *ctx)
Set function evaluating jacobina in TS solver.
PetscErrorCode TsMonitorSet(TS ts, PetscInt step, PetscReal t, Vec u, void *ctx)
Set monitor for TS solver.
PetscErrorCode TsSetI2Function(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, Vec F, void *ctx)
Calculation the right hand side for second order PDE in time.
PetscErrorCode TsSetRHSFunction(TS ts, PetscReal t, Vec u, Vec F, void *ctx)
TS solver function.
PetscErrorCode TsSetIFunction(TS ts, PetscReal t, Vec u, Vec u_t, Vec F, void *ctx)
Set IFunction for TS solver.
PetscErrorCode TsSetI2Jacobian(TS ts, PetscReal t, Vec u, Vec u_t, Vec u_tt, PetscReal a, PetscReal aa, Mat A, Mat B, void *ctx)
Calculation Jaconian for second order PDE in time.
PetscErrorCode TsSetRHSJacobian(TS ts, PetscReal t, Vec u, Mat A, Mat B, void *ctx)
TS solver function.
constexpr double t
plate stiffness
virtual MoFEMErrorCode cache_problem_entities(const std::string prb_name, CacheTupleWeakPtr cache_ptr)=0
Cache variables.
virtual MoFEMErrorCode problem_basic_method_preProcess(const Problem *problem_ptr, BasicMethod &method, int verb=DEFAULT_VERBOSITY)=0
Set data for BasicMethod.
static constexpr Switches CtxSetA
static constexpr Switches CtxSetX
static constexpr Switches CtxSetX_TT
static constexpr Switches CtxSetNone
static constexpr Switches CtxSetF
static constexpr Switches CtxSetX_T
static constexpr Switches CtxSetB
static constexpr Switches CtxSetTime
Interface for Time Stepping (TS) solver.
FEMethodsSequence loopsIJacobian
MoFEMTypes bH
If set to MF_EXIST check if element exist.
PetscLogEvent MOFEM_EVENT_TsCtxRHSJacobian
FEMethodsSequence loopsRHSFunction
PetscLogEvent MOFEM_EVENT_TsCtxMonitor
BasicMethodsSequence postProcessRHSFunction
BasicMethodsSequence preProcessMonitor
PetscLogEvent MOFEM_EVENT_TsCtxRHSFunction
BasicMethodsSequence preProcessIJacobian
BasicMethodsSequence postProcessIFunction
FEMethodsSequence loopsIFunction
FEMethodsSequence loopsRHSJacobian
BasicMethodsSequence preProcessIFunction
FEMethodsSequence loopsMonitor
BasicMethodsSequence postProcessMonitor
BasicMethodsSequence preProcessRHSJacobian
boost::movelib::unique_ptr< bool > vecAssembleSwitch
boost::movelib::unique_ptr< bool > matAssembleSwitch
MoFEMErrorCode clearLoops()
Clear loops.
MoFEM::Interface & mField
BasicMethodsSequence preProcessRHSFunction
BasicMethodsSequence postProcessIJacobian
PetscLogEvent MOFEM_EVENT_TsCtxIFunction
BasicMethodsSequence postProcessRHSJacobian
PetscLogEvent MOFEM_EVENT_TsCtxI2Function
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Vector manager is used to create vectors \mofem_vectors.