v0.13.1
Loading...
Searching...
No Matches
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 = 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 , 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 32 of file plate.cpp.

◆ BoundaryEleOp

Definition at line 33 of file plate.cpp.

◆ DomainEle

Definition at line 30 of file plate.cpp.

◆ DomainEleOp

Finire element operator type.

Definition at line 31 of file plate.cpp.

◆ EntData

Data on entities.

Definition at line 42 of file plate.cpp.

◆ FaceSideEle

Definition at line 37 of file plate.cpp.

◆ FaceSideOp

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

◆ PostProcEle

Definition at line 35 of file plate.cpp.

Enumeration Type Documentation

◆ ElementSide

Enumerator
LEFT_SIDE 
RIGHT_SIDE 
LEFT_SIDE 
RIGHT_SIDE 

Definition at line 93 of file plate.cpp.

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

Function Documentation

◆ get_diff2_ntensor() [1/2]

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

Definition at line 490 of file plate.cpp.

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

◆ get_diff2_ntensor() [2/2]

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

Definition at line 496 of file plate.cpp.

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

◆ get_diff_ntensor() [1/2]

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

Definition at line 479 of file plate.cpp.

479 {
480 double *ptr = &*base_mat.data().begin();
481 return getFTensor1FromPtr<2>(ptr);
482};

◆ get_diff_ntensor() [2/2]

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

Definition at line 485 of file plate.cpp.

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

◆ get_ntensor() [1/2]

template<typename T >
auto get_ntensor ( T base_mat)
inline

Definition at line 469 of file plate.cpp.

469 {
471 &*base_mat.data().begin());
472};

◆ get_ntensor() [2/2]

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

Definition at line 474 of file plate.cpp.

474 {
475 double *ptr = &base_mat(gg, bb);
477};

◆ 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]

Definition at line 391 of file plate.cpp.

391 {
392
393 // Initialisation of MoFEM/PETSc and MOAB data structures
394 const char param_file[] = "param_file.petsc";
396
397 // Add logging channel for example
398 auto core_log = logging::core::get();
399 core_log->add_sink(LogManager::createSink(LogManager::getStrmWorld(), "PL"));
400 LogManager::setLog("PL");
401 MOFEM_LOG_TAG("PL", "plate");
402
403 try {
404
405 //! [Register MoFEM discrete manager in PETSc]
406 DMType dm_name = "DMMOFEM";
407 CHKERR DMRegister_MoFEM(dm_name);
408 //! [Register MoFEM discrete manager in PETSc
409
410 //! [Create MoAB]
411 moab::Core mb_instance; ///< mesh database
412 moab::Interface &moab = mb_instance; ///< mesh database interface
413 //! [Create MoAB]
414
415 //! [Create MoFEM]
416 MoFEM::Core core(moab); ///< finite element database
417 MoFEM::Interface &m_field = core; ///< finite element database insterface
418 //! [Create MoFEM]
419
420 //! [Plate]
421 Plate ex(m_field);
422 CHKERR ex.runProblem();
423 //! [Plate]
424 }
426
428}
std::string param_file
#define CATCH_ERRORS
Catch errors.
Definition: definitions.h:372
#define CHKERR
Inline error check.
Definition: definitions.h:535
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition: DMMMoFEM.cpp:47
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:364
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:332
static char help[]
Definition: plate.cpp:13
Core (interface) class.
Definition: Core.hpp:82
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
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
Deprecated interface functions.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:279
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:323
Definition: plate.cpp:141

Variable Documentation

◆ areaMap

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

Definition at line 102 of file plate.cpp.

◆ BASE_DIM

constexpr int BASE_DIM = 1
constexpr

dimension of base

Definition at line 17 of file plate.cpp.

◆ diff2BaseSideMap

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

Definition at line 101 of file plate.cpp.

◆ diffBaseSideMap

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

Definition at line 99 of file plate.cpp.

◆ FIELD_DIM

constexpr int FIELD_DIM = 1
constexpr

dimension of approx. field

Examples
plate.cpp.

Definition at line 19 of file plate.cpp.

◆ help

char help[] = "...\n\n"
static

Definition at line 13 of file plate.cpp.

◆ i

Examples
plate.cpp.

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

◆ j

Examples
plate.cpp.

Definition at line 62 of file plate.cpp.

◆ k

Examples
plate.cpp.

Definition at line 63 of file plate.cpp.

◆ l

Examples
plate.cpp.

Definition at line 64 of file plate.cpp.

◆ lambda

constexpr double lambda = 1
constexpr

Definition at line 57 of file plate.cpp.

◆ mu

constexpr double mu = 1
constexpr

lame parameter

Definition at line 58 of file plate.cpp.

◆ nitsche

double nitsche = 1
static
Examples
plate.cpp.

Definition at line 69 of file plate.cpp.

◆ order

int order = 4
static
Examples
plate.cpp.

Definition at line 70 of file plate.cpp.

◆ penalty

double penalty = 1e6
static
Examples
plate.cpp.

Definition at line 66 of file plate.cpp.

◆ phi

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

Definition at line 67 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
constexpr AssemblyType A
Definition: plastic.cpp:46
constexpr double mu
lame parameter
Definition: plate.cpp:58
FTensor::Index< 'j', SPACE_DIM > j
Definition: plate.cpp:62
FTensor::Index< 'k', SPACE_DIM > k
Definition: plate.cpp:63
constexpr double lambda
Definition: plate.cpp:57
FTensor::Index< 'i', SPACE_DIM > i
Definition: plate.cpp:61
constexpr auto t_kd
Definition: plate.cpp:54
constexpr int SPACE_DIM
dimension of space
Definition: plate.cpp:18
FTensor::Index< 'l', SPACE_DIM > l
Definition: plate.cpp:64
constexpr double t
plate stiffness
Definition: plate.cpp:59

get fourth-order constitutive tensor

Examples
plate.cpp.

Definition at line 80 of file plate.cpp.

◆ senseMap

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

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

◆ SPACE_DIM

constexpr int SPACE_DIM = 2
constexpr

dimension of space

Examples
plate.cpp.

Definition at line 18 of file plate.cpp.

◆ t

constexpr double t = 1
constexpr

◆ t_kd

constexpr auto t_kd = FTensor::Kronecker_Delta_symmetric<int>()
constexpr

Definition at line 54 of file plate.cpp.