|
| v0.14.0
|
Go to the documentation of this file.
9 static char help[] =
"...\n\n";
11 int main(
int argc,
char *argv[]) {
20 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
22 PetscBool flg = PETSC_TRUE;
25 #if PETSC_VERSION_GE(3, 6, 4)
33 if (flg != PETSC_TRUE)
34 SETERRQ1(PETSC_COMM_SELF,
MOFEM_NOT_FOUND,
"file not found -my_file %s",
60 constexpr
int order = 3;
85 CHKERR prb_mng_ptr->buildProblem(
"P1",
true);
86 CHKERR prb_mng_ptr->partitionProblem(
"P1");
87 CHKERR prb_mng_ptr->partitionFiniteElements(
"P1");
88 CHKERR prb_mng_ptr->partitionGhostDofs(
"P1");
91 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Create matrix";
94 ->createMPIAIJWithArrays<PetscGlobalIdx_mi_tag>(
"P1",
A);
96 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Done";
98 auto fe_ptr = boost::make_shared<FEMethod>();
100 auto pre_proc_hook = [&]() {
105 auto post_proc_hook = [&]() {
110 auto op_hook = [&]() {
115 <<
"Iterate finite element " << *(fe_ptr->numeredEntFiniteElementPtr);
117 auto row_dofs = fe_ptr->getRowDofsPtr();
118 for (
auto &dof : *row_dofs)
119 MOFEM_LOG(
"WORLD", Sev::noisy) << *dof << endl;
124 fe_ptr->preProcessHook = pre_proc_hook;
125 fe_ptr->postProcessHook = post_proc_hook;
126 fe_ptr->operatorHook = op_hook;
129 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Iterate finite elements";
131 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Done";
137 auto vol_ptr = boost::make_shared<Vol>(m_field);
143 MoFEMErrorCode doWork(
int row_side,
int col_side, EntityType row_type,
144 EntityType col_type,
EntData &row_data,
150 vol_ptr->getOpPtrVector().push_back(
new Op());
153 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Iterate volume finite elements";
155 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Done";
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Data on single entity (This is passed as argument to DataOperator::doWork)
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.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Problem manager is used to build and partition problems.
virtual MoFEMErrorCode modify_finite_element_add_field_row(const std::string &fe_name, const std::string name_row)=0
set field row which finite element use
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
@ OPROWCOL
operator doWork is executed on FE rows &columns
virtual MoFEMErrorCode add_ents_to_field_by_type(const Range &ents, const EntityType type, const std::string &name, int verb=DEFAULT_VERBOSITY)=0
Add entities to field meshset.
Deprecated interface functions.
DeprecatedCoreInterface Interface
virtual MoFEMErrorCode add_ents_to_finite_element_by_type(const EntityHandle entities, const EntityType type, const std::string &name, const bool recursive=true)=0
add entities to finite element
#define CHKERR
Inline error check.
virtual MoFEMErrorCode add_finite_element(const std::string &fe_name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
add finite element
implementation of Data Operators for Forces and Sources
virtual MoFEMErrorCode modify_finite_element_add_field_col(const std::string &fe_name, const std::string name_row)=0
set field col which finite element use
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
friend class UserDataOperator
virtual MoFEMErrorCode modify_finite_element_add_field_data(const std::string &fe_name, const std::string name_field)=0
set finite element field data
Volume finite element base.
VolEle::UserDataOperator VolOp
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
EntitiesFieldData::EntData EntData
Matrix manager is used to build and partition problems.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
#define MOFEM_LOG(channel, severity)
Log.
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
int main(int argc, char *argv[])
virtual MoFEMErrorCode modify_problem_add_finite_element(const std::string name_problem, const std::string &fe_name)=0
add finite element to problem, this add entities assigned to finite element to a particular problem
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
virtual MoFEMErrorCode build_adjacencies(const Range &ents, int verb=DEFAULT_VERBOSITY)=0
build adjacencies
virtual MoFEMErrorCode set_field_order(const EntityHandle meshset, const EntityType type, const std::string &name, const ApproximationOrder order, int verb=DEFAULT_VERBOSITY)=0
Set order approximation of the entities in the field.
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
virtual MoFEMErrorCode add_field(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add field.
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...