v0.16.3
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Functions | Variables
thermo_elastic.cpp File Reference
#include <MoFEM.hpp>
#include <MatrixFunction.hpp>
#include <ThermalConvection.hpp>
#include <ThermalRadiation.hpp>
#include <HenckyOps.hpp>
#include <FiniteThermalOps.hpp>
#include <ThermalOps.hpp>
#include <ThermoElasticOps.hpp>

Go to the source code of this file.

Classes

struct  ThermoElasticProblem
 
struct  ThermoElasticProblem::BlockedThermalParameters
 
struct  ThermoElasticProblem::BlockedThermoElasticParameters
 

Macros

#define EXECUTABLE_DIMENSION   3
 
#define FINITE_DEFORMATION_FLAG   true
 

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 SkinPostProcEle = PostProcBrokenMeshInMoab< BoundaryEle >
 
using SideEle = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle
 
using AssemblyDomainEleOp = FormsIntegrators< DomainEleOp >::Assembly< PETSC >::OpBase
 
using DomainNaturalBCRhs = NaturalBC< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >
 [Thermal problem]
 
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]
 
using OpForce = BoundaryNaturalBC::OpFlux< NaturalForceMeshsets, 1, 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
 
constexpr bool IS_LARGE_STRAINS
 
constexpr AssemblyType AT = AssemblyType::PETSC
 
constexpr IntegrationType IT
 
double default_young_modulus = 1
 [Natural boundary conditions]
 
double default_poisson_ratio = 0.25
 
double default_ref_temp = 0.0
 
double default_init_temp = 0.0
 
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
 
PetscBool do_output_domain
 
PetscBool do_output_skin
 
auto save_range
 
static char help [] = "...\n\n"
 [Solve]
 

Macro Definition Documentation

◆ EXECUTABLE_DIMENSION

#define EXECUTABLE_DIMENSION   3

Definition at line 10 of file thermo_elastic.cpp.

◆ FINITE_DEFORMATION_FLAG

#define FINITE_DEFORMATION_FLAG   true

Definition at line 14 of file thermo_elastic.cpp.

Typedef Documentation

◆ AssemblyDomainEleOp

Definition at line 41 of file thermo_elastic.cpp.

◆ BoundaryEle

Definition at line 34 of file thermo_elastic.cpp.

◆ BoundaryEleOp

Definition at line 36 of file thermo_elastic.cpp.

◆ BoundaryNaturalBC

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

[Body and heat source]

[Natural boundary conditions]

Definition at line 74 of file thermo_elastic.cpp.

◆ DomainEle

Definition at line 32 of file thermo_elastic.cpp.

◆ DomainEleOp

Definition at line 33 of file thermo_elastic.cpp.

◆ DomainNaturalBCLhs

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

Definition at line 69 of file thermo_elastic.cpp.

◆ DomainNaturalBCRhs

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

[Thermal problem]

[Body and heat source]

Definition at line 63 of file thermo_elastic.cpp.

◆ EntData

Definition at line 31 of file thermo_elastic.cpp.

◆ OpBodyForce

◆ OpForce

Definition at line 76 of file thermo_elastic.cpp.

◆ OpHeatSource

Definition at line 67 of file thermo_elastic.cpp.

◆ OpSetTemperatureLhs

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

Definition at line 108 of file thermo_elastic.cpp.

◆ OpSetTemperatureRhs

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

Definition at line 106 of file thermo_elastic.cpp.

◆ PostProcEle

Definition at line 37 of file thermo_elastic.cpp.

◆ SideEle

Definition at line 39 of file thermo_elastic.cpp.

◆ SkinPostProcEle

Definition at line 38 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]

Definition at line 1790 of file thermo_elastic.cpp.

1790 {
1791
1792 // Initialisation of MoFEM/PETSc and MOAB data structures
1793 const char param_file[] = "param_file.petsc";
1794 MoFEM::Core::Initialize(&argc, &argv, param_file, help);
1795
1796 // Add logging channel for example
1797 auto core_log = logging::core::get();
1798 core_log->add_sink(
1800 LogManager::setLog("ThermoElastic");
1801 MOFEM_LOG_TAG("ThermoElastic", "ThermoElastic");
1802
1803 core_log->add_sink(
1804 LogManager::createSink(LogManager::getStrmSync(), "ThermoElasticSync"));
1805 LogManager::setLog("ThermoElasticSync");
1806 MOFEM_LOG_TAG("ThermoElasticSync", "ThermoElasticSync");
1807
1808 try {
1809
1810 //! [Register MoFEM discrete manager in PETSc]
1811 DMType dm_name = "DMMOFEM";
1812 CHKERR DMRegister_MoFEM(dm_name);
1813 //! [Register MoFEM discrete manager in PETSc
1814
1815 //! [Create MoAB]
1816 moab::Core mb_instance; ///< mesh database
1817 moab::Interface &moab = mb_instance; ///< mesh database interface
1818 //! [Create MoAB]
1819
1820 //! [Create MoFEM]
1821 MoFEM::Core core(moab); ///< finite element database
1822 MoFEM::Interface &m_field = core; ///< finite element database interface
1823 //! [Create MoFEM]
1824
1825 //! [Load mesh]
1826 Simple *simple = m_field.getInterface<Simple>();
1829 {"target_temperature", "heat_transfer_coefficient",
1830 "stefan_boltzmann_constant", "emissivity", "ambient_temperature"});
1831 CHKERR simple->loadFile();
1832 CHKERR m_field.getInterface<MeshsetsManager>()->setMeshsetFromFile();
1833
1834 //! [Load mesh]
1835
1836 //! [ThermoElasticProblem]
1837 ThermoElasticProblem ex(m_field);
1838 CHKERR ex.runProblem();
1839 //! [ThermoElasticProblem]
1840 }
1842
1844}
void simple(double P1[], double P2[], double P3[], double c[], const int N)
Definition acoustic.cpp:69
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
Definition DMMoFEM.cpp:43
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Core (interface) class.
Definition Core.hpp:83
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
Definition Core.cpp:68
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Definition Core.cpp:123
Deprecated interface functions.
static MoFEMErrorCode addCanonicalAttributeNames(const std::vector< std::string > &names)
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Interface for managing meshsets containing materials and boundary conditions.
Simple interface for fast problem set-up.
Definition Simple.hpp:27
MoFEMErrorCode getOptions()
get options
Definition Simple.cpp:180
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
static char help[]
[Solve]

Variable Documentation

◆ AT

constexpr AssemblyType AT = AssemblyType::PETSC
constexpr

Definition at line 44 of file thermo_elastic.cpp.

◆ atom_test

int atom_test = 0

Definition at line 96 of file thermo_elastic.cpp.

◆ default_coeff_expansion

double default_coeff_expansion = 1

Definition at line 85 of file thermo_elastic.cpp.

◆ default_heat_capacity

double default_heat_capacity = 1

Definition at line 89 of file thermo_elastic.cpp.

◆ default_heat_conductivity

double default_heat_conductivity
Initial value:
=
1

Definition at line 86 of file thermo_elastic.cpp.

◆ default_init_temp

double default_init_temp = 0.0

Definition at line 83 of file thermo_elastic.cpp.

◆ default_poisson_ratio

double default_poisson_ratio = 0.25

◆ default_ref_temp

double default_ref_temp = 0.0

Definition at line 82 of file thermo_elastic.cpp.

◆ default_young_modulus

double default_young_modulus = 1

[Natural boundary conditions]

[Default input parameters]

Examples
mofem/tutorials/adv-5_poroelasticity/seepage.cpp.

Definition at line 80 of file thermo_elastic.cpp.

◆ do_output_domain

PetscBool do_output_domain

Definition at line 99 of file thermo_elastic.cpp.

◆ do_output_skin

PetscBool do_output_skin

Definition at line 100 of file thermo_elastic.cpp.

◆ help

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

[Solve]

Definition at line 1788 of file thermo_elastic.cpp.

◆ IS_LARGE_STRAINS

constexpr bool IS_LARGE_STRAINS
constexpr
Initial value:
=
true

Definition at line 28 of file thermo_elastic.cpp.

◆ IT

constexpr IntegrationType IT
constexpr
Initial value:
=
IntegrationType::GAUSS

Definition at line 45 of file thermo_elastic.cpp.

◆ order_disp

int order_disp = 3

Definition at line 94 of file thermo_elastic.cpp.

◆ order_flux

int order_flux = 3

Definition at line 93 of file thermo_elastic.cpp.

◆ order_temp

int order_temp = 2

Definition at line 92 of file thermo_elastic.cpp.

◆ save_every

int save_every = 1

◆ save_range

MoFEMErrorCode 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);
}
std::string name
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
Examples
mofem/tutorials/adv-3_level_set/level_set.cpp, mofem/tutorials/adv-5_poroelasticity/seepage.cpp, mofem/tutorials/adv-6_dg_projection/between_meshes_dg_projection.cpp, mofem/tutorials/vec-5_free_surface/free_surface.cpp, and mofem/tutorials/vec-7_shape_optimisation/adjoint.cpp.

Definition at line 111 of file thermo_elastic.cpp.

112 {
114 auto out_meshset = get_temp_meshset_ptr(moab);
115 CHKERR moab.add_entities(*out_meshset, r);
116 CHKERR moab.write_file(name.c_str(), "VTK", "", out_meshset->get_ptr(), 1);
118};

◆ SPACE_DIM

constexpr int SPACE_DIM
constexpr
Initial value:
=
3

Definition at line 25 of file thermo_elastic.cpp.