[block_1001]
# Example applying attributes to blockset
id=2001
user1=1.0 # attribute value 1
user2=2.0 # you can set up to 10 attributes (if needed could be easily
extended to more, let us know)
user3=3.0
[block_1002]
# Example applying material block (isotropic elastic material)
id=2002
name=MAT_ELASTIC
young=10
poisson=0.25
thermalexpansion=0
[block_1003]
# Example applying displacement constrains
id=2003
# Each flag means that boundary consition on displacements is set.
disp_flag1=1 # Setting constrains in x- direction
disp_flag2=1 # Setting constrains in y- direction
disp_flag3=1 # Setting constrains in z- direction
disp_flag4=1 # Setting constrains on rotation over x- axis
disp_flag5=1 # Setting constrains on rotation over y- axis
disp_flag6=1 # Setting constrains on rotation over z-axis
disp_ux=1 # value of disp in x- direction
disp_uy=2
disp_uz=3
disp_rx=4 # value of rotation in y-direction
disp_ry=5
disp_rz=6
# Note above values could be interpreted differently if needed.
[block_1004]
# Example applying force boundary conditions
id=2004
force_magnitude=1
moment_magnitude=1
force_fx=1
force_fy=1
force_fz=1
moment_mx=1
moment_my=1
moment_mz=1
[block_1005]
# Example applying pressure boundary conditions
id=2005
pressure_flag2=1 # 0: Pressure is interpreted as pure pressure 1:
pressure is interpreted as total force
pressure_magnitude=1
# Example applying temperature boundary conditions
[block_1006]
id=2006
temperature_flag1=1 # 0:
N/
A, 1: temperature value applied
temperature_t=1
[block_1007]
id=2007
heatflux_flag1=1 # 0:
N/
A, 1: heat flux applied
heatflux_magnitude=1
[block_1008]
# Example applying material block (isotropic thermal material)
id=2008
name=MAT_THERMAL # Hast to be set for Thermal Mat
conductivity=1
capacity=1
[block_1009]
# Example applying interface
id=2009
interface_type=1
[block_1010]
# Example applying material block for interface element
id=2010
name=MAT_INTERF
interface_alpha = 1
interface_beta = 0
interface_ft = 1
interface_Gf = 1
[block_1009]
# Example applying material block (isotropic trans iso material)
id=2011
name=MAT_ELASTIC_TRANS_ISO
Youngp=1
Youngz=2
Poissonp=3
Poissonpz=4
Shearzp=5
[SET_ATTR_foo]
# Example set atttributes to block name "foo"
number_of_attributes=3
user1=1
user2=2
user3=3
795 std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
796 po::variables_map vm;
797 if (clean_file_options) {
799 boost::shared_ptr<boost::program_options::options_description>(
800 new po::options_description());
803 auto add_block_attributes = [&](
auto prefix,
auto &block_lists,
auto &it) {
806 (prefix +
".number_of_attributes").c_str(),
807 po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
809 "Number of blockset attribute");
810 for (
int ii = 1; ii <= 10; ii++) {
811 std::string surfix =
".user" + boost::lexical_cast<std::string>(ii);
813 (prefix + surfix).c_str(),
814 po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
815 ->default_value(0.0),
816 "Add block attribute");
821 map<int, BlockData> block_lists;
823 block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
825 "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
827 (prefix +
".add").c_str(),
828 po::value<string>(&block_lists[it->getMeshsetId()].addType)
829 ->default_value(
"UNKNOWNSET"),
831 (prefix +
".id").c_str(),
832 po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
834 (prefix +
".name").c_str(),
835 po::value<string>(&block_lists[it->getMeshsetId()].nAme)
837 "Name of the meshset");
840 add_block_attributes(prefix, block_lists, it);
848 (prefix +
".young").c_str(),
850 &block_lists[it->getMeshsetId()].matElastic.data.Young)
853 (prefix +
".poisson").c_str(),
855 &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
858 (prefix +
".thermalexpansion").c_str(),
860 &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
862 "Thermal expansion");
873 (prefix +
".Youngp").c_str(),
875 &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
878 (prefix +
".Youngz").c_str(),
880 &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
883 (prefix +
".Poissonp").c_str(),
885 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
888 (prefix +
".Poissonpz").c_str(),
890 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
893 (prefix +
".Shearzp").c_str(),
895 &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
905 (prefix +
".conductivity").c_str(),
907 &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
910 (prefix +
".capacity").c_str(),
912 &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
924 (prefix +
".interface_alpha").c_str(),
926 &block_lists[it->getMeshsetId()].matInterf.data.alpha)
928 "alpha")((prefix +
".interface_beta").c_str(),
930 &block_lists[it->getMeshsetId()].matInterf.data.beta)
933 (prefix +
".interface_ft").c_str(),
934 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
937 (prefix +
".interface_Gf").c_str(),
938 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
959 (prefix +
".disp_flag1").c_str(),
960 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
963 (prefix +
".disp_flag2").c_str(),
964 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
967 (prefix +
".disp_flag3").c_str(),
968 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
971 (prefix +
".disp_flag4").c_str(),
972 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
975 (prefix +
".disp_flag5").c_str(),
976 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
979 (prefix +
".disp_flag6").c_str(),
980 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
983 (prefix +
".disp_ux").c_str(),
984 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
987 (prefix +
".disp_uy").c_str(),
988 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
991 (prefix +
".disp_uz").c_str(),
992 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
995 (prefix +
".disp_rx").c_str(),
996 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
999 (prefix +
".disp_ry").c_str(),
1000 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
1003 (prefix +
".disp_rz").c_str(),
1004 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
1021 (prefix +
".force_magnitude").c_str(),
1023 &block_lists[it->getMeshsetId()].forceBc.data.value1)
1025 "value1")((prefix +
".moment_magnitude").c_str(),
1027 &block_lists[it->getMeshsetId()].forceBc.data.value2)
1030 (prefix +
".force_fx").c_str(),
1032 &block_lists[it->getMeshsetId()].forceBc.data.value3)
1034 "value3")((prefix +
".force_fy").c_str(),
1036 &block_lists[it->getMeshsetId()].forceBc.data.value4)
1039 (prefix +
".force_fz").c_str(),
1041 &block_lists[it->getMeshsetId()].forceBc.data.value5)
1043 "value5")((prefix +
".moment_mx").c_str(),
1045 &block_lists[it->getMeshsetId()].forceBc.data.value6)
1048 (prefix +
".moment_my").c_str(),
1050 &block_lists[it->getMeshsetId()].forceBc.data.value7)
1052 "value7")((prefix +
".moment_mz").c_str(),
1054 &block_lists[it->getMeshsetId()].forceBc.data.value8)
1075 (prefix +
".temperature_flag1").c_str(),
1077 &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
1080 (prefix +
".temperature_t").c_str(),
1082 &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1095 (prefix +
".pressure_flag2").c_str(),
1097 &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1099 "flag2")((prefix +
".pressure_magnitude").c_str(),
1101 &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1117 (prefix +
".heatflux_flag1").c_str(),
1119 &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1121 "flag1")((prefix +
".heatflux_magnitude").c_str(),
1123 &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1130 (prefix +
".interface_type").c_str(),
1131 po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1137 map<int, BlockData> block_set_attributes;
1139 block_set_attributes[it->getMeshsetId()].cubitMeshset = it->getMeshset();
1140 block_set_attributes[it->getMeshsetId()].iD = it->getMeshsetId();
1141 block_set_attributes[it->getMeshsetId()].bcType =
BLOCKSET;
1142 std::string block_name = it->getName();
1144 std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1146 block_set_attributes[it->getMeshsetId()].nAme = block_name;
1148 if (block_name.compare(
"NoNameSet") != 0) {
1149 std::string prefix =
"SET_ATTR_" + block_name;
1151 add_block_attributes(prefix, block_set_attributes, it);
1155 po::parsed_options parsed =
1167 block_lists[it->getMeshsetId()].addType) {
1172 if (bc_type.none()) {
1173 block_lists[it->getMeshsetId()].bcType =
UNKNOWNSET;
1178 if (bc_type.to_ulong() ==
BLOCKSET)
1179 block_lists[it->getMeshsetId()].bcType =
BLOCKSET;
1180 else if (bc_type.to_ulong() ==
NODESET)
1181 block_lists[it->getMeshsetId()].bcType =
NODESET;
1182 else if (bc_type.to_ulong() ==
SIDESET)
1183 block_lists[it->getMeshsetId()].bcType =
SIDESET;
1186 "Not yet implemented type %s\n",
1187 block_lists[it->getMeshsetId()].addType.c_str());
1189 if (block_lists[it->getMeshsetId()].iD == -1) {
1191 "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1195 std::vector<std::string> additional_parameters;
1196 additional_parameters =
1197 collect_unrecognized(parsed.options, po::include_positional);
1198 for (std::vector<std::string>::iterator vit = additional_parameters.begin();
1199 vit != additional_parameters.end(); vit++) {
1200 MOFEM_LOG_C(
"MeshsetMngSelf", Sev::warning,
"Unrecognized option %s",
1203 for (map<int, BlockData>::iterator mit = block_lists.begin();
1204 mit != block_lists.end(); mit++) {
1205 CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1209 "Data inconsistency\n");
1211 switch (mit->second.bcType) {
1215 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1217 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1229 if (mit->second.matElastic.data.Young != -1) {
1231 mit->second.matElastic);
1233 if (mit->second.matTransIso.data.Youngp != -1) {
1235 mit->second.matTransIso);
1237 if (mit->second.matThermal.data.Conductivity != -1) {
1239 mit->second.matThermal);
1241 if (mit->second.matInterf.data.ft != -1) {
1243 mit->second.matInterf);
1247 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1249 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1258 if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
1259 mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
1260 mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
1261 if (mit->second.dispBc.data.flag1 ==
'0')
1262 mit->second.dispBc.data.flag1 = 0;
1263 if (mit->second.dispBc.data.flag1 ==
'N')
1264 mit->second.dispBc.data.flag1 = 0;
1265 if (mit->second.dispBc.data.flag1)
1266 mit->second.dispBc.data.flag1 = 1;
1267 if (mit->second.dispBc.data.flag2 ==
'0')
1268 mit->second.dispBc.data.flag2 = 0;
1269 if (mit->second.dispBc.data.flag2 ==
'N')
1270 mit->second.dispBc.data.flag2 = 0;
1271 if (mit->second.dispBc.data.flag2)
1272 mit->second.dispBc.data.flag2 = 1;
1273 if (mit->second.dispBc.data.flag3 ==
'0')
1274 mit->second.dispBc.data.flag3 = 0;
1275 if (mit->second.dispBc.data.flag3 ==
'N')
1276 mit->second.dispBc.data.flag3 = 0;
1277 if (mit->second.dispBc.data.flag3)
1278 mit->second.dispBc.data.flag3 = 1;
1279 if (mit->second.dispBc.data.flag4 ==
'0')
1280 mit->second.dispBc.data.flag4 = 0;
1281 if (mit->second.dispBc.data.flag4 ==
'N')
1282 mit->second.dispBc.data.flag4 = 0;
1283 if (mit->second.dispBc.data.flag4)
1284 mit->second.dispBc.data.flag4 = 1;
1285 if (mit->second.dispBc.data.flag5 ==
'0')
1286 mit->second.dispBc.data.flag5 = 0;
1287 if (mit->second.dispBc.data.flag5 ==
'N')
1288 mit->second.dispBc.data.flag5 = 0;
1289 if (mit->second.dispBc.data.flag5)
1290 mit->second.dispBc.data.flag5 = 1;
1291 if (mit->second.dispBc.data.flag6 ==
'0')
1292 mit->second.dispBc.data.flag6 = 0;
1293 if (mit->second.dispBc.data.flag6 ==
'N')
1294 mit->second.dispBc.data.flag6 = 0;
1295 if (mit->second.dispBc.data.flag6)
1296 mit->second.dispBc.data.flag6 = 1;
1298 mit->second.dispBc);
1300 if (mit->second.forceBc.data.value1 != 0 ||
1301 mit->second.forceBc.data.value2 != 0) {
1303 mit->second.forceBc);
1306 if (mit->second.temperatureBc.data.flag1) {
1307 if (mit->second.temperatureBc.data.flag1 ==
'0')
1308 mit->second.temperatureBc.data.flag1 = 0;
1309 if (mit->second.temperatureBc.data.flag1 ==
'N')
1310 mit->second.temperatureBc.data.flag1 = 0;
1311 if (mit->second.temperatureBc.data.flag1)
1312 mit->second.temperatureBc.data.flag1 = 1;
1314 mit->second.temperatureBc);
1318 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1320 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1329 if (mit->second.pressureBc.data.value1 != 0) {
1330 if (mit->second.pressureBc.data.flag2 ==
'0')
1331 mit->second.pressureBc.data.flag2 = 0;
1332 if (mit->second.pressureBc.data.flag2 ==
'N')
1333 mit->second.pressureBc.data.flag2 = 0;
1334 if (mit->second.pressureBc.data.flag2)
1335 mit->second.pressureBc.data.flag2 = 1;
1337 mit->second.pressureBc);
1340 if (mit->second.heatFluxBc.data.value1 != 0) {
1341 if (mit->second.heatFluxBc.data.flag1 ==
'0')
1342 mit->second.heatFluxBc.data.flag1 = 0;
1343 if (mit->second.heatFluxBc.data.flag1 ==
'N')
1344 mit->second.heatFluxBc.data.flag1 = 0;
1345 if (mit->second.heatFluxBc.data.flag1)
1346 mit->second.heatFluxBc.data.flag1 = 1;
1348 mit->second.heatFluxBc);
1351 if (mit->second.cfgBc.data.type != 0) {
1352 CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1357 "Not yet implemented type\n");
1361 for (
auto set_attr : block_set_attributes) {
1363 if (set_attr.second.numberOfAttributes > 0) {
1364 MOFEM_LOG(
"MeshsetMngSelf", Sev::verbose)
1365 <<
"Set attributes to blockset " << set_attr.second.nAme;
1366 set_attr.second.aTtr.resize(set_attr.second.numberOfAttributes);
1368 set_attr.second.aTtr);