From ad6bf14648d1d9f8945e587e97e0bb9533ec0095 Mon Sep 17 00:00:00 2001 From: Panos Mavrogiorgos Date: Wed, 10 Apr 2024 00:30:54 +0300 Subject: [PATCH] gmsh: Inline gmsh import This will make it easier to import pyposeidon on EuroHPC --- pyposeidon/mgmsh.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pyposeidon/mgmsh.py b/pyposeidon/mgmsh.py index f44abeab..37cfe0fb 100644 --- a/pyposeidon/mgmsh.py +++ b/pyposeidon/mgmsh.py @@ -16,7 +16,6 @@ import os from tqdm.auto import tqdm import sys -import gmsh import subprocess import shapely import shlex @@ -67,6 +66,8 @@ def get_ibounds(df, mm): def read_msh(filename, **kwargs): + import gmsh + model = gmsh.model factory = model.geo @@ -800,6 +801,8 @@ def make_bgmesh(df, fpos, **kwargs): def make_gmsh(df, **kwargs): + import gmsh + logger.info("Creating mesh") model = gmsh.model @@ -1006,6 +1009,8 @@ def make_gmsh(df, **kwargs): def make_gmsh_3d(df, **kwargs): + import gmsh + logger.info("Creating global mesh") model = gmsh.model