Closed yewalenikhil65 closed 2 years ago
Hello @yewalenikhil65 ,
Thanks for reporting the issue! This is interesting; did you have any issues or suspicious output during the pre-processing (with automatedPreProcessing.py
)?
Alternatively, could you provide the .xml.gz
(and .vtu
) files, if available?
Best regards, Henrik
yes.. i did encounter an error in generating mesh files.. as follows.. I think DOLFIN suitable mesh file wasn't generated properly
Remeshing endcaps
Iteration 1/10
Iteration 2/10
Iteration 3/10
Iteration 4/10
Iteration 5/10
Iteration 6/10
Iteration 7/10
Iteration 8/10
Iteration 9/10
Iteration 10/10
Final mesh improvement
Computing sizing function
Generating volume mesh
TetGen command line options: pq1.414000q10.000000q165.000000YsT1.000000e-08zQm
Assembling final mesh
2022-09-13 18:22:17.674 ( 18.644s) [ AE894740] vtkThreshold.cxx:84 WARN| vtkThreshold::ThresholdByUpper was deprecated for VTK 9.1 and will be removed in a future version.
Writing Dolfin file.
Traceback (most recent call last):
File "/home/nikhil/VaMPy/automatedPreProcessing/automatedPreProcessing.py", line 505, in <module>
run_pre_processing(**read_command_line())
File "/home/nikhil/VaMPy/automatedPreProcessing/automatedPreProcessing.py", line 307, in run_pre_processing
write_mesh(compress_mesh, file_name_surface_name, file_name_vtu_mesh, file_name_xml_mesh,
File "/home/nikhil/VaMPy/automatedPreProcessing/common.py", line 756, in write_mesh
meshWriter.Execute()
File "/home/nikhil/anaconda3/envs/vampy_environment/lib/python3.10/site-packages/vmtk/vmtkmeshwriter.py", line 365, in Execute
self.WriteDolfinMeshFile()
File "/home/nikhil/anaconda3/envs/vampy_environment/lib/python3.10/site-packages/vmtk/vmtkmeshwriter.py", line 268, in WriteDolfinMeshFile
gzfile.write(xml)
File "/home/nikhil/anaconda3/envs/vampy_environment/lib/python3.10/gzip.py", line 285, in write
data = memoryview(data)
TypeError: memoryview: a bytes-like object is required, not 'str'
also attaching .vtu
and .xml.gz
files generated ..zipped into following artery.zip
artery.zip
Hi @yewalenikhil65 ,
I think I have experienced something similar before. I think this is an issue with the vmtkmeshgenerator.py
script, in the way it compresses the Dolfin mesh. So two options I can think of is
--compress-mesh False
and use `mesh_path=[some path]/artery.xmlor
vmtkmeshgenerator.py
file (for you located under /home/nikhil/anaconda3/envs/vampy_environment/lib/python3.10/site-packages/vmtk/
) and change lines 263 and 268 from 'r'
and 'w'
to 'rb'
and 'wb'
, respectively. I will probably include this in the documentation if the issue is not fixed on VMTKs side, so thank you for noticing!
Best, Henrik
hi @hkjeldsberg ,
i check the file vmtkmeshgenerator.py
. However, I couldn't find strings r
and w
within whole file (quick control+f !). is it some other file ?
can you tell me full command according to the first option ?
Hi @yewalenikhil65 ,
Sorry! I meant the vmtkmeshwriter.py
file! Located within the WriteDolfinMeshFile()
function.
Best, Henrik
Hi @yewalenikhil65 ,
Sorry! I meant the
vmtkmeshwriter.py
file! Located within theWriteDolfinMeshFile()
function.Best, Henrik
thanks very much.. that did the trick..
I had three more questions, if you would like to address regarding VaMPy
1) Can we use mesh file generated in ANSYS(ICEM-CFD) . i.e. .msh
format and read it into VaMPy ?
2) How generalised is the mesh generation procedure adopted in VaMPy , say for the problems of intracranial aneurysms ?
3) how to visualise solution in paraview ? i mean how do I read .h5
files generated in simulations
folder?
Also, @yewalenikhil65 ,
The full command would be first:
python automatedPreProcessing/automatedPreProcessing.py -m diameter -i test/Case_test_artery/artery.vtp -c 1.3 -cM False
Then
oasis NSfracStep problem=Artery mesh_path=../test/Case_test_artery/artery.xml T=9.61 save_solution_after_cycle=0 && cd ..
Hope this helps!
Hi @yewalenikhil65 , Sorry! I meant the
vmtkmeshwriter.py
file! Located within theWriteDolfinMeshFile()
function. Best, Henrikthanks very much.. that did the trick..
I had three more questions, if you would like to address regarding VaMPy
- Can we use mesh file generated in ANSYS(ICEM-CFD) . i.e.
.msh
format and read it into VaMPy ?- How generalised is the mesh generation procedure adopted in VaMPy , say for the problems of intracranial aneurysms ?
- how to visualise solution in paraview ?
@yewalenikhil65 Great! Happy it worked.
.xdmf
format. Unfortunately, I am not so familiar with the meshing process in Ansys. However I found one possibility you could check out here, posted quite recently. --refine-region
flag set to True
) of the aneurysm region. u = Function(V)
in compute_hemodynamic_indices.py
for each time step. Saving to .h5
was initially done to save storage space, but I agree that the velocity field should be part of the solution or post-processing. I can make an issue on this 👍Best, Henrik
Closing this issue for now. The hotfix has been added to the documentation as part of PR #73, and merged to master as soon as the tests pass.
I am encountering following error for running the simulation using Oasis for
artery
example as shown in the documentationerror as follows
Can someone please help me with this ?