v0.15.0
Loading...
Searching...
No Matches
ThermalOps.hpp
Go to the documentation of this file.
1/**
2 * @file ThermalOps.hpp
3 * @author Ross Williams (ross.williams@glasgow.ac.uk)
4 * @brief Thermal operators agnostic to small/large deformations
5 * @version 0.14.0
6 * @date 2025-03-31
7 */
8
9#ifndef __THERMAL_OPS_HPP__
10#define __THERMAL_OPS_HPP__
11
12namespace ThermalOps {
13
14// Templated on IS_LARGE_STRAINS to allow different implementations with
15// different numbers of arguments at compile time
16/**
17 * @brief Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)
18 *
19 */
20template <int SPACE_DIM, bool IS_LARGE_STRAINS> struct OpHdivHdivImpl;
21
22template <int SPACE_DIM>
24 : public FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm<
25 GAUSS>::OpMass<3, SPACE_DIM> {
26 OpHdivHdivImpl(const std::string row_field_name,
27 const std::string col_field_name,
28 ScalarFun resistance_function,
29 boost::shared_ptr<MatrixDouble> mat_Grad_Ptr,
30 boost::shared_ptr<Range> ents_ptr = nullptr)
31 : FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm<
32 GAUSS>::OpMass<3, SPACE_DIM>(row_field_name, col_field_name,
33 resistance_function, ents_ptr) {}
34};
35
36template <int SPACE_DIM>
38 : public OpCalculateQdotQLhs_dQ<SPACE_DIM, GAUSS, AssemblyDomainEleOp> {
39 OpHdivHdivImpl(const std::string row_field_name,
40 const std::string col_field_name,
41 ScalarFun resistance_function,
42 boost::shared_ptr<MatrixDouble> mat_Grad_Ptr,
43 boost::shared_ptr<Range> ents_ptr = nullptr)
45 row_field_name, col_field_name, resistance_function, mat_Grad_Ptr,
46 ents_ptr) {}
47};
48
49// Add alias to allow same implementation for small and large strains
51
52/**
53 * @brief Integrate Lhs div of base of flux times base of temperature (FLUX x
54 * T) and transpose of it, i.e. (T x FLUX)
55 *
56 */
57using OpHdivT = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm<
58 GAUSS>::OpMixDivTimesScalar<SPACE_DIM>;
59
60// Templated on IS_LARGE_STRAINS to allow different implementations with
61// different numbers of arguments at compile time. An empty operator is called
62// for IS_LARGE_STRAINS = false
63/**
64 * @brief Integrate Lhs of flux term coupled to displacement field
65 *
66 */
67using OpHdivU = OpCalculateQdotQLhs_dU<SPACE_DIM, GAUSS, AssemblyDomainEleOp,
69
70/**
71 * @brief Integrate Lhs base of temperature times (heat capacity) times base of
72 * temperature (T x T)
73 *
74 */
75using OpCapacity = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::BiLinearForm<
76 GAUSS>::OpMass<1, 1>;
77
78// Templated on IS_LARGE_STRAINS to allow different implementations with
79// different numbers of arguments at compile time
80/**
81 * @brief Integrating Rhs flux base (1/k) flux (FLUX)
82 */
83template <int SPACE_DIM, bool IS_LARGE_STRAINS> struct OpHdivFluxImpl;
84
85template <int SPACE_DIM>
87 : public FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm<
88 GAUSS>::OpBaseTimesVector<3, SPACE_DIM, 1> {
89 OpHdivFluxImpl(const std::string field_name,
90 boost::shared_ptr<MatrixDouble> vec,
91 ScalarFun resistance_function,
92 boost::shared_ptr<MatrixDouble> mat_Grad_Ptr,
93 boost::shared_ptr<Range> ents_ptr = nullptr)
94 : FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm<
95 GAUSS>::OpBaseTimesVector<3, SPACE_DIM, 1>(field_name, vec,
96 resistance_function,
97 ents_ptr) {}
98};
99template <int SPACE_DIM>
101 : public OpCalculateQdotQRhs<SPACE_DIM, GAUSS, AssemblyDomainEleOp> {
102 OpHdivFluxImpl(const std::string field_name,
103 boost::shared_ptr<MatrixDouble> vec,
104 ScalarFun resistance_function,
105 boost::shared_ptr<MatrixDouble> mat_Grad_Ptr,
106 boost::shared_ptr<Range> ents_ptr = nullptr)
108 field_name, vec, resistance_function, mat_Grad_Ptr, ents_ptr) {}
109};
110
111// Add alias to allow same implementation for small and large strains
113
114/**
115 * @brief Integrate Rhs div flux base times temperature (T)
116 *
117 */
118using OpHDivTemp = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm<
119 GAUSS>::OpMixDivTimesU<3, 1, SPACE_DIM>;
120
121/**
122 * @brief Integrate Rhs base of temperature time heat capacity times heat rate
123 * (T)
124 *
125 */
126using OpBaseDotT = FormsIntegrators<DomainEleOp>::Assembly<PETSC>::LinearForm<
127 GAUSS>::OpBaseTimesScalar<1>;
128
129/**
130 * @brief Integrate Rhs base of temperature times divergence of flux (T)
131 *
132 */
134
135} // namespace ThermalOps
136
137#endif // __THERMAL_OPS_HPP__
constexpr int SPACE_DIM
OpCalculateQdotQLhs_dU< SPACE_DIM, GAUSS, AssemblyDomainEleOp, IS_LARGE_STRAINS > OpHdivU
Integrate Lhs of flux term coupled to displacement field.
OpBaseDotT OpBaseDivFlux
Integrate Rhs base of temperature times divergence of flux (T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 1, SPACE_DIM > OpHDivTemp
Integrate Rhs div flux base times temperature (T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMixDivTimesScalar< SPACE_DIM > OpHdivT
Integrate Lhs div of base of flux times base of temperature (FLUX x T) and transpose of it,...
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpBaseDotT
Integrate Rhs base of temperature time heat capacity times heat rate (T)
constexpr auto field_name
OpHdivFluxImpl(const std::string field_name, boost::shared_ptr< MatrixDouble > vec, ScalarFun resistance_function, boost::shared_ptr< MatrixDouble > mat_Grad_Ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
OpHdivFluxImpl(const std::string field_name, boost::shared_ptr< MatrixDouble > vec, ScalarFun resistance_function, boost::shared_ptr< MatrixDouble > mat_Grad_Ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
Integrating Rhs flux base (1/k) flux (FLUX)
OpHdivHdivImpl(const std::string row_field_name, const std::string col_field_name, ScalarFun resistance_function, boost::shared_ptr< MatrixDouble > mat_Grad_Ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
OpHdivHdivImpl(const std::string row_field_name, const std::string col_field_name, ScalarFun resistance_function, boost::shared_ptr< MatrixDouble > mat_Grad_Ptr, boost::shared_ptr< Range > ents_ptr=nullptr)
Integrate Lhs base of flux (1/k) base of flux (FLUX x FLUX)
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
constexpr bool IS_LARGE_STRAINS