3#include <PoissonOperators.hpp>
8static char help[] =
"...\n\n";
47 : domainField(
"U"), moab(mb_instance), mField(core),
48 mpiComm(mField.get_comm()), mpiRank(mField.get_comm_rank()),
77 auto vol_ruleLhs = [](int, int,
int p) ->
int {
return 2 * (
p - 1); };
78 auto vol_ruleRhs = [](int, int,
int p) ->
int {
return 2 * (
p - 1); };
86 auto det_ptr = boost::make_shared<VectorDouble>();
87 auto jac_ptr = boost::make_shared<MatrixDouble>();
88 auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
99 boost::shared_ptr<VolEle> null;
111 Vec global_rhs, global_solution;
112 CHKERR DMCreateGlobalVector(
dm, &global_rhs);
113 CHKERR VecDuplicate(global_rhs, &global_solution);
118 CHKERR KSPCreate(PETSC_COMM_WORLD, &
ksp);
129 CHKERR KSPSolve(
ksp, global_rhs, global_solution);
137 CHKERR VecDestroy(&global_solution);
138 CHKERR VecDestroy(&global_rhs);
144 boost::static_pointer_cast<PostProcFaceOnRefinedMesh>(
postFaceVolume)
145 ->writeFile(
"out_vol.h5m");
159 boost::static_pointer_cast<PostProcFaceOnRefinedMesh>(
postFaceVolume)
160 ->generateReferenceElementMesh();
162 boost::static_pointer_cast<PostProcFaceOnRefinedMesh>(
postFaceVolume)
175 string name = it->getName();
176 if (name.compare(0, 14,
"ESSENTIAL") == 0) {
178 bdry_entities,
true);
182 cerr << bdry_entities;
185 bdry_entities.merge(bdr_verts);
210int main(
int argc,
char *argv[]) {
214 moab::Core mb_instance;
215 moab::Interface &moab = mb_instance;
217 DMType dm_name =
"DMMOFEM";
#define CATCH_ERRORS
Catch errors.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#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.
PetscErrorCode DMMoFEMKSPSetComputeRHS(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
set KSP right hand side evaluation function
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
PetscErrorCode DMoFEMMeshToGlobalVector(DM dm, Vec g, InsertMode mode, ScatterMode scatter_mode)
set ghosted vector values on all existing mesh entities
PetscErrorCode DMMoFEMKSPSetComputeOperators(DM dm, const char fe_name[], MoFEM::FEMethod *method, MoFEM::BasicMethod *pre_only, MoFEM::BasicMethod *post_only)
Set KSP operators and push mofem finite element methods.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
OpCalculateHOJacForFaceImpl< 2 > OpCalculateHOJacForFace
virtual moab::Interface & get_moab()=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.
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
MoFEMErrorCode addDomainField(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_ZERO, int verb=-1)
Add field on domain.
MoFEMErrorCode getOptions()
get options
MoFEMErrorCode getDM(DM *dm)
Get DM.
MoFEMErrorCode loadFile(const std::string options, const std::string mesh_file_name)
Load mesh file.
MoFEMErrorCode setFieldOrder(const std::string field_name, const int order, const Range *ents=NULL)
Set field order.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
const std::string getProblemName() const
Get the Problem Name.
const std::string getDomainFEName() const
Get the Domain FE Name.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
boost::shared_ptr< VolEle > postFaceVolume
Poisson(moab::Core &mb_instance, MoFEM::Core &core, int order)
MoFEMErrorCode runAnalysis()
boost::shared_ptr< VolEle > volPipelineLhs
MoFEM::Interface & mField
MoFEMErrorCode assembleSystem()
MoFEMErrorCode setupSystem()
MoFEMErrorCode setOutput()
MoFEMErrorCode setIntegrationRule()
boost::shared_ptr< VolEle > volPipelineRhs
MoFEMErrorCode readMesh()
MoFEMErrorCode solveSystem()
VolumeElementForcesAndSourcesCore VolEle