feat(pythonInterface/mfem): added loads of mfem bindings to make interacting through python easy
This commit is contained in:
11
tests/python/polytrope/loadMesh.py
Normal file
11
tests/python/polytrope/loadMesh.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from serif.mfem import Mesh
|
||||
import argparse
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Test loading a mesh using MFEM's mesh loading called from Python")
|
||||
parser.add_argument("path", type=str, help="path to mesh")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
mesh = Mesh(args.path)
|
||||
print(mesh.nv)
|
||||
@@ -1,8 +1,18 @@
|
||||
from serif import config
|
||||
from serif.polytrope import PolySolver
|
||||
from serif.mfem import Matrix
|
||||
from serif.mfem import Operator
|
||||
from serif.mfem.forms import BilinearForm
|
||||
|
||||
config.loadConfig('../../testsConfig.yaml')
|
||||
n = config.get("Tests:Poly:Index", 0.0)
|
||||
|
||||
polytrope = PolySolver(n, 1)
|
||||
polytrope.solve()
|
||||
polytrope.solve()
|
||||
theta = polytrope.get_theta()
|
||||
print(theta)
|
||||
|
||||
FESpace = theta.FESpace()
|
||||
print(FESpace)
|
||||
|
||||
print(theta.as_numpy())
|
||||
|
||||
Reference in New Issue
Block a user