v0.14.0
Classes | Macros | Typedefs | Functions | Variables
thermo_elastic.cpp File Reference
#include <MoFEM.hpp>
#include <ThermalConvection.hpp>
#include <ThermalRadiation.hpp>
#include <ThermoElasticOps.hpp>

Go to the source code of this file.

Classes

struct  ThermoElasticProblem
 
struct  ThermoElasticProblem::BlockedParameters
 

Macros

#define EXECUTABLE_DIMENSION   3
 

Typedefs

using EntData = EntitiesFieldData::EntData
 
using DomainEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::DomainEle
 
using DomainEleOp = DomainEle::UserDataOperator
 
using BoundaryEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::BoundaryEle
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using PostProcEle = PostProcBrokenMeshInMoab< DomainEle >
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase
 
using OpKCauchy = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradSymTensorGrad< 1, SPACE_DIM, SPACE_DIM, 0 >
 [Linear elastic problem] More...
 
using OpInternalForceCauchy = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesSymTensor< 1, SPACE_DIM, SPACE_DIM >
 
using OpHdivHdiv = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 3, SPACE_DIM >
 [Linear elastic problem] More...
 
using OpHdivT = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< SPACE_DIM >
 Integrate Lhs div of base of flux time base of temperature (FLUX x T) and transpose of it, i.e. (T x FLAX) More...
 
using OpCapacity = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 >
 Integrate Lhs base of temperature times (heat capacity) times base of temperature (T x T) More...
 
using OpHdivFlux = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesVector< 3, SPACE_DIM, 1 >
 Integrating Rhs flux base (1/k) flux (FLUX) More...
 
using OpHDivTemp = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 1, SPACE_DIM >
 Integrate Rhs div flux base times temperature (T) More...
 
using OpBaseDotT = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 >
 Integrate Rhs base of temperature time heat capacity times heat rate (T) More...
 
using OpBaseDivFlux = OpBaseDotT
 Integrate Rhs base of temperature times divergence of flux (T) More...
 
using DomainNaturalBCRhs = NaturalBC< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >
 [Thermal problem] More...
 
using OpBodyForce = DomainNaturalBCRhs::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, SPACE_DIM >
 
using OpHeatSource = DomainNaturalBCRhs::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, 1 >
 
using DomainNaturalBCLhs = NaturalBC< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >
 
using BoundaryNaturalBC = NaturalBC< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >
 [Body and heat source] More...
 
using OpForce = BoundaryNaturalBC::OpFlux< NaturalForceMeshsets, 1, SPACE_DIM >
 
using OpEssentialFluxRhs = EssentialBC< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpEssentialRhs< HeatFluxCubitBcData, 3, SPACE_DIM >
 [Natural boundary conditions] More...
 
using OpEssentialFluxLhs = EssentialBC< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpEssentialLhs< HeatFluxCubitBcData, 3, SPACE_DIM >
 
using OpSetTemperatureRhs = DomainNaturalBCRhs::OpFlux< SetTargetTemperature, 1, 1 >
 
using OpSetTemperatureLhs = DomainNaturalBCLhs::OpFlux< SetTargetTemperature, 1, 1 >
 

Functions

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

Variables

constexpr int SPACE_DIM
 
double default_young_modulus = 1
 [Essential boundary conditions (Least square approach)] More...
 
double default_poisson_ratio = 0.25
 
double ref_temp = 0.0
 
double init_temp = 0.0
 
PetscBool is_plane_strain = PETSC_FALSE
 
double default_coeff_expansion = 1
 
double default_heat_conductivity
 
double default_heat_capacity = 1
 
int order_temp = 2
 
int order_flux = 3
 
int order_disp = 3
 
int atom_test = 0
 
int save_every = 1
 
auto save_range
 
static char help [] = "...\n\n"
 [Solve] More...
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3
Examples
thermo_elastic.cpp.

Definition at line 10 of file thermo_elastic.cpp.

Typedef Documentation

◆ AssemblyDomainEleOp

Definition at line 31 of file thermo_elastic.cpp.

◆ BoundaryEle

Definition at line 26 of file thermo_elastic.cpp.

◆ BoundaryEleOp

Definition at line 27 of file thermo_elastic.cpp.

◆ BoundaryNaturalBC

using BoundaryNaturalBC = NaturalBC<BoundaryEleOp>::Assembly<PETSC>::LinearForm<GAUSS>

[Body and heat source]

[Natural boundary conditions]

Definition at line 109 of file thermo_elastic.cpp.

◆ DomainEle

Definition at line 23 of file thermo_elastic.cpp.

◆ DomainEleOp

Definition at line 24 of file thermo_elastic.cpp.

◆ DomainNaturalBCLhs

using DomainNaturalBCLhs = NaturalBC<DomainEleOp>::Assembly<PETSC>::BiLinearForm<GAUSS>

Definition at line 104 of file thermo_elastic.cpp.

◆ DomainNaturalBCRhs

using DomainNaturalBCRhs = NaturalBC<DomainEleOp>::Assembly<PETSC>::LinearForm<GAUSS>

[Thermal problem]

[Body and heat source]

Definition at line 98 of file thermo_elastic.cpp.

◆ EntData

Examples
thermo_elastic.cpp.

Definition at line 22 of file thermo_elastic.cpp.

◆ OpBaseDivFlux

Integrate Rhs base of temperature times divergence of flux (T)

Examples
thermo_elastic.cpp.

Definition at line 92 of file thermo_elastic.cpp.

◆ OpBaseDotT

using OpBaseDotT = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpBaseTimesScalar<1>

Integrate Rhs base of temperature time heat capacity times heat rate (T)

Examples
thermo_elastic.cpp.

Definition at line 86 of file thermo_elastic.cpp.

◆ OpBodyForce

Definition at line 100 of file thermo_elastic.cpp.

◆ OpCapacity

using OpCapacity = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpMass<1, 1>

Integrate Lhs base of temperature times (heat capacity) times base of temperature (T x T)

Examples
thermo_elastic.cpp.

Definition at line 65 of file thermo_elastic.cpp.

◆ OpEssentialFluxLhs

using OpEssentialFluxLhs = EssentialBC<BoundaryEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpEssentialLhs<HeatFluxCubitBcData, 3, SPACE_DIM>

Definition at line 120 of file thermo_elastic.cpp.

◆ OpEssentialFluxRhs

using OpEssentialFluxRhs = EssentialBC<BoundaryEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpEssentialRhs<HeatFluxCubitBcData, 3, SPACE_DIM>

[Natural boundary conditions]

[Essential boundary conditions (Least square approach)]

Definition at line 117 of file thermo_elastic.cpp.

◆ OpForce

Definition at line 110 of file thermo_elastic.cpp.

◆ OpHdivFlux

using OpHdivFlux = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpBaseTimesVector<3, SPACE_DIM, 1>

Integrating Rhs flux base (1/k) flux (FLUX)

Examples
test_broken_space.cpp, and thermo_elastic.cpp.

Definition at line 71 of file thermo_elastic.cpp.

◆ OpHdivHdiv

using OpHdivHdiv = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpMass<3, SPACE_DIM>

[Linear elastic problem]

[Thermal problem]

Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)

Examples
test_broken_space.cpp, and thermo_elastic.cpp.

Definition at line 49 of file thermo_elastic.cpp.

◆ OpHdivT

using OpHdivT = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpMixDivTimesScalar<SPACE_DIM>

Integrate Lhs div of base of flux time base of temperature (FLUX x T) and transpose of it, i.e. (T x FLAX)

Examples
thermo_elastic.cpp.

Definition at line 57 of file thermo_elastic.cpp.

◆ OpHDivTemp

using OpHDivTemp = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpMixDivTimesU<3, 1, SPACE_DIM>

Integrate Rhs div flux base times temperature (T)

Examples
thermo_elastic.cpp.

Definition at line 78 of file thermo_elastic.cpp.

◆ OpHeatSource

Definition at line 102 of file thermo_elastic.cpp.

◆ OpInternalForceCauchy

using OpInternalForceCauchy = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm< GAUSS>::OpGradTimesSymTensor<1, SPACE_DIM, SPACE_DIM>
Examples
PlasticOps.hpp, and thermo_elastic.cpp.

Definition at line 40 of file thermo_elastic.cpp.

◆ OpKCauchy

using OpKCauchy = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm< GAUSS>::OpGradSymTensorGrad<1, SPACE_DIM, SPACE_DIM, 0>

[Linear elastic problem]

Examples
PlasticOps.hpp, and thermo_elastic.cpp.

Definition at line 36 of file thermo_elastic.cpp.

◆ OpSetTemperatureLhs

using OpSetTemperatureLhs = DomainNaturalBCLhs::OpFlux<SetTargetTemperature, 1, 1>

Definition at line 151 of file thermo_elastic.cpp.

◆ OpSetTemperatureRhs

using OpSetTemperatureRhs = DomainNaturalBCRhs::OpFlux<SetTargetTemperature, 1, 1>

Definition at line 149 of file thermo_elastic.cpp.

◆ PostProcEle

Definition at line 28 of file thermo_elastic.cpp.

Function Documentation

◆ main()

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

[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 interface

[Create MoFEM]

[Load mesh]

[Load mesh]

[ThermoElasticProblem]

[ThermoElasticProblem]

Examples
thermo_elastic.cpp.

Definition at line 1478 of file thermo_elastic.cpp.

1478  {
1479 
1480  // Initialisation of MoFEM/PETSc and MOAB data structures
1481  const char param_file[] = "param_file.petsc";
1482  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1483 
1484  // Add logging channel for example
1485  auto core_log = logging::core::get();
1486  core_log->add_sink(
1487  LogManager::createSink(LogManager::getStrmWorld(), "ThermoElastic"));
1488  LogManager::setLog("ThermoElastic");
1489  MOFEM_LOG_TAG("ThermoElastic", "ThermoElastic");
1490 
1491  core_log->add_sink(
1492  LogManager::createSink(LogManager::getStrmSync(), "ThermoElasticSync"));
1493  LogManager::setLog("ThermoElasticSync");
1494  MOFEM_LOG_TAG("ThermoElasticSync", "ThermoElasticSync");
1495 
1496  try {
1497 
1498  //! [Register MoFEM discrete manager in PETSc]
1499  DMType dm_name = "DMMOFEM";
1500  CHKERR DMRegister_MoFEM(dm_name);
1501  //! [Register MoFEM discrete manager in PETSc
1502 
1503  //! [Create MoAB]
1504  moab::Core mb_instance; ///< mesh database
1505  moab::Interface &moab = mb_instance; ///< mesh database interface
1506  //! [Create MoAB]
1507 
1508  //! [Create MoFEM]
1509  MoFEM::Core core(moab); ///< finite element database
1510  MoFEM::Interface &m_field = core; ///< finite element database interface
1511  //! [Create MoFEM]
1512 
1513  //! [Load mesh]
1514  Simple *simple = m_field.getInterface<Simple>();
1515  CHKERR simple->getOptions();
1516  CHKERR simple->loadFile();
1517  //! [Load mesh]
1518 
1519  //! [ThermoElasticProblem]
1520  ThermoElasticProblem ex(m_field);
1521  CHKERR ex.runProblem();
1522  //! [ThermoElasticProblem]
1523  }
1524  CATCH_ERRORS;
1525 
1527 }

Variable Documentation

◆ atom_test

int atom_test = 0
Examples
thermo_elastic.cpp.

Definition at line 141 of file thermo_elastic.cpp.

◆ default_coeff_expansion

double default_coeff_expansion = 1
Examples
thermo_elastic.cpp.

Definition at line 130 of file thermo_elastic.cpp.

◆ default_heat_capacity

double default_heat_capacity = 1
Examples
thermo_elastic.cpp.

Definition at line 134 of file thermo_elastic.cpp.

◆ default_heat_conductivity

double default_heat_conductivity
Initial value:
=
1
Examples
thermo_elastic.cpp.

Definition at line 131 of file thermo_elastic.cpp.

◆ default_poisson_ratio

double default_poisson_ratio = 0.25
Examples
thermo_elastic.cpp.

Definition at line 124 of file thermo_elastic.cpp.

◆ default_young_modulus

double default_young_modulus = 1

[Essential boundary conditions (Least square approach)]

Examples
thermo_elastic.cpp.

Definition at line 123 of file thermo_elastic.cpp.

◆ help

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

[Solve]

Examples
thermo_elastic.cpp.

Definition at line 1476 of file thermo_elastic.cpp.

◆ init_temp

double init_temp = 0.0

◆ is_plane_strain

PetscBool is_plane_strain = PETSC_FALSE
Examples
thermo_elastic.cpp.

Definition at line 128 of file thermo_elastic.cpp.

◆ order_disp

int order_disp = 3
Examples
thermo_elastic.cpp.

Definition at line 139 of file thermo_elastic.cpp.

◆ order_flux

int order_flux = 3
Examples
thermo_elastic.cpp.

Definition at line 138 of file thermo_elastic.cpp.

◆ order_temp

int order_temp = 2
Examples
thermo_elastic.cpp.

Definition at line 137 of file thermo_elastic.cpp.

◆ ref_temp

double ref_temp = 0.0
Examples
thermo_elastic.cpp, and ThermoElasticOps.hpp.

Definition at line 125 of file thermo_elastic.cpp.

◆ save_every

int save_every = 1
Examples
thermo_elastic.cpp.

Definition at line 143 of file thermo_elastic.cpp.

◆ save_range

auto save_range
Initial value:
= [](moab::Interface &moab, const std::string name,
const Range r) {
auto out_meshset = get_temp_meshset_ptr(moab);
CHKERR moab.add_entities(*out_meshset, r);
CHKERR moab.write_file(name.c_str(), "VTK", "", out_meshset->get_ptr(), 1);
}
Examples
level_set.cpp, and thermo_elastic.cpp.

Definition at line 153 of file thermo_elastic.cpp.

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
Examples
thermo_elastic.cpp.

Definition at line 19 of file thermo_elastic.cpp.

MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
MoFEM::CoreTmp< 0 >::Finalize
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition: Core.cpp:112
MoFEM::Simple
Simple interface for fast problem set-up.
Definition: Simple.hpp:27
sdf.r
int r
Definition: sdf.py:8
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
ThermoElasticProblem
Definition: thermo_elastic.cpp:162
MoFEM::get_temp_meshset_ptr
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
Definition: Templates.hpp:1886
simple
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition: acoustic.cpp:69
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
Range
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
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1148
EXECUTABLE_DIMENSION
#define EXECUTABLE_DIMENSION
Definition: thermo_elastic.cpp:10
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
help
static char help[]
[Solve]
Definition: thermo_elastic.cpp:1476