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 cache_ptr = boost::make_shared<CacheTuple>();
65 auto set = [&](
auto &fe) {
77 fe.cacheWeakPtr = cache_ptr;
81 auto unset = [&](
auto &fe) {
104 *(lit.second),
nullptr,
121 CHKERR VecGhostUpdateBegin(
F, ADD_VALUES, SCATTER_REVERSE);
122 CHKERR VecGhostUpdateEnd(
F, ADD_VALUES, SCATTER_REVERSE);
132 Mat
A, Mat
B,
void *ctx) {
137 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
138 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
139 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
140 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
147#if PETSC_VERSION_GE(3, 8, 0)
148 CHKERR TSGetStepNumber(ts, &step);
150 CHKERR TSGetTimeStepNumber(ts, &step);
155 auto cache_ptr = boost::make_shared<CacheTuple>();
158 auto set = [&](
auto &fe) {
172 fe.cacheWeakPtr = cache_ptr;
176 auto unset = [&](
auto &fe) {
197 *(lit.second),
nullptr,
214 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
215 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
226 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
227 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
231 auto cache_ptr = boost::make_shared<CacheTuple>();
234 auto set = [&](
auto &fe) {
239 fe.ts_F = PETSC_NULL;
244 fe.cacheWeakPtr = cache_ptr;
248 auto unset = [&](
auto &fe) {
264 *(lit.second),
nullptr,
285 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
286 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
290 auto zero_ghost_vec = [](Vec
g) {
298 for (
int i = 0;
i != s; ++
i)
301 CHKERR VecGhostRestoreLocalForm(
g, &
l);
307 auto cache_ptr = boost::make_shared<CacheTuple>();
311#if PETSC_VERSION_GE(3, 8, 0)
312 CHKERR TSGetStepNumber(ts, &step);
314 CHKERR TSGetTimeStepNumber(ts, &step);
317 auto set = [&](
auto &fe) {
328 fe.cacheWeakPtr = cache_ptr;
332 auto unset = [&](
auto &fe) {
353 *(lit.second),
nullptr,
370 CHKERR VecGhostUpdateBegin(
F, ADD_VALUES, SCATTER_REVERSE);
371 CHKERR VecGhostUpdateEnd(
F, ADD_VALUES, SCATTER_REVERSE);
385 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
386 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
396 auto cache_ptr = boost::make_shared<CacheTuple>();
400#if PETSC_VERSION_GE(3, 8, 0)
401 CHKERR TSGetStepNumber(ts, &step);
403 CHKERR TSGetTimeStepNumber(ts, &step);
406 auto set = [&](
auto &fe) {
418 fe.cacheWeakPtr = cache_ptr;
422 auto unset = [&](
auto &fe) {
444 *(lit.second),
nullptr,
461 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
462 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
470 PetscReal a, PetscReal aa, Mat
A, Mat
B,
476 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
477 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
478 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
479 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
480 CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
481 CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
488#if PETSC_VERSION_GE(3, 8, 0)
489 CHKERR TSGetStepNumber(ts, &step);
491 CHKERR TSGetTimeStepNumber(ts, &step);
496 auto cache_ptr = boost::make_shared<CacheTuple>();
499 auto set = [&](
auto &fe) {
517 fe.cacheWeakPtr = cache_ptr;
521 auto unset = [&](
auto &fe) {
542 *(lit.second),
nullptr,
559 CHKERR MatAssemblyBegin(
B, MAT_FINAL_ASSEMBLY);
560 CHKERR MatAssemblyEnd(
B, MAT_FINAL_ASSEMBLY);
571 CHKERR VecGhostUpdateBegin(u, INSERT_VALUES, SCATTER_FORWARD);
572 CHKERR VecGhostUpdateEnd(u, INSERT_VALUES, SCATTER_FORWARD);
573 CHKERR VecGhostUpdateBegin(u_t, INSERT_VALUES, SCATTER_FORWARD);
574 CHKERR VecGhostUpdateEnd(u_t, INSERT_VALUES, SCATTER_FORWARD);
575 CHKERR VecGhostUpdateBegin(u_tt, INSERT_VALUES, SCATTER_FORWARD);
576 CHKERR VecGhostUpdateEnd(u_tt, INSERT_VALUES, SCATTER_FORWARD);
580 auto zero_ghost_vec = [](Vec
g) {
588 for (
int i = 0;
i != s; ++
i)
591 CHKERR VecGhostRestoreLocalForm(
g, &
l);
597 auto cache_ptr = boost::make_shared<CacheTuple>();
601#if PETSC_VERSION_GE(3, 8, 0)
602 CHKERR TSGetStepNumber(ts, &step);
604 CHKERR TSGetTimeStepNumber(ts, &step);
607 auto set = [&](
auto &fe) {
621 fe.cacheWeakPtr = cache_ptr;
625 auto unset = [&](
auto &fe) {
647 *(lit.second),
nullptr,
664 CHKERR VecGhostUpdateBegin(
F, ADD_VALUES, SCATTER_REVERSE);
665 CHKERR VecGhostUpdateEnd(
F, ADD_VALUES, SCATTER_REVERSE);
#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.