v0.14.0
VEC-6: Discontinuous Galerkin for Kirchoff-Love Plate

Table of Contents

Note
Prerequisites of this tutorial include SCL-11: Discontinuous Galerkin for Poisson problem


Note
Intended learning outcome:

Source code main code

/**
* \file plate.cpp
* \example plate.cpp
*
* Implementation Kirchhoff-Love plate using Discointinous Galerkin (DG-Nitsche
* method)
*/
#include <MoFEM.hpp>
using namespace MoFEM;
static char help[] = "...\n\n";
constexpr int BASE_DIM = 1; ///< dimension of base
constexpr int SPACE_DIM = 2; ///< dimension of space
constexpr int FIELD_DIM = 1; ///< dimension of approx. field
template <int DIM> struct ElementsAndOps {};
template <> struct ElementsAndOps<2> {
};
using DomainEleOp =
DomainEle::UserDataOperator; ///< Finire element operator type
using EntData = EntitiesFieldData::EntData; ///< Data on entities
GAUSS>::OpGradGradSymTensorGradGrad<1, 1, SPACE_DIM, 0>;
PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>;
// Kronecker delta
// material parameters
constexpr double lambda = 1;
constexpr double mu = 1; ///< lame parameter
constexpr double t = 1; ///< plate stiffness
static double penalty = 1e6;
static double phi =
-1; // 1 - symmetric Nitsche, 0 - nonsymmetric, -1 antisymmetrica
static double nitsche = 1;
static int order = 4; // approximation order
auto source = [](const double x, const double y, const double) {
return cos(2 * x * M_PI) * sin(2 * y * M_PI);
};
/**
* @brief get fourth-order constitutive tensor
*
*/
auto plate_stiffness = []() {
constexpr auto a = (SPACE_DIM * (SPACE_DIM + 1)) / 2;
auto mat_D_ptr = boost::make_shared<MatrixDouble>(a * a, 1);
auto t_D = getFTensor4DdgFromMat<2, 2, 0>(*(mat_D_ptr));
constexpr double t3 = t * t * t;
constexpr double A = mu * t3 / 12;
constexpr double B = lambda * t3 / 12;
t_D(i, j, k, l) =
2 * B * ((t_kd(i, k) ^ t_kd(j, l)) / 4.) + A * t_kd(i, j) * t_kd(k, l);
// t_D(i, j, k, l) = (t_kd(i, k) ^ t_kd(j, l)) / 4.;
return mat_D_ptr;
};
// data for skeleton computation
std::array<std::vector<VectorInt>, 2>
indicesSideMap; ///< indices on rows for left hand-side
std::array<std::vector<MatrixDouble>, 2>
diffBaseSideMap; // first derivative of base functions
std::array<std::vector<MatrixDouble>, 2>
diff2BaseSideMap; // second derivative of base functions
std::array<double, 2> areaMap; // area/volume of elements on the side
std::array<int, 2> senseMap; // orientaton of local element edge/face in respect
// to global orientation of edge/face
/**
* @brief Operator tp collect data from elements on the side of Edge/Face
*
*/
OpCalculateSideData(std::string field_name, std::string col_field_name);
MoFEMErrorCode doWork(int side, EntityType type, EntData &data);
};
/**
* @brief Operator the left hand side matrix
*
*/
struct OpH1LhsSkeleton : public BoundaryEleOp {
public:
/**
* @brief Construct a new OpH1LhsSkeleton
*
* @param side_fe_ptr pointer to FE to evaluate side elements
*/
OpH1LhsSkeleton(boost::shared_ptr<FaceSideEle> side_fe_ptr,
boost::shared_ptr<MatrixDouble> d_mat_ptr);
MoFEMErrorCode doWork(int side, EntityType type,
private:
boost::shared_ptr<FaceSideEle>
sideFEPtr; ///< pointer to element to get data on edge/face sides
MatrixDouble locMat; ///< local operator matrix
boost::shared_ptr<MatrixDouble> dMatPtr;
};
struct Plate {
Plate(MoFEM::Interface &m_field) : mField(m_field) {}
MoFEMErrorCode runProblem();
private:
MoFEMErrorCode readMesh();
MoFEMErrorCode setupProblem();
MoFEMErrorCode boundaryCondition();
MoFEMErrorCode assembleSystem();
MoFEMErrorCode solveSystem();
MoFEMErrorCode outputResults();
};
//! [Read mesh]
auto simple = mField.getInterface<Simple>();
CHKERR simple->getOptions();
CHKERR simple->loadFile();
}
//! [Read mesh]
//! [Set up problem]
auto simple = mField.getInterface<Simple>();
CHKERR PetscOptionsGetInt(PETSC_NULL, "", "-order", &order, PETSC_NULL);
CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-penalty", &penalty,
PETSC_NULL);
CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-phi", &phi, PETSC_NULL);
CHKERR PetscOptionsGetScalar(PETSC_NULL, "", "-nitsche", &nitsche,
PETSC_NULL);
MOFEM_LOG("WORLD", Sev::inform) << "Set order: " << order;
MOFEM_LOG("WORLD", Sev::inform) << "Set penalty: " << penalty;
MOFEM_LOG("WORLD", Sev::inform) << "Set phi: " << phi;
MOFEM_LOG("WORLD", Sev::inform) << "Set nitche: " << nitsche;
CHKERR simple->addSkeletonField("U", H1, AINSWORTH_LEGENDRE_BASE, FIELD_DIM);
CHKERR simple->addBoundaryField("U", H1, AINSWORTH_LEGENDRE_BASE, FIELD_DIM);
CHKERR simple->setFieldOrder("U", order);
CHKERR simple->setUp();
}
//! [Set up problem]
//! [Boundary condition]
// get edges and vertices on body skin
auto get_skin = [&]() {
Range body_ents;
mField.get_moab().get_entities_by_dimension(0, SPACE_DIM, body_ents));
Skinner skin(&mField.get_moab());
Range skin_ents;
MOAB_THROW(skin.find_skin(0, body_ents, false, skin_ents));
Range verts;
MOAB_THROW(mField.get_moab().get_connectivity(skin_ents, verts, true));
skin_ents.merge(verts);
return skin_ents;
};
// remove dofs on skin edges from priblem
auto remove_dofs_from_problem = [&](Range &&skin) {
auto problem_mng = mField.getInterface<ProblemsManager>();
auto simple = mField.getInterface<Simple>();
CHKERR problem_mng->removeDofsOnEntities(simple->getProblemName(), "U",
skin, 0, 1);
};
// it make plate simply supported
CHKERR remove_dofs_from_problem(get_skin());
}
//! [Boundary condition]
//! [Push operators to pipeline]
auto pipeline_mng = mField.getInterface<PipelineManager>();
auto rule_lhs = [](int, int, int p) -> int { return 2 * p; };
auto rule_rhs = [](int, int, int p) -> int { return 2 * p; };
auto rule_2 = [this](int, int, int) { return 2 * order; };
CHKERR pipeline_mng->setDomainLhsIntegrationRule(rule_lhs);
CHKERR pipeline_mng->setDomainRhsIntegrationRule(rule_rhs);
CHKERR pipeline_mng->setSkeletonLhsIntegrationRule(rule_2);
CHKERR pipeline_mng->setSkeletonRhsIntegrationRule(rule_2);
CHKERR pipeline_mng->setBoundaryLhsIntegrationRule(rule_2);
CHKERR pipeline_mng->setBoundaryRhsIntegrationRule(rule_2);
auto det_ptr = boost::make_shared<VectorDouble>();
auto jac_ptr = boost::make_shared<MatrixDouble>();
auto inv_jac_ptr = boost::make_shared<MatrixDouble>();
auto base_mass_ptr = boost::make_shared<MatrixDouble>();
auto data_l2_ptr = boost::make_shared<EntitiesFieldData>(MBENTITYSET);
auto mat_D_ptr = plate_stiffness();
auto push_ho_direcatives = [&](auto &pipeline) {
pipeline.push_back(new OpBaseDerivativesMass<BASE_DIM>(
base_mass_ptr, data_l2_ptr, AINSWORTH_LEGENDRE_BASE, L2));
pipeline.push_back(new OpBaseDerivativesNext<BASE_DIM>(
BaseDerivatives::SecondDerivative, base_mass_ptr, data_l2_ptr,
};
/**
* @brief calculate jacobian
*
*/
auto push_jacobian = [&](auto &pipeline) {
pipeline.push_back(new OpSetHOWeightsOnFace());
pipeline.push_back(new OpCalculateHOJac<SPACE_DIM>(jac_ptr));
pipeline.push_back(
new OpInvertMatrix<SPACE_DIM>(jac_ptr, det_ptr, inv_jac_ptr));
// push first base derivatives tp physical element shape
pipeline.push_back(new OpSetInvJacH1ForFace<1>(inv_jac_ptr));
// push second base derivatives tp physical element shape
pipeline.push_back(new OpSetInvJacH1ForFace<2>(inv_jac_ptr));
};
push_ho_direcatives(pipeline_mng->getOpDomainLhsPipeline());
push_jacobian(pipeline_mng->getOpDomainLhsPipeline());
pipeline_mng->getOpDomainLhsPipeline().push_back(
new OpDomainPlateStiffness("U", "U", mat_D_ptr));
// pipeline_mng->getOpDomainLhsPipeline().push_back(new OpDomainGradGrad(
// "U", "U", [](const double, const double, const double) { return 1; }));
pipeline_mng->getOpDomainRhsPipeline().push_back(
// Push operators to the Pipeline for Skeleton
auto side_fe_ptr = boost::make_shared<FaceSideEle>(mField);
push_ho_direcatives(side_fe_ptr->getOpPtrVector());
push_jacobian(side_fe_ptr->getOpPtrVector());
side_fe_ptr->getOpPtrVector().push_back(new OpCalculateSideData("U", "U"));
// Push operators to the Pipeline for Skeleton
pipeline_mng->getOpSkeletonLhsPipeline().push_back(
new OpH1LhsSkeleton(side_fe_ptr, mat_D_ptr));
}
//! [Push operators to pipeline]
//! [Solve system]
auto pipeline_mng = mField.getInterface<PipelineManager>();
auto simple = mField.getInterface<Simple>();
auto ksp_solver = pipeline_mng->createKSP();
CHKERR KSPSetFromOptions(ksp_solver);
CHKERR KSPSetUp(ksp_solver);
// Create RHS and solution vectors
auto dm = simple->getDM();
auto F = createDMVector(dm);
auto D = vectorDuplicate(F);
CHKERR KSPSolve(ksp_solver, F, D);
// Scatter result data on the mesh
CHKERR VecGhostUpdateBegin(D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR VecGhostUpdateEnd(D, INSERT_VALUES, SCATTER_FORWARD);
CHKERR DMoFEMMeshToLocalVector(dm, D, INSERT_VALUES, SCATTER_REVERSE);
}
//! [Solve system]
//! [Output results]
auto pipeline_mng = mField.getInterface<PipelineManager>();
pipeline_mng->getDomainLhsFE().reset();
pipeline_mng->getSkeletonRhsFE().reset();
pipeline_mng->getSkeletonLhsFE().reset();
pipeline_mng->getBoundaryRhsFE().reset();
pipeline_mng->getBoundaryLhsFE().reset();
auto post_proc_fe = boost::make_shared<PostProcEle>(mField);
auto u_ptr = boost::make_shared<VectorDouble>();
post_proc_fe->getOpPtrVector().push_back(
new OpCalculateScalarFieldValues("U", u_ptr));
post_proc_fe->getOpPtrVector().push_back(
new OpPPMap(post_proc_fe->getPostProcMesh(),
post_proc_fe->getMapGaussPts(),
{{"U", u_ptr}},
{}, {}, {}
)
);
pipeline_mng->getDomainRhsFE() = post_proc_fe;
CHKERR pipeline_mng->loopFiniteElements();
CHKERR post_proc_fe->writeFile("out_result.h5m");
}
//! [Output results]
//! [Run program]
// CHKERR checkResults();
}
//! [Run program]
int main(int argc, char *argv[]) {
// Initialisation of MoFEM/PETSc and MOAB data structures
const char param_file[] = "param_file.petsc";
MoFEM::Core::Initialize(&argc, &argv, param_file, help);
// Add logging channel for example
auto core_log = logging::core::get();
core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(), "PL"));
LogManager::setLog("PL");
MOFEM_LOG_TAG("PL", "plate");
try {
//! [Register MoFEM discrete manager in PETSc]
DMType dm_name = "DMMOFEM";
//! [Register MoFEM discrete manager in PETSc
//! [Create MoAB]
moab::Core mb_instance; ///< mesh database
moab::Interface &moab = mb_instance; ///< mesh database interface
//! [Create MoAB]
//! [Create MoFEM]
MoFEM::Core core(moab); ///< finite element database
MoFEM::Interface &m_field = core; ///< finite element database insterface
//! [Create MoFEM]
//! [Plate]
Plate ex(m_field);
CHKERR ex.runProblem();
//! [Plate]
}
}
OpCalculateSideData::OpCalculateSideData(std::string row_field_name,
std::string col_field_name)
: FaceSideOp(row_field_name, col_field_name, FaceSideOp::OPROW) {}
EntData &data) {
const auto nb_in_loop = getFEMethod()->nInTheLoop;
auto clear = [](auto nb) {
indicesSideMap[nb].clear();
diffBaseSideMap[nb].clear();
diff2BaseSideMap[nb].clear();
};
if (type == MBVERTEX) {
areaMap[nb_in_loop] = getMeasure();
senseMap[nb_in_loop] = getEdgeSense();
if (!nb_in_loop) {
clear(0);
clear(1);
areaMap[1] = 0;
senseMap[1] = 0;
}
}
const auto nb_dofs = data.getIndices().size();
if (nb_dofs) {
indicesSideMap[nb_in_loop].push_back(data.getIndices());
diffBaseSideMap[nb_in_loop].push_back(
data.getN(BaseDerivatives::FirstDerivative));
diff2BaseSideMap[nb_in_loop].push_back(
data.getN(BaseDerivatives::SecondDerivative));
}
}
template <typename T> inline auto get_ntensor(T &base_mat) {
&*base_mat.data().begin());
};
template <typename T> inline auto get_ntensor(T &base_mat, int gg, int bb) {
double *ptr = &base_mat(gg, bb);
};
template <typename T> inline auto get_diff_ntensor(T &base_mat) {
double *ptr = &*base_mat.data().begin();
return getFTensor1FromPtr<2>(ptr);
};
template <typename T>
inline auto get_diff_ntensor(T &base_mat, int gg, int bb) {
double *ptr = &base_mat(gg, 2 * bb);
return getFTensor1FromPtr<2>(ptr);
};
template <typename T> inline auto get_diff2_ntensor(T &base_mat) {
double *ptr = &*base_mat.data().begin();
};
template <typename T>
inline auto get_diff2_ntensor(T &base_mat, int gg, int bb) {
double *ptr = &base_mat(gg, 4 * bb);
};
/**
* @brief Construct a new OpH1LhsSkeleton
*
* @param side_fe_ptr pointer to FE to evaluate side elements
*/
OpH1LhsSkeleton::OpH1LhsSkeleton(boost::shared_ptr<FaceSideEle> side_fe_ptr,
boost::shared_ptr<MatrixDouble> mat_d_ptr)
: BoundaryEleOp(NOSPACE, BoundaryEleOp::OPSPACE), sideFEPtr(side_fe_ptr),
dMatPtr(mat_d_ptr) {}
// Collect data from side domian elements
CHKERR loopSideFaces("dFE", *sideFEPtr);
const auto in_the_loop =
sideFEPtr->nInTheLoop; // return number of elements on the side
// calculate penalty
const double s = getMeasure() / (areaMap[0] + areaMap[1]);
const double p = penalty * s;
// get normal of the face or edge
auto t_normal = getFTensor1Normal();
t_normal.normalize();
// Elastic stiffness tensor (4th rank tensor with minor and major
// symmetry)
auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*dMatPtr);
// get number of integration points on face
const size_t nb_integration_pts = getGaussPts().size2();
// beta paramter is zero, when penalty method is used, also, takes value 1,
// when boundary edge/face is evaluated, and 2 when is skeleton edge/face.
const double beta = static_cast<double>(nitsche) / (in_the_loop + 1);
auto integrate = [&](auto sense_row, auto &row_ind, auto &row_diff,
auto &row_diff2, auto sense_col, auto &col_ind,
auto &col_diff, auto &col_diff2) {
// number of dofs, for homogenous approximation this value is
// constant.
const auto nb_rows = row_ind.size();
const auto nb_cols = col_ind.size();
const auto nb_row_base_functions = row_diff.size2() / SPACE_DIM;
if (nb_cols) {
// resize local element matrix
locMat.resize(nb_rows, nb_cols, false);
locMat.clear();
// get base functions, and integration weights
auto t_diff_row_base = get_diff_ntensor(row_diff);
auto t_diff2_row_base = get_diff2_ntensor(row_diff2);
auto t_w = getFTensor0IntegrationWeight();
// iterate integration points on face/edge
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
// t_w is integration weight, and measure is element area, or
// volume, depending if problem is in 2d/3d.
const double alpha = getMeasure() * t_w;
auto t_mat = locMat.data().begin();
// iterate rows
size_t rr = 0;
for (; rr != nb_rows; ++rr) {
t_mv(i, j) = t_D(i, j, k, l) * t_diff2_row_base(k, l);
// calculate tetting function
t_vn_plus(i, j) = beta * (phi * t_mv(i, j) / p);
t_vn(i, j) = (t_diff_row_base(j) * (t_normal(i) * sense_row)) -
t_vn_plus(i, j);
// get base functions on columns
auto t_diff_col_base = get_diff_ntensor(col_diff, gg, 0);
auto t_diff2_col_base = get_diff2_ntensor(col_diff2, gg, 0);
// iterate columns
for (size_t cc = 0; cc != nb_cols; ++cc) {
t_mu(i, j) = t_D(i, j, k, l) * t_diff2_col_base(k, l);
// // calculate variance of tested function
t_un(i, j) = -p * ((t_diff_col_base(j) * (t_normal(i) * sense_col) -
beta * t_mu(i, j) / p));
// assemble matrix
*t_mat -= alpha * (t_vn(i, j) * t_un(i, j));
*t_mat -= alpha * (t_vn_plus(i, j) * (beta * t_mu(i, j)));
// move to next column base and element of matrix
++t_diff_col_base;
++t_diff2_col_base;
++t_mat;
}
// move to next row base
++t_diff_row_base;
++t_diff2_row_base;
}
// this is obsolete for this particular example, we keep it for
// generality. in case of multi-physcis problems diffrent fields
// can chare hierarchical base but use diffrent approx. order,
// so is possible to have more base functions than DOFs on
// element.
for (; rr < nb_row_base_functions; ++rr) {
++t_diff_row_base;
++t_diff2_row_base;
}
++t_w;
}
// assemble system
CHKERR ::MatSetValues(getKSPB(), nb_rows, &*row_ind.begin(),
col_ind.size(), &*col_ind.begin(),
&*locMat.data().begin(), ADD_VALUES);
}
};
// iterate the sides rows
for (auto s0 : {LEFT_SIDE, RIGHT_SIDE}) {
const auto sense_row = senseMap[s0];
for (auto x0 = 0; x0 != indicesSideMap[s0].size(); ++x0) {
for (auto s1 : {LEFT_SIDE, RIGHT_SIDE}) {
const auto sense_col = senseMap[s1];
for (auto x1 = 0; x1 != indicesSideMap[s1].size(); ++x1) {
CHKERR integrate(sense_row, indicesSideMap[s0][x0],
sense_col, indicesSideMap[s1][x1],
);
}
}
}
}
}
NOSPACE
@ NOSPACE
Definition: definitions.h:83
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::EntitiesFieldData::EntData
Data on single entity (This is passed as argument to DataOperator::doWork)
Definition: EntitiesFieldData.hpp:128
senseMap
std::array< int, 2 > senseMap
Definition: plate.cpp:102
BoundaryEle
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
Definition: child_and_parent.cpp:39
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
H1
@ H1
continuous field
Definition: definitions.h:85
MoFEM::MatSetValues
MoFEMErrorCode MatSetValues(Mat M, const EntitiesFieldData::EntData &row_data, const EntitiesFieldData::EntData &col_data, const double *ptr, InsertMode iora)
Assemble PETSc matrix.
Definition: EntitiesFieldData.hpp:1644
OpH1LhsSkeleton::sideFEPtr
boost::shared_ptr< FaceSideEle > sideFEPtr
pointer to element to get data on edge/face sides
Definition: plate.cpp:135
plate_stiffness
auto plate_stiffness
get fourth-order constitutive tensor
Definition: plate.cpp:79
OpH1LhsSkeleton::OpH1LhsSkeleton
OpH1LhsSkeleton(boost::shared_ptr< FaceSideEle > side_fe_ptr, boost::shared_ptr< MatrixDouble > d_mat_ptr)
Construct a new OpH1LhsSkeleton.
Definition: plate.cpp:505
OpDomainPlateLoad
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM > OpDomainPlateLoad
Definition: plate.cpp:50
MoFEM::ProblemsManager
Problem manager is used to build and partition problems.
Definition: ProblemsManager.hpp:21
L2
@ L2
field with C-1 continuity
Definition: definitions.h:88
Plate
Definition: plate.cpp:140
phi
static double phi
Definition: poisson_2d_dis_galerkin.cpp:30
OpCalculateSideData::OpCalculateSideData
OpCalculateSideData(std::string field_name, std::string col_field_name)
Definition: plate.cpp:429
help
static char help[]
Definition: activate_deactivate_dofs.cpp:13
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
FaceSideEle
PipelineManager::ElementsAndOpsByDim< FE_DIM >::FaceSideEle FaceSideEle
Definition: level_set.cpp:41
MoFEM::PETSC
@ PETSC
Definition: FormsIntegrators.hpp:105
MoFEM::PipelineManager
PipelineManager interface.
Definition: PipelineManager.hpp:24
MoFEM.hpp
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
MoFEM::DMoFEMMeshToLocalVector
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
Definition: DMMoFEM.cpp:523
MOAB_THROW
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:554
MoFEM::OpBaseDerivativesNext
Definition: BaseDerivativesDataOperators.hpp:67
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
Poisson2DiscontGalerkinOperators::get_diff_ntensor
auto get_diff_ntensor(T &base_mat)
Definition: PoissonDiscontinousGalerkin.hpp:100
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
Plate::readMesh
MoFEMErrorCode readMesh()
[Read mesh]
Definition: plate.cpp:158
diff2BaseSideMap
std::array< std::vector< MatrixDouble >, 2 > diff2BaseSideMap
Definition: plate.cpp:100
BASE_DIM
constexpr int BASE_DIM
Definition: dg_projection.cpp:15
RIGHT_SIDE
@ RIGHT_SIDE
Definition: plate.cpp:92
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
order
constexpr int order
Definition: dg_projection.cpp:18
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
FIELD_DIM
constexpr int FIELD_DIM
Definition: child_and_parent.cpp:15
MoFEM::OpCalculateHOJac
Definition: HODataOperators.hpp:267
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::PipelineManager::EdgeEle
MoFEM::EdgeElementForcesAndSourcesCore EdgeEle
Definition: PipelineManager.hpp:36
MoFEM::PostProcBrokenMeshInMoab
Definition: PostProcBrokenMeshInMoabBase.hpp:667
indicesSideMap
std::array< std::vector< VectorInt >, 2 > indicesSideMap
indices on rows for left hand-side
Definition: plate.cpp:96
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
MoFEM::OpBaseDerivativesMass
Definition: BaseDerivativesDataOperators.hpp:35
MoFEM::createDMVector
auto createDMVector(DM dm)
Get smart vector from DM.
Definition: DMMoFEM.hpp:1099
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
FaceSideOp
a
constexpr double a
Definition: approx_sphere.cpp:30
OpCalculateSideData::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntData &data)
Definition: plate.cpp:433
OpH1LhsSkeleton::locMat
MatrixDouble locMat
local operator matrix
Definition: plate.cpp:136
BoundaryEleOp
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
double
convert.type
type
Definition: convert.py:64
MoFEM::PipelineManager::FaceEle
MoFEM::FaceElementForcesAndSourcesCore FaceEle
Definition: PipelineManager.hpp:35
MoFEM::FormsIntegrators::Assembly
Assembly methods.
Definition: FormsIntegrators.hpp:317
OpPPMap
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
Definition: photon_diffusion.cpp:29
MoFEM::OpCalculateScalarFieldValues
Get value at integration points for scalar field.
Definition: UserDataOperators.hpp:82
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
areaMap
std::array< double, 2 > areaMap
Definition: plate.cpp:101
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
Poisson2DiscontGalerkinOperators::get_ntensor
auto get_ntensor(T &base_mat)
Definition: PoissonDiscontinousGalerkin.hpp:90
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
Poisson2DiscontGalerkinOperators::OpCalculateSideData
Operator tp collect data from elements on the side of Edge/Face.
Definition: PoissonDiscontinousGalerkin.hpp:38
MoFEM::OpSetHOWeightsOnFace
Modify integration weights on face to take in account higher-order geometry.
Definition: HODataOperators.hpp:122
nitsche
static double nitsche
Definition: poisson_2d_dis_galerkin.cpp:32
OpH1LhsSkeleton::doWork
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Definition: plate.cpp:510
OpH1LhsSkeleton::dMatPtr
boost::shared_ptr< MatrixDouble > dMatPtr
Definition: plate.cpp:137
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
Plate::runProblem
MoFEMErrorCode runProblem()
[Output results]
Definition: plate.cpp:375
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
penalty
constexpr double penalty
Definition: shallow_wave.cpp:75
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
BiLinearForm
main
int main(int argc, char *argv[])
Definition: activate_deactivate_dofs.cpp:15
OpDomainPlateStiffness
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGradSymTensorGradGrad< 1, 1, SPACE_DIM, 0 > OpDomainPlateStiffness
Definition: plate.cpp:48
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', SPACE_DIM >
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
MoFEM::OpSetInvJacH1ForFace
Definition: UserDataOperators.hpp:2918
ElementsAndOps
Definition: child_and_parent.cpp:18
Range
Plate::setupProblem
MoFEMErrorCode setupProblem()
[Read mesh]
Definition: plate.cpp:170
DomainEleOp
MoFEM::CoreTmp< 0 >::Initialize
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:72
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::vectorDuplicate
SmartPetscObj< Vec > vectorDuplicate(Vec vec)
Create duplicate vector of smart vector.
Definition: PetscSmartObj.hpp:221
OpDomainGradGrad
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< 1, 1, SPACE_DIM > OpDomainGradGrad
Definition: helmholtz.cpp:25
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
Poisson2DiscontGalerkinOperators::areaMap
std::array< double, 2 > areaMap
Definition: PoissonDiscontinousGalerkin.hpp:30
FTensor::Tensor0
Definition: Tensor0.hpp:16
Plate::solveSystem
MoFEMErrorCode solveSystem()
[Push operators to pipeline]
Definition: plate.cpp:308
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
diffBaseSideMap
std::array< std::vector< MatrixDouble >, 2 > diffBaseSideMap
Definition: plate.cpp:98
Plate::assembleSystem
MoFEMErrorCode assembleSystem()
[Boundary condition]
Definition: plate.cpp:234
mu
double mu
Definition: dynamic_first_order_con_law.cpp:98
AINSWORTH_LEGENDRE_BASE
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:60
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
get_diff2_ntensor
auto get_diff2_ntensor(T &base_mat)
Definition: plate.cpp:489
MoFEM::OpInvertMatrix
Definition: UserDataOperators.hpp:3249
LEFT_SIDE
@ LEFT_SIDE
Definition: plate.cpp:92
ReactionDiffusionEquation::D
const double D
diffusivity
Definition: reaction_diffusion.cpp:20
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::getFTensor2SymmetricLowerFromPtr< 2 >
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 4 >, 2 > getFTensor2SymmetricLowerFromPtr< 2 >(double *ptr)
Definition: Templates.hpp:1106
MoFEM::PetscOptionsGetScalar
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:162
DomainEle
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
Definition: child_and_parent.cpp:34
source
auto source
Definition: poisson_2d_dis_galerkin.cpp:62
Plate::boundaryCondition
MoFEMErrorCode boundaryCondition()
[Set up problem]
Definition: plate.cpp:199
OpH1LhsSkeleton
Operator the left hand side matrix.
Definition: plate.cpp:120
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
ElementSide
ElementSide
Definition: plate.cpp:92
convert.int
int
Definition: convert.py:64
MoFEM::PetscOptionsGetInt
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
Definition: DeprecatedPetsc.hpp:142
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEM::FaceElementForcesAndSourcesCoreOnSide
Base face element used to integrate on skeleton.
Definition: FaceElementForcesAndSourcesCoreOnSide.hpp:19
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
Poisson2DiscontGalerkinOperators::senseMap
std::array< int, 2 > senseMap
Definition: PoissonDiscontinousGalerkin.hpp:31
Plate::outputResults
MoFEMErrorCode outputResults()
[Solve system]
Definition: plate.cpp:335
F
@ F
Definition: free_surface.cpp:394
MoFEM::OpPostProcMapInMoab
Post post-proc data at points from hash maps.
Definition: PostProcBrokenMeshInMoabBase.hpp:698