v0.13.1
Classes | Typedefs | Enumerations | Functions | Variables
plate.cpp File Reference
#include <MoFEM.hpp>
#include <BasicFiniteElements.hpp>

Go to the source code of this file.

Classes

struct  ElementsAndOps< DIM >
 
struct  ElementsAndOps< 2 >
 
struct  OpCalculateSideData
 Operator tp collect data from elements on the side of Edge/Face. More...
 
struct  OpH1LhsSkeleton
 Operator the left hand side matrix. More...
 
struct  Plate
 

Typedefs

using DomainEle = ElementsAndOps< SPACE_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 Finire element operator type. More...
 
using BoundaryEle = ElementsAndOps< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using PostProcEle = ElementsAndOps< SPACE_DIM >::PostProcEle
 
using FaceSideEle = ElementsAndOps< SPACE_DIM >::FaceSideEle
 
using FaceSideOp = ElementsAndOps< SPACE_DIM >::FaceSideOp
 
using EntData = EntitiesFieldData::EntData
 Data on entities. More...
 
using OpDomainGradGrad = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGrad< BASE_DIM, FIELD_DIM, SPACE_DIM >
 
using OpDomainPlateStiffness = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradGradSymTensorGradGrad< 1, 1, SPACE_DIM, 0 >
 
using OpDomainPlateLoad = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpSource< BASE_DIM, FIELD_DIM >
 

Enumerations

enum  ElementSide { LEFT_SIDE = 0 , RIGHT_SIDE }
 

Functions

int main (int argc, char *argv[])
 [Run program] More...
 
template<typename T >
auto get_ntensor (T &base_mat)
 
template<typename T >
auto get_ntensor (T &base_mat, int gg, int bb)
 
template<typename T >
auto get_diff_ntensor (T &base_mat)
 
template<typename T >
auto get_diff_ntensor (T &base_mat, int gg, int bb)
 
template<typename T >
auto get_diff2_ntensor (T &base_mat)
 
template<typename T >
auto get_diff2_ntensor (T &base_mat, int gg, int bb)
 

Variables

static char help [] = "...\n\n"
 
constexpr int BASE_DIM = 1
 dimension of base More...
 
constexpr int SPACE_DIM = 2
 dimension of space More...
 
constexpr int FIELD_DIM = 1
 dimension of approx. field More...
 
constexpr auto t_kd = FTensor::Kronecker_Delta_symmetric<int>()
 
constexpr double lambda = 1
 
constexpr double mu = 1
 lame parameter More...
 
constexpr double t = 1
 plate stiffness More...
 
FTensor::Index< 'i', SPACE_DIMi
 
FTensor::Index< 'j', SPACE_DIMj
 
FTensor::Index< 'k', SPACE_DIMk
 
FTensor::Index< 'l', SPACE_DIMl
 
static double penalty = 1e6
 
static double phi
 
static double nitsche = 1
 
static int order = 4
 
auto source
 
auto plate_stiffness
 get fourth-order constitutive tensor More...
 
std::array< std::vector< VectorInt >, 2 > indicesSideMap
 indices on rows for left hand-side More...
 
std::array< std::vector< MatrixDouble >, 2 > diffBaseSideMap
 
std::array< std::vector< MatrixDouble >, 2 > diff2BaseSideMap
 
std::array< double, 2 > areaMap
 
std::array< int, 2 > senseMap
 

Typedef Documentation

◆ BoundaryEle

Definition at line 50 of file plate.cpp.

◆ BoundaryEleOp

Definition at line 51 of file plate.cpp.

◆ DomainEle

Definition at line 48 of file plate.cpp.

◆ DomainEleOp

Finire element operator type.

Definition at line 49 of file plate.cpp.

◆ EntData

Data on entities.

Examples
plate.cpp.

Definition at line 59 of file plate.cpp.

◆ FaceSideEle

Definition at line 54 of file plate.cpp.

◆ FaceSideOp

Definition at line 55 of file plate.cpp.

◆ OpDomainGradGrad

Definition at line 61 of file plate.cpp.

◆ OpDomainPlateLoad

using OpDomainPlateLoad = FormsIntegrators<DomainEleOp>::Assembly< PETSC>::LinearForm<GAUSS>::OpSource<BASE_DIM, FIELD_DIM>
Examples
plate.cpp.

Definition at line 67 of file plate.cpp.

◆ OpDomainPlateStiffness

using OpDomainPlateStiffness = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpGradGradSymTensorGradGrad<1, 1, SPACE_DIM, 0>
Examples
plate.cpp.

Definition at line 64 of file plate.cpp.

◆ PostProcEle

Definition at line 52 of file plate.cpp.

Enumeration Type Documentation

◆ ElementSide

Enumerator
LEFT_SIDE 
RIGHT_SIDE 

Definition at line 110 of file plate.cpp.

110{ LEFT_SIDE = 0, RIGHT_SIDE };
@ LEFT_SIDE
Definition: plate.cpp:110
@ RIGHT_SIDE
Definition: plate.cpp:110

Function Documentation

◆ get_diff2_ntensor() [1/2]

template<typename T >
auto get_diff2_ntensor ( T base_mat)
Examples
plate.cpp.

Definition at line 489 of file plate.cpp.

489 {
490 double *ptr = &*base_mat.data().begin();
492};
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 4 >, 2 > getFTensor2SymmetricLowerFromPtr< 2 >(double *ptr)
Definition: Templates.hpp:853

◆ get_diff2_ntensor() [2/2]

template<typename T >
auto get_diff2_ntensor ( T base_mat,
int  gg,
int  bb 
)

Definition at line 495 of file plate.cpp.

495 {
496 double *ptr = &base_mat(gg, 4 * bb);
498};

◆ get_diff_ntensor() [1/2]

template<typename T >
auto get_diff_ntensor ( T base_mat)
Examples
plate.cpp.

Definition at line 478 of file plate.cpp.

478 {
479 double *ptr = &*base_mat.data().begin();
480 return getFTensor1FromPtr<2>(ptr);
481};
FTensor::Tensor1< FTensor::PackPtr< double *, 2 >, 2 > getFTensor1FromPtr< 2 >(double *ptr)
Definition: Templates.hpp:740

◆ get_diff_ntensor() [2/2]

template<typename T >
auto get_diff_ntensor ( T base_mat,
int  gg,
int  bb 
)

Definition at line 484 of file plate.cpp.

484 {
485 double *ptr = &base_mat(gg, 2 * bb);
486 return getFTensor1FromPtr<2>(ptr);
487};

◆ get_ntensor() [1/2]

template<typename T >
auto get_ntensor ( T base_mat)
Examples
plate.cpp.

Definition at line 468 of file plate.cpp.

468 {
470 &*base_mat.data().begin());
471};

◆ get_ntensor() [2/2]

template<typename T >
auto get_ntensor ( T base_mat,
int  gg,
int  bb 
)

Definition at line 473 of file plate.cpp.

473 {
474 double *ptr = &base_mat(gg, bb);
476};

◆ main()

int main ( int  argc,
char *  argv[] 
)

[Run program]

Examples
plate.cpp.

Definition at line 390 of file plate.cpp.

390 {
391
392 // Initialisation of MoFEM/PETSc and MOAB data structures
393 const char param_file[] = "param_file.petsc";
395
396 // Add logging channel for example
397 auto core_log = logging::core::get();
398 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(), "PL"));
399 LogManager::setLog("PL");
400 MOFEM_LOG_TAG("PL", "plate");
401
402 try {
403
404 //! [Register MoFEM discrete manager in PETSc]
405 DMType dm_name = "DMMOFEM";
406 CHKERR DMRegister_MoFEM(dm_name);
407 //! [Register MoFEM discrete manager in PETSc
408
409 //! [Create MoAB]
410 moab::Core mb_instance; ///< mesh database
411 moab::Interface &moab = mb_instance; ///< mesh database interface
412 //! [Create MoAB]
413
414 //! [Create MoFEM]
415 MoFEM::Core core(moab); ///< finite element database
416 MoFEM::Interface &m_field = core; ///< finite element database insterface
417 //! [Create MoFEM]
418
419 //! [Plate]
420 Plate ex(m_field);
421 CHKERR ex.runProblem();
422 //! [Plate]
423 }
425
427}
std::string param_file
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
#define CHKERR
Inline error check.
Definition: definitions.h:548
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:59
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:342
CoreTmp< 0 > Core
Definition: Core.hpp:1096
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
static char help[]
Definition: plate.cpp:27
Core (interface) class.
Definition: Core.hpp:92
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition: Core.cpp:85
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:125
Deprecated interface functions.
Definition: plate.cpp:158

Variable Documentation

◆ areaMap

std::array<double, 2> areaMap
Examples
plate.cpp.

Definition at line 119 of file plate.cpp.

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr

dimension of base

Examples
plate.cpp.

Definition at line 31 of file plate.cpp.

◆ diff2BaseSideMap

std::array<std::vector<MatrixDouble>, 2> diff2BaseSideMap
Examples
plate.cpp.

Definition at line 118 of file plate.cpp.

◆ diffBaseSideMap

std::array<std::vector<MatrixDouble>, 2> diffBaseSideMap
Examples
plate.cpp.

Definition at line 116 of file plate.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr

dimension of approx. field

Examples
plate.cpp.

Definition at line 33 of file plate.cpp.

◆ help

char help[] = "...\n\n"
static
Examples
plate.cpp.

Definition at line 27 of file plate.cpp.

◆ i

Examples
plate.cpp.

Definition at line 78 of file plate.cpp.

◆ indicesSideMap

std::array<std::vector<VectorInt>, 2> indicesSideMap

indices on rows for left hand-side

Examples
plate.cpp.

Definition at line 114 of file plate.cpp.

◆ j

Examples
plate.cpp.

Definition at line 79 of file plate.cpp.

◆ k

Examples
plate.cpp.

Definition at line 80 of file plate.cpp.

◆ l

Examples
plate.cpp.

Definition at line 81 of file plate.cpp.

◆ lambda

constexpr double lambda = 1
constexpr
Examples
plate.cpp.

Definition at line 74 of file plate.cpp.

◆ mu

constexpr double mu = 1
constexpr

lame parameter

Examples
plate.cpp.

Definition at line 75 of file plate.cpp.

◆ nitsche

double nitsche = 1
static
Examples
plate.cpp.

Definition at line 86 of file plate.cpp.

◆ order

int order = 4
static
Examples
plate.cpp.

Definition at line 87 of file plate.cpp.

◆ penalty

double penalty = 1e6
static

Definition at line 83 of file plate.cpp.

◆ phi

double phi
static
Initial value:
=
-1
Examples
plate.cpp.

Definition at line 84 of file plate.cpp.

◆ plate_stiffness

auto plate_stiffness
Initial value:
= []() {
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);
return mat_D_ptr;
}
constexpr double a
double A
constexpr double mu
lame parameter
Definition: plate.cpp:75
FTensor::Index< 'j', SPACE_DIM > j
Definition: plate.cpp:79
FTensor::Index< 'k', SPACE_DIM > k
Definition: plate.cpp:80
constexpr double lambda
Definition: plate.cpp:74
FTensor::Index< 'i', SPACE_DIM > i
Definition: plate.cpp:78
constexpr auto t_kd
Definition: plate.cpp:71
constexpr int SPACE_DIM
dimension of space
Definition: plate.cpp:32
FTensor::Index< 'l', SPACE_DIM > l
Definition: plate.cpp:81
constexpr double t
plate stiffness
Definition: plate.cpp:76

get fourth-order constitutive tensor

Examples
plate.cpp.

Definition at line 97 of file plate.cpp.

◆ senseMap

std::array<int, 2> senseMap
Examples
plate.cpp.

Definition at line 120 of file plate.cpp.

◆ source

auto source
Initial value:
= [](const double x, const double y, const double) {
return cos(2 * x * M_PI) * sin(2 * y * M_PI);
}
Examples
plate.cpp.

Definition at line 89 of file plate.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

dimension of space

Examples
plate.cpp.

Definition at line 32 of file plate.cpp.

◆ t

constexpr double t = 1
constexpr

◆ t_kd

constexpr auto t_kd = FTensor::Kronecker_Delta_symmetric<int>()
constexpr
Examples
plate.cpp.

Definition at line 71 of file plate.cpp.