15 {
16
18
19 try {
20
21 moab::Core mb_instance;
22 moab::Interface &moab = mb_instance;
23 int rank;
24 MPI_Comm_rank(PETSC_COMM_WORLD, &rank);
25
26
27 PetscBool flg = PETSC_TRUE;
29#if PETSC_VERSION_GE(3, 6, 4)
31 255, &flg);
32#else
35#endif
36 if (flg != PETSC_TRUE) {
38 "*** ERROR -my_file (MESH FILE NEEDED)");
39 }
40
41
42 const char *option;
43 option = "";
45
46
49
50
51 std::ofstream myfile;
53
54 std::cout << "<<<< NODESETs >>>>>" << std::endl;
55
57 std::cout << *it << std::endl;
58 CHKERR it->printBcData(std::cout);
59 std::vector<char> bc_data;
60 CHKERR it->getBcData(bc_data);
61 if (bc_data.empty())
62 continue;
63
64
65 if (strcmp(&bc_data[0], "Displacement") == 0) {
67 CHKERR it->getBcDataStructure(mydata);
68
69 std::cout << mydata;
70 myfile << mydata;
71 }
72
73
74 else if (strcmp(&bc_data[0], "Force") == 0) {
76 CHKERR it->getBcDataStructure(mydata);
77
78 std::cout << mydata;
79 myfile << mydata;
80 }
81
82
83 else if (strcmp(&bc_data[0], "Velocity") == 0) {
85 CHKERR it->getBcDataStructure(mydata);
86
87 std::cout << mydata;
88 myfile << mydata;
89 }
90
91
92 else if (strcmp(&bc_data[0], "Acceleration") == 0) {
94 CHKERR it->getBcDataStructure(mydata);
95
96 std::cout << mydata;
97 myfile << mydata;
98 }
99
100
101 else if (strcmp(&bc_data[0], "Temperature") == 0) {
103 CHKERR it->getBcDataStructure(mydata);
104
105 std::cout << mydata;
106 myfile << mydata;
107 }
108
109 else
110 SETERRQ(PETSC_COMM_SELF, 1, "Error: Unrecognizable BC type");
111 }
112
113 std::cout << "<<<< SIDESETs >>>>>" << std::endl;
114
116 std::cout << *it << std::endl;
117 CHKERR it->printBcData(std::cout);
118 std::vector<char> bc_data;
119 CHKERR it->getBcData(bc_data);
120 if (bc_data.empty())
121 continue;
122
123
124 if (strcmp(&bc_data[0], "Pressure") == 0) {
126 CHKERR it->getBcDataStructure(mydata);
127
128 std::cout << mydata;
129 myfile << mydata;
130 }
131
132
133 else if (strcmp(&bc_data[0], "HeatFlux") == 0) {
135 CHKERR it->getBcDataStructure(mydata);
136
137 std::cout << mydata;
138 myfile << mydata;
139 }
140
141
142 else if (strcmp(&bc_data[0], "cfd_bc") == 0) {
144 CHKERR it->getBcDataStructure(mydata);
145
146
147 if (mydata.
data.type == 6) {
148
149
150 std::cout << std::endl << "Interface" << std::endl;
151 myfile << std::endl << "Interface" << std::endl;
152 std::cout << mydata;
153 myfile << mydata;
154 }
155
156 else if (mydata.
data.type == 15) {
157
158
159
160 std::cout << std::endl << "Pressure Inlet" << std::endl;
161 myfile << std::endl << "Pressure Inlet" << std::endl;
162 std::cout << mydata;
163 myfile << mydata;
164 }
165
166 else if (mydata.
data.type == 16) {
167
168
169
170 std::cout << std::endl << "Pressure Outlet" << std::endl;
171 myfile << std::endl << "Pressure Outlet" << std::endl;
172 std::cout << mydata;
173 myfile << mydata;
174 }
175 }
176
177 else
178 SETERRQ(PETSC_COMM_SELF, 1, "Error: Unrecognizable BC type");
179 }
180
183
184 std::cout << "<<<< BLOCKSETs >>>>>" << std::endl;
185
187 std::cout << std::endl << *it << std::endl;
188
189
190 CHKERR it->printName(std::cout);
191 CHKERR it->printName(myfile);
192
193
194 std::vector<double> attributes;
195 CHKERR it->getAttributes(attributes);
196 CHKERR it->printAttributes(std::cout);
197 CHKERR it->printAttributes(myfile);
198 }
199
200
201
202
203
204
205
206
207
208
209
210
211
213
214 std::cout << std::endl << *it << std::endl;
215
216
217 std::string name = it->getName();
218
219
220 if (name.compare(0, 20, "MAT_ELASTIC_TRANSISO") == 0) {
222 CHKERR it->getAttributeDataStructure(mydata);
223
224 std::cout << mydata;
225 myfile << mydata;
226 } else if (name.compare(0, 11, "MAT_ELASTIC") == 0) {
228 CHKERR it->getAttributeDataStructure(mydata);
229
230 std::cout << mydata;
231 myfile << mydata;
232 } else if (name.compare(0, 10, "MAT_INTERF") == 0) {
234 CHKERR it->getAttributeDataStructure(mydata);
235
236 std::cout << mydata;
237 myfile << mydata;
238 } else
239 SETERRQ(PETSC_COMM_SELF, 1, "Error: Unrecognizable Material type");
240 }
241
242
243 myfile.close();
244
246
248}
#define CATCH_ERRORS
Catch errors.
#define CHKERR
Inline error check.
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
PetscErrorCode PetscOptionsGetString(PetscOptions *, const char pre[], const char name[], char str[], size_t size, PetscBool *set)
Definition of the acceleration bc data structure.
Definition of the cfd_bc data structure.
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.
Definition of the force bc data structure.
Definition of the heat flux bc data structure.
Transverse Isotropic material data structure.
Elastic material data structure.
Linear interface data structure.
Interface for managing meshsets containing materials and boundary conditions.
Definition of the pressure bc data structure.
Definition of the temperature bc data structure.
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.
Definition of the velocity bc data structure.