|
| v0.14.0
|
Go to the documentation of this file.
7 static char help[] =
"...\n\n";
16 volumeVec(volume_vec) {}
22 if (row_type != MBVERTEX)
25 auto t_w = getFTensor0IntegrationWeight();
27 int nb_gauss_pts = row_data.
getN().size1();
28 for (
int gg = 0; gg != nb_gauss_pts; gg++) {
29 vol += getVolume() * t_w;
33 CHKERR VecSetValue(volumeVec, 0, vol, ADD_VALUES);
39 int main(
int argc,
char *argv[]) {
48 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
50 PetscBool flg = PETSC_TRUE;
52 #if PETSC_VERSION_GE(3, 6, 4)
59 if (flg != PETSC_TRUE) {
60 SETERRQ(PETSC_COMM_SELF, 1,
"*** ERROR -my_file (MESH FILE NEEDED)");
83 "MESH_NODE_POSITIONS");
85 "MESH_NODE_POSITIONS");
87 "MESH_NODE_POSITIONS");
94 CHKERR moab.get_entities_by_type(0, MBTET, tets,
true);
96 CHKERR moab.get_entities_by_type(0, MBEDGE, edges,
true);
130 boost::make_shared<VolumeElementForcesAndSourcesCore>(m_field);
131 auto material_grad_mat = boost::make_shared<MatrixDouble>();
132 auto material_det_vec = boost::make_shared<VectorDouble>();
134 "MESH_NODE_POSITIONS", material_grad_mat));
135 fe_ptr->getOpPtrVector().push_back(
137 fe_ptr->getOpPtrVector().push_back(
new OpSetHOWeights(material_det_vec));
143 CHKERR VecAssemblyBegin(vol_vec);
144 CHKERR VecAssemblyEnd(vol_vec);
145 CHKERR VecSum(vol_vec, &vol);
146 CHKERR PetscPrintf(PETSC_COMM_WORLD,
"vol = %3.8e\n", vol);
147 if (fabs(vol - 1.0) > 1e-4)
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
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_dofs(const Problem *problem_ptr, const std::string &field_name, RowColData rc, DofMethod &method, int lower_rank, int upper_rank, int verb=DEFAULT_VERBOSITY)=0
Make a loop over dofs.
virtual MPI_Comm & get_comm() const =0
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.
virtual int get_comm_rank() const =0
PetscErrorCode DMSetUp_MoFEM(DM dm)
Projection of edge entities with one mid-node on hierarchical basis.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
int main(int argc, char *argv[])
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.
PetscErrorCode DMMoFEMAddElement(DM dm, std::string fe_name)
add element to dm
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
auto createDM(MPI_Comm comm, const std::string dm_type_name)
Creates smart DM object.
virtual MoFEMErrorCode build_finite_elements(int verb=DEFAULT_VERBOSITY)=0
Build finite elements.
OpVolumeCalculation(Vec volume_vec)
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMMoFEMCreateMoFEM(DM dm, MoFEM::Interface *m_field_ptr, const char problem_name[], const MoFEM::BitRefLevel bit_level, const MoFEM::BitRefLevel bit_mask=MoFEM::BitRefLevel().set())
Must be called by user to set MoFEM data structures.
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.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
#define CATCH_ERRORS
Catch errors.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Set inverse jacobian to base functions.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
const FTensor::Tensor2< T, Dim, Dim > Vec
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
virtual MoFEMErrorCode build_fields(int verb=DEFAULT_VERBOSITY)=0
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
@ MOFEM_ATOM_TEST_INVALID
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.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
#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 ...
MoFEMErrorCode doWork(int row_side, EntityType row_type, EntitiesFieldData::EntData &row_data)
Operator for linear form, usually to calculate values on right hand side.
PetscErrorCode DMMoFEMSetIsPartitioned(DM dm, PetscBool is_partitioned)