9#ifndef EXECUTABLE_DIMENSION
10 #define EXECUTABLE_DIMENSION 3
13#ifndef FINITE_DEFORMATION_FLAG
14 #define FINITE_DEFORMATION_FLAG true
22#include <ThermalConvection.hpp>
23#include <ThermalRadiation.hpp>
46 IntegrationType::GAUSS;
49#include <HenckyOps.hpp>
54#include <FiniteThermalOps.hpp>
58#include <ThermalOps.hpp>
66 DomainNaturalBCRhs::OpFlux<NaturalMeshsetType<BLOCKSET>, 1,
SPACE_DIM>;
68 DomainNaturalBCRhs::OpFlux<NaturalMeshsetType<BLOCKSET>, 1, 1>;
76using OpForce = BoundaryNaturalBC::OpFlux<NaturalForceMeshsets, 1, SPACE_DIM>;
83 GAUSS>::OpEssentialRhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
86 GAUSS>::OpEssentialLhs<HeatFluxCubitBcData, 3, SPACE_DIM>;
113#include <ThermoElasticOps.hpp>
117 DomainNaturalBCRhs::OpFlux<SetTargetTemperature, 1, 1>;
119 DomainNaturalBCLhs::OpFlux<SetTargetTemperature, 1, 1>;
121auto save_range = [](moab::Interface &moab,
const std::string name,
125 CHKERR moab.add_entities(*out_meshset, r);
126 CHKERR moab.write_file(name.c_str(),
"VTK",
"", out_meshset->get_ptr(), 1);
141 boost::shared_ptr<FieldEvaluatorInterface::SetPtsData>
fieldEvalData;
158 :
public boost::enable_shared_from_this<BlockedThermalParameters> {
167 return boost::shared_ptr<double>(shared_from_this(), &
heatCapacity);
172 :
public boost::enable_shared_from_this<BlockedThermoElasticParameters> {
177 return boost::shared_ptr<VectorDouble>(shared_from_this(),
182 return boost::shared_ptr<double>(shared_from_this(), &
refTemp);
187 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
188 std::string block_name,
189 boost::shared_ptr<BlockedThermalParameters> blockedParamsPtr,
Sev sev);
192 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
193 std::string block_name,
194 boost::shared_ptr<BlockedThermoElasticParameters> blockedParamsPtr,
197 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
200 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
202 boost::shared_ptr<HenckyOps::CommonData> elastic_common_ptr,
203 boost::shared_ptr<ThermoElasticProblem::BlockedThermalParameters>
205 boost::shared_ptr<ThermoElasticProblem::BlockedThermoElasticParameters>
206 thermoelastic_common_ptr,
213 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
215 auto coeff_expansion_ptr = thermoelastic_common_ptr->getCoeffExpansionPtr();
216 auto ref_temp_ptr = thermoelastic_common_ptr->getRefTempPtr();
218 new typename H::template OpCalculateHenckyThermalStress<DIM, I, 0>(
219 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
224 "U", elastic_common_ptr->getMatFirstPiolaStress()));
229 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
232 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
233 std::string
field_name, std::string elastic_block_name,
234 std::string thermal_block_name, std::string thermoelastic_block_name,
238 auto elastic_common_ptr = commonDataFactory<DIM, I, DomainEleOp>(
240 auto thermal_common_ptr = boost::make_shared<BlockedThermalParameters>();
243 auto thermoelastic_common_ptr =
244 boost::make_shared<BlockedThermoElasticParameters>();
246 thermoelastic_common_ptr, Sev::inform);
247 CHKERR opThermoElasticFactoryDomainRhs<DIM, A, I, DomainEleOp>(
248 m_field, pip,
field_name, elastic_common_ptr, thermal_common_ptr,
249 thermoelastic_common_ptr, sev);
254 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
257 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
258 std::string
field_name, std::string coupled_field_name,
259 boost::shared_ptr<HenckyOps::CommonData> elastic_common_ptr,
260 boost::shared_ptr<ThermoElasticProblem::BlockedThermalParameters>
262 boost::shared_ptr<ThermoElasticProblem::BlockedThermoElasticParameters>
263 thermoelastic_common_ptr,
269 using OpKPiola =
typename B::template OpGradTensorGrad<1, DIM, DIM, 1>;
272 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
274 auto coeff_expansion_ptr = thermoelastic_common_ptr->getCoeffExpansionPtr();
275 auto ref_temp_ptr = thermoelastic_common_ptr->getRefTempPtr();
277 new typename H::template OpCalculateHenckyThermalStress<DIM, I, 0>(
278 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
280 pip.push_back(
new typename H::template OpHenckyTangent<DIM, I, 0>(
283 elastic_common_ptr->getMatTangent()));
284 pip.push_back(
new typename H::template OpCalculateHenckyThermalStressdT<
286 field_name, coupled_field_name, elastic_common_ptr,
287 coeff_expansion_ptr));
292 template <
int DIM, AssemblyType A, IntegrationType I,
typename DomainEleOp>
295 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
296 std::string
field_name, std::string coupled_field_name,
297 std::string elastic_block_name, std::string thermal_block_name,
298 std::string thermoelastic_block_name,
Sev sev,
double scale = 1) {
301 auto elastic_common_ptr = commonDataFactory<DIM, I, DomainEleOp>(
303 auto thermal_common_ptr = boost::make_shared<BlockedThermalParameters>();
306 auto thermoelastic_common_ptr =
307 boost::make_shared<BlockedThermoElasticParameters>();
309 thermoelastic_common_ptr, Sev::inform);
310 CHKERR opThermoElasticFactoryDomainLhs<DIM, A, I, DomainEleOp>(
311 m_field, pip,
field_name, coupled_field_name, elastic_common_ptr,
312 thermal_common_ptr, thermoelastic_common_ptr, sev);
319 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
320 std::string block_name,
321 boost::shared_ptr<BlockedThermalParameters> blockedParamsPtr,
Sev sev) {
325 OpMatThermalBlocks(boost::shared_ptr<double> conductivity_ptr,
326 boost::shared_ptr<double> capacity_ptr,
328 std::vector<const CubitMeshSets *> meshset_vec_ptr)
330 conductivityPtr(conductivity_ptr), capacityPtr(capacity_ptr) {
332 "Cannot get data from thermal block");
339 for (
auto &b : blockData) {
341 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
342 *conductivityPtr = b.conductivity;
343 *capacityPtr = b.capacity;
361 std::vector<BlockData> blockData;
365 std::vector<const CubitMeshSets *> meshset_vec_ptr,
369 for (
auto m : meshset_vec_ptr) {
371 std::vector<double> block_data;
372 CHKERR m->getAttributes(block_data);
373 if (block_data.size() < 2) {
375 "Expected that block has at least two attributes");
377 auto get_block_ents = [&]() {
380 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
385 <<
m->getName() <<
": conductivity = " << block_data[0]
386 <<
" capacity = " << block_data[1];
388 blockData.push_back({block_data[0], block_data[1], get_block_ents()});
394 boost::shared_ptr<double> conductivityPtr;
395 boost::shared_ptr<double> capacityPtr;
398 pipeline.push_back(
new OpMatThermalBlocks(
399 blockedParamsPtr->getHeatConductivityPtr(),
400 blockedParamsPtr->getHeatCapacityPtr(),
mField, sev,
405 (boost::format(
"%s(.*)") % block_name).str()
415 boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pipeline,
416 std::string block_name,
417 boost::shared_ptr<BlockedThermoElasticParameters> blockedParamsPtr,
421 struct OpMatThermoElasticBlocks :
public DomainEleOp {
422 OpMatThermoElasticBlocks(boost::shared_ptr<VectorDouble> expansion_ptr,
423 boost::shared_ptr<double> ref_temp_ptr,
425 std::vector<const CubitMeshSets *> meshset_vec_ptr)
427 expansionPtr(expansion_ptr), refTempPtr(ref_temp_ptr) {
429 extractThermoElasticBlockData(m_field, meshset_vec_ptr, sev),
430 "Cannot get data from thermoelastic block");
437 for (
auto &b : blockData) {
439 if (b.blockEnts.find(getFEEntityHandle()) != b.blockEnts.end()) {
440 *expansionPtr = b.expansion;
441 *refTempPtr = b.ref_temp;
459 std::vector<BlockData> blockData;
463 std::vector<const CubitMeshSets *> meshset_vec_ptr,
Sev sev) {
466 for (
auto m : meshset_vec_ptr) {
468 std::vector<double> block_data;
469 CHKERR m->getAttributes(block_data);
470 if (block_data.size() < 2) {
472 "Expected that block has at least two attributes");
474 auto get_block_ents = [&]() {
477 m_field.
get_moab().get_entities_by_handle(
m->meshset, ents,
true);
481 auto get_expansion = [&]() {
483 if (block_data.size() > 2) {
484 expansion[1] = block_data[2];
486 if (
SPACE_DIM == 3 && block_data.size() > 3) {
487 expansion[2] = block_data[3];
492 auto coeff_exp_vec = get_expansion();
495 <<
" ref_temp = " << block_data[0]
496 <<
" expansion = " << coeff_exp_vec;
498 blockData.push_back({block_data[0], coeff_exp_vec, get_block_ents()});
504 boost::shared_ptr<VectorDouble> expansionPtr;
505 boost::shared_ptr<double> refTempPtr;
508 pipeline.push_back(
new OpMatThermoElasticBlocks(
509 blockedParamsPtr->getCoeffExpansionPtr(),
510 blockedParamsPtr->getRefTempPtr(),
mField, sev,
515 (boost::format(
"%s(.*)") % block_name).str()
540 auto get_command_line_parameters = [&]() {
606 CHKERR get_command_line_parameters();
624 CHKERR simple->addDomainField(
"FLUX", flux_space, base, 1);
625 CHKERR simple->addBoundaryField(
"FLUX", flux_space, base, 1);
655 auto no_rule = [](
int,
int,
int) {
return -1; };
658 field_eval_fe_ptr->getRuleHook = no_rule;
660 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
661 auto block_thermoelastic_params =
662 boost::make_shared<BlockedThermoElasticParameters>();
663 auto coeff_expansion_ptr =
664 block_thermoelastic_params->getCoeffExpansionPtr();
665 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
668 "MAT_THERMAL", block_thermal_params,
671 field_eval_fe_ptr->getOpPtrVector(),
"MAT_THERMOELASTIC",
672 block_thermoelastic_params, Sev::verbose);
675 field_eval_fe_ptr->getOpPtrVector(), {H1, HDIV});
677 auto hencky_common_data_ptr =
678 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
679 mField, field_eval_fe_ptr->getOpPtrVector(),
"U",
"MAT_ELASTIC",
681 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
682 auto dispGradPtr = hencky_common_data_ptr->matGradPtr;
683 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
685 field_eval_fe_ptr->getOpPtrVector().push_back(
687 field_eval_fe_ptr->getOpPtrVector().push_back(
689 field_eval_fe_ptr->getOpPtrVector().push_back(
691 field_eval_fe_ptr->getOpPtrVector().push_back(
697 field_eval_fe_ptr->getOpPtrVector().push_back(
699 typename H::template OpCalculateHenckyThermalStress<SPACE_DIM, IT, 0>(
700 "U",
tempFieldPtr, hencky_common_data_ptr, coeff_expansion_ptr,
703 field_eval_fe_ptr->getOpPtrVector().push_back(
705 hencky_common_data_ptr->getMatFirstPiolaStress(),
707 field_eval_fe_ptr->getOpPtrVector().push_back(
710 field_eval_fe_ptr->getOpPtrVector().push_back(
711 new typename H::template OpCalculateLogC<SPACE_DIM, IT>(
712 "U", hencky_common_data_ptr));
713 stressFieldPtr = hencky_common_data_ptr->getMatFirstPiolaStress();
732 auto get_skin = [&]() {
737 CHKERR skin.find_skin(0, body_ents,
false, skin_ents);
741 auto filter_flux_blocks = [&](
auto skin,
bool temp_bc =
false) {
742 auto remove_cubit_blocks = [&](
auto c) {
752 skin = subtract(skin, ents);
757 auto remove_named_blocks = [&](
auto n) {
762 (boost::format(
"%s(.*)") %
n).str()
770 skin = subtract(skin, ents);
776 "remove_cubit_blocks");
778 "remove_named_blocks");
781 "remove_cubit_blocks");
790 ParallelComm *pcomm =
792 CHKERR pcomm->filter_pstatus(skin, PSTATUS_SHARED | PSTATUS_MULTISHARED,
793 PSTATUS_NOT, -1, &boundary_ents);
794 return boundary_ents;
798 auto remove_temp_bc_ents =
804 remove_temp_bc_ents);
806 MOFEM_LOG(
"SYNC", Sev::noisy) << remove_flux_ents << endl;
809 MOFEM_LOG(
"SYNC", Sev::noisy) << remove_temp_bc_ents << endl;
822 remove_temp_bc_ents);
827 simple->getProblemName(),
"FLUX", remove_flux_ents);
829 simple->getProblemName(),
"TBC", remove_temp_bc_ents);
831 auto set_init_temp = [](boost::shared_ptr<FieldEntity> field_entity_ptr) {
839 simple->getProblemName(),
"U");
841 simple->getProblemName(),
"FLUX",
false);
857 auto boundary_marker =
858 bc_mng->getMergedBlocksMarker(vector<string>{
"HEATFLUX"});
868 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
869 auto heat_conductivity_ptr = block_thermal_params->getHeatConductivityPtr();
870 auto heat_capacity_ptr = block_thermal_params->getHeatCapacityPtr();
872 auto block_thermoelastic_params =
873 boost::make_shared<BlockedThermoElasticParameters>();
874 auto coeff_expansion_ptr = block_thermoelastic_params->getCoeffExpansionPtr();
875 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
879 boost::make_shared<TimeScale>(
"",
false, [](
const double) {
return 1; });
880 auto def_time_scale = [time_scale](
const double time) {
881 return (!time_scale->argFileScale) ? time : 1;
883 auto def_file_name = [time_scale](
const std::string &&name) {
884 return (!time_scale->argFileScale) ? name :
"";
888 auto time_bodyforce_scaling = boost::make_shared<TimeScale>(
889 def_file_name(
"bodyforce_scale.txt"),
false, def_time_scale);
890 auto time_heatsource_scaling = boost::make_shared<TimeScale>(
891 def_file_name(
"heatsource_scale.txt"),
false, def_time_scale);
892 auto time_temperature_scaling = boost::make_shared<TimeScale>(
893 def_file_name(
"temperature_bc_scale.txt"),
false, def_time_scale);
894 auto time_displacement_scaling = boost::make_shared<TimeScale>(
895 def_file_name(
"displacement_bc_scale.txt"),
false, def_time_scale);
896 auto time_flux_scaling = boost::make_shared<TimeScale>(
897 def_file_name(
"flux_bc_scale.txt"),
false, def_time_scale);
898 auto time_force_scaling = boost::make_shared<TimeScale>(
899 def_file_name(
"force_bc_scale.txt"),
false, def_time_scale);
900 auto time_convection_temp_scaling = boost::make_shared<TimeScale>(
901 def_file_name(
"convection_temp_scale.txt"),
false, def_time_scale);
902 auto time_radiation_temp_scaling = boost::make_shared<TimeScale>(
903 def_file_name(
"radiation_temp_scale.txt"),
false, def_time_scale);
905 auto add_domain_rhs_ops = [&](
auto &pipeline) {
910 block_thermoelastic_params, Sev::inform);
913 auto hencky_common_data_ptr =
914 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
915 mField, pipeline,
"U",
"MAT_ELASTIC", Sev::inform);
916 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
917 auto mat_grad_ptr = hencky_common_data_ptr->matGradPtr;
918 auto mat_strain_ptr = boost::make_shared<MatrixDouble>();
919 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
921 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
922 auto vec_temp_dot_ptr = boost::make_shared<VectorDouble>();
923 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
924 auto vec_temp_div_ptr = boost::make_shared<VectorDouble>();
930 "FLUX", vec_temp_div_ptr));
934 CHKERR opThermoElasticFactoryDomainRhs<SPACE_DIM, AT, IT, DomainEleOp>(
935 mField, pipeline,
"U",
"MAT_ELASTIC",
"MAT_THERMAL",
936 "MAT_THERMOELASTIC", Sev::inform);
938 auto resistance = [heat_conductivity_ptr](
const double,
const double,
940 return (1. / (*heat_conductivity_ptr));
943 auto capacity = [heat_capacity_ptr](
const double,
const double,
945 return -(*heat_capacity_ptr);
951 new OpHdivFlux(
"FLUX", mat_flux_ptr, resistance, mat_grad_ptr));
952 pipeline.push_back(
new OpHDivTemp(
"FLUX", vec_temp_ptr, unity));
953 pipeline.push_back(
new OpBaseDivFlux(
"T", vec_temp_div_ptr, unity));
954 pipeline.push_back(
new OpBaseDotT(
"T", vec_temp_dot_ptr, capacity));
957 CHKERR DomainNaturalBCRhs::AddFluxToPipeline<OpHeatSource>::add(
958 pipeline,
mField,
"T", {time_scale, time_heatsource_scaling},
959 "HEAT_SOURCE", Sev::inform);
960 CHKERR DomainNaturalBCRhs::AddFluxToPipeline<OpBodyForce>::add(
961 pipeline,
mField,
"U", {time_scale, time_bodyforce_scaling},
962 "BODY_FORCE", Sev::inform);
963 CHKERR DomainNaturalBCRhs::AddFluxToPipeline<OpSetTemperatureRhs>::add(
964 pipeline,
mField,
"T", vec_temp_ptr,
"SETTEMP", Sev::inform);
969 auto add_domain_lhs_ops = [&](
auto &pipeline) {
974 block_thermoelastic_params,
978 auto hencky_common_data_ptr =
979 HenckyOps::commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
980 mField, pipeline,
"U",
"MAT_ELASTIC", Sev::inform, 1);
981 auto mat_D_ptr = hencky_common_data_ptr->matDPtr;
982 auto mat_grad_ptr = hencky_common_data_ptr->matGradPtr;
984 auto resistance = [heat_conductivity_ptr](
const double,
const double,
986 return (1. / (*heat_conductivity_ptr));
988 auto capacity = [heat_capacity_ptr](
const double,
const double,
990 return -(*heat_capacity_ptr);
993 new OpHdivHdiv(
"FLUX",
"FLUX", resistance, mat_grad_ptr));
995 new OpHdivT(
"FLUX",
"T", []()
constexpr {
return -1; },
true));
997 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
1002 new OpHdivU(
"FLUX",
"U", mat_flux_ptr, resistance, mat_grad_ptr));
1004 CHKERR opThermoElasticFactoryDomainLhs<SPACE_DIM, AT, IT, DomainEleOp>(
1005 mField, pipeline,
"U",
"T",
"MAT_ELASTIC",
"MAT_THERMAL",
1006 "MAT_THERMOELASTIC", Sev::inform);
1008 auto op_capacity =
new OpCapacity(
"T",
"T", capacity);
1009 op_capacity->feScalingFun = [](
const FEMethod *fe_ptr) {
1010 return fe_ptr->ts_a;
1012 pipeline.push_back(op_capacity);
1014 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
1016 CHKERR DomainNaturalBCLhs::AddFluxToPipeline<OpSetTemperatureLhs>::add(
1017 pipeline,
mField,
"T", vec_temp_ptr,
"SETTEMP", Sev::verbose);
1022 auto add_boundary_rhs_ops = [&](
auto &pipeline) {
1027 CHKERR BoundaryNaturalBC::AddFluxToPipeline<OpForce>::add(
1028 pipeline,
mField,
"U", {time_scale, time_force_scaling},
"FORCE",
1034 BoundaryNaturalBC::OpFlux<NaturalTemperatureMeshsets, 3, SPACE_DIM>;
1035 CHKERR BoundaryNaturalBC::AddFluxToPipeline<OpTemperatureBC>::add(
1036 pipeline,
mField,
"FLUX", {time_scale, time_temperature_scaling},
1037 "TEMPERATURE", Sev::inform);
1045 BoundaryNaturalBC::OpFlux<NaturalMeshsetType<HEATFLUXSET>, 1, 1>;
1046 CHKERR BoundaryNaturalBC::AddFluxToPipeline<OpFluxBC>::add(
1047 pipeline,
mField,
"TBC", {time_scale, time_flux_scaling},
"FLUX",
1051 using OpConvectionRhsBC =
1052 T::OpFlux<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1>;
1053 using OpRadiationRhsBC =
1054 T::OpFlux<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1>;
1055 auto temp_bc_ptr = boost::make_shared<VectorDouble>();
1057 T::AddFluxToPipeline<OpConvectionRhsBC>::add(
1058 pipeline,
mField,
"TBC", temp_bc_ptr,
1059 {time_scale, time_convection_temp_scaling},
"CONVECTION", Sev::inform);
1060 T::AddFluxToPipeline<OpRadiationRhsBC>::add(
1061 pipeline,
mField,
"TBC", temp_bc_ptr,
1062 {time_scale, time_radiation_temp_scaling},
"RADIATION", Sev::inform);
1064 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
1073 struct OpTBCTimesNormalFlux
1078 OpTBCTimesNormalFlux(
const std::string
field_name,
1079 boost::shared_ptr<MatrixDouble> vec,
1080 boost::shared_ptr<Range> ents_ptr =
nullptr)
1087 auto t_w = OP::getFTensor0IntegrationWeight();
1091 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1093 auto t_vec = getFTensor1FromMat<SPACE_DIM, 1>(*sourceVec);
1095 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1097 const double alpha = t_w * (t_vec(
i) * t_normal(
i));
1100 for (; rr != OP::nbRows; ++rr) {
1101 OP::locF[rr] += alpha * t_row_base;
1104 for (; rr < OP::nbRowBaseFunctions; ++rr)
1110 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1111 if (fe_type == MBTRI) {
1118 boost::shared_ptr<MatrixDouble> sourceVec;
1120 pipeline.push_back(
new OpTBCTimesNormalFlux(
"TBC", mat_flux_ptr));
1122 struct OpBaseNormalTimesTBC
1127 OpBaseNormalTimesTBC(
const std::string
field_name,
1128 boost::shared_ptr<VectorDouble> vec,
1129 boost::shared_ptr<Range> ents_ptr =
nullptr)
1136 auto t_w = OP::getFTensor0IntegrationWeight();
1140 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1142 auto t_vec = getFTensor0FromVec(*sourceVec);
1144 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1146 const double alpha = t_w * t_vec;
1149 for (; rr != OP::nbRows; ++rr) {
1150 OP::locF[rr] += alpha * (t_row_base(
i) * t_normal(
i));
1153 for (; rr < OP::nbRowBaseFunctions; ++rr)
1159 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1160 if (fe_type == MBTRI) {
1167 boost::shared_ptr<VectorDouble> sourceVec;
1170 pipeline.push_back(
new OpBaseNormalTimesTBC(
"FLUX", temp_bc_ptr));
1175 auto add_boundary_lhs_ops = [&](
auto &pipeline) {
1182 using OpConvectionLhsBC =
1183 T::OpFlux<ThermoElasticOps::ConvectionBcType<BLOCKSET>, 1, 1>;
1184 using OpRadiationLhsBC =
1185 T::OpFlux<ThermoElasticOps::RadiationBcType<BLOCKSET>, 1, 1>;
1186 auto temp_bc_ptr = boost::make_shared<VectorDouble>();
1188 T::AddFluxToPipeline<OpConvectionLhsBC>::add(pipeline,
mField,
"TBC",
"TBC",
1189 "CONVECTION", Sev::verbose);
1190 T::AddFluxToPipeline<OpRadiationLhsBC>::add(
1191 pipeline,
mField,
"TBC",
"TBC", temp_bc_ptr,
"RADIATION", Sev::verbose);
1198 struct OpTBCTimesNormalFlux
1203 OpTBCTimesNormalFlux(
const std::string row_field_name,
1204 const std::string col_field_name,
1205 boost::shared_ptr<Range> ents_ptr =
nullptr)
1206 :
OP(row_field_name, col_field_name,
OP::OPROWCOL, ents_ptr) {
1208 this->assembleTranspose =
true;
1209 this->onlyTranspose =
false;
1219 auto t_w = OP::getFTensor0IntegrationWeight();
1223 auto t_normal = OP::getFTensor1NormalsAtGaussPts();
1225 for (
int gg = 0; gg != OP::nbIntegrationPts; gg++) {
1227 auto a_mat_ptr = &*OP::locMat.data().begin();
1229 for (; rr != OP::nbRows; rr++) {
1231 const double alpha = t_w * t_row_base;
1235 for (
int cc = 0; cc != OP::nbCols; cc++) {
1239 *a_mat_ptr += alpha * (t_col_base(
i) * t_normal(
i));
1245 for (; rr < OP::nbRowBaseFunctions; ++rr)
1250 EntityType fe_type = OP::getNumeredEntFiniteElementPtr()->getEntType();
1251 if (fe_type == MBTRI) {
1258 pipeline.push_back(
new OpTBCTimesNormalFlux(
"TBC",
"FLUX"));
1264 auto get_bc_hook_rhs = [&]() {
1266 mField, pipeline_mng->getDomainRhsFE(),
1267 {time_scale, time_displacement_scaling});
1270 auto get_bc_hook_lhs = [&]() {
1272 mField, pipeline_mng->getDomainLhsFE(),
1273 {time_scale, time_displacement_scaling});
1277 pipeline_mng->getDomainRhsFE()->preProcessHook = get_bc_hook_rhs();
1278 pipeline_mng->getDomainLhsFE()->preProcessHook = get_bc_hook_lhs();
1280 CHKERR add_domain_rhs_ops(pipeline_mng->getOpDomainRhsPipeline());
1281 CHKERR add_domain_lhs_ops(pipeline_mng->getOpDomainLhsPipeline());
1282 CHKERR add_boundary_rhs_ops(pipeline_mng->getOpBoundaryRhsPipeline());
1283 CHKERR add_boundary_lhs_ops(pipeline_mng->getOpBoundaryLhsPipeline());
1297 auto dm =
simple->getDM();
1298 auto solver = pipeline_mng->createTSIM();
1301 auto set_section_monitor = [&](
auto solver) {
1304 CHKERR TSGetSNES(solver, &snes);
1305 CHKERR SNESMonitorSet(snes,
1308 (
void *)(snes_ctx_ptr.get()),
nullptr);
1312 auto create_post_process_elements = [&]() {
1313 auto block_thermal_params = boost::make_shared<BlockedThermalParameters>();
1315 auto block_thermoelastic_params =
1316 boost::make_shared<BlockedThermoElasticParameters>();
1317 auto coeff_expansion_ptr =
1318 block_thermoelastic_params->getCoeffExpansionPtr();
1319 auto ref_temp_ptr = block_thermoelastic_params->getRefTempPtr();
1321 auto u_ptr = boost::make_shared<MatrixDouble>();
1322 auto mat_grad_ptr = boost::make_shared<MatrixDouble>();
1323 auto mat_strain_ptr = boost::make_shared<MatrixDouble>();
1324 auto mat_stress_ptr = boost::make_shared<MatrixDouble>();
1325 auto vec_temp_ptr = boost::make_shared<VectorDouble>();
1326 auto mat_flux_ptr = boost::make_shared<MatrixDouble>();
1328 auto push_domain_ops = [&](
auto &pp_fe) {
1330 auto &pip = pp_fe->getOpPtrVector();
1335 pip,
"MAT_THERMOELASTIC", block_thermoelastic_params, Sev::verbose);
1345 "U", mat_grad_ptr));
1346 auto elastic_common_ptr = commonDataFactory<SPACE_DIM, IT, DomainEleOp>(
1347 mField, pip,
"U",
"MAT_ELASTIC", Sev::inform);
1351 typename H::template OpCalculateHenckyThermalStress<SPACE_DIM, IT, 0>(
1352 "U", vec_temp_ptr, elastic_common_ptr, coeff_expansion_ptr,
1356 elastic_common_ptr->getMatFirstPiolaStress(), mat_stress_ptr));
1360 mat_stress_ptr = elastic_common_ptr->getMatFirstPiolaStress();
1361 mat_strain_ptr = elastic_common_ptr->getMatLogC();
1367 auto push_post_proc_ops = [&](
auto &pp_fe) {
1369 auto &pip = pp_fe->getOpPtrVector();
1377 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
1379 {{
"T", vec_temp_ptr}},
1381 {{
"U", u_ptr}, {
"FLUX", mat_flux_ptr}},
1385 {{
"CAUCHY", mat_stress_ptr}, {
"STRAIN", mat_strain_ptr}}
1395 pp_fe->getPostProcMesh(), pp_fe->getMapGaussPts(),
1397 {{
"T", vec_temp_ptr}},
1399 {{
"U", u_ptr}, {
"FLUX", mat_flux_ptr}},
1401 {{
"PIOLA", mat_stress_ptr}},
1403 {{
"HENCKY_STRAIN", mat_strain_ptr}}
1413 auto domain_post_proc = [&]() {
1415 return boost::shared_ptr<PostProcEle>();
1416 auto pp_fe = boost::make_shared<PostProcEle>(mField);
1418 "push domain ops to domain element");
1420 "push post proc ops to domain element");
1424 auto skin_post_proc = [&]() {
1426 return boost::shared_ptr<SkinPostProcEle>();
1427 auto pp_fe = boost::make_shared<SkinPostProcEle>(mField);
1432 "push domain ops to side element");
1433 pp_fe->getOpPtrVector().push_back(op_side);
1435 "push post proc ops to skin element");
1439 return std::make_pair(domain_post_proc(), skin_post_proc());
1442 auto monitor_ptr = boost::make_shared<FEMethod>();
1444 auto set_time_monitor = [&](
auto dm,
auto solver,
auto domain_post_proc_fe,
1445 auto skin_post_proc_fe) {
1447 monitor_ptr->preProcessHook = [&]() {
1453 domain_post_proc_fe,
1454 monitor_ptr->getCacheWeakPtr());
1455 CHKERR domain_post_proc_fe->writeFile(
1456 "out_" + boost::lexical_cast<std::string>(monitor_ptr->ts_step) +
1462 monitor_ptr->getCacheWeakPtr());
1463 CHKERR skin_post_proc_fe->writeFile(
1465 boost::lexical_cast<std::string>(monitor_ptr->ts_step) +
".h5m");
1472 ->evalFEAtThePoint<SPACE_DIM>(
1473 fieldEvalCoords.data(), 1e-12,
simple->getProblemName(),
1474 simple->getDomainFEName(), fieldEvalData,
1481 CHKERR VecZeroEntries(eval_num_vec);
1482 if (tempFieldPtr->size()) {
1483 CHKERR VecSetValue(eval_num_vec, 0, 1, ADD_VALUES);
1485 CHKERR VecAssemblyBegin(eval_num_vec);
1486 CHKERR VecAssemblyEnd(eval_num_vec);
1489 CHKERR VecSum(eval_num_vec, &eval_num);
1490 if (!(
int)eval_num) {
1492 "atom test %d failed: did not find elements to evaluate "
1493 "the field, check the coordinates",
1498 if (tempFieldPtr->size()) {
1499 auto t_temp = getFTensor0FromVec(*tempFieldPtr);
1500 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1501 <<
"Eval point T: " << t_temp;
1502 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1503 if (
atom_test <= 3 && fabs(t_temp - 554.48) > 1e-2) {
1505 "atom test %d failed: wrong temperature value",
1508 if (
atom_test == 4 && fabs(t_temp - 250) > 1e-2) {
1510 "atom test %d failed: wrong temperature value",
1513 if (
atom_test == 5 && fabs(t_temp - 1) > 1e-2) {
1515 "atom test %d failed: wrong temperature value",
1520 if (fluxFieldPtr->size1()) {
1522 auto t_flux = getFTensor1FromMat<SPACE_DIM>(*fluxFieldPtr);
1523 auto flux_mag = sqrt(t_flux(
i) * t_flux(
i));
1524 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1525 <<
"Eval point FLUX magnitude: " << flux_mag;
1526 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1527 if (
atom_test <= 3 && fabs(flux_mag - 27008.0) > 2e1) {
1529 "atom test %d failed: wrong flux value",
atom_test);
1531 if (
atom_test == 4 && fabs(flux_mag - 150e3) > 1e-1) {
1533 "atom test %d failed: wrong flux value",
atom_test);
1535 if (
atom_test == 5 && fabs(flux_mag) > 1e-6) {
1537 "atom test %d failed: wrong flux value",
atom_test);
1541 if (dispFieldPtr->size1()) {
1543 auto t_disp = getFTensor1FromMat<SPACE_DIM>(*dispFieldPtr);
1544 auto disp_mag = sqrt(t_disp(
i) * t_disp(
i));
1545 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1546 <<
"Eval point U magnitude: " << disp_mag;
1547 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1548 if (
atom_test == 1 && fabs(disp_mag - 0.00345) > 1e-5) {
1550 "atom test %d failed: wrong displacement value",
1554 fabs(disp_mag - 0.00265) > 1e-5) {
1556 "atom test %d failed: wrong displacement value",
1560 fabs(t_disp(0) - (std::sqrt(std::exp(0.2)) - 1)) > 1e-5 &&
1561 fabs(t_disp(1) - (std::sqrt(std::exp(0.2)) - 1)) > 1e-5) {
1563 "atom test %d failed: wrong displacement value",
1568 if (strainFieldPtr->size1()) {
1571 getFTensor2SymmetricFromMat<SPACE_DIM>(*strainFieldPtr);
1572 auto t_strain_trace = t_strain(
i,
i);
1573 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1574 if (
atom_test == 1 && fabs(t_strain_trace - 0.00679) > 1e-5) {
1576 "atom test %d failed: wrong strain value",
atom_test);
1579 fabs(t_strain_trace - 0.00522) > 1e-5) {
1581 "atom test %d failed: wrong strain value",
atom_test);
1583 if ((
atom_test == 5) && fabs(t_strain_trace - 0.2) > 1e-5) {
1585 "atom test %d failed: wrong strain value",
atom_test);
1589 if (stressFieldPtr->size1()) {
1590 double von_mises_stress;
1591 auto getVonMisesStress = [&](
auto t_stress) {
1593 von_mises_stress = std::sqrt(
1595 ((t_stress(0, 0) - t_stress(1, 1)) *
1596 (t_stress(0, 0) - t_stress(1, 1)) +
1597 (
SPACE_DIM == 3 ? (t_stress(1, 1) - t_stress(2, 2)) *
1598 (t_stress(1, 1) - t_stress(2, 2))
1600 (
SPACE_DIM == 3 ? (t_stress(2, 2) - t_stress(0, 0)) *
1601 (t_stress(2, 2) - t_stress(0, 0))
1603 6 * (t_stress(0, 1) * t_stress(0, 1) +
1604 (
SPACE_DIM == 3 ? t_stress(1, 2) * t_stress(1, 2) : 0) +
1605 (
SPACE_DIM == 3 ? t_stress(2, 0) * t_stress(2, 0) : 0))));
1610 getFTensor2SymmetricFromMat<SPACE_DIM>(*stressFieldPtr);
1611 CHKERR getVonMisesStress(t_stress);
1614 getFTensor2FromMat<SPACE_DIM, SPACE_DIM>(*stressFieldPtr);
1615 CHKERR getVonMisesStress(t_stress);
1617 MOFEM_LOG(
"ThermoElasticSync", Sev::inform)
1618 <<
"Eval point von Mises Stress: " << von_mises_stress;
1619 if (
atom_test && fabs(monitor_ptr->ts_t - 10) < 1e-12) {
1620 if (
atom_test == 1 && fabs(von_mises_stress - 523.0) > 5e-1) {
1622 "atom test %d failed: wrong von Mises stress value",
1625 if (
atom_test == 2 && fabs(von_mises_stress - 16.3) > 5e-2) {
1627 "atom test %d failed: wrong von Mises stress value",
1630 if (
atom_test == 3 && fabs(von_mises_stress - 14.9) > 5e-2) {
1632 "atom test %d failed: wrong von Mises stress value",
1635 if (
atom_test == 5 && fabs(von_mises_stress) > 5e-2) {
1637 "atom test %d failed: wrong von Mises stress value",
1648 auto null = boost::shared_ptr<FEMethod>();
1654 auto set_fieldsplit_preconditioner = [&](
auto solver) {
1658 CHKERR TSGetSNES(solver, &snes);
1660 CHKERR SNESGetKSP(snes, &ksp);
1662 CHKERR KSPGetPC(ksp, &pc);
1663 PetscBool is_pcfs = PETSC_FALSE;
1664 PetscObjectTypeCompare((PetscObject)pc, PCFIELDSPLIT, &is_pcfs);
1667 if (is_pcfs == PETSC_TRUE) {
1669 auto name_prb =
simple->getProblemName();
1672 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"U", 0,
1675 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"FLUX", 0, 0,
1678 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"T", 0, 0,
1681 CHKERR is_mng->isCreateProblemFieldAndRank(name_prb,
ROW,
"TBC", 0, 0,
1684 CHKERR ISExpand(is_T, is_flux, &is_tmp);
1685 CHKERR ISExpand(is_TBC, is_tmp, &is_tmp2);
1686 CHKERR ISDestroy(&is_tmp);
1691 CHKERR PCFieldSplitSetIS(pc, PETSC_NULLPTR, is_TFlux);
1692 CHKERR PCFieldSplitSetIS(pc, PETSC_NULLPTR, is_u);
1699 CHKERR TSSetIJacobian(solver,
B,
B, PETSC_NULLPTR, PETSC_NULLPTR);
1702 CHKERR TSSetSolution(solver,
D);
1703 CHKERR TSSetFromOptions(solver);
1705 CHKERR set_section_monitor(solver);
1706 CHKERR set_fieldsplit_preconditioner(solver);
1708 auto [domain_post_proc_fe, skin_post_proc_fe] =
1709 create_post_process_elements();
1710 CHKERR set_time_monitor(dm, solver, domain_post_proc_fe, skin_post_proc_fe);
1713 CHKERR TSSolve(solver, NULL);
1719static char help[] =
"...\n\n";
1721int main(
int argc,
char *argv[]) {
1724 const char param_file[] =
"param_file.petsc";
1728 auto core_log = logging::core::get();
1730 LogManager::createSink(LogManager::getStrmWorld(),
"ThermoElastic"));
1731 LogManager::setLog(
"ThermoElastic");
1735 LogManager::createSink(LogManager::getStrmSync(),
"ThermoElasticSync"));
1736 LogManager::setLog(
"ThermoElasticSync");
1742 DMType dm_name =
"DMMOFEM";
1747 moab::Core mb_instance;
1748 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
#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.
auto createDMMatrix(DM dm)
Get smart matrix from DM.
#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.
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]
BoundaryNaturalBC::OpFlux< NaturalTemperatureMeshsets, 3, SPACE_DIM > OpTemperatureBC
FTensor::Index< 'm', 3 > m
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.
Field evaluator interface.
Definition of the heat flux bc data structure.
Section manager is used to create indexes and sections.
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.
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.
MoFEMErrorCode setDomainRhsIntegrationRule(RuleHookFun rule)
Set integration rule for domain right-hand side finite element.
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()
[Run problem]
MoFEMErrorCode runProblem()
[Run problem]
boost::shared_ptr< MatrixDouble > dispFieldPtr
boost::shared_ptr< MatrixDouble > strainFieldPtr
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
MoFEMErrorCode bC()
[Set up problem]
boost::shared_ptr< MatrixDouble > stressFieldPtr
MoFEMErrorCode OPs()
[Boundary condition]
MoFEMErrorCode tsSolve()
[Push operators to pipeline]
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
boost::shared_ptr< FieldEvaluatorInterface::SetPtsData > fieldEvalData
constexpr AssemblyType AT
constexpr IntegrationType IT
ElementsAndOps< SPACE_DIM >::SideEle SideEle
#define EXECUTABLE_DIMENSION
PostProcBrokenMeshInMoab< BoundaryEle > SkinPostProcEle
#define FINITE_DEFORMATION_FLAG
NaturalBC< DomainEleOp >::Assembly< PETSC >::LinearForm< GAUSS > DomainNaturalBCRhs
[Thermal problem]
BoundaryNaturalBC::OpFlux< NaturalForceMeshsets, 1, SPACE_DIM > OpForce
constexpr bool IS_LARGE_STRAINS
DomainNaturalBCRhs::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, 1 > OpHeatSource
double default_heat_capacity
EssentialBC< BoundaryEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS >::OpEssentialLhs< HeatFluxCubitBcData, 3, SPACE_DIM > OpEssentialFluxLhs
DomainNaturalBCRhs::OpFlux< NaturalMeshsetType< BLOCKSET >, 1, SPACE_DIM > OpBodyForce
DomainNaturalBCLhs::OpFlux< SetTargetTemperature, 1, 1 > OpSetTemperatureLhs
NaturalBC< DomainEleOp >::Assembly< PETSC >::BiLinearForm< GAUSS > DomainNaturalBCLhs
double default_young_modulus
[Essential boundary conditions (Least square approach)]
DomainNaturalBCRhs::OpFlux< SetTargetTemperature, 1, 1 > OpSetTemperatureRhs
double default_coeff_expansion
PetscBool do_output_domain
EssentialBC< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS >::OpEssentialRhs< HeatFluxCubitBcData, 3, SPACE_DIM > OpEssentialFluxRhs
[Natural boundary conditions]
double default_heat_conductivity
NaturalBC< BoundaryEleOp >::Assembly< PETSC >::LinearForm< GAUSS > BoundaryNaturalBC
[Body and heat source]
double default_poisson_ratio