|
| v0.14.0
|
#include <MoFEM.hpp>
#include <Hdiv.hpp>
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
|
static PetscBool | quiet = PETSC_FALSE |
|
static PetscBool | base_cache = PETSC_FALSE |
|
static char | help [] = "...\n\n" |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Simple user data operator which main purpose is to print values of base functions at integration points.
- Examples
- forces_and_sources_testing_users_base.cpp.
Definition at line 172 of file forces_and_sources_testing_users_base.cpp.
185 PetscBool flg = PETSC_TRUE;
187 #if PETSC_VERSION_GE(3, 6, 4)
194 if (flg != PETSC_TRUE) {
196 "*** ERROR -my_file (MESH FILE NEEDED)");
223 auto field_order_table =
224 const_cast<Field *
>(field_ptr)->getFieldOrderTable();
227 auto get_cgg_bubble_order_zero = [](
int p) {
return 0; };
229 auto get_cgg_bubble_order_face = [](
int p) {
232 auto get_cgg_bubble_order_tet = [](
int p) {
235 field_order_table[MBVERTEX] = get_cgg_bubble_order_zero;
236 field_order_table[MBEDGE] = get_cgg_bubble_order_zero;
237 field_order_table[MBTRI] = get_cgg_bubble_order_face;
238 field_order_table[MBTET] = get_cgg_bubble_order_tet;
239 const_cast<Field *
>(field_ptr)->rebuildDofsOrderMap();
242 for(
auto d = 0;
d!=10; ++
d) {
243 MOFEM_LOG(
"WORLD", Sev::noisy) <<
"dof " << dof_order_map[
d];
302 typedef tee_device<std::ostream, std::ofstream>
TeeDevice;
305 std::ofstream ofs(
"forces_and_sources_testing_users_base.txt");
317 MyOp1(
const std::string &row_field,
const std::string &col_field,
320 row_field, col_field,
type),
321 my_split(_my_split) {
332 my_split << rowFieldName << endl;
333 my_split <<
"side: " << side <<
" type: " <<
type << std::endl;
334 my_split << data << endl;
335 my_split << data.
getN() << endl;
351 my_split << rowFieldName <<
" : " << colFieldName << endl;
352 my_split <<
"row side: " << row_side <<
" row_type: " << row_type
354 my_split <<
"col side: " << col_side <<
" col_type: " << col_type
356 my_split << row_data.
getIndices().size() <<
" : "
367 fe1.getUserPolynomialBase() =
373 fe1.getOpPtrVector().push_back(
374 new MyOp1(
"FILED_CGG",
"FILED_CGG", my_split,
375 ForcesAndSourcesCore::UserDataOperator::OPROW));
376 fe1.getOpPtrVector().push_back(
377 new MyOp1(
"FILED_CGG",
"FILED_RT", my_split,
378 ForcesAndSourcesCore::UserDataOperator::OPROWCOL));
389 if (!TetPolynomialBase::switchCacheBaseInterior<HDIV>(
◆ base_cache
PetscBool base_cache = PETSC_FALSE |
|
static |
◆ help
◆ quiet
PetscBool quiet = PETSC_FALSE |
|
static |
#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_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.
const std::array< ApproximationOrder, MAX_DOFS_ON_ENTITY > & getDofOrderMap(const EntityType type) const
get hash-map relating dof index on entity with its order
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
virtual const Field * get_field_structure(const std::string &name, enum MoFEMTypes bh=MF_EXIST) const =0
get field structure
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
virtual MoFEMErrorCode doWork(int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
Operator for bi-linear form, usually to calculate values on left hand side.
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.
Provide data structure for (tensor) field approximation.
@ USER_BASE
user implemented approximation base
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
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.
#define NBFACETRI_DEMKOWICZ_HDIV(P)
static PetscBool base_cache
const VectorInt & getIndices() const
Get global indices of dofs on entity.
#define NBVOLUMETET_DEMKOWICZ_HDIV(P)
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.
virtual MoFEMErrorCode modify_problem_ref_level_add_bit(const std::string &name_problem, const BitRefLevel &bit)=0
add ref level to problem
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.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
@ MOFEM_DATA_INCONSISTENCY
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
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
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
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.
Class used to calculate base functions at integration points.
virtual MoFEMErrorCode add_problem(const std::string &name, enum MoFEMTypes bh=MF_EXCL, int verb=DEFAULT_VERBOSITY)=0
Add problem.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
@ HDIV
field with continuous normal traction
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.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)