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),
80 this->snes =
snes.snes;
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,
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
EntityHandle get_id_for_max_type()
EntityHandle get_id_for_min_type()
constexpr auto field_name
Data structure to exchange data between mofem and User Loop Methods.
int loopSize
local number oe methods to process
const FieldEntity_multiIndex * entitiesPtr
raw pointer to container of field entities
unsigned int getFieldBitNumber(std::string field_name) const
MoFEMErrorCode copyBasicMethod(const BasicMethod &basic)
Copy data from other base method to this base method.
const FiniteElement_multiIndex * finiteElementsPtr
raw pointer to container finite elements
const RefElement_multiIndex * refinedFiniteElementsPtr
container of mofem finite element entities
boost::function< MoFEMErrorCode()> preProcessHook
Hook function for pre-processing.
const DofEntity_multiIndex * dofsPtr
raw pointer container of dofs
const Field_multiIndex * fieldsPtr
raw pointer to fields container
int nInTheLoop
number currently of processed method
const RefEntity_multiIndex * refinedEntitiesPtr
container of mofem dof entities
virtual MoFEMErrorCode postProcess()
function is run at the end of loop
const FieldEntityEntFiniteElementAdjacencyMap_multiIndex * adjacenciesPtr
virtual MoFEMErrorCode operator()()
function is run for every finite element
virtual MoFEMErrorCode preProcess()
function is run at the beginning of loop
const EntFiniteElement_multiIndex * finiteElementsEntitiesPtr
const Problem * problemPtr
raw pointer to problem
boost::function< MoFEMErrorCode()> operatorHook
Hook function for operator.
int sIze
number of processors in communicator
boost::weak_ptr< CacheTuple > cacheWeakPtr
boost::function< MoFEMErrorCode()> postProcessHook
Hook function for post-processing.
MoFEMErrorCode getNodeData(const std::string field_name, VectorDouble &data, const bool reset_dofs=true)
auto getDataDofsPtr() const
auto getNumberOfNodes() const
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
data structure for ksp (linear solver) context
MoFEMErrorCode copyKsp(const KspMethod &ksp)
copy data form another method
KSPContext ksp_ctx
Context.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
static constexpr Switches CtxSetA
static constexpr Switches CtxSetX
static constexpr Switches CtxSetX_TT
static constexpr Switches CtxSetNone
static constexpr Switches CtxSetF
std::bitset< 8 > Switches
static constexpr Switches CtxSetX_T
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
static constexpr Switches CtxSetB
static constexpr Switches CtxSetTime
MoFEMErrorCode copyPetscData(const PetscData &petsc_data)
data structure for snes (nonlinear solver) context
MoFEMErrorCode copySnes(const SnesMethod &snes)
Copy snes data.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
data structure for TS (time stepping) context
PetscReal ts_dt
time step size
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
PetscReal ts_a
shift for U_t (see PETSc Time Solver)
PetscInt ts_step
time step number
MoFEMErrorCode copyTs(const TSMethod &ts)
Copy TS solver data.
MoFEMErrorCode copyTao(const TaoMethod &tao)
Copy TAO data.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
base class for all interface classes