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

Method initializeBoundaryMappings

src/Initializer/CellLocalMatrices.cpp:325–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325void seissol::initializer::initializeBoundaryMappings(const seissol::geometry::MeshReader& i_meshReader,
326 const EasiBoundary* easiBoundary,
327 LTSTree* io_ltsTree,
328 LTS* i_lts,
329 Lut* i_ltsLut) {
330 std::vector<Element> const& elements = i_meshReader.getElements();
331 std::vector<Vertex> const& vertices = i_meshReader.getVertices();
332
333 const unsigned* ltsToMesh = i_ltsLut->getLtsToMeshLut(i_lts->material.mask);
334
335 for (auto& layer : io_ltsTree->leaves(Ghost)) {
336 auto* cellInformation = layer.var(i_lts->cellInformation);
337 auto* boundary = layer.var(i_lts->boundaryMapping);
338
339#ifdef _OPENMP
340#pragma omp for schedule(static)
341#endif
342 for (unsigned cell = 0; cell < layer.getNumberOfCells(); ++cell) {
343 const auto& element = elements[ltsToMesh[cell]];
344 double const* coords[4];
345 for (unsigned v = 0; v < 4; ++v) {
346 coords[v] = vertices[ element.vertices[ v ] ].coords;
347 }
348 for (unsigned side = 0; side < 4; ++side) {
349 if (cellInformation[cell].faceTypes[side] != FaceType::FreeSurfaceGravity
350 && cellInformation[cell].faceTypes[side] != FaceType::Dirichlet
351 && cellInformation[cell].faceTypes[side] != FaceType::Analytical) {
352 continue;
353 }
354 // Compute nodal points in global coordinates for each side.
355 real nodesReferenceData[nodal::tensor::nodes2D::Size];
356 std::copy_n(nodal::init::nodes2D::Values,
357 nodal::tensor::nodes2D::Size,
358 nodesReferenceData);
359 auto nodesReference = nodal::init::nodes2D::view::create(nodesReferenceData);
360 auto nodes = boundary[cell][side].nodes;
361 assert(nodes != nullptr);
362 auto offset = 0;
363 for (unsigned int i = 0; i < nodal::tensor::nodes2D::Shape[0]; ++i) {
364 double nodeReference[2];
365 nodeReference[0] = nodesReference(i,0);
366 nodeReference[1] = nodesReference(i,1);
367 // Compute the global coordinates for the nodal points.
368 double xiEtaZeta[3], xyz[3];
369 seissol::transformations::chiTau2XiEtaZeta(side,
370 nodeReference,
371 xiEtaZeta);
372 seissol::transformations::tetrahedronReferenceToGlobal(coords[0],
373 coords[1],
374 coords[2],
375 coords[3],
376 xiEtaZeta,
377 xyz);
378 nodes[offset++] = xyz[0];
379 nodes[offset++] = xyz[1];
380 nodes[offset++] = xyz[2];
381 }
382

Callers

nothing calls this directly

Calls 6

sizeFunction · 0.85
getLtsToMeshLutMethod · 0.80
leavesMethod · 0.80
queryMethod · 0.80
varMethod · 0.45
getNumberOfCellsMethod · 0.45

Tested by

no test coverage detected