15static char help[] =
"...\n\n";
44 const double eps = 1e-12;
45 if (norm_inf(diff) >
eps)
47 "coordinates at integration pts are different");
49 const size_t nb_dofs = data.
getN().size2() / 3;
50 const size_t nb_integration_pts = data.
getN().size1();
61 dot_elem_data.resize(nb_integration_pts, nb_dofs,
false);
63 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
64 for (
size_t bb = 0; bb != nb_dofs; ++bb) {
65 dot_elem_data(gg, bb) = t_tangent(
i) * t_hcurl_base(
i);
90 const size_t nb_dofs = data.
getN().size2() / 3;
91 const size_t nb_integration_pts = data.
getN().size1();
100 for (
size_t gg = 0; gg != nb_integration_pts; ++gg) {
101 for (
size_t bb = 0; bb != nb_dofs; ++bb) {
109 auto check_continuity_of_base = [&](
auto &vol_dot_data) {
114 "Inconsistent number of integration points");
118 "Inconsistent number of base functions");
119 const double eps = 1e-12;
120 for (
size_t gg = 0; gg != vol_dot_data.size1(); ++gg)
121 for (
size_t bb = 0; bb != vol_dot_data.size2(); ++bb) {
126 "Inconsistency (%d, %d) %3.4e != %3.4e", gg, bb,
145int main(
int argc,
char *argv[]) {
153 moab::Core moab_core;
154 moab::Interface &moab = moab_core;
160 auto core_log = logging::core::get();
166 DMType dm_name =
"DMMOFEM";
179 enum bases { AINSWORTH, DEMKOWICZ, LASTBASEOP };
180 const char *list_bases[] = {
"ainsworth",
"demkowicz"};
182 PetscInt choice_base_value = AINSWORTH;
184 LASTBASEOP, &choice_base_value, &flg);
185 if (flg == PETSC_TRUE) {
187 if (choice_base_value == AINSWORTH)
189 else if (choice_base_value == DEMKOWICZ)
197 auto base = get_base();
205 auto dm = simple_interface->
getDM();
209 boost::shared_ptr<EdgeEle> skeleton_fe =
210 boost::shared_ptr<EdgeEle>(
new EdgeEle(m_field));
213 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()
@ HCURL
field with continuous tangents
#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.
FTensor::Index< 'i', SPACE_DIM > i
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)
Add operators pushing bases from local to physical configuration.
int nInTheLoop
number currently of processed method
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
FTensor::Tensor1< double, 3 > getFTensor1Direction()
MoFEMErrorCode loopSideFaces(const string fe_name, FaceElementForcesAndSourcesCoreOnSide &fe_side)
Data on single entity (This is passed as argument to DataOperator::doWork)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
default operator for Face element
int getEdgeSideNumber() const
get face side number in respect to volume
MatrixDouble & getEdgeCoordsAtGaussPts()
get face coordinates at Gauss pts.
auto getFTensor1Direction()
get normal as tensor
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.
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)