v0.14.0
Classes | Typedefs | Enumerations | Functions | Variables
plate.cpp File Reference
#include <MoFEM.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 = PostProcBrokenMeshInMoab< DomainEle >
 
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 31 of file plate.cpp.

◆ BoundaryEleOp

Definition at line 32 of file plate.cpp.

◆ DomainEle

Definition at line 29 of file plate.cpp.

◆ DomainEleOp

Finire element operator type.

Definition at line 30 of file plate.cpp.

◆ EntData

Data on entities.

Examples
plate.cpp.

Definition at line 41 of file plate.cpp.

◆ FaceSideEle

Definition at line 36 of file plate.cpp.

◆ FaceSideOp

Definition at line 37 of file plate.cpp.

◆ OpDomainGradGrad

Definition at line 44 of file plate.cpp.

◆ OpDomainPlateLoad

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

Definition at line 50 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 48 of file plate.cpp.

◆ PostProcEle

Definition at line 34 of file plate.cpp.

Enumeration Type Documentation

◆ ElementSide

Enumerator
LEFT_SIDE 
RIGHT_SIDE 

Definition at line 92 of file plate.cpp.

92 { LEFT_SIDE = 0, RIGHT_SIDE };

Function Documentation

◆ get_diff2_ntensor() [1/2]

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

Definition at line 489 of file plate.cpp.

489  {
490  double *ptr = &*base_mat.data().begin();
492 };

◆ get_diff2_ntensor() [2/2]

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

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)
inline
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 };

◆ get_diff_ntensor() [2/2]

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

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)
inline
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 
)
inline

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]

[Register MoFEM discrete manager in PETSc]

[Register MoFEM discrete manager in PETSc

[Create MoAB]

< mesh database

< mesh database interface

[Create MoAB]

[Create MoFEM]

< finite element database

< finite element database insterface

[Create MoFEM]

[Plate]

[Plate]

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";
394  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
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  }
424  CATCH_ERRORS;
425 
427 }

Variable Documentation

◆ areaMap

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

Definition at line 101 of file plate.cpp.

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr

dimension of base

Examples
plate.cpp.

Definition at line 16 of file plate.cpp.

◆ diff2BaseSideMap

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

Definition at line 100 of file plate.cpp.

◆ diffBaseSideMap

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

Definition at line 98 of file plate.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr

dimension of approx. field

Examples
plate.cpp.

Definition at line 18 of file plate.cpp.

◆ help

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

Definition at line 13 of file plate.cpp.

◆ i

Examples
plate.cpp.

Definition at line 60 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 96 of file plate.cpp.

◆ j

Examples
plate.cpp.

Definition at line 61 of file plate.cpp.

◆ k

Examples
plate.cpp.

Definition at line 62 of file plate.cpp.

◆ l

Examples
plate.cpp.

Definition at line 63 of file plate.cpp.

◆ lambda

constexpr double lambda = 1
constexpr
Examples
plate.cpp.

Definition at line 56 of file plate.cpp.

◆ mu

constexpr double mu = 1
constexpr

lame parameter

Examples
plate.cpp.

Definition at line 57 of file plate.cpp.

◆ nitsche

double nitsche = 1
static
Examples
plate.cpp.

Definition at line 68 of file plate.cpp.

◆ order

int order = 4
static
Examples
plate.cpp.

Definition at line 69 of file plate.cpp.

◆ penalty

double penalty = 1e6
static

Definition at line 65 of file plate.cpp.

◆ phi

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

Definition at line 66 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;
}

get fourth-order constitutive tensor

Examples
plate.cpp.

Definition at line 79 of file plate.cpp.

◆ senseMap

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

Definition at line 102 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 71 of file plate.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

dimension of space

Examples
plate.cpp.

Definition at line 17 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 53 of file plate.cpp.

t_kd
constexpr auto t_kd
Definition: plate.cpp:53
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
k
FTensor::Index< 'k', SPACE_DIM > k
Definition: plate.cpp:62
SPACE_DIM
constexpr int SPACE_DIM
dimension of space
Definition: plate.cpp:17
Plate
Definition: plate.cpp:140
l
FTensor::Index< 'l', SPACE_DIM > l
Definition: plate.cpp:63
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
RIGHT_SIDE
@ RIGHT_SIDE
Definition: plate.cpp:92
lambda
constexpr double lambda
Definition: plate.cpp:56
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
a
constexpr double a
Definition: approx_sphere.cpp:30
double
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: plate.cpp:60
MoFEM::DMRegister_MoFEM
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMoFEM.cpp:43
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
t
constexpr double t
plate stiffness
Definition: plate.cpp:58
help
static char help[]
Definition: plate.cpp:13
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
CATCH_ERRORS
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:385
FTensor::Tensor0
Definition: Tensor0.hpp:16
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
LEFT_SIDE
@ LEFT_SIDE
Definition: plate.cpp:92
j
FTensor::Index< 'j', SPACE_DIM > j
Definition: plate.cpp:61
MoFEM::getFTensor2SymmetricLowerFromPtr< 2 >
FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 4 >, 2 > getFTensor2SymmetricLowerFromPtr< 2 >(double *ptr)
Definition: Templates.hpp:1106
mu
constexpr double mu
lame parameter
Definition: plate.cpp:57