v0.14.0
Classes | Macros | Typedefs | Functions | Variables
thermo_elastic.cpp File Reference
#include <MoFEM.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 OpTemperatureBC = BoundaryNaturalBC::OpFlux< NaturalTemperatureMeshsets, 3, 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
 
double default_coeff_expansion = 1
 
double default_heat_conductivity
 
double default_heat_capacity = 1
 
int order = 2
 
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 29 of file thermo_elastic.cpp.

◆ BoundaryEle

Definition at line 24 of file thermo_elastic.cpp.

◆ BoundaryEleOp

Definition at line 25 of file thermo_elastic.cpp.

◆ BoundaryNaturalBC

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

[Body and heat source]

[Natural boundary conditions]

Definition at line 107 of file thermo_elastic.cpp.

◆ DomainEle

Definition at line 21 of file thermo_elastic.cpp.

◆ DomainEleOp

Definition at line 22 of file thermo_elastic.cpp.

◆ DomainNaturalBCLhs

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

Definition at line 102 of file thermo_elastic.cpp.

◆ DomainNaturalBCRhs

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

[Thermal problem]

[Body and heat source]

Definition at line 96 of file thermo_elastic.cpp.

◆ EntData

Examples
thermo_elastic.cpp.

Definition at line 20 of file thermo_elastic.cpp.

◆ OpBaseDivFlux

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

Examples
thermo_elastic.cpp.

Definition at line 90 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 84 of file thermo_elastic.cpp.

◆ OpBodyForce

Definition at line 98 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 63 of file thermo_elastic.cpp.

◆ OpEssentialFluxLhs

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

Definition at line 119 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 116 of file thermo_elastic.cpp.

◆ OpForce

Definition at line 108 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
thermo_elastic.cpp.

Definition at line 69 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
thermo_elastic.cpp.

Definition at line 47 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 55 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 76 of file thermo_elastic.cpp.

◆ OpHeatSource

Definition at line 100 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 38 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 34 of file thermo_elastic.cpp.

◆ OpSetTemperatureLhs

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

Definition at line 142 of file thermo_elastic.cpp.

◆ OpSetTemperatureRhs

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

Definition at line 140 of file thermo_elastic.cpp.

◆ OpTemperatureBC

Definition at line 110 of file thermo_elastic.cpp.

◆ PostProcEle

Definition at line 26 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 1100 of file thermo_elastic.cpp.

1100  {
1101 
1102  // Initialisation of MoFEM/PETSc and MOAB data structures
1103  const char param_file[] = "param_file.petsc";
1104  MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1105 
1106  // Add logging channel for example
1107  auto core_log = logging::core::get();
1108  core_log->add_sink(
1109  LogManager::createSink(LogManager::getStrmWorld(), "ThermoElastic"));
1110  LogManager::setLog("ThermoElastic");
1111  MOFEM_LOG_TAG("ThermoElastic", "ThermoElastic");
1112 
1113  core_log->add_sink(
1114  LogManager::createSink(LogManager::getStrmSync(), "ThermoElasticSync"));
1115  LogManager::setLog("ThermoElasticSync");
1116  MOFEM_LOG_TAG("ThermoElasticSync", "ThermoElasticSync");
1117 
1118  try {
1119 
1120  //! [Register MoFEM discrete manager in PETSc]
1121  DMType dm_name = "DMMOFEM";
1122  CHKERR DMRegister_MoFEM(dm_name);
1123  //! [Register MoFEM discrete manager in PETSc
1124 
1125  //! [Create MoAB]
1126  moab::Core mb_instance; ///< mesh database
1127  moab::Interface &moab = mb_instance; ///< mesh database interface
1128  //! [Create MoAB]
1129 
1130  //! [Create MoFEM]
1131  MoFEM::Core core(moab); ///< finite element database
1132  MoFEM::Interface &m_field = core; ///< finite element database interface
1133  //! [Create MoFEM]
1134 
1135  //! [Load mesh]
1136  Simple *simple = m_field.getInterface<Simple>();
1137  CHKERR simple->getOptions();
1138  CHKERR simple->loadFile();
1139  //! [Load mesh]
1140 
1141  //! [ThermoElasticProblem]
1142  ThermoElasticProblem ex(m_field);
1143  CHKERR ex.runProblem();
1144  //! [ThermoElasticProblem]
1145  }
1146  CATCH_ERRORS;
1147 
1149 }

Variable Documentation

◆ default_coeff_expansion

double default_coeff_expansion = 1
Examples
thermo_elastic.cpp.

Definition at line 127 of file thermo_elastic.cpp.

◆ default_heat_capacity

double default_heat_capacity = 1
Examples
thermo_elastic.cpp.

Definition at line 131 of file thermo_elastic.cpp.

◆ default_heat_conductivity

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

Definition at line 128 of file thermo_elastic.cpp.

◆ default_poisson_ratio

double default_poisson_ratio = 0.25
Examples
thermo_elastic.cpp.

Definition at line 123 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 122 of file thermo_elastic.cpp.

◆ help

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

[Solve]

Examples
thermo_elastic.cpp.

Definition at line 1098 of file thermo_elastic.cpp.

◆ init_temp

double init_temp = 0.0

◆ order

int order = 2
Examples
thermo_elastic.cpp.

Definition at line 134 of file thermo_elastic.cpp.

◆ ref_temp

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

Definition at line 124 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 144 of file thermo_elastic.cpp.

◆ SPACE_DIM

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

Definition at line 17 of file thermo_elastic.cpp.

MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce 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:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
ThermoElasticProblem
Definition: thermo_elastic.cpp:153
MoFEM::get_temp_meshset_ptr
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
Definition: Templates.hpp:1857
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:47
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:372
MoFEM::Core
CoreTmp< 0 > Core
Definition: Core.hpp:1094
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:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
help
static char help[]
[Solve]
Definition: thermo_elastic.cpp:1098