28    : data_ctx(
PetscData::CtxSetNone), f(PETSC_NULLPTR), 
A(PETSC_NULLPTR),
 
   29      B(PETSC_NULLPTR), x(PETSC_NULLPTR), dx(PETSC_NULLPTR), x_t(PETSC_NULLPTR),
 
   30      x_tt(PETSC_NULLPTR) {}
 
 
   34  this->
f = petsc_data.
f;
 
   35  this->
A = petsc_data.
A;
 
   36  this->
B = petsc_data.
B;
 
   37  this->
x = petsc_data.
x;
 
   38  this->
dx = petsc_data.
dx;
 
   39  this->
x_t = petsc_data.
x_t;
 
 
   53    : ksp_ctx(CTX_KSPNONE), ksp(PETSC_NULLPTR), ksp_f(
PetscData::f),
 
 
  108  *iface = 
const_cast<TSMethod *
>(
this);
 
 
  113    : 
ts_ctx(CTX_TSNONE), ts_step(-1), ts_a(0), ts_t(0), ts_u(
PetscData::x),
 
 
  132      nInTheLoop(0), loopSize(0), rAnk(-1), sIze(-1),
 
  133      refinedEntitiesPtr(nullptr), refinedFiniteElementsPtr(nullptr),
 
  134      problemPtr(nullptr), fieldsPtr(nullptr), entitiesPtr(nullptr),
 
  135      dofsPtr(nullptr), finiteElementsPtr(nullptr),
 
  136      finiteElementsEntitiesPtr(nullptr), adjacenciesPtr(nullptr) {}
 
 
  166            "should be implemented by user in derived class (preProcess)");
 
 
  177            "should be implemented by user in derived class (postProcess)");
 
 
  188            "should be implemented by user in derived class (operator)");
 
 
  195                                     const bool reset_dofs) {
 
  200  auto get_nodes_field_data =
 
  201      [&](boost::shared_ptr<FEDofEntity_multiIndex> &&dofs,
 
  209                bit_number, get_id_for_min_type<MBVERTEX>()));
 
  212                bit_number, get_id_for_max_type<MBVERTEX>()));
 
  215          auto &first_dof = **dit;
 
  217          const int nb_dof_idx = first_dof.getNbOfCoeffs();
 
  218          const int max_nb_dofs = nb_dof_idx * num_nodes;
 
  219          nodes_data.resize(max_nb_dofs, 
false);
 
  222          for (; dit != hi_dit;) {
 
  223            const auto &dof_ptr = *dit;
 
  224            const auto &dof = *dof_ptr;
 
  225            const auto &sn = *dof.getSideNumberPtr();
 
  226            const int side_number = sn.side_number;
 
  228            int pos = side_number * nb_dof_idx;
 
  229            auto ent_filed_data_vec = dof.getEntFieldData();
 
  230            for (
int ii = 0; ii != nb_dof_idx; ++ii) {
 
  231              nodes_data[pos] = ent_filed_data_vec[ii];
 
  237        } 
else if (reset_dofs) {
 
  238          nodes_data.resize(0, 
false);
 
 
#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 CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
@ MOFEM_OPERATION_UNSUCCESSFUL
#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 ...
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
Data structure to exchange data between MoFEM and User Loop Methods.
int loopSize
Total number of methods to process in the loop.
const FieldEntity_multiIndex * entitiesPtr
Raw pointer to container of field entities.
BasicMethod()
Default constructor.
unsigned int getFieldBitNumber(std::string field_name) const
Get bit number for a specific field by name.
MoFEMErrorCode copyBasicMethod(const BasicMethod &basic)
Copy data from another BasicMethod instance.
const FiniteElement_multiIndex * finiteElementsPtr
Raw pointer to container of finite elements.
const RefElement_multiIndex * refinedFiniteElementsPtr
Pointer to container of refined finite element entities.
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing operations.
const DofEntity_multiIndex * dofsPtr
Raw pointer to container of degree of freedom entities.
int rAnk
Current processor rank in MPI communicator.
const Field_multiIndex * fieldsPtr
Raw pointer to fields multi-index container.
int nInTheLoop
Current index of processed method in the loop.
const RefEntity_multiIndex * refinedEntitiesPtr
Pointer to container of refined MoFEM DOF entities.
virtual MoFEMErrorCode postProcess()
Post-processing function executed at loop completion.
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * adjacenciesPtr
Raw pointer to container of adjacencies between DOFs and finite elements.
virtual MoFEMErrorCode operator()()
Main operator function executed for each loop iteration.
virtual MoFEMErrorCode preProcess()
Pre-processing function executed at loop initialization.
const EntFiniteElement_multiIndex * finiteElementsEntitiesPtr
Raw pointer to container of finite element entities.
const Problem * problemPtr
Raw pointer to current MoFEM problem instance.
boost::function< MoFEMErrorCode()> operatorHook
Hook function for main operator execution.
int sIze
Total number of processors in MPI communicator.
boost::weak_ptr< CacheTuple > cacheWeakPtr
Weak pointer to cached entity data.
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing operations.
MoFEMErrorCode getNodeData(const std::string field_name, VectorDouble &data, const bool reset_dofs=true)
Get nodal data for a specific field.
auto getDataDofsPtr() const
Get pointer to DOF data for the current finite element.
auto getNumberOfNodes() const
Get the number of nodes in the current finite element.
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
Data structure for KSP (linear solver) context.
MoFEMErrorCode copyKsp(const KspMethod &ksp)
Copy data from another KSP method.
KSPContext ksp_ctx
Current KSP computation context.
KspMethod()
Default constructor.
KSP ksp
PETSc KSP linear solver object.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type casting.
Base data structure for PETSc-related contexts.
static constexpr Switches CtxSetA
Jacobian matrix switch.
static constexpr Switches CtxSetX
Solution vector switch.
Vec f
PETSc residual vector.
static constexpr Switches CtxSetX_TT
Second time derivative switch.
static constexpr Switches CtxSetNone
No data switch.
static constexpr Switches CtxSetF
Residual vector switch.
Vec x_t
PETSc first time derivative vector.
std::bitset< 8 > Switches
Bitset type for context switches.
Vec x_tt
PETSc second time derivative vector.
Vec dx
PETSc solution increment vector.
Switches data_ctx
Current data context switches.
static constexpr Switches CtxSetX_T
First time derivative switch.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type casting.
Vec x
PETSc solution vector.
Mat B
PETSc preconditioner matrix.
static constexpr Switches CtxSetB
Preconditioner matrix switch.
PetscData()
Default constructor.
static constexpr Switches CtxSetTime
Time value switch.
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
Copy PETSc data from another instance.
Mat A
PETSc Jacobian matrix.
Data structure for SNES (nonlinear solver) context.
MoFEMErrorCode copySnes(const SnesMethod &snes)
Copy SNES data from another instance.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type casting.
SnesMethod()
Default constructor.
SNESContext snes_ctx
Current SNES computation context.
SNES snes
PETSc SNES nonlinear solver object.
Data structure for TS (time stepping) context.
TS ts
PETSc time stepping solver object.
TSMethod()
Default constructor.
PetscReal ts_t
Current time value.
PetscReal ts_dt
Current time step size.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type casting.
TSContext ts_ctx
Current TS computation context.
PetscReal ts_a
Shift parameter for U_t (see PETSc Time Solver documentation)
PetscInt ts_step
Current time step number.
MoFEMErrorCode copyTs(const TSMethod &ts)
Copy TS solver data from another instance.
Data structure for TAO (optimization) context.
TAOContext tao_ctx
Current TAO computation context.
Tao tao
PETSc TAO optimization solver object.
TaoMethod()
Default constructor.
MoFEMErrorCode copyTao(const TaoMethod &tao)
Copy TAO data from another instance.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for type casting.
base class for all interface classes