v0.14.0
EssentialTemperatureCubitBcData.hpp
Go to the documentation of this file.
1 /**
2  * @file EssentialTemperatureCubitBcData.hpp
3  * @brief Specialization for essential b.c. with TemperatureCubitBcData
4  * @version 0.13.2
5  * @date 2022-09-18
6  *
7  * @copyright Copyright (c) 2022
8  *
9  */
10 
11 #ifndef _ESSENTIAL_TEMPERATURECUBITBCDATA_HPP_
12 #define _ESSENTIAL_TEMPERATURECUBITBCDATA_HPP_
13 
14 namespace MoFEM {
15 
16 // FIXME: OpEssentialRhsImpl<TemperatureCubitBcData, 1, 1, A, I, OpBase> not
17 // tested.
18 
19 template <AssemblyType A, IntegrationType I, typename OpBase>
21  : FormsIntegrators<OpBase>::template Assembly<A>::template LinearForm<
22  I>::template OpSource<1, 1> {
23 
24  using OpSource = typename FormsIntegrators<OpBase>::template Assembly<
25  A>::template LinearForm<I>::template OpSource<1, 1>;
26 
27  OpEssentialRhsImpl(const std::string field_name,
28  boost::shared_ptr<TemperatureCubitBcData> bc_data,
29  boost::shared_ptr<Range> ents_ptr,
30  std::vector<boost::shared_ptr<ScalingMethod>> smv);
31 
32 private:
34  double bcVal;
35 };
36 
37 template <AssemblyType A, IntegrationType I, typename OpBase>
39  OpEssentialRhsImpl(const std::string field_name,
40  boost::shared_ptr<TemperatureCubitBcData> bc_data,
41  boost::shared_ptr<Range> ents_ptr,
42  std::vector<boost::shared_ptr<ScalingMethod>> smv)
43  : OpSource(
44  field_name, [this](double, double, double) { return bcVal; },
45  ents_ptr),
46  vecOfTimeScalingMethods(smv) {
47 
48  bcVal = bc_data->data.value1;
49  this->timeScalingFun = [this](const double t) {
50  double s = 1;
51  for (auto &o : vecOfTimeScalingMethods) {
52  s *= o->getScale(t);
53  }
54  return s;
55  };
56 
57 }
58 
59 template <AssemblyType A, IntegrationType I, typename OpBase>
61  : FormsIntegrators<OpBase>::template Assembly<A>::template BiLinearForm<
62  I>::template OpMass<1, 1> {
63 
64  using OpMass = typename FormsIntegrators<OpBase>::template Assembly<
66 
67  OpEssentialLhsImpl(const std::string field_name,
68  boost::shared_ptr<Range> ents_ptr);
69 };
70 
71 template <AssemblyType A, IntegrationType I, typename OpBase>
74  boost::shared_ptr<Range>
75  ents_ptr)
76  : OpMass(
78 
79  [](double, double, double) constexpr { return 1; },
80 
81  ents_ptr) {}
82 
83 /**
84  * @brief Specialization for TemperatureCubitBcData
85  *
86  * Specialization to enforce blocksets which TemperatureCubitBcData ptr. That is
87  * to enforce constrains on temperature. set
88  *
89  * @tparam
90  */
93  boost::shared_ptr<FEMethod> fe_ptr,
94  std::vector<boost::shared_ptr<ScalingMethod>> smv);
95 
96  MoFEMErrorCode operator()();
97 
98 protected:
100  boost::weak_ptr<FEMethod> fePtr;
102 };
103 
104 } // namespace MoFEM
105 
106 #endif //_ESSENTIAL_TEMPERATURECUBITBCDATA_HPP_
MoFEM::TemperatureCubitBcData
Definition of the temperature bc data structure.
Definition: BCData.hpp:306
MoFEM::EssentialPreProc< TemperatureCubitBcData >::fePtr
boost::weak_ptr< FEMethod > fePtr
Definition: EssentialTemperatureCubitBcData.hpp:100
MoFEM::EssentialPreProc< TemperatureCubitBcData >::mField
MoFEM::Interface & mField
Definition: EssentialTemperatureCubitBcData.hpp:99
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
I
constexpr IntegrationType I
Definition: operators_tests.cpp:31
MoFEM::OpBaseImpl
Definition: FormsIntegrators.hpp:178
MoFEM::OpEssentialRhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >::vecOfTimeScalingMethods
VecOfTimeScalingMethods vecOfTimeScalingMethods
Definition: EssentialTemperatureCubitBcData.hpp:33
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::OpEssentialLhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >::OpMass
typename FormsIntegrators< OpBase >::template Assembly< A >::template BiLinearForm< I >::template OpMass< 1, 1 > OpMass
Definition: EssentialTemperatureCubitBcData.hpp:65
double
MoFEM::OpEssentialLhsImpl
Enforce essential constrains on lhs.
Definition: Essential.hpp:81
MoFEM::OpEssentialRhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >::bcVal
double bcVal
Definition: EssentialTemperatureCubitBcData.hpp:34
t
constexpr double t
plate stiffness
Definition: plate.cpp:59
BiLinearForm
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
MoFEM::OpEssentialRhsImpl< TemperatureCubitBcData, 1, 1, A, I, OpBase >::OpSource
typename FormsIntegrators< OpBase >::template Assembly< A >::template LinearForm< I >::template OpSource< 1, 1 > OpSource
Definition: EssentialTemperatureCubitBcData.hpp:25
MoFEM::OpEssentialRhsImpl
Enforce essential constrains on rhs.
Definition: Essential.hpp:65
MoFEM::VecOfTimeScalingMethods
std::vector< boost::shared_ptr< ScalingMethod > > VecOfTimeScalingMethods
Vector of time scaling methods.
Definition: Natural.hpp:20
MoFEM::EssentialPreProc< TemperatureCubitBcData >::vecOfTimeScalingMethods
VecOfTimeScalingMethods vecOfTimeScalingMethods
Definition: EssentialTemperatureCubitBcData.hpp:101
MoFEM::FormsIntegrators
Integrator forms.
Definition: FormsIntegrators.hpp:299
MoFEM::EssentialPreProc
Class (Function) to enforce essential constrains.
Definition: Essential.hpp:25