Closed Cocytus-kyon closed 1 year ago
Hi,
I solved this problem.
Because my labels are '1','2','3'...'10000', will become ' 1', ' 2', ' 3'...'10000' in the MESH file.
But in _ extract.py,
parameters ["element"]. keys()
The result is
['1', '2', '3', '4', '5', ...'1 1'...]
The space on the left of labels has been deleted.
Therefore, make the following changes in _extract.py
line 52
[parameters["elements"][label.lstrip()]["center"] for label in output[-1].labels]
That shouldn't happen. I will investigate the issue when I have time. Thanks for reporting. I am reopening the issue until it's actually fixed.
Thank you. I have one more question.
The mesh I input is POLYHEDRON, however, after TMVOC calculation, the output mesh is tetrahedron.
inputMesh
outputMesh
Did I miss any parameters?
I tried to read a vtu-mesh with polyhedrons (vtk.VTK_WEDGE, vtk.VTK_HEXAHEDRON, vtk.VTK_PENTAGONAL_PRISM, VTK_HEXAGONAL_PRISM, vtk.VTK_CONVEX_POINT_SET) and I saw some error messages, that some of these element types are not supported.
That looks like a recurrent issue when dealing with Voronoi grids. I am not sure how to solve it (the code is relying on SciPy's Delaunay triangulation function to reconstruct a mesh).
I would recommend to interpolate your results on a rectangular grid, for instance:
import numpy as np
import toughio
from scipy.interpolate import griddata
parameters = toughio.read_input("MESH.txt")
outputs = toughio.read_output("ini.out.txt")
centers = np.array([element["center"] for element in parameters["elements"].values()])
xmin, ymin, zmin = centers.min(axis=0)
xmax, ymax, zmax = centers.max(axis=0)
nx, ny, nz = 20, 20, 20
dx = np.diff(np.linspace(xmin, xmax, nx + 1))
dy = np.diff(np.linspace(ymin, ymax, ny + 1))
dz = np.diff(np.linspace(zmin, zmax, nz + 1))
mesh = toughio.meshmaker.structured_grid(dx, dy, dz, origin=[xmin, ymin, zmin], layer=True)
for k, v in outputs[-1].data.items():
vint = griddata(centers, v, mesh.centers, method="linear")
mesh.add_cell_data(k, vint)
mesh.write("out.vtu")
I will implement such feature later in toughio
.
Hello
Can you tell me in which format I should write the origin point coordiantes?
Hi @medhay36
Please use the following syntax:
toughio-export -t -1 -o parameter.vtu -f vtu -v --origin 0.0 0.0 0.0 OUTPUT_ELEME.csv
Thank you dear @keurfonluu I tried that but still encoutring the same error
My bad:
toughio-export OUTPUT_ELEME.csv -t -1 -o parameter.vtu -f vtu -v --origin 0.0 0.0 0.0
My bad:
toughio-export OUTPUT_ELEME.csv -t -1 -o parameter.vtu -f vtu -v --origin 0.0 0.0 0.0
@keurfonluu Thank you very much . works fine now
Hello again @keurfonluu I am encountreing an issure while trying to use an atmospheric boundary condition on top
I tried using --ignore-elements option but it seems there is an issue with it here is the element causing the problem
have you got any ideas ? and thank you
What's the issue with "ignore-elements"? toughio-export OUTPUT_ELEME.csv --ignore-elements "at 0"
should work.
Thank you dear Luu. Problem solved (forgot to put quotes around element name) Best regards
Hi,
When I intend to extract results from output file and reformat as a TMVOC CSV output file:
I get the following error message:
I'm not sure if it's toughio's problem.
I am enclosing the input, output and MESH files here.
MESH.txt ini.txt ini.out.txt
Thank you!