9#ifndef EXECUTABLE_DIMENSION
10#define EXECUTABLE_DIMENSION 3
18#include <ThermalConvection.hpp>
19#include <ThermalRadiation.hpp>
42 IntegrationType::GAUSS;
45#include <HenckyOps.hpp>
50#include <FiniteThermalOps.hpp>
54#include <ThermalOps.hpp>
79 GAUSS>::OpEssentialRhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
82 GAUSS>::OpEssentialLhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
109#include <ThermoElasticOps.hpp>
117auto save_range = [](moab::Interface &moab,
const std::string name,
121 CHKERR moab.add_entities(*out_meshset, r);
122 CHKERR moab.write_file(name.c_str(),
"VTK",
"", out_meshset->get_ptr(), 1);
154 :
public boost::enable_shared_from_this<BlockedThermalParameters> {
163 return boost::shared_ptr<double>(shared_from_this(), &
heatCapacity);
168 :
public boost::enable_shared_from_this<BlockedThermoElasticParameters> {
173 return boost::shared_ptr<VectorDouble>(shared_from_this(),
178 return boost::shared_ptr<double>(shared_from_this(), &
refTemp);
183 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
184 std::string block_name,
185 boost::shared_ptr<BlockedThermalParameters> blockedParamsPtr,
Sev sev);
188 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
189 std::string block_name,
190 boost::shared_ptr<BlockedThermoElasticParameters> blockedParamsPtr,
193 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
196 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
198 boost::shared_ptr<HenckyOps::CommonData> elastic_common_ptr,
199 boost::shared_ptr<ThermoElasticProblem::BlockedThermalParameters>
201 boost::shared_ptr<ThermoElasticProblem::BlockedThermoElasticParameters>
202 thermoelastic_common_ptr,
209 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
211 auto coeff_expansion_ptr = thermoelastic_common_ptr->getCoeffExpansionPtr();
212 auto ref_temp_ptr = thermoelastic_common_ptr->getRefTempPtr();
214 new typename H::template OpCalculateHenckyThermalStress<DIM, I, 0>(
215 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
220 "U", elastic_common_ptr->getMatFirstPiolaStress()));
225 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
228 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
229 std::string
field_name, std::string elastic_block_name,
230 std::string thermal_block_name, std::string thermoelastic_block_name,
234 auto elastic_common_ptr = commonDataFactory<DIM, I, DomainEleOp>(
236 auto thermal_common_ptr = boost::make_shared<BlockedThermalParameters>();
239 auto thermoelastic_common_ptr =
240 boost::make_shared<BlockedThermoElasticParameters>();
242 thermoelastic_common_ptr, Sev::inform);
243 CHKERR opThermoElasticFactoryDomainRhs<DIM, A, I, DomainEleOp>(
244 m_field, pip,
field_name, elastic_common_ptr, thermal_common_ptr,
245 thermoelastic_common_ptr, sev);
250 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
253 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
254 std::string
field_name, std::string coupled_field_name,
255 boost::shared_ptr<HenckyOps::CommonData> elastic_common_ptr,
256 boost::shared_ptr<ThermoElasticProblem::BlockedThermalParameters>
258 boost::shared_ptr<ThermoElasticProblem::BlockedThermoElasticParameters>
259 thermoelastic_common_ptr,
265 using OpKPiola =
typename B::template OpGradTensorGrad<1, DIM, DIM, 1>;
268 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
270 auto coeff_expansion_ptr = thermoelastic_common_ptr->getCoeffExpansionPtr();
271 auto ref_temp_ptr = thermoelastic_common_ptr->getRefTempPtr();
273 new typename H::template OpCalculateHenckyThermalStress<DIM, I, 0>(
274 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
276 pip.push_back(
new typename H::template OpHenckyTangent<DIM, I, 0>(
279 elastic_common_ptr->getMatTangent()));
280 pip.push_back(
new typename H::template OpCalculateHenckyThermalStressdT<
282 field_name, coupled_field_name, elastic_common_ptr,
283 coeff_expansion_ptr));
288 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
291 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
292 std::string
field_name, std::string coupled_field_name,
293 std::string elastic_block_name, std::string thermal_block_name,
294 std::string thermoelastic_block_name,
Sev sev,
double scale = 1) {
297 auto elastic_common_ptr = commonDataFactory<DIM, I, DomainEleOp>(
299 auto thermal_common_ptr = boost::make_shared<BlockedThermalParameters>();
302 auto thermoelastic_common_ptr =
303 boost::make_shared<BlockedThermoElasticParameters>();
305 thermoelastic_common_ptr, Sev::inform);
306 CHKERR opThermoElasticFactoryDomainLhs<DIM, A, I, DomainEleOp>(
307 m_field, pip,
field_name, coupled_field_name, elastic_common_ptr,
308 thermal_common_ptr, thermoelastic_common_ptr, sev);
315 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
316 std::string block_name,
317 boost::shared_ptr<BlockedThermalParameters> blockedParamsPtr,
Sev sev) {
321 OpMatThermalBlocks(boost::shared_ptr<double> conductivity_ptr,
322 boost::shared_ptr<double> capacity_ptr,
324 std::vector<const CubitMeshSets *> meshset_vec_ptr)
326 conductivityPtr(conductivity_ptr), capacityPtr(capacity_ptr) {
328 "Cannot get data from thermal block");
335 for (
auto &b : blockData) {
337 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
338 *conductivityPtr = b.conductivity;
339 *capacityPtr = b.capacity;
357 std::vector<BlockData> blockData;
361 std::vector<const CubitMeshSets *> meshset_vec_ptr,
365 for (
auto m : meshset_vec_ptr) {
367 std::vector<double> block_data;
368 CHKERR m->getAttributes(block_data);
369 if (block_data.size() < 2) {
371 "Expected that block has at least two attributes");
373 auto get_block_ents = [&]() {
376 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
381 <<
m->getName() <<
": conductivity = " << block_data[0]
382 <<
" capacity = " << block_data[1];
384 blockData.push_back({block_data[0], block_data[1], get_block_ents()});
390 boost::shared_ptr<double> conductivityPtr;
391 boost::shared_ptr<double> capacityPtr;
394 pipeline.push_back(
new OpMatThermalBlocks(
395 blockedParamsPtr->getHeatConductivityPtr(),
396 blockedParamsPtr->getHeatCapacityPtr(),
mField, sev,
401 (boost::format(
"%s(.*)") % block_name).str()
411 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
412 std::string block_name,
413 boost::shared_ptr<BlockedThermoElasticParameters> blockedParamsPtr,
417 struct OpMatThermoElasticBlocks :
public DomainEleOp {
418 OpMatThermoElasticBlocks(boost::shared_ptr<VectorDouble> expansion_ptr,
419 boost::shared_ptr<double> ref_temp_ptr,
421 std::vector<const CubitMeshSets *> meshset_vec_ptr)
423 expansionPtr(expansion_ptr), refTempPtr(ref_temp_ptr) {
425 extractThermoElasticBlockData(m_field, meshset_vec_ptr, sev),
426 "Cannot get data from thermoelastic block");
433 for (
auto &b : blockData) {
435 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
436 *expansionPtr = b.expansion;
437 *refTempPtr = b.ref_temp;
455 std::vector<BlockData> blockData;
459 std::vector<const CubitMeshSets *> meshset_vec_ptr,
Sev sev) {
462 for (
auto m : meshset_vec_ptr) {
464 std::vector<double> block_data;
465 CHKERR m->getAttributes(block_data);
466 if (block_data.size() < 2) {
468 "Expected that block has at least two attributes");
470 auto get_block_ents = [&]() {
473 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
477 auto get_expansion = [&]() {
479 if (block_data.size() > 2) {
480 expansion[1] = block_data[2];
482 if (
SPACE_DIM == 3 && block_data.size() > 3) {
483 expansion[2] = block_data[3];
488 auto coeff_exp_vec = get_expansion();
491 <<
" ref_temp = " << block_data[0]
492 <<
" expansion = " << coeff_exp_vec;
494 blockData.push_back({block_data[0], coeff_exp_vec, get_block_ents()});
500 boost::shared_ptr<VectorDouble> expansionPtr;
501 boost::shared_ptr<double> refTempPtr;
504 pipeline.push_back(
new OpMatThermoElasticBlocks(
505 blockedParamsPtr->getCoeffExpansionPtr(),
506 blockedParamsPtr->getRefTempPtr(),
mField, sev,
511 (boost::format(
"%s(.*)") % block_name).str()
536 auto get_command_line_parameters = [&]() {
602 CHKERR get_command_line_parameters();
620 CHKERR simple->addDomainField(
"FLUX", flux_space, base, 1);
621 CHKERR simple->addBoundaryField(
"FLUX", flux_space, base, 1);
651 auto no_rule = [](int, int, int) {
return -1; };
654 field_eval_fe_ptr->getRuleHook = no_rule;
656 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
657 auto block_thermoelastic_params =
658 boost::make_shared<BlockedThermoElasticParameters>();
659 auto coeff_expansion_ptr =
660 block_thermoelastic_params->getCoeffExpansionPtr();
661 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
664 "MAT_THERMAL", block_thermal_params,
667 field_eval_fe_ptr->getOpPtrVector(),
"MAT_THERMOELASTIC",
668 block_thermoelastic_params, Sev::verbose);
671 field_eval_fe_ptr->getOpPtrVector(), {H1, HDIV});
673 auto hencky_common_data_ptr =
674 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
675 mField, field_eval_fe_ptr->getOpPtrVector(),
"U",
"MAT_ELASTIC",
677 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
678 auto dispGradPtr = hencky_common_data_ptr->matGradPtr;
679 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
681 field_eval_fe_ptr->getOpPtrVector().push_back(
683 field_eval_fe_ptr->getOpPtrVector().push_back(
685 field_eval_fe_ptr->getOpPtrVector().push_back(
687 field_eval_fe_ptr->getOpPtrVector().push_back(
693 field_eval_fe_ptr->getOpPtrVector().push_back(
695 typename H::template OpCalculateHenckyThermalStress<SPACE_DIM, IT, 0>(
696 "U",
tempFieldPtr, hencky_common_data_ptr, coeff_expansion_ptr,
699 field_eval_fe_ptr->getOpPtrVector().push_back(
701 hencky_common_data_ptr->getMatFirstPiolaStress(),
703 field_eval_fe_ptr->getOpPtrVector().push_back(
706 field_eval_fe_ptr->getOpPtrVector().push_back(
707 new typename H::template OpCalculateLogC<SPACE_DIM, IT>(
708 "U", hencky_common_data_ptr));
709 stressFieldPtr = hencky_common_data_ptr->getMatFirstPiolaStress();
728 auto get_skin = [&]() {
733 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
737 auto filter_flux_blocks = [&](
auto skin,
bool temp_bc =
false) {
738 auto remove_cubit_blocks = [&](
auto c) {
748 skin = subtract(skin, ents);
753 auto remove_named_blocks = [&](
auto n) {
758 (boost::format(
"%s(.*)") %
n).str()
766 skin = subtract(skin, ents);
772 "remove_cubit_blocks");
774 "remove_named_blocks");
777 "remove_cubit_blocks");
786 ParallelComm *pcomm =
788 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
789 PSTATUS_NOT, -1, &boundary_ents);
790 return boundary_ents;
794 auto remove_temp_bc_ents =
800 remove_temp_bc_ents);
802 MOFEM_LOG(
"SYNC", Sev::noisy) << remove_flux_ents << endl;
805 MOFEM_LOG(
"SYNC", Sev::noisy) << remove_temp_bc_ents << endl;
818 remove_temp_bc_ents);
823 simple->getProblemName(),
"FLUX", remove_flux_ents);
825 simple->getProblemName(),
"TBC", remove_temp_bc_ents);
827 auto set_init_temp = [](boost::shared_ptr<FieldEntity> field_entity_ptr) {
835 simple->getProblemName(),
"U");
837 simple->getProblemName(),
"FLUX",
false);
854 auto boundary_marker =
855 bc_mng->getMergedBlocksMarker(vector<string>{
"HEATFLUX"});
865 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
866 auto heat_conductivity_ptr = block_thermal_params->getHeatConductivityPtr();
867 auto heat_capacity_ptr = block_thermal_params->getHeatCapacityPtr();
869 auto block_thermoelastic_params =
870 boost::make_shared<BlockedThermoElasticParameters>();
871 auto coeff_expansion_ptr = block_thermoelastic_params->getCoeffExpansionPtr();
872 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
876 boost::make_shared<TimeScale>(
"",
false, [](
const double) {
return 1; });
877 auto def_time_scale = [time_scale](
const double time) {
878 return (!time_scale->argFileScale) ? time : 1;
880 auto def_file_name = [time_scale](
const std::string &&name) {
881 return (!time_scale->argFileScale) ? name :
"";
885 auto time_bodyforce_scaling = boost::make_shared<TimeScale>(
886 def_file_name(
"bodyforce_scale.txt"),
false, def_time_scale);
887 auto time_heatsource_scaling = boost::make_shared<TimeScale>(
888 def_file_name(
"heatsource_scale.txt"),
false, def_time_scale);
889 auto time_temperature_scaling = boost::make_shared<TimeScale>(
890 def_file_name(
"temperature_bc_scale.txt"),
false, def_time_scale);
891 auto time_displacement_scaling = boost::make_shared<TimeScale>(
892 def_file_name(
"displacement_bc_scale.txt"),
false, def_time_scale);
893 auto time_flux_scaling = boost::make_shared<TimeScale>(
894 def_file_name(
"flux_bc_scale.txt"),
false, def_time_scale);
895 auto time_force_scaling = boost::make_shared<TimeScale>(
896 def_file_name(
"force_bc_scale.txt"),
false, def_time_scale);
898 auto add_domain_rhs_ops = [&](
auto &pipeline) {
903 block_thermoelastic_params, Sev::inform);
906 auto hencky_common_data_ptr =
907 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
908 mField, pipeline,
"U",
"MAT_ELASTIC", Sev::inform);
909 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
910 auto mat_grad_ptr = hencky_common_data_ptr->matGradPtr;
911 auto mat_strain_ptr = boost::make_shared<MatrixDouble>();
912 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
914 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
915 auto vec_temp_dot_ptr = boost::make_shared<VectorDouble>();
916 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
917 auto vec_temp_div_ptr = boost::make_shared<VectorDouble>();
923 "FLUX", vec_temp_div_ptr));
927 CHKERR opThermoElasticFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
928 mField, pipeline,
"U",
"MAT_ELASTIC",
"MAT_THERMAL",
929 "MAT_THERMOELASTIC", Sev::inform);
931 auto resistance = [heat_conductivity_ptr](
const double,
const double,
933 return (1. / (*heat_conductivity_ptr));
936 auto capacity = [heat_capacity_ptr](
const double,
const double,
938 return -(*heat_capacity_ptr);
944 new OpHdivFlux(
"FLUX", mat_flux_ptr, resistance, mat_grad_ptr));
945 pipeline.push_back(
new OpHDivTemp(
"FLUX", vec_temp_ptr, unity));
946 pipeline.push_back(
new OpBaseDivFlux(
"T", vec_temp_div_ptr, unity));
947 pipeline.push_back(
new OpBaseDotT(
"T", vec_temp_dot_ptr, capacity));
951 pipeline,
mField,
"T", {time_scale, time_heatsource_scaling},
952 "HEAT_SOURCE", Sev::inform);
954 pipeline,
mField,
"U", {time_scale, time_bodyforce_scaling},
955 "BODY_FORCE", Sev::inform);
957 pipeline,
mField,
"T", vec_temp_ptr,
"SETTEMP", Sev::inform);
962 auto add_domain_lhs_ops = [&](
auto &pipeline) {
967 block_thermoelastic_params,
971 auto hencky_common_data_ptr =
972 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
973 mField, pipeline,
"U",
"MAT_ELASTIC", Sev::inform, 1);
974 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
975 auto mat_grad_ptr = hencky_common_data_ptr->matGradPtr;
977 auto resistance = [heat_conductivity_ptr](
const double,
const double,
979 return (1. / (*heat_conductivity_ptr));
981 auto capacity = [heat_capacity_ptr](
const double,
const double,
983 return -(*heat_capacity_ptr);
986 new OpHdivHdiv(
"FLUX",
"FLUX", resistance, mat_grad_ptr));
988 new OpHdivT(
"FLUX",
"T", []()
constexpr {
return -1; },
true));
990 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
995 new OpHdivU(
"FLUX",
"U", mat_flux_ptr, resistance, mat_grad_ptr));
997 CHKERR opThermoElasticFactoryDomainLhs<SPACE_DIM, AT, IT, DomainEleOp>(
998 mField, pipeline,
"U",
"T",
"MAT_ELASTIC",
"MAT_THERMAL",
999 "MAT_THERMOELASTIC", Sev::inform);
1001 auto op_capacity =
new OpCapacity(
"T",
"T", capacity);
1002 op_capacity->feScalingFun = [](
const FEMethod *fe_ptr) {
1003 return fe_ptr->ts_a;
1005 pipeline.push_back(op_capacity);
1007 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
1010 pipeline,
mField,
"T", vec_temp_ptr,
"SETTEMP", Sev::verbose);
1015 auto add_boundary_rhs_ops = [&](
auto &pipeline) {
1021 pipeline,
mField,
"U", {time_scale, time_force_scaling},
"FORCE",
1029 pipeline,
mField,
"FLUX", {time_scale, time_temperature_scaling},
1030 "TEMPERATURE", Sev::inform);
1040 pipeline,
mField,
"TBC", {time_scale, time_flux_scaling},
"FLUX",
1044 using OpConvectionRhsBC =
1045 T::OpFlux<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1>;
1046 using OpRadiationRhsBC =
1047 T::OpFlux<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1>;
1048 auto temp_bc_ptr = boost::make_shared<VectorDouble>();
1050 T::AddFluxToPipeline<OpConvectionRhsBC>::add(
1051 pipeline,
mField,
"TBC", temp_bc_ptr,
"CONVECTION", Sev::inform);
1052 T::AddFluxToPipeline<OpRadiationRhsBC>::add(
1053 pipeline,
mField,
"TBC", temp_bc_ptr,
"RADIATION", Sev::inform);
1055 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
1064 struct OpTBCTimesNormalFlux
1069 OpTBCTimesNormalFlux(
const std::string
field_name,
1070 boost::shared_ptr<MatrixDouble> vec,
1071 boost::shared_ptr<Range> ents_ptr =
nullptr)
1078 auto t_w = OP::getFTensor0IntegrationWeight();
1082 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1084 auto t_vec = getFTensor1FromMat<SPACE_DIM, 1>(*sourceVec);
1086 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1088 const double alpha = t_w * (t_vec(
i) * t_normal(
i));
1091 for (; rr != OP::nbRows; ++rr) {
1092 OP::locF[rr] += alpha * t_row_base;
1095 for (; rr < OP::nbRowBaseFunctions; ++rr)
1101 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1102 if (fe_type == MBTRI) {
1109 boost::shared_ptr<MatrixDouble> sourceVec;
1111 pipeline.push_back(
new OpTBCTimesNormalFlux(
"TBC", mat_flux_ptr));
1113 struct OpBaseNormalTimesTBC
1118 OpBaseNormalTimesTBC(
const std::string
field_name,
1119 boost::shared_ptr<VectorDouble> vec,
1120 boost::shared_ptr<Range> ents_ptr =
nullptr)
1127 auto t_w = OP::getFTensor0IntegrationWeight();
1131 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1135 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1137 const double alpha = t_w * t_vec;
1140 for (; rr != OP::nbRows; ++rr) {
1141 OP::locF[rr] += alpha * (t_row_base(
i) * t_normal(
i));
1144 for (; rr < OP::nbRowBaseFunctions; ++rr)
1150 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1151 if (fe_type == MBTRI) {
1158 boost::shared_ptr<VectorDouble> sourceVec;
1161 pipeline.push_back(
new OpBaseNormalTimesTBC(
"FLUX", temp_bc_ptr));
1166 auto add_boundary_lhs_ops = [&](
auto &pipeline) {
1173 using OpConvectionLhsBC =
1174 T::OpFlux<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1>;
1175 using OpRadiationLhsBC =
1176 T::OpFlux<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1>;
1177 auto temp_bc_ptr = boost::make_shared<VectorDouble>();
1179 T::AddFluxToPipeline<OpConvectionLhsBC>::add(pipeline,
mField,
"TBC",
"TBC",
1180 "CONVECTION", Sev::verbose);
1181 T::AddFluxToPipeline<OpRadiationLhsBC>::add(
1182 pipeline,
mField,
"TBC",
"TBC", temp_bc_ptr,
"RADIATION", Sev::verbose);
1189 struct OpTBCTimesNormalFlux
1194 OpTBCTimesNormalFlux(
const std::string row_field_name,
1195 const std::string col_field_name,
1196 boost::shared_ptr<Range> ents_ptr =
nullptr)
1197 :
OP(row_field_name, col_field_name,
OP::OPROWCOL, ents_ptr) {
1199 this->assembleTranspose =
true;
1200 this->onlyTranspose =
false;
1210 auto t_w = OP::getFTensor0IntegrationWeight();
1214 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1216 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1218 auto a_mat_ptr = &*OP::locMat.data().begin();
1220 for (; rr != OP::nbRows; rr++) {
1222 const double alpha = t_w * t_row_base;
1226 for (
int cc = 0; cc != OP::nbCols; cc++) {
1230 *a_mat_ptr += alpha * (t_col_base(
i) * t_normal(
i));
1236 for (; rr < OP::nbRowBaseFunctions; ++rr)
1241 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1242 if (fe_type == MBTRI) {
1249 pipeline.push_back(
new OpTBCTimesNormalFlux(
"TBC",
"FLUX"));
1255 auto get_bc_hook_rhs = [&]() {
1257 mField, pipeline_mng->getDomainRhsFE(),
1258 {time_scale, time_displacement_scaling});
1261 auto get_bc_hook_lhs = [&]() {
1263 mField, pipeline_mng->getDomainLhsFE(),
1264 {time_scale, time_displacement_scaling});
1268 pipeline_mng->getDomainRhsFE()->preProcessHook = get_bc_hook_rhs();
1269 pipeline_mng->getDomainLhsFE()->preProcessHook = get_bc_hook_lhs();
1271 CHKERR add_domain_rhs_ops(pipeline_mng->getOpDomainRhsPipeline());
1272 CHKERR add_domain_lhs_ops(pipeline_mng->getOpDomainLhsPipeline());
1273 CHKERR add_boundary_rhs_ops(pipeline_mng->getOpBoundaryRhsPipeline());
1274 CHKERR add_boundary_lhs_ops(pipeline_mng->getOpBoundaryLhsPipeline());
1288 auto dm =
simple->getDM();
1289 auto solver = pipeline_mng->createTSIM();
1292 auto set_section_monitor = [&](
auto solver) {
1295 CHKERR TSGetSNES(solver, &snes);
1296 CHKERR SNESMonitorSet(snes,
1299 (
void *)(snes_ctx_ptr.get()),
nullptr);
1303 auto create_post_process_elements = [&]() {
1304 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
1306 auto block_thermoelastic_params =
1307 boost::make_shared<BlockedThermoElasticParameters>();
1308 auto coeff_expansion_ptr =
1309 block_thermoelastic_params->getCoeffExpansionPtr();
1310 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
1312 auto u_ptr = boost::make_shared<MatrixDouble>();
1313 auto mat_grad_ptr = boost::make_shared<MatrixDouble>();
1314 auto mat_strain_ptr = boost::make_shared<MatrixDouble>();
1315 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
1316 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
1317 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
1319 auto push_domain_ops = [&](
auto &pp_fe) {
1321 auto &pip = pp_fe->getOpPtrVector();
1326 pip,
"MAT_THERMOELASTIC", block_thermoelastic_params, Sev::verbose);
1336 "U", mat_grad_ptr));
1337 auto elastic_common_ptr = commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
1338 mField, pip,
"U",
"MAT_ELASTIC", Sev::inform);
1342 typename H::template OpCalculateHenckyThermalStress<SPACE_DIM, IT, 0>(
1343 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
1347 elastic_common_ptr->getMatFirstPiolaStress(), mat_stress_ptr));
1351 mat_stress_ptr = elastic_common_ptr->getMatFirstPiolaStress();
1352 mat_strain_ptr = elastic_common_ptr->getMatLogC();
1358 auto push_post_proc_ops = [&](
auto &pp_fe) {
1360 auto &pip = pp_fe->getOpPtrVector();
1368 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
1370 {{
"T", vec_temp_ptr}},
1372 {{
"U", u_ptr}, {
"FLUX", mat_flux_ptr}},
1376 {{
"CAUCHY", mat_stress_ptr}, {
"STRAIN", mat_strain_ptr}}
1386 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
1388 {{
"T", vec_temp_ptr}},
1390 {{
"U", u_ptr}, {
"FLUX", mat_flux_ptr}},
1392 {{
"PIOLA", mat_stress_ptr}},
1394 {{
"HENCKY_STRAIN", mat_strain_ptr}}
1404 auto domain_post_proc = [&]() {
1406 return boost::shared_ptr<PostProcEle>();
1407 auto pp_fe = boost::make_shared<PostProcEle>(mField);
1409 "push domain ops to domain element");
1411 "push post proc ops to domain element");
1415 auto skin_post_proc = [&]() {
1417 return boost::shared_ptr<SkinPostProcEle>();
1418 auto pp_fe = boost::make_shared<SkinPostProcEle>(mField);
1423 "push domain ops to side element");
1424 pp_fe->getOpPtrVector().push_back(op_side);
1426 "push post proc ops to skin element");
1430 return std::make_pair(domain_post_proc(), skin_post_proc());
1433 auto monitor_ptr = boost::make_shared<FEMethod>();
1435 auto set_time_monitor = [&](
auto dm,
auto solver,
auto domain_post_proc_fe,
1436 auto skin_post_proc_fe) {
1438 monitor_ptr->preProcessHook = [&]() {
1444 domain_post_proc_fe,
1445 monitor_ptr->getCacheWeakPtr());
1446 CHKERR domain_post_proc_fe->writeFile(
1447 "out_" + boost::lexical_cast<std::string>(monitor_ptr->ts_step) +
1453 monitor_ptr->getCacheWeakPtr());
1454 CHKERR skin_post_proc_fe->writeFile(
1456 boost::lexical_cast<std::string>(monitor_ptr->ts_step) +
".h5m");
1463 ->evalFEAtThePoint<SPACE_DIM>(
1464 fieldEvalCoords.data(), 1e-12,
simple->getProblemName(),
1465 simple->getDomainFEName(), fieldEvalData,
1472 CHKERR VecZeroEntries(eval_num_vec);
1473 if (tempFieldPtr->size()) {
1474 CHKERR VecSetValue(eval_num_vec, 0, 1, ADD_VALUES);
1476 CHKERR VecAssemblyBegin(eval_num_vec);
1477 CHKERR VecAssemblyEnd(eval_num_vec);
1480 CHKERR VecSum(eval_num_vec, &eval_num);
1481 if (!(
int)eval_num) {
1483 "atom test %d failed: did not find elements to evaluate "
1484 "the field, check the coordinates",
1489 if (tempFieldPtr->size()) {
1491 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1492 <<
"Eval point T: " << t_temp;
1493 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1494 if (
atom_test <= 3 && fabs(t_temp - 554.48) > 1e-2) {
1496 "atom test %d failed: wrong temperature value",
1499 if (
atom_test == 4 && fabs(t_temp - 250) > 1e-2) {
1501 "atom test %d failed: wrong temperature value",
1504 if (
atom_test == 5 && fabs(t_temp - 1) > 1e-2) {
1506 "atom test %d failed: wrong temperature value",
1511 if (fluxFieldPtr->size1()) {
1513 auto t_flux = getFTensor1FromMat<SPACE_DIM>(*fluxFieldPtr);
1514 auto flux_mag = sqrt(t_flux(
i) * t_flux(
i));
1515 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1516 <<
"Eval point FLUX magnitude: " << flux_mag;
1517 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1518 if (
atom_test <= 3 && fabs(flux_mag - 27008.0) > 2e1) {
1520 "atom test %d failed: wrong flux value",
atom_test);
1522 if (
atom_test == 4 && fabs(flux_mag - 150e3) > 1e-1) {
1524 "atom test %d failed: wrong flux value",
atom_test);
1526 if (
atom_test == 5 && fabs(flux_mag) > 1e-6) {
1528 "atom test %d failed: wrong flux value",
atom_test);
1532 if (dispFieldPtr->size1()) {
1534 auto t_disp = getFTensor1FromMat<SPACE_DIM>(*dispFieldPtr);
1535 auto disp_mag = sqrt(t_disp(
i) * t_disp(
i));
1536 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1537 <<
"Eval point U magnitude: " << disp_mag;
1538 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1539 if (
atom_test == 1 && fabs(disp_mag - 0.00345) > 1e-5) {
1541 "atom test %d failed: wrong displacement value",
1545 fabs(disp_mag - 0.00265) > 1e-5) {
1547 "atom test %d failed: wrong displacement value",
1551 fabs(t_disp(0) - (std::sqrt(std::exp(0.2)) - 1)) > 1e-5 &&
1552 fabs(t_disp(1) - (std::sqrt(std::exp(0.2)) - 1)) > 1e-5) {
1554 "atom test %d failed: wrong displacement value",
1559 if (strainFieldPtr->size1()) {
1562 getFTensor2SymmetricFromMat<SPACE_DIM>(*strainFieldPtr);
1563 auto t_strain_trace = t_strain(
i,
i);
1564 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1565 if (
atom_test == 1 && fabs(t_strain_trace - 0.00679) > 1e-5) {
1567 "atom test %d failed: wrong strain value",
atom_test);
1570 fabs(t_strain_trace - 0.00522) > 1e-5) {
1572 "atom test %d failed: wrong strain value",
atom_test);
1574 if ((
atom_test == 5) && fabs(t_strain_trace - 0.2) > 1e-5) {
1576 "atom test %d failed: wrong strain value",
atom_test);
1580 if (stressFieldPtr->size1()) {
1581 double von_mises_stress;
1582 auto getVonMisesStress = [&](
auto t_stress) {
1584 von_mises_stress = std::sqrt(
1586 ((t_stress(0, 0) - t_stress(1, 1)) *
1587 (t_stress(0, 0) - t_stress(1, 1)) +
1588 (
SPACE_DIM == 3 ? (t_stress(1, 1) - t_stress(2, 2)) *
1589 (t_stress(1, 1) - t_stress(2, 2))
1591 (
SPACE_DIM == 3 ? (t_stress(2, 2) - t_stress(0, 0)) *
1592 (t_stress(2, 2) - t_stress(0, 0))
1594 6 * (t_stress(0, 1) * t_stress(0, 1) +
1595 (
SPACE_DIM == 3 ? t_stress(1, 2) * t_stress(1, 2) : 0) +
1596 (
SPACE_DIM == 3 ? t_stress(2, 0) * t_stress(2, 0) : 0))));
1601 getFTensor2SymmetricFromMat<SPACE_DIM>(*stressFieldPtr);
1602 CHKERR getVonMisesStress(t_stress);
1605 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*stressFieldPtr);
1606 CHKERR getVonMisesStress(t_stress);
1608 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1609 <<
"Eval point von Mises Stress: " << von_mises_stress;
1610 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1611 if (
atom_test == 1 && fabs(von_mises_stress - 523.0) > 5e-1) {
1613 "atom test %d failed: wrong von Mises stress value",
1616 if (
atom_test == 2 && fabs(von_mises_stress - 16.3) > 5e-2) {
1618 "atom test %d failed: wrong von Mises stress value",
1621 if (
atom_test == 3 && fabs(von_mises_stress - 14.9) > 5e-2) {
1623 "atom test %d failed: wrong von Mises stress value",
1626 if (
atom_test == 5 && fabs(von_mises_stress) > 5e-2) {
1628 "atom test %d failed: wrong von Mises stress value",
1639 auto null = boost::shared_ptr<FEMethod>();
1645 auto set_fieldsplit_preconditioner = [&](
auto solver) {
1649 CHKERR TSGetSNES(solver, &snes);
1651 CHKERR SNESGetKSP(snes, &ksp);
1653 CHKERR KSPGetPC(ksp, &pc);
1654 PetscBool is_pcfs = PETSC_FALSE;
1655 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1658 if (is_pcfs == PETSC_TRUE) {
1661 auto name_prb =
simple->getProblemName();
1664 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"U", 0,
1667 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"FLUX", 0, 0,
1670 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"T", 0, 0,
1673 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"TBC", 0, 0,
1676 CHKERR ISExpand(is_T, is_flux, &is_tmp);
1677 CHKERR ISExpand(is_TBC, is_tmp, &is_tmp2);
1678 CHKERR ISDestroy(&is_tmp);
1683 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL, is_TFlux);
1684 CHKERR PCFieldSplitSetIS(pc, PETSC_NULL, is_u);
1692 CHKERR TSSetSolution(solver,
D);
1693 CHKERR TSSetFromOptions(solver);
1695 CHKERR set_section_monitor(solver);
1696 CHKERR set_fieldsplit_preconditioner(solver);
1698 auto [domain_post_proc_fe, skin_post_proc_fe] =
1699 create_post_process_elements();
1700 CHKERR set_time_monitor(dm, solver, domain_post_proc_fe, skin_post_proc_fe);
1703 CHKERR TSSolve(solver, NULL);
1711int main(
int argc,
char *argv[]) {
1714 const char param_file[] =
"param_file.petsc";
1718 auto core_log = logging::core::get();
1732 DMType dm_name =
"DMMOFEM";
1737 moab::Core mb_instance;
1738 moab::Interface &moab = mb_instance;
static auto filter_true_skin(MoFEM::Interface &m_field, Range &&skin)
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
#define MOFEM_LOG_SYNCHRONISE(comm)
Synchronise "SYNC" channel.
#define MOFEM_TAG_AND_LOG(channel, severity, tag)
Tag and log in channel.
#define FTENSOR_INDEX(DIM, I)
void simple(double P1[], double P2[], double P3[], double c[], const int N)
ElementsAndOps< SPACE_DIM >::DomainEle DomainEle
constexpr int SPACE_DIM
[Define dimension]
ElementsAndOps< SPACE_DIM >::BoundaryEle BoundaryEle
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
#define CATCH_ERRORS
Catch errors.
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ L2
field with C-1 continuity
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
@ MOFEM_ATOM_TEST_INVALID
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
PetscErrorCode DMoFEMMeshToLocalVector(DM dm, Vec l, InsertMode mode, ScatterMode scatter_mode)
set local (or ghosted) vector values on mesh for partition only
PetscErrorCode DMRegister_MoFEM(const char sname[])
Register MoFEM problem.
PetscErrorCode DMoFEMLoopFiniteElements(DM dm, const char fe_name[], MoFEM::FEMethod *method, CacheTupleWeakPtr cache_ptr=CacheTupleSharedPtr())
Executes FEMethod for finite elements in DM.
auto createDMVector(DM dm)
Get smart vector from DM.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
SeverityLevel
Severity levels.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
const double n
refractive index of diffusive medium
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasVector< double > VectorDouble
implementation of Data Operators for Forces and Sources
PetscErrorCode DMMoFEMTSSetMonitor(DM dm, TS ts, const std::string fe_name, boost::shared_ptr< MoFEM::FEMethod > method, boost::shared_ptr< MoFEM::BasicMethod > pre_only, boost::shared_ptr< MoFEM::BasicMethod > post_only)
Set Monitor To TS solver.
PetscErrorCode PetscOptionsGetInt(PetscOptions *, const char pre[], const char name[], PetscInt *ivalue, PetscBool *set)
MoFEMErrorCode MoFEMSNESMonitorFields(SNES snes, PetscInt its, PetscReal fgnorm, SnesCtx *ctx)
Sens monitor printing residual field by field.
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
PetscErrorCode PetscOptionsGetScalar(PetscOptions *, const char pre[], const char name[], PetscScalar *dval, PetscBool *set)
PetscErrorCode PetscOptionsGetRealArray(PetscOptions *, const char pre[], const char name[], PetscReal dval[], PetscInt *nmax, PetscBool *set)
auto createVectorMPI(MPI_Comm comm, PetscInt n, PetscInt N)
Create MPI Vector.
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
OpCalculateScalarFieldValuesFromPetscVecImpl< PetscData::CTX_SET_X_T > OpCalculateScalarFieldValuesDot
auto get_temp_meshset_ptr(moab::Interface &moab)
Create smart pointer to temporary meshset.
auto getDMSnesCtx(DM dm)
Get SNES context data structure used by DM.
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,...
OpHdivHdivImpl< SPACE_DIM, IS_LARGE_STRAINS > OpHdivHdiv
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpMass< 1, 1 > OpCapacity
Integrate Lhs base of temperature times (heat capacity) times base of temperature (T x T)
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpBaseTimesScalar< 1 > OpBaseDotT
Integrate Rhs base of temperature time heat capacity times heat rate (T)
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)
OpCalculateQdotQLhs_dU< SPACE_DIM, GAUSS, AssemblyDomainEleOp, IS_LARGE_STRAINS > OpHdivU
Integrate Lhs of flux term coupled to displacement field.
OpHdivFluxImpl< SPACE_DIM, IS_LARGE_STRAINS > OpHdivFlux
FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesTensor< 1, FIELD_DIM, SPACE_DIM > OpGradTimesTensor
constexpr IntegrationType I
constexpr AssemblyType A
[Define dimension]
OpPostProcMapInMoab< SPACE_DIM, SPACE_DIM > OpPPMap
constexpr auto field_name
static constexpr int approx_order
OpBaseImpl< PETSC, EdgeEleOp > OpBase
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpGradTimesTensor< 1, SPACE_DIM, SPACE_DIM > OpInternalForcePiola
FormsIntegrators< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpGradTensorGrad< 1, SPACE_DIM, SPACE_DIM, 1 > OpKPiola
[Only used for dynamics]
FTensor::Index< 'm', 3 > m
Add operators pushing bases from local to physical configuration.
Boundary condition manager for finite element problem setup.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
virtual int get_comm_rank() const =0
static MoFEMErrorCode Initialize(int *argc, char ***args, const char file[], const char help[])
Initializes the MoFEM database PETSc, MOAB and MPI.
static MoFEMErrorCode Finalize()
Checks for options to be called at the conclusion of the program.
Deprecated interface functions.
Definition of the displacement bc data structure.
Data on single entity (This is passed as argument to DataOperator::doWork)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
Class (Function) to enforce essential constrains.
Structure for user loop methods on finite elements.
Field evaluator interface.
Definition of the heat flux bc data structure.
Section manager is used to create indexes and sections.
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.
Natural boundary conditions.
Get vector field for H-div approximation.
Calculate divergence of vector field.
Specialization for double precision scalar field values calculation.
Get field gradients at integration pts for scalar field rank 0, i.e. vector field.
Specialization for double precision vector field values calculation.
Enforce essential constrains on lhs.
Enforce essential constrains on rhs.
Element used to execute operators on side of the element.
Post post-proc data at points from hash maps.
Operator for symmetrizing tensor fields.
Template struct for dimension-specific finite element types.
PipelineManager interface.
Problem manager is used to build and partition problems.
Simple interface for fast problem set-up.
MoFEMErrorCode addDomainField(const std::string name, const FieldSpace space, const FieldApproximationBase base, const FieldCoefficientsNumber nb_of_coefficients, const TagType tag_type=MB_TAG_SPARSE, const enum MoFEMTypes bh=MF_ZERO, int verb=-1)
Add field on domain.
MoFEMErrorCode getOptions()
get options
intrusive_ptr for managing petsc objects
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
auto getHeatCapacityPtr()
auto getHeatConductivityPtr()
VectorDouble coeffExpansion
auto getCoeffExpansionPtr()
MoFEMErrorCode getCommandLineParameters()
MoFEMErrorCode runProblem()
std::array< double, SPACE_DIM > fieldEvalCoords
boost::shared_ptr< MatrixDouble > dispFieldPtr
boost::shared_ptr< MatrixDouble > strainFieldPtr
ThermoElasticProblem(MoFEM::Interface &m_field)
std::array< double, 3 > fieldEvalCoords
boost::shared_ptr< VectorDouble > tempFieldPtr
boost::shared_ptr< MatrixDouble > fluxFieldPtr
MoFEMErrorCode opThermoElasticFactoryDomainRhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, boost::shared_ptr< HenckyOps::CommonData > elastic_common_ptr, boost::shared_ptr< ThermoElasticProblem::BlockedThermalParameters > thermal_common_ptr, boost::shared_ptr< ThermoElasticProblem::BlockedThermoElasticParameters > thermoelastic_common_ptr, Sev sev)
MoFEM::Interface & mField
MoFEMErrorCode setupProblem()
add fields
boost::shared_ptr< MatrixDouble > stressFieldPtr
MoFEMErrorCode opThermoElasticFactoryDomainLhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, std::string coupled_field_name, std::string elastic_block_name, std::string thermal_block_name, std::string thermoelastic_block_name, Sev sev, double scale=1)
MoFEMErrorCode opThermoElasticFactoryDomainLhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, std::string coupled_field_name, boost::shared_ptr< HenckyOps::CommonData > elastic_common_ptr, boost::shared_ptr< ThermoElasticProblem::BlockedThermalParameters > thermal_common_ptr, boost::shared_ptr< ThermoElasticProblem::BlockedThermoElasticParameters > thermoelastic_common_ptr, Sev sev)
MoFEMErrorCode addMatThermalBlockOps(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::string block_name, boost::shared_ptr< BlockedThermalParameters > blockedParamsPtr, Sev sev)
MoFEMErrorCode addMatThermoElasticBlockOps(boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pipeline, std::string block_name, boost::shared_ptr< BlockedThermoElasticParameters > blockedParamsPtr, Sev sev)
boost::shared_ptr< MatrixDouble > dispGradPtr
MoFEMErrorCode opThermoElasticFactoryDomainRhs(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string field_name, std::string elastic_block_name, std::string thermal_block_name, std::string thermoelastic_block_name, Sev sev, double scale=1)
boost::shared_ptr< FieldEvaluatorInterface::SetPtsData > fieldEvalData
ElementsAndOps< SPACE_DIM >::SideEle SideEle
#define FINITE_DEFORMATION_FLAG
constexpr AssemblyType AT
constexpr IntegrationType IT
static char help[]
[Solve]
constexpr bool IS_LARGE_STRAINS
#define EXECUTABLE_DIMENSION
double default_heat_capacity
double default_young_modulus
[Essential boundary conditions (Least square approach)]
double default_coeff_expansion
PetscBool do_output_domain
double default_heat_conductivity
double default_poisson_ratio