Skip to content

Commit 44fc5ec

Browse files
RIS valve mesh scale factor bug fix (SimVascular#439)
* Fixed bug for using uris mesh max eNoN and scale factor. * Fixed bugs for RIS valve with mesh scale factor other than 1 * Changed default RIS valve signed distance function to a large value --------- Co-authored-by: Aaron Brown <[email protected]>
1 parent ef69207 commit 44fc5ec

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

Code/Source/solver/ComMod.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,10 +1456,10 @@ class urisType
14561456
Array<double> Yd;
14571457

14581458
// Default signed distance value away from the valve.
1459-
double sdf_default = 10.0;
1459+
double sdf_default = 1000.0;
14601460

14611461
// Default distance value of the valve boundary (valve thickness).
1462-
double sdf_deps = 0.04;
1462+
double sdf_deps = 0.25;
14631463

14641464
// Default distance value of the valve boundary when the valve is closed.
14651465
double sdf_deps_close = 0.25;

Code/Source/solver/uris.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,9 @@ void uris_read_msh(Simulation* simulation) {
518518
}
519519
file_stream.close();
520520

521-
uris_obj.sdf_deps = param->thickness();
522-
uris_obj.sdf_deps_close = param->close_thickness();
521+
uris_obj.sdf_default = uris_obj.sdf_default * uris_obj.scF;
522+
uris_obj.sdf_deps = param->thickness() * uris_obj.scF;
523+
uris_obj.sdf_deps_close = param->close_thickness() * uris_obj.scF;
523524
uris_obj.clsFlg = param->valve_starts_as_closed();
524525

525526
// uris_obj.tnNo = 0;
@@ -779,7 +780,8 @@ void uris_write_vtus(ComMod& com_mod) {
779780
for (int a = 0; a < mesh.nNo; a++) {
780781
int Ac = mesh.gN(a);
781782
for (int i = 0; i < nsd; i++) {
782-
d[iM].x(i,a) = uris_obj.x(i,Ac);
783+
// Scale the valve displacement to the unit of the mesh
784+
d[iM].x(i,a) = uris_obj.x(i,Ac) / uris_obj.scF;
783785
}
784786
}
785787
for (int e = 0; e < mesh.nEl; e++) {
@@ -802,7 +804,7 @@ void uris_write_vtus(ComMod& com_mod) {
802804
for (int a = 0; a < mesh.nNo; a++) {
803805
int Ac = mesh.gN(a);
804806
for (int i = 0; i < nsd; i++) {
805-
d[iM].x(is+i,a) = uris_obj.Yd(s+i,Ac); // [HZ] Need to check this
807+
d[iM].x(is+i,a) = uris_obj.Yd(s+i,Ac) / uris_obj.scF; // [HZ] Need to check this
806808
}
807809
}
808810

0 commit comments

Comments
 (0)