From f8ed2deb4ee97dd867b95932d958ae5d30fa2a4e Mon Sep 17 00:00:00 2001 From: ZaellixA <axilleaz@protonmail.com> Date: Thu, 13 Feb 2025 18:29:14 +0000 Subject: [PATCH] Allow zero distance between the elements and calclulate the number of tetrahedrals to rotate with nnz --- Utilities/Geometries/MATLAB/Functions/rcvGeo.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Utilities/Geometries/MATLAB/Functions/rcvGeo.m b/Utilities/Geometries/MATLAB/Functions/rcvGeo.m index cea25d6..a9f37ee 100644 --- a/Utilities/Geometries/MATLAB/Functions/rcvGeo.m +++ b/Utilities/Geometries/MATLAB/Functions/rcvGeo.m @@ -3,7 +3,7 @@ % Author: Achilles Kappis % e-mail: axilleaz@protonmail.com % -% Date: 15/12/2024 (DD/MM/YYYY) +% Date: 13/02/2025 (DD/MM/YYYY) % % Copyright: MIT % -------------------------------------------------- @@ -216,7 +216,7 @@ function [omniPos, fig8Pos, triPos, boxPos, box2DPos, tetPos, fig8Vec, triVec, b end if nargin > 2 && ~isempty(elemDist) - validateattributes(elemDist, "numeric", {'scalar', 'real', 'positive', 'nonnan', 'finite'}, mfilename, "Array inter-element distance", 3); + validateattributes(elemDist, "numeric", {'scalar', 'real', 'nonnegative', 'nonnan', 'finite'}, mfilename, "Array inter-element distance", 3); else elemDist = 0.1; end @@ -327,7 +327,7 @@ function [omniPos, fig8Pos, triPos, boxPos, box2DPos, tetPos, fig8Vec, triVec, b switch lower(gType) case "ula" % Rotate the tetrahedrals on the positive side of the y-axis - rotIdx = sum(omniPos(1, :) > 0); % Calculate how many tetrahedrals we have to rotate + rotIdx = nnz(omniPos(1, :) > 0); % Calculate how many tetrahedrals we have to rotate % Go through the tetrahedrals for measPosIdx = size(omniPos, 2):-1:1 -- GitLab