Skip to content

Commit 3e2e2ba

Browse files
authored
Invalid Memory Access for 'fsils' Assembly Type in Trilinos Linear Algebra (addresses SimVascular#470) (SimVascular#471)
* Fixed the segmentation fault on the fsils assembly type in the trilinos implementation. * nnzPerRow variables was used in assembly but was not created before * correctly creating nnzPerRow using unsorted order * Added integration test case ustruct/LV_HolzapfelOgdenModifiedAnisotropy_passive_trilinos to test 'fsils' assembly type when using trilinos library * Adding default for krylov space dimension for CG adn BICGS linear solver types
1 parent 3be16f6 commit 3e2e2ba

File tree

13 files changed

+153
-2
lines changed

13 files changed

+153
-2
lines changed

Code/Source/liner_solver/ls.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,20 @@ void fsils_ls_create(FSILS_lsType& ls, LinearSolverType LS_type, double relTol,
3434

3535
case LinearSolverType::LS_TYPE_GMRES:
3636
ls.RI.relTol = 0.1;
37-
ls.RI.mItr = 4;
37+
ls.RI.mItr = 1000;
3838
ls.RI.sD = 250;
3939
break;
4040

4141
case LinearSolverType::LS_TYPE_CG:
4242
ls.RI.relTol = 1.E-2;
4343
ls.RI.mItr = 1000;
44+
ls.RI.sD = 250;
4445
break;
4546

4647
case LinearSolverType::LS_TYPE_BICGS:
4748
ls.RI.relTol = 1.E-2;
48-
ls.RI.mItr = 500;
49+
ls.RI.mItr = 1000;
50+
ls.RI.sD = 250;
4951
break;
5052

5153
default:

Code/Source/solver/trilinos_impl.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ void trilinos_lhs_create(const Teuchos::RCP<Trilinos> &trilinos_, const int numG
159159
globalDofGIDs.reserve(numGhostAndLocalNodes * dof);
160160
globalGhostDofGIDs.reserve(numGhostAndLocalNodes * dof);
161161

162+
nnzPerRow.clear (); // for fsils assembly
163+
nnzPerRow.reserve(numGhostAndLocalNodes);
164+
162165
// Define localtoglobal to be used for unqiue partition map
163166
//only take ltgSorted(1:numLocalNodes) since those are owned by the processor
164167
//
@@ -179,6 +182,7 @@ void trilinos_lhs_create(const Teuchos::RCP<Trilinos> &trilinos_, const int numG
179182
{
180183
globalGhostDofGIDs.emplace_back(ltgSorted[i] * dof + d);
181184
}
185+
nnzPerRow.emplace_back(rowPtr[i+1] - rowPtr[i]);
182186
}
183187

184188
/*
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:3cf8ccb1b43920269cf72e84d8a5332c053a1a24865ce845284987aa1a3872ad
3+
size 20865
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:de695cbe805a262926972c8d2e59be6d82f43bbb0e10e6e0bb4780832b32cc0d
3+
size 93997
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:00ce8af58380bc6f682a5fbab0473818eeeb9f8024b419fbe928d38f5f8e34ec
3+
size 99744
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:516ca5f67f51c432410c65a1f98d73baca653b0378664607a20eba3fd5e94db4
3+
size 19832
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:9b7c72acb6c365fae7c33091f8d932c95863d95ffee7fed934a2f832aeba976d
3+
size 27192
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:4028808552b03a2854ce33bf5016243c6b994e62a61928625691b72938f1480d
3+
size 10038
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:f125c7001fc4a5ad90313fcff8ef24749ccd054a6b045521dfc3d06169160a09
3+
size 11982
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:2050d191642b719f651de6587571a7021eff67801eddd97c0fec397f3e9b62cd
3+
size 3940

0 commit comments

Comments
 (0)