Skip to content
Snippets Groups Projects
Commit 2b11efc5 authored by Frederik Zahle's avatar Frederik Zahle
Browse files

Merge branch 'boxmeshFix' into 'master'

Bugfix boxmesh with .x3d format and added error message staggered BC

See merge request !69
parents 3d8fd997 02f374ac
No related branches found
No related tags found
1 merge request!69Bugfix boxmesh with .x3d format and added error message staggered BC
Pipeline #69512 passed
import numpy as np
import sys
try:
import matplotlib.pyplot as plt
......@@ -189,6 +190,13 @@ class BoxMesh(Domain):
# Add shift (assume z-direction is ground and top)
if self.staggered:
if nbj > 96:
print(
"ERROR: the number of blocks in y-dir is",
nbj,
"but cannot be more than 96 when staggered=True.",
)
sys.exit()
for k in range(nbk):
for j in range(nbj):
in_ind = nbj + 1 - j - 1
......@@ -219,10 +227,12 @@ class BoxMesh(Domain):
print("Writing x3d file {:}".format(self.filename))
with open(self.filename, "w") as f:
f.write(
" {:d} {:d}\n".format(bsize, nbm)
" {:d} {:d}\n".format(
self.bsize, nbm
)
)
for bname in self.locks.keys():
temp = np.empty(((bsize + 1) ** 3, 4))
for bname in self.blocks.keys():
temp = np.empty(((self.bsize + 1) ** 3, 4))
temp[:, 0] = (
self.blocks[bname].scalars["attr"].flatten()
)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment