Skip to content

Commit 5d9a215

Browse files
committed
fix test
1 parent de2336d commit 5d9a215

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

examples/ansys/pymapdl_tess/test.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,35 @@
1+
"""
2+
/usr/ansys_inc/v241/ansys/bin/ansys241 -port 50005 -grpc
3+
"""
14
import os
25

36
import numpy as np
4-
from dotenv import load_dotenv
57
from tesseract_core import Tesseract
68

7-
load_dotenv()
89

10+
# load the MAPDL server's address from your environment
911
host = os.getenv("MAPDL_HOST")
1012
if host is None:
11-
raise ValueError("Unable to read $MAPDL_HOST from the environment.")
13+
raise ValueError("Unable to read $MAPDL_HOST from the environment. " + \
14+
"Use 'export MAPDL_HOST=X.X.X.X' for local IP address of your MAPDL Instance.")
1215
port = os.getenv("MAPDL_PORT")
1316
if port is None:
14-
raise ValueError("Unable to read $MAPDL_PORT from the environment.")
17+
raise ValueError("Unable to read $MAPDL_PORT from the environment. " + \
18+
"Use 'export MAPDL_PORT=X' for the port of your MAPDL Instance.")
1519

1620

17-
tess_simp_compliance = Tesseract.from_tesseract_api(
18-
"tesseract_pymapdl/tess_simp_compiance/tesseract_api.py"
19-
)
21+
# Initialize Tesseract from api (for testing)
22+
try:
23+
tess_simp_compliance = Tesseract.from_tesseract_api(
24+
"./tesseract_api.py"
25+
)
26+
except RuntimeError as e:
27+
raise RuntimeError("Unable to load tesseract from api. " \
28+
"Ensure that you have installed the build requirements using 'pip install -r tesseract_requirements.txt'")
29+
2030
Lx, Ly, Lz = 3, 2, 1
21-
Nx, Ny, Nz = 60, 40, 20
22-
# Nx, Ny, Nz = 6, 4, 2
31+
# Nx, Ny, Nz = 60, 40, 20
32+
Nx, Ny, Nz = 6, 4, 2
2333

2434
n_elem = Nx * Ny * Nz
2535
# Create a test density field varying from 0 to 1

0 commit comments

Comments
 (0)