11 const std::string row_field_name,
const std::string col_field_name,
12 boost::shared_ptr<MatrixDouble> mDptr,
13 boost::shared_ptr<double> coeff_expansion_ptr);
19 boost::shared_ptr<MatrixDouble>
mDPtr;
28 boost::shared_ptr<MatrixDouble> strain_ptr,
29 boost::shared_ptr<VectorDouble> temp_ptr,
30 boost::shared_ptr<MatrixDouble> m_D_ptr,
31 boost::shared_ptr<double> coeff_expansion_ptr,
32 boost::shared_ptr<MatrixDouble> stress_ptr);
35 boost::shared_ptr<VectorDouble> temp_ptr,
36 boost::shared_ptr<MatrixDouble> m_D_ptr,
37 boost::shared_ptr<double> coeff_expansion_ptr,
38 boost::shared_ptr<MatrixDouble> stress_ptr);
45 boost::shared_ptr<MatrixDouble>
mDPtr;
51 const std::string row_field_name,
const std::string col_field_name,
52 boost::shared_ptr<MatrixDouble> mDptr,
53 boost::shared_ptr<double> coeff_expansion_ptr)
56 mDPtr(mDptr), coeffExpansionPtr(coeff_expansion_ptr) {
67 const auto nb_integration_pts = row_data.getN().size1();
68 const auto nb_row_base_functions = row_data.getN().size2();
69 auto t_w = getFTensor0IntegrationWeight();
72 auto t_row_diff_base = row_data.getFTensor1DiffN<
SPACE_DIM>();
73 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
mDPtr);
82 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
84 double alpha = getMeasure() * t_w;
88 auto t_col_base = col_data.getFTensor0N(gg, 0);
92 (t_row_diff_base(
j) * t_eigen_strain(
i,
j)) * (t_col_base * alpha);
100 for (; rr != nb_row_base_functions; ++rr)
110 boost::shared_ptr<MatrixDouble> strain_ptr,
111 boost::shared_ptr<VectorDouble> temp_ptr,
112 boost::shared_ptr<MatrixDouble> m_D_ptr,
113 boost::shared_ptr<double> coeff_expansion_ptr,
114 boost::shared_ptr<MatrixDouble> stress_ptr)
116 tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
117 stressPtr(stress_ptr) {
119 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE],
false);
123 boost::shared_ptr<VectorDouble> temp_ptr,
124 boost::shared_ptr<MatrixDouble> m_D_ptr,
125 boost::shared_ptr<double> coeff_expansion_ptr,
126 boost::shared_ptr<MatrixDouble> stress_ptr)
128 tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
129 stressPtr(stress_ptr) {}
135 const auto nb_gauss_pts = getGaussPts().size2();
139 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
mDPtr);
140 auto t_strain = getFTensor2SymmetricFromMat<SPACE_DIM>(*
strainPtr);
141 auto t_stress = getFTensor2SymmetricFromMat<SPACE_DIM>(*
stressPtr);
147 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
159 struct SetTargetTemperature;
165 template <AssemblyType A, IntegrationType I,
typename OpBase>
169 template <AssemblyType A, IntegrationType I, typename OpBase>
173 template <AssemblyType A, IntegrationType I, typename OpBase>
176 MoFEM::OpFluxRhsImpl<ThermoElasticOps::SetTargetTemperature, 1, 1, A, I,
186 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
188 boost::shared_ptr<VectorDouble> temp_ptr, std::string block_name,
Sev sev
194 A>::template LinearForm<I>::template OpSource<1, 1>;
196 A>::template LinearForm<I>::template OpBaseTimesScalar<1>;
198 auto add_op = [&](
auto &&meshset_vec_ptr) {
200 for (
auto m : meshset_vec_ptr) {
201 std::vector<double> block_data;
202 m->getAttributes(block_data);
203 if (block_data.size() != 2) {
205 "Expected two parameters");
207 double target_temperature = block_data[0];
210 auto ents_ptr = boost::make_shared<Range>();
215 <<
"Add " << *
m <<
" target temperature " << target_temperature
216 <<
" penalty " << beta;
218 pipeline.push_back(
new OP_SOURCE(
220 [target_temperature, beta](
double,
double,
double) {
221 return target_temperature * beta;
224 pipeline.push_back(
new OP_TEMP(
226 [beta](
double,
double,
double) {
return -beta; }, ents_ptr));
235 (boost::format(
"%s(.*)") % block_name).str()
247 template <AssemblyType A, IntegrationType I,
typename OpBase>
248 struct AddFluxToLhsPipelineImpl<
255 AddFluxToLhsPipelineImpl() =
delete;
259 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
261 boost::shared_ptr<VectorDouble> temp_ptr, std::string block_name,
Sev sev
266 using OP_MASS =
typename FormsIntegrators<OpBase>::template Assembly<
269 auto add_op = [&](
auto &&meshset_vec_ptr) {
271 for (
auto m : meshset_vec_ptr) {
272 std::vector<double> block_data;
273 m->getAttributes(block_data);
274 if (block_data.size() != 2) {
276 "Expected two parameters");
280 auto ents_ptr = boost::make_shared<Range>();
285 <<
"Add " << *
m <<
" penalty " << beta;
287 pipeline.push_back(
new OP_MASS(
289 [beta](
double,
double,
double) {
return -beta; }, ents_ptr));
296 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
298 (boost::format(
"%s(.*)") % block_name).str()