MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / cubeGenerator

Method cubeGenerator

src/Geometry/CubeGenerator.cpp:183–1574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181}
182
183void seissol::geometry::CubeGenerator::cubeGenerator(
184 const std::array<unsigned int, 4> numCubes,
185 const std::array<unsigned int, 4> numPartitions,
186 unsigned int boundaryMinx,
187 unsigned int boundaryMaxx,
188 unsigned int boundaryMiny,
189 unsigned int boundaryMaxy,
190 unsigned int boundaryMinz,
191 unsigned int boundaryMaxz,
192 const std::array<unsigned int, 4> numCubesPerPart,
193 const std::array<unsigned long, 4> numElemPerPart,
194 const std::array<unsigned int, 4> numVrtxPerPart,
195 const std::array<unsigned int, 3> numBndElements,
196 double scale,
197 double scaleX,
198 double scaleY,
199 double scaleZ,
200 double tx,
201 double ty,
202 double tz,
203 const std::string& meshFile) {
204
205 logInfo(rank) << "Total number of cubes:" << numCubes[0] << 'x' << numCubes[1] << 'x'
206 << numCubes[2] << '=' << numCubes[3];
207 logInfo(rank) << "Total number of partitions" << numPartitions[0] << 'x' << numPartitions[1]
208 << 'x' << numPartitions[2] << '=' << numPartitions[3];
209 logInfo(rank) << "Total number of cubes per partition:" << numCubesPerPart[0] << 'x'
210 << numCubesPerPart[1] << 'x' << numCubesPerPart[2] << '=' << numCubesPerPart[3];
211 logInfo(rank) << "Total number of elements per partition:" << numElemPerPart[0] << 'x'
212 << numElemPerPart[1] << 'x' << numElemPerPart[2] << '='
213 << numElemPerPart[0] * numElemPerPart[1] * numElemPerPart[2];
214 logInfo(rank) << "Using" << omp_get_max_threads() << "threads";
215
216 // Setup MPI Communicator
217#ifdef USE_MPI
218 MPI_Comm commMaster = MPI_COMM_NULL;
219 MPI_Comm_split(seissol::MPI::mpi.comm(), rank % 1 == 0 ? 1 : MPI_UNDEFINED, rank, &commMaster);
220#endif // USE_MPI
221
222 size_t bndSize = -1;
223 size_t bndElemSize = -1;
224
225 int* sizes = nullptr;
226 int maxSize = 0;
227
228 // Get important dimensions
229 const size_t partitions = numPartitions[3];
230
231 if (partitions != static_cast<unsigned int>(nProcs)) {
232 logError() << "Number of partitions does not match number of MPI ranks.";
233 }
234
235 bndSize = 6;
236 bndElemSize = *std::max_element(numBndElements.begin(), numBndElements.end());
237
238 // Elements
239 sizes = new int[1];
240 const int size = numElemPerPart[3];

Callers

nothing calls this directly

Calls 5

commMethod · 0.80
resizeMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected