DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
cart_overset_test_2D.py
Go to the documentation of this file.
1from DNDSR import DNDS, Geom
2import os
3import matplotlib.pyplot as plt
4import matplotlib.patches as patches
5import numpy as np
6import sympy
7
8def get_mesh_2D(meshFile: str):
9 mpi = DNDS.MPIInfo()
10 mpi.setWorld()
11
12 mesh = Geom.UnstructuredMesh(mpi, 2)
13 meshReader = Geom.UnstructuredMeshSerialRW(mesh, 0)
14 assert os.path.isfile(meshFile)
15 name2ID = meshReader.ReadFromCGNSSerial(meshFile)
16 print(name2ID.n2id_map)
17 meshReader.Deduplicate1to1Periodic(1e-9)
18 meshReader.BuildCell2Cell()
19 meshReader.MeshPartitionCell2Cell({"metisUfactor": 5})
20 meshReader.PartitionReorderToMeshCell2Cell()
21
22 mesh.RecoverNode2CellAndNode2Bnd()
23 mesh.RecoverCell2CellAndBnd2Cell()
24 mesh.BuildGhostPrimary()
25 mesh.AdjGlobal2LocalPrimary()
26 mesh.InterpolateFace()
27 mesh.AssertOnFaces()
28
29 return mesh, meshReader
30
31
32if __name__ == "__main__":
33 meshFile = os.path.join(
34 os.path.dirname(__file__), "..", "..", "data", "mesh", "NACA0012_H2.cgns"
35 )
36 m, msr = get_mesh_2D(meshFile)
Lightweight bundle of an MPI communicator and the calling rank's coordinates.
Definition MPI.hpp:215