10 using namespace MoFEM;
12 static char help[] =
"...\n\n";
14 int main(
int argc,
char *argv[]) {
18 auto core_log = logging::core::get();
28 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
42 MOFEM_LOG(
"ATOM_TEST", Sev::verbose) <<
"<<<< SIDESETs >>>>>";
44 bool add_block_is_there =
false;
48 strncpy(mybc.
data.name,
"Pressure", 8);
55 if (it->getMeshsetId() != 1002)
57 add_block_is_there =
true;
59 CHKERR it->getBcDataStructure(mydata);
61 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
63 if (!add_block_is_there)
65 "no added block set");
67 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"<<<< BLOCKSETs >>>>>";
69 add_block_is_there =
false;
71 std::vector<double> attr(3);
78 std::string name = it->getName();
79 if (name.compare(0, 13,
"ADD_BLOCK_SET") == 0) {
80 add_block_is_there =
true;
81 std::vector<double> attributes;
82 it->getAttributes(attributes);
83 if (attributes.size() != 3) {
85 "should be 3 attributes but is %d", attributes.size());
87 if (attributes[0] != 0 || attributes[1] != 1 || attributes[2] != 2) {
89 "wrong values of attributes");
93 if (!add_block_is_there) {
95 "no added block set");
97 add_block_is_there =
false;
101 mydata.
data.Young = 1;
102 mydata.
data.Poisson = 0.25;
107 if (it->getMeshsetId() != 1001)
110 std::string name = it->getName();
111 if (name.compare(0, 13,
"MAT_ELASTIC") == 0 &&
113 add_block_is_there =
true;
115 CHKERR it->getAttributeDataStructure(mydata);
117 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
118 if (mydata.
data.Young != 1 || mydata.
data.Poisson != 0.25) {
120 "wrong values of attributes");
124 if (!add_block_is_there) {
126 "no added block set");
129 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"<<<< NODESET >>>>>";
133 std::memcpy(disp_bc.
data.name,
"Displacement", 12);
134 disp_bc.
data.flag1 = 1;
135 disp_bc.
data.flag2 = 1;
136 disp_bc.
data.flag3 = 1;
137 disp_bc.
data.flag4 = 0;
138 disp_bc.
data.flag5 = 0;
139 disp_bc.
data.flag6 = 0;
140 disp_bc.
data.value1 = 0;
141 disp_bc.
data.value2 = 0;
142 disp_bc.
data.value3 = 0;
143 disp_bc.
data.value4 = 0;
144 disp_bc.
data.value5 = 0;
145 disp_bc.
data.value6 = 0;
152 CHKERR it->getBcDataStructure(disp_data);
153 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << disp_data;
157 <<
"<<<< ADD BLOCKSETs FROM CONFIG FILE >>>>>";
173 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Iterate blocksets";
175 bool mat_elastic_trans_is_found =
true;
177 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << *it;
179 std::vector<double> attributes;
180 it->getAttributes(attributes);
181 std::ostringstream ss;
183 for (
unsigned int ii = 0; ii != attributes.size(); ii++) {
184 ss << attributes[ii] <<
" ";
186 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << ss.str();
188 std::string block_name = it->getName();
189 if (block_name.compare(0, block_name.size(),
"MAT_ELASTIC_TRANS_ISO") ==
191 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat Trans Iso block ";
192 mat_elastic_trans_is_found =
true;
194 CHKERR it->getAttributeDataStructure(mydata);
196 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
197 if (mydata.
data.Youngp != 1)
199 if (mydata.
data.Youngz != 2)
201 if (mydata.
data.Poissonp != 3)
203 if (mydata.
data.Poissonpz != 4)
205 if (mydata.
data.Shearzp != 5)
209 if(!mat_elastic_trans_is_found)
214 CHKERR it->getAttributeDataStructure(mydata);
215 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat elastic found ";
216 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
220 CHKERR it->getAttributeDataStructure(mydata);
221 MOFEM_LOG(
"ATOM_TEST", Sev::inform) <<
"Mat thermal found ";
222 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
226 CHKERR it->getBcDataStructure(mydata);
227 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
231 CHKERR it->getBcDataStructure(mydata);
232 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
236 CHKERR it->getBcDataStructure(mydata);
237 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
241 CHKERR it->getBcDataStructure(mydata);
242 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;
246 CHKERR it->getBcDataStructure(mydata);
247 MOFEM_LOG(
"ATOM_TEST", Sev::inform) << mydata;