15static char help[] =
"...\n\n";
45 const double eps = 1e-12;
46 if (norm_inf(diff) >
eps) {
54 MOFEM_LOG(
"ATOM", Sev::error) <<
"Difference: " << diff;
56 "Coordinates at integration pts are different");
59 const size_t nb_dofs = data.
getN().size2();
60 const size_t nb_integration_pts = data.
getN().size1();
69 dot_elem_data.resize(nb_integration_pts, nb_dofs,
false);
71 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
72 for (
size_t bb = 0; bb != nb_dofs; ++bb) {
73 dot_elem_data(gg, bb) = t_base;
97 const size_t nb_dofs = data.
getN().size2();
98 const size_t nb_integration_pts = data.
getN().size1();
108 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
109 for (
size_t bb = 0; bb != nb_dofs; ++bb) {
117 auto check_continuity_of_base = [&](
auto &vol_dot_data) {
122 "Inconsistent number of integration points");
126 "Inconsistent number of base functions");
127 const double eps = 1e-12;
128 for (
size_t gg = 0; gg != vol_dot_data.size1(); ++gg)
129 for (
size_t bb = 0; bb != vol_dot_data.size2(); ++bb) {
134 "Inconsistency (%d, %d) %3.4e != %3.4e", gg, bb,
151int main(
int argc,
char *argv[]) {
159 moab::Core moab_core;
160 moab::Interface &moab = moab_core;
166 auto core_log = logging::core::get();
172 DMType dm_name =
"DMMOFEM";
188 enum bases { AINSWORTH, DEMKOWICZ, LASTBASEOP };
189 const char *list_bases[] = {
"ainsworth",
"demkowicz"};
191 PetscInt choice_base_value = AINSWORTH;
193 LASTBASEOP, &choice_base_value, &flg);
194 if (flg == PETSC_TRUE) {
196 if (choice_base_value == AINSWORTH)
198 else if (choice_base_value == DEMKOWICZ)
206 auto base = get_base();
217 auto dm = simple_interface->
getDM();
221 boost::shared_ptr<EdgeEle> skeleton_fe =
222 boost::shared_ptr<EdgeEle>(
new EdgeEle(m_field));
223 skeleton_fe->getOpPtrVector().push_back(
ForcesAndSourcesCore::UserDataOperator UserDataOperator
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_ATOM_TEST_INVALID
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_ATTRIBUTES(channel, bit)
Add attributes to channel.
#define MOFEM_LOG_FUNCTION()
Set scope.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
PetscErrorCode PetscOptionsGetEList(PetscOptions *, const char pre[], const char name[], const char *const *list, PetscInt next, PetscInt *value, PetscBool *set)
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.
default operator for EDGE element
MoFEMErrorCode loopSideFaces(const string fe_name, FaceElementForcesAndSourcesCoreOnSide &fe_side)
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
default operator for Face element
int getEdgeSideNumber() const
get face side number in respect to volume
MatrixDouble & getEdgeCoordsAtGaussPts()
get face coordinates at Gauss pts.
Base face element used to integrate on skeleton.
MatrixDouble & getCoordsAtGaussPts()
Gauss points and weight, matrix (nb. of points x 3)
@ OPROW
operator doWork function is executed on FE rows
const FEMethod * getFEMethod() const
Return raw pointer to Finite Element Method object.
boost::ptr_deque< UserDataOperator > & getOpPtrVector()
Use to push back operator for row operator.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Simple interface for fast problem set-up.
const std::string getSkeletonFEName() const
Get the Skeleton FE Name.
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 addSkeletonField(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 skeleton.
bool & getAddSkeletonFE()
Get the addSkeletonFE.
MoFEMErrorCode setUp(const PetscBool is_partitioned=PETSC_TRUE)
Setup problem.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
OpFaceSide(CommonData &elem_data)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
SkeletonFE(MoFEM::Interface &m_field, CommonData &elem_data)