Deformable wall simulation: functions execution order

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Deformable wall simulation: functions execution order

Post by Michela Garau » Mon Sep 07, 2020 2:56 am

Hello everybody.

I have some question about the functions execution order when I run a deformable (variable) wall, unsteady simulation, by using the simVascular version I downloaded from: https://github.com/SimVascular/svSolver".

I try to list below the steps I have understood and some questions. If any point is not correct, please correct me:

1. By prescribing the wall parameters (thickness,E, ks, cs, p0) for each inlet/outlet and by using the command "solve_varwall_(parameter)", everyone is computed for the entire wall with a linear interpolation;

2. With the command "varwallprop_write_vtp varwallprop.vtp", the computed parameters are written in the varwallprop.vtp file, together with the cells referements;

3. By prescribing some more variable (deformable_nu, deformable_kcons, deformable_pressure) and by running the function "deformable_solve_varwall_displacements", the displacements are computed by employing the latter parameters and the already computed varwallprop;

- Varwallprop are in this step stored in a temporary memory or are they read from the .vtp file? Because, if I want to change some value forcing the .vtp file and then I want to compute displacements from the changed file, I get in trouble, thus I think I have not understand in depth how this function computes displacements or how to read the varwallprop.

- The restart file automatically contains the varwallprop and the displacements or is it necessary to specified "append_..." in order to put properties inside the file?

- The geombc file works likewise?

Thank you in advance for every help,
Bests

Michela Garau

User avatar
David Parker
Posts: 1609
Joined: Tue Aug 23, 2005 2:43 pm

Re: Deformable wall simulation: functions execution order

Post by David Parker » Tue Sep 08, 2020 2:57 pm

Hi Michela,

3. By prescribing some more variable (deformable_nu, deformable_kcons, deformable_pressure) and by running the function "deformable_solve_varwall_displacements", the displacements are computed by employing the latter parameters and the already computed varwallprop;

- Varwallprop are in this step stored in a temporary memory or are they read from the .vtp file? Because, if I want to change some value forcing the .vtp file and then I want to compute displacements from the changed file, I get in trouble, thus I think I have not understand in depth how this function computes displacements or how to read the varwallprop.

Varwallprop is computed using the variable wall properties set in the .svpre file and then written to varwallprop.vtp.
It seems that you can read in wall properties using the read_varwallprop_vtu command, see http://simvascular.github.io/docsFlowSo ... ercommands. This will read in a two-component data array with values set for each node in the mesh. The first component is thickness, the second Young's modulus.

- The restart file automatically contains the varwallprop and the displacements or is it necessary to specified "append_..." in order to put properties inside the file?

The restart file automatically contains the varwallprop.

- The geombc file works likewise?
Yes.

Cheers,
Dave

User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Re: Deformable wall simulation: functions execution order

Post by Michela Garau » Wed Sep 09, 2020 2:47 am

Thank you David for your reply!

Unfortunately, I already tested the read_varwallprop_vtu command in this way: read_varwallprop_vtu varwallprop.vtp, because the name of the file is request and a varwallprop.vtu does not exist. Thus, even if I try to read the original varwallprop.vtp (written by simVascular without changes), I always obtain this error:

read_varwallprop_vtu varwallprop.vtp

Generic Warning: In /usr/local/svsolver/ext/2019.06/release/gl2/src/vtk-8.1.1/Common/Core/vtkInstantiator.cxx, line 265
vtkInstantiator::CreateInstance was deprecated for VTK 8.1 and will be removed in a future version.

ERROR: In /usr/local/svsolver/ext/2019.06/release/gl2/src/vtk-8.1.1/IO/XML/vtkXMLReader.cxx, line 891
vtkXMLUnstructuredGridReader (0x560f586d3870): Cannot find UnstructuredGrid element in file.

ERROR: In /usr/local/svsolver/ext/2019.06/release/gl2/src/vtk-8.1.1/Common/ExecutionModel/vtkExecutive.cxx, line 784
vtkCompositeDataPipeline (0x560f586d7070): Algorithm vtkXMLUnstructuredGridReader(0x560f586d3870) returned failure for request: vtkInformation (0x560f586d8dc0)
Debug: Off
Modified Time: 22694
Reference Count: 1
Registered Events: (none)
Request: REQUEST_INFORMATION
FORWARD_DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1

ERROR: Needs nodes in (varwallprop.vtp)!
ERROR: command could not be processed.
_____________________________________________________________________________________________

In order to avoid this command, I tried to employ the "read_varwallprop_restart" restart.0.1, but I obtained a new error:

read_varwallprop_restart restart.0.1

terminate called after throwing an instance of 'std::bad_array_new_length'
what(): std::bad_array_new_length
Aborted (core dumped)
_______________________________________________________________

Finally if I use the "read_varwallprop_geombc" geombc.dat.1 command,
it seems work without problems. But then, when I ask to solve displacements with the command "deformable_solve_varwall_displacements", I receiv this error:

LINE 0012: deformable_solve_varwall_displacements

N= 0
ndim= 1
maxnz= 1
before call nw= 19998
before call inw= 0


************************************************************
****************** f a t a l e r r o r ******************
************************************************************

routine echall
nonpositive matrix size n

************************************************************
_______________________________________________

I suppose it could be generated by a misreading of the varwallprop data, but really I don't know how to proceed along that path.
I hope there is a chance to solve these problems, otherwise I have to move forward a completely different way.
Cheers,

Michela

User avatar
David Parker
Posts: 1609
Joined: Tue Aug 23, 2005 2:43 pm

Re: Deformable wall simulation: functions execution order

Post by David Parker » Wed Sep 09, 2020 10:37 am

Hi Michela,

The read_varwallprop_vtu command expects a vtkUnstructuredGrid mesh in a .vtu file. From what I understand from your post you want to change the values in a varwallprop.vtp file and use those values to compute displacements. How do you change the values in the varwallprop.vtp file?

What you will need to do is to create a .vtu file from the varwallprop.vtp file
1) Read in a .vtu file with the mesh
2) Read in the varwallprop.vtp file, this has thickness and Young_Mod vtk PointData DataArray values
3) Create a vtk PointData DataArray named wallproperty and set the values from the thickness and Young_Mod values

Note that the simulation results files have a wallproperty vtk PointData DataArray

Code: Select all

more all_results_00000.vtu
<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <UnstructuredGrid>
    <Piece NumberOfPoints="2349"                 NumberOfCells="11079"               >
      <PointData Scalars="pressure" Vectors="velocity">
        <DataArray type="Int32" Name="GlobalNodeID" format="appended" RangeMin="1"                    RangeMax="2349"                 offset="0"                   />
        <DataArray type="Float64" Name="displacement" NumberOfComponents="3" format="appended" RangeMin="0"                    RangeMax="0.74999724237"        offset="3538"                />
        <DataArray type="Float64" Name="wallproperty" NumberOfComponents="2" format="appended" RangeMin="0"                    RangeMax="4000000"              offset="26947"               />
      </PointData>
You can thus use a results .vtu file for the read_varwallprop_vtu command, if that makes sense.

Cheers,
Dave

User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Re: Deformable wall simulation: functions execution order

Post by Michela Garau » Fri Sep 11, 2020 2:34 am

Hi David, thank you.

Now I have a better understanding, but I think there is a problem with read_varwallprop_vtu command in the SimVascular version I am using.

Indeed, if I impose the 5 parameter (E, thickness, ks, cs, p0), I receive the error :

Code: Select all

ERROR: In /usr/local/svsolver/ext/2019.06/release/gl2/src/vtk-8.1.1/Common/Core/vtkDataArray.cxx, line 980
vtkDoubleArray (0x562b4bee21d0): The number of components do not match the number requested: 5 != 6
I obtain the same kind of error if I use just the thickness and Young_Mod:

Code: Select all

ERROR: In /usr/local/svsolver/ext/2019.06/release/gl2/src/vtk-8.1.1/Common/Core/vtkDataArray.cxx, line 980
vtkDoubleArray (0x562b4bee21d0): The number of components do not match the number requested: 2 != 6
Differently, if I use other commands like read_velocity_vtu or read_displacements_vtu, it runs correctly.
I hope is a resolvable issue.

Bests,

Michela

User avatar
David Parker
Posts: 1609
Joined: Tue Aug 23, 2005 2:43 pm

Re: Deformable wall simulation: functions execution order

Post by David Parker » Fri Sep 11, 2020 10:02 am

Hi Michela,

There is a bug in svPre introduced when tissue support was added. I will open a GitHub Issue on this.

The svPre code is expecting a six-component DataArray so try adding this array with the first two components thickness and Young_Mod and the rest just set to zero. I think this will work.

Cheers,
Dave

User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Re: Deformable wall simulation: functions execution order

Post by Michela Garau » Mon Sep 14, 2020 1:47 am

Hi David,

thanks a lot for your help. I will try in this way and I let you know how it works.

I did forget to answer your question: "How do you change the values in the varwallprop.vtp file?"

I am using a matlab code in order to read, modify and re-write values in a few specific areas along the aortic wall, where either different mechanical characteristics. In this way I hope to start from a physiological condition and then vary gradually this condition without vary the other parameters.

Cheers,

Michela Garau

User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Re: Deformable wall simulation: functions execution order

Post by Michela Garau » Thu Sep 17, 2020 2:26 am

Hi David,

I have taken your suggestion by imposing the rest of parameters equal to zero, and know the read_varwallprop_vtu, looks like it's working fine.
However when I move forward in the svPre file, with the commands listed below:

Code: Select all

read_varwallprop_vtu varwall.vtu
deformable_nu 0.5
deformable_kcons 0.833333
deformable_pressure 80000
deformable_solve_varwall_displacements
wall_displacements_write_vtp displacement.vtp
write_geombc geombc.dat.1
append_displacements restart.0.1
I obtain a fatal error with the deformable_solve_varwall_displacements command:

Code: Select all

LINE 0014: deformable_solve_varwall_displacements

 N=           0
 ndim=           1
 maxnz=           1
 before call nw=       19998
 before call inw=           0


 ************************************************************
 ****************** f a t a l    e r r o r ******************
 ************************************************************

 routine echall
 nonpositive matrix size n                                                       

 ************************************************************

 after call nw=       19998
 after call inw=           0
 before 2nd call nw=       19998
 before 2nd call inw=           0


 ************************************************************
 ****************** f a t a l    e r r o r ******************
 ************************************************************

 routine echall
 nonpositive matrix size n                                                       

 ************************************************************

 after 2nd call nw=       19998
 after 2nd call inw=           0
Have you any idea?

User avatar
David Parker
Posts: 1609
Joined: Tue Aug 23, 2005 2:43 pm

Re: Deformable wall simulation: functions execution order

Post by David Parker » Thu Sep 17, 2020 10:27 am

Hi Michela,

Looking at the svPre code I see that the read_varwallprop_vtu command is setting other data than just wallproperty. Try using this command

Code: Select all

read_varwallprop_vtu varwall.vtu wallproperty
I think this will just set the wallproperty data.

If you still have problems then please upload all of the files you are using to run the svPre command so I can debug.

Cheers,
Dave

User avatar
Michela Garau
Posts: 19
Joined: Fri Sep 20, 2019 7:20 am

Re: Deformable wall simulation: functions execution order

Post by Michela Garau » Wed Oct 14, 2020 3:36 am

Hello David,

sorry if I didn't wrote you anymore, but I haven't been to work in the past few weeks.

I send you a link where you can find all the data I am using, together with a readme.txt
Thanks in advance, cheers

Michela

POST REPLY