Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/ldem/ANSYS.m
Original file line number Diff line number Diff line change
Expand Up @@ -327,16 +327,14 @@

if TEST == 102
for I = 1:NNT
if BDX(I) == 1
fprintf(IFILE, 'D,%d,UX\n', I);

LOGIC1 = (W0(I) < (((L1/2)-0.49)*LCO)) && (W0(I) > (((L1/2)-0.51)*LCO));
LOGIC2 = (V0(I) > (0.49 * LCO)) && (V0(I) < (0.51 * LCO));

if LOGIC1 && LOGIC2
fprintf(IFILE, 'F,%d,FY,%d\n', I, -100);
end
if BDY(I) == 1
fprintf(IFILE, 'D,%d,UY\n', I);
end
if BDZ(I) == 1
fprintf(IFILE, 'D,%d,UZ\n', I);
end
end
end
end

fprintf(IFILE, '\n');
Expand Down
82 changes: 10 additions & 72 deletions src/ldem/BOUND.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,70 +26,7 @@
%!--------------------------------------------------------------------------
%!


%
% !
% ! TEST = 101
% IF (TEST.EQ.101) THEN
%
% DO I=1,NNT
%
% Logic2=(u0(I).LT.(0.51*LCO)).AND.(u0(I).GT.(0.49*LCO))
%
% IF (Logic2) THEN
% BDX(I)=1
% ! BDY(I)=1
% ! BDZ(I)=1
% ! write(*,*) "nobound=",I
% END IF
%
% Logic2=(u0(I).GT.(M1-0.51*LCO)).AND.(u0(I).LT.(M1-0.49*LCO))
%
% IF (Logic2) THEN
% BDX(I)=1
% ! BDY(I)=1
% ! BDZ(I)=1
% ! write(*,*) "nobound=",I
% END IF
%
% END DO
% END IF
%
% IF (TEST.EQ.102) THEN
%
% DO I=1,NNT
% Logic1=(v0(I).GT.(0.49*LCO)).AND.(v0(I).LT.(0.51*LCO))
% Logic2=(u0(I).LT.(4.51*LCO)).AND.(u0(I).GT.(4.49*LCO))
% IF (Logic1.AND.Logic2) THEN
% BDX(I)=1
% BDY(I)=1
% epsL! BDZ(I)=1
% ! write(*,*) "nobound=",I
% END IF
% Logic1=(u0(I).GT.((M1-4.51)*LCO)).AND.(u0(I).LT.((M1-4.49)*LCO))
% Logic2=(v0(I).LT.(0.51*LCO)).AND.(v0(I).GT.(0.49*LCO))
% IF(Logic1.AND.Logic2) THEN
% BDy(I)=1
% ! BDZ(I)=1
% ! write(*,*) "nobound2=",I
% END IF
% END DO
% DO I=1,NNT
% LOGIC1=u0(I).LT.((M1-33.49)*LCO).AND.u0(I).GT.((M1-33.51)*LCO)
% LOGIC3=v0(I).LT.((N1-0.49)*LCO).AND.v0(I).GT.((N1-0.51)*LCO)
% LOGIC2=u0(I).LT.((33.51)*LCO).AND.u0(I).GT.((33.49)*LCO)
% IF(LOGIC1.AND.LOGIC3)THEN
% BDy(I)=1
% endif
% IF(LOGIC2.AND.LOGIC3)THEN
% BDy(I)=1
% endif
%
% END DO
% END IF
% RETURN
% END
%

if TEST == 101

% Masks for the two conditions (operate on all elements at once)
Expand All @@ -104,16 +41,17 @@
if TEST == 102

% --- First block of conditions (replaces the first loop) ---
mask1 = (V0 > (0.49 * LCO)) & (V0 < (0.51 * LCO)) & ...
(U0 < (4.51 * LCO)) & (U0 > (4.49 * LCO));

mask2 = (U0 > ((M1 - 4.51) * LCO)) & (U0 < ((M1 - 4.49) * LCO)) & ...
(V0 < (0.51 * LCO)) & (V0 > (0.49 * LCO));
mask1 = (W0 > (0.49 * LCO)) & (W0 < (0.51 * LCO)) ;
mask2=(W0 < ((L1-0.49)*LCO)) & (W0 > ((L1-0.51)*LCO));


% Apply the assignments
BDX(mask1) = 1;
BDY(mask1) = 1;
BDY(mask2) = 1; % Originally BDy -> unified to BDY (Fortran is case-insensitive)
BDX(mask1) = 1;
BDY(mask1) = 1;
BDZ(mask1) = 1;
BDX( mask2) = 1;
BDY( mask2) = 1;
BDZ( mask2) = 1;


% --- S econd block of conditions (replaces the second loop) ---
Expand Down
2 changes: 1 addition & 1 deletion src/ldem/CABAR.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
% PARAMETER (INN=1.2E6, INB=6E6, IRU=20, INCON=8)
% These parameters are not used in this routine.
%--------------------------------------------------------------------------
NUMBAR = 7014;
NUMBAR = 14398;

for B = 1:NBT
NOI = CN(2*B - 1);
Expand Down
28 changes: 13 additions & 15 deletions src/ldem/CALOAD.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,20 @@
if TEST == 102
VF2 = 400.0e-5; % m/s

for I = 1:NNT
LOGIC1 = (U0(I) < (M1 - 33.49) * LCO) && ...
(U0(I) > (M1 - 33.51) * LCO);
LOGIC3 = (V0(I) < (N1 - 0.49) * LCO) && ...
(V0(I) > (N1 - 0.51) * LCO);
LOGIC2 = (U0(I) < 33.51 * LCO) && ...
(U0(I) > 33.49 * LCO);
mask_z = (W0 < ( ((L1/2)-0.49)*LCO) ) & (W0 > ( ((L1/2)-0.51)*LCO) );
mask_y = (V0 > (0.49 * LCO)) & (V0 < (0.51 * LCO));


mascara_total = mask_z & mask_y;

tempo_limite = 0.00035;

if LOGIC1 && LOGIC3
V(2,I) = V0(I) - VF2 * TIME;
end
if LOGIC1 && LOGIC2
V(2,I) = V0(I) - VF2 * TIME;
end
if TIME < tempo_limite
FRY(mascara_total) = 1000 * TIME;
else

FRY(mascara_total) = 1000 * tempo_limite;
end
end

ini=1;
end
end
38 changes: 19 additions & 19 deletions src/ldem/DATA0.DAT
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
102 ' TEST '
123 ' SEED'
0.003 ' LCO '
101 ' M '
41 ' N '
21 ' L '
25000.00E+0 ' DF1 '
25000.00E+0 ' DF2 '
1E-3 ' LCO '
6 ' M '
6 ' N '
51 ' L '
2500.00E+0 ' DF1 '
2500.00E+0 ' DF2 '
0.015 ' TDAF '
0.00E-00 ' CON '
2.00E-7 ' DT '
3.0E-2 ' TTOT '
3.5E-7 ' DT '
2.8E-3 ' TTOT '
5 ' INCO '
1 ' Ncon1 '
2 ' Ncon2 '
3 ' Ncon3 '
4 ' Ncon4 '
5 ' Ncon5 '
9999999 ' OU2 '
10000 ' OU3 '
2441 ' Ncon1 '
2441 ' Ncon2 '
6870 ' Ncon3 '
14398 ' Ncon4 '
884 ' Ncon5 '
14398 ' OU2 '
1000 ' OU3 '
0 ' OU4 '
0 ' OU5 '
1 ' OU6 '
1 ' OU7 '
1 ' OU8 '
1 ' OU9 '
2.50E-01 ' PSN '
2000.0E+0 ' ROH '
32.00E+9 ' YNG '
50.0E+00 ' GFR '
0.028 ' DEQ '
1500.0E+0 ' ROH '
3.87E+9 ' YNG '
0.5E+00 ' GFR '
4.5E-3 ' DEQ '

Loading