This package intends to support the solution of PDEs using the Element-based Finite Volume Method (EbFVM). The input mesh may be *.msh or *.xdmf files, and the output may be *.csv or *.cgns.
- Python 3 (3.8.2);
- matplotlib (3.3.2);
- meshio (4.0.15);
- numpy (1.17.4);
- pandas(1.1.3);
- petsc4py (3.12.0);
- scipy (1.5.3);
- xmltodict (0.12.0).
Also, for CGNS writing, C++ is used, and two libraries are required: CGNS and Boost.
from PyEFVLib import MSHReader, Grid, Point
import os, numpy as np
path = os.path.join(*[os.path.dirname(__file__), os.path.pardir, "meshes", "Square.msh"])
reader = MSHReader(path)
grid = Grid(reader.getData())
totalVolume = 0.0
for element in grid.elements:
for vertex in element:
totalVolume += vertex.volume
print(totalVolume)