casfeq / PyEFVLib

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 files.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyEFVLib

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.

Dependencies & Installation

Also, for CGNS writing, C++ is used, and two libraries are required: CGNS and Boost.

Usage

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)

About

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 files.


Languages

Language:Python 91.1%Language:GLSL 5.1%Language:C++ 3.3%Language:CMake 0.6%