11 const std::string row_field_name,
const std::string col_field_name,
12 boost::shared_ptr<MatrixDouble> mDptr,
13 boost::shared_ptr<VectorDouble> coeff_expansion_ptr);
19 boost::shared_ptr<MatrixDouble>
mDPtr;
29 boost::shared_ptr<MatrixDouble> strain_ptr,
30 boost::shared_ptr<VectorDouble> temp_ptr,
31 boost::shared_ptr<MatrixDouble> m_D_ptr,
32 boost::shared_ptr<VectorDouble> coeff_expansion_ptr,
33 boost::shared_ptr<MatrixDouble> stress_ptr);
36 boost::shared_ptr<VectorDouble> temp_ptr,
37 boost::shared_ptr<MatrixDouble> m_D_ptr,
38 boost::shared_ptr<VectorDouble> coeff_expansion_ptr,
39 boost::shared_ptr<MatrixDouble> stress_ptr);
46 boost::shared_ptr<MatrixDouble>
mDPtr;
52 const std::string row_field_name,
const std::string col_field_name,
53 boost::shared_ptr<MatrixDouble> mDptr,
54 boost::shared_ptr<VectorDouble> coeff_expansion_ptr)
57 mDPtr(mDptr), coeffExpansionPtr(coeff_expansion_ptr) {
68 const auto nb_integration_pts = row_data.getN().size1();
69 const auto nb_row_base_functions = row_data.getN().size2();
70 auto t_w = getFTensor0IntegrationWeight();
71 auto t_row_diff_base = row_data.getFTensor1DiffN<
SPACE_DIM>();
72 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
mDPtr);
81 t_coeff_exp(
i,
j) = 0;
83 t_coeff_exp(
d,
d) = (*coeffExpansionPtr)[
d];
86 t_eigen_strain(
i,
j) = (t_D(
i,
j,
k,
l) * t_coeff_exp(
k,
l));
88 for (
auto gg = 0; gg != nb_integration_pts; ++gg) {
90 double alpha = getMeasure() * t_w;
94 auto t_col_base = col_data.getFTensor0N(gg, 0);
98 (t_row_diff_base(
j) * t_eigen_strain(
i,
j)) * (t_col_base * alpha);
106 for (; rr != nb_row_base_functions; ++rr)
116 const std::string
field_name, boost::shared_ptr<MatrixDouble> strain_ptr,
117 boost::shared_ptr<VectorDouble> temp_ptr,
118 boost::shared_ptr<MatrixDouble> m_D_ptr,
119 boost::shared_ptr<VectorDouble> coeff_expansion_ptr,
120 boost::shared_ptr<MatrixDouble> stress_ptr)
122 tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
123 stressPtr(stress_ptr) {
125 std::fill(&doEntities[MBEDGE], &doEntities[MBMAXTYPE],
false);
129 boost::shared_ptr<MatrixDouble> strain_ptr,
130 boost::shared_ptr<VectorDouble> temp_ptr,
131 boost::shared_ptr<MatrixDouble> m_D_ptr,
132 boost::shared_ptr<VectorDouble> coeff_expansion_ptr,
133 boost::shared_ptr<MatrixDouble> stress_ptr)
135 tempPtr(temp_ptr), mDPtr(m_D_ptr), coeffExpansionPtr(coeff_expansion_ptr),
136 stressPtr(stress_ptr) {}
142 const auto nb_gauss_pts = getGaussPts().size2();
145 auto t_D = getFTensor4DdgFromMat<SPACE_DIM, SPACE_DIM, 0>(*
mDPtr);
146 auto t_strain = getFTensor2SymmetricFromMat<SPACE_DIM>(*
strainPtr);
147 auto t_stress = getFTensor2SymmetricFromMat<SPACE_DIM>(*
stressPtr);
156 t_coeff_exp(
i,
j) = 0;
158 t_coeff_exp(
d,
d) = (*coeffExpansionPtr)[
d];
161 for (
size_t gg = 0; gg != nb_gauss_pts; ++gg) {
162 t_stress(
i,
j) = t_D(
i,
j,
k,
l) *
163 (t_strain(
k,
l) - t_coeff_exp(
k,
l) * (t_temp -
ref_temp));
172 struct SetTargetTemperature;
178 template <AssemblyType A, IntegrationType I,
typename OpBase>
182 template <AssemblyType A, IntegrationType I, typename OpBase>
186 template <AssemblyType A, IntegrationType I, typename OpBase>
189 MoFEM::OpFluxRhsImpl<ThermoElasticOps::SetTargetTemperature, 1, 1, A, I,
199 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
201 boost::shared_ptr<VectorDouble> temp_ptr, std::string block_name,
Sev sev
207 A>::template LinearForm<I>::template OpSource<1, 1>;
209 A>::template LinearForm<I>::template OpBaseTimesScalar<1>;
211 auto add_op = [&](
auto &&meshset_vec_ptr) {
213 for (
auto m : meshset_vec_ptr) {
214 std::vector<double> block_data;
215 m->getAttributes(block_data);
216 if (block_data.size() < 2) {
218 "Expected two parameters");
220 double target_temperature = block_data[0];
223 auto ents_ptr = boost::make_shared<Range>();
228 <<
"Add " << *
m <<
" target temperature " << target_temperature
229 <<
" penalty " << beta;
231 pipeline.push_back(
new OP_SOURCE(
233 [target_temperature, beta](
double,
double,
double) {
234 return target_temperature * beta;
237 pipeline.push_back(
new OP_TEMP(
239 [beta](
double,
double,
double) {
return -beta; }, ents_ptr));
248 (boost::format(
"%s(.*)") % block_name).str()
260 template <AssemblyType A, IntegrationType I,
typename OpBase>
261 struct AddFluxToLhsPipelineImpl<
268 AddFluxToLhsPipelineImpl() =
delete;
272 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
274 boost::shared_ptr<VectorDouble> temp_ptr, std::string block_name,
Sev sev
279 using OP_MASS =
typename FormsIntegrators<OpBase>::template Assembly<
282 auto add_op = [&](
auto &&meshset_vec_ptr) {
284 for (
auto m : meshset_vec_ptr) {
285 std::vector<double> block_data;
286 m->getAttributes(block_data);
287 if (block_data.size() != 2) {
289 "Expected two parameters");
293 auto ents_ptr = boost::make_shared<Range>();
298 <<
"Add " << *
m <<
" penalty " << beta;
300 pipeline.push_back(
new OP_MASS(
302 [beta](
double,
double,
double) {
return -beta; }, ents_ptr));
309 m_field.
getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
311 (boost::format(
"%s(.*)") % block_name).str()