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

Zero F_lambda. More...

#include "users_modules/basic_finite_elements/src/ArcLengthTools.hpp"

Inheritance diagram for ZeroFLmabda:
[legend]
Collaboration diagram for ZeroFLmabda:
[legend]

Public Member Functions

 ZeroFLmabda (boost::shared_ptr< ArcLengthCtx > arc_ptr)
 
MoFEMErrorCode preProcess ()
 

Public Attributes

boost::shared_ptr< ArcLengthCtxarcPtr
 

Detailed Description

Zero F_lambda.

Definition at line 283 of file ArcLengthTools.hpp.

Constructor & Destructor Documentation

◆ ZeroFLmabda()

ZeroFLmabda::ZeroFLmabda ( boost::shared_ptr< ArcLengthCtx > arc_ptr)

Definition at line 359 of file ArcLengthTools.cpp.

360 : arcPtr(arc_ptr) {}
boost::shared_ptr< ArcLengthCtx > arcPtr

Member Function Documentation

◆ preProcess()

MoFEMErrorCode ZeroFLmabda::preProcess ( )

Definition at line 362 of file ArcLengthTools.cpp.

362 {
364 switch (snes_ctx) {
365 case CTX_SNESSETFUNCTION: {
366
367 auto zero_vals = [&](auto v) {
369 int size = problemPtr->getNbLocalDofsRow();
370 int ghosts = problemPtr->getNbGhostDofsRow();
371 double *array;
372 CHKERR VecGetArray(v, &array);
373 for (int i = 0; i != size + ghosts; ++i)
374 array[i] = 0;
375 CHKERR VecRestoreArray(v, &array);
377 };
378
379 Vec l_x_lambda, l_f_lambda;
380 CHKERR VecGhostGetLocalForm(arcPtr->xLambda, &l_x_lambda);
381 CHKERR VecGhostGetLocalForm(arcPtr->F_lambda, &l_f_lambda);
382 CHKERR zero_vals(l_x_lambda);
383 CHKERR zero_vals(l_f_lambda);
384 CHKERR VecGhostRestoreLocalForm(arcPtr->xLambda, &l_x_lambda);
385 CHKERR VecGhostRestoreLocalForm(arcPtr->F_lambda, &l_f_lambda);
386
387 } break;
388 default:
389 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
390 "Lambda can be zeroed ONLY when the right hand side is evaluated.");
391 }
393}
#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 ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#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 ...
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)

Member Data Documentation

◆ arcPtr

boost::shared_ptr<ArcLengthCtx> ZeroFLmabda::arcPtr

Definition at line 285 of file ArcLengthTools.hpp.


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