From f40495ed116a9793cea2fc97781836b72e896200 Mon Sep 17 00:00:00 2001 From: akeeste Date: Fri, 12 Jul 2024 15:30:44 -0500 Subject: [PATCH 1/3] readCapytaine - fix reading multiple bodies with <6 dofs --- source/functions/BEMIO/readCAPYTAINE.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/functions/BEMIO/readCAPYTAINE.m b/source/functions/BEMIO/readCAPYTAINE.m index 27f7bfe3a..4bd28d6fd 100644 --- a/source/functions/BEMIO/readCAPYTAINE.m +++ b/source/functions/BEMIO/readCAPYTAINE.m @@ -476,7 +476,7 @@ end % set the indices that sort the old dofs/variables into the correct order -inds = zeros(1,max([6,sum(nDofs_per_body)])); +inds = zeros(1,max([6*length(nDofs_per_body),sum(nDofs_per_body)])); for j=1:length(old_dofs) for i=1:length(sorted_dofs) if lower(old_dofs(j)) == sorted_dofs(i) From 08a2d523048e32d5fab56d29ce4726de5ecb66ff Mon Sep 17 00:00:00 2001 From: akeeste Date: Wed, 14 Aug 2024 16:38:12 -0500 Subject: [PATCH 2/3] make fix from @mshabara review --- source/functions/BEMIO/readCAPYTAINE.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/functions/BEMIO/readCAPYTAINE.m b/source/functions/BEMIO/readCAPYTAINE.m index 4bd28d6fd..53ad10199 100644 --- a/source/functions/BEMIO/readCAPYTAINE.m +++ b/source/functions/BEMIO/readCAPYTAINE.m @@ -476,7 +476,7 @@ end % set the indices that sort the old dofs/variables into the correct order -inds = zeros(1,max([6*length(nDofs_per_body),sum(nDofs_per_body)])); +inds = zeros(1,max([6*length(body_names),sum(nDofs_per_body)])); for j=1:length(old_dofs) for i=1:length(sorted_dofs) if lower(old_dofs(j)) == sorted_dofs(i) From 10d541e81ee08da7ce9098948c7199b321800773 Mon Sep 17 00:00:00 2001 From: akeeste Date: Wed, 14 Aug 2024 16:41:20 -0500 Subject: [PATCH 3/3] more robust indexing of dofs --- source/functions/BEMIO/readCAPYTAINE.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/functions/BEMIO/readCAPYTAINE.m b/source/functions/BEMIO/readCAPYTAINE.m index 53ad10199..69cc49688 100644 --- a/source/functions/BEMIO/readCAPYTAINE.m +++ b/source/functions/BEMIO/readCAPYTAINE.m @@ -476,7 +476,7 @@ end % set the indices that sort the old dofs/variables into the correct order -inds = zeros(1,max([6*length(body_names),sum(nDofs_per_body)])); +inds = zeros(1,length(sorted_dofs)); for j=1:length(old_dofs) for i=1:length(sorted_dofs) if lower(old_dofs(j)) == sorted_dofs(i)