static char help[] =
"...\n\n";
#define HelloFunctionBegin \
MoFEMFunctionBegin; \
MOFEM_LOG_CHANNEL("SYNC"); \
MOFEM_LOG_FUNCTION(); \
MOFEM_LOG_TAG("WORLD", "HelloWorld");
struct OpRow :
public ForcesAndSourcesCore::UserDataOperator {
if (type == MBVERTEX) {
MOFEM_LOG(
"SYNC", Sev::inform) <<
"**** " << getNinTheLoop() <<
" ****";
MOFEM_LOG(
"SYNC", Sev::inform) <<
"**** Operators ****";
}
<< "Hello Operator OpRow:"
<< " field name " << rowFieldName << " side " << side << " type "
<< CN::EntityTypeName(type) << " nb dofs on entity "
}
};
struct OpRowCol :
public ForcesAndSourcesCore::UserDataOperator {
OpRowCol(
const std::string row_field,
const std::string col_field,
const bool symm)
symm) {}
EntityType col_type,
<< "Hello Operator OpRowCol:"
<< " row field name " << rowFieldName << " row side " << row_side
<< " row type " << CN::EntityTypeName(row_type)
<<
" nb dofs on row entity " << row_data.
getIndices().size() <<
" : "
<< " col field name " << colFieldName << " col side " << col_side
<< " col type " << CN::EntityTypeName(col_type)
<<
" nb dofs on col entity " << col_data.
getIndices().size();
}
};
struct OpVolume :
public VolumeElementForcesAndSourcesCore::UserDataOperator {
}
if (type == MBVERTEX) {
MOFEM_LOG(
"SYNC", Sev::inform) <<
"Hello Operator OpVolume:"
<< " volume " << getVolume();
}
}
};
struct OpFace :
public FaceElementForcesAndSourcesCore::UserDataOperator {
if (type == MBVERTEX) {
MOFEM_LOG(
"SYNC", Sev::inform) <<
"Hello Operator OpFace:"
}
}
};
struct OpFaceSide :
public FaceElementForcesAndSourcesCore::UserDataOperator {
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &
feSidePtr;
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> &fe_side_ptr)
if (type == MBVERTEX) {
MOFEM_LOG(
"SYNC", Sev::inform) <<
"Hello Operator OpSideFace";
}
}
};
: public VolumeElementForcesAndSourcesCoreOnSide::UserDataOperator {
if (type == MBVERTEX) {
<< "Hello Operator OpVolumeSide:"
<< " volume " << getVolume() << " normal " << getNormal();
}
}
};
int main(
int argc,
char *argv[]) {
try {
DMType dm_name = "DMMOFEM";
moab::Core moab_core;
moab::Interface &moab = moab_core;
pipeline_mng->getOpDomainRhsPipeline().push_back(
new OpVolume(
"U"));
pipeline_mng->getOpDomainLhsPipeline().push_back(
pipeline_mng->getOpBoundaryRhsPipeline().push_back(
new OpRow(
"L"));
pipeline_mng->getOpBoundaryRhsPipeline().push_back(
new OpFace(
"L"));
pipeline_mng->getOpBoundaryLhsPipeline().push_back(
boost::shared_ptr<VolumeElementForcesAndSourcesCoreOnSide> side_fe(
new VolumeElementForcesAndSourcesCoreOnSide(m_field));
pipeline_mng->getOpSkeletonRhsPipeline().push_back(
new OpRow(
"S"));
pipeline_mng->getOpSkeletonRhsPipeline().push_back(
CHKERR pipeline_mng->loopFiniteElements();
}
return 0;
}
ForcesAndSourcesCore::UserDataOperator UserDataOperator
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
void simple(double P1[], double P2[], double P3[], double c[], const int N)
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base nme:nme847.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
boost::ptr_deque< UserDataOperator > & getOpDomainRhsPipeline()
Get the Op Domain Rhs Pipeline object.
#define MOFEM_LOG(channel, severity)
Log.
#define HelloFunctionBegin
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
constexpr auto field_name
virtual MPI_Comm & get_comm() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Data on single entity (This is passed as argument to DataOperator::doWork)
const VectorInt & getIndices() const
Get global indices of dofs on entity.
VectorDouble & getNormal()
get triangle normal
@ OPROW
operator doWork function is executed on FE rows
structure to get information form mofem into EntitiesFieldData
PipelineManager interface.
Simple interface for fast problem set-up.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
OpFace(const Range &skin_ents, const std::vector< unsigned char > &marker)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > & feSidePtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpFaceSide(const std::string &field_name, boost::shared_ptr< VolumeElementForcesAndSourcesCoreOnSide > &fe_side_ptr)
MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
OpRowCol(const std::string row_field, const std::string col_field, const bool symm)
OpRow(const std::string &field_name)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpVolume(const std::string &field_name, Vec vol)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
OpVolumeSide(const std::string &field_name)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)