Skip to content

Commit

Permalink
check dimension of Xc and Xg
Browse files Browse the repository at this point in the history
  • Loading branch information
gha3mi committed Apr 2, 2024
1 parent 0acfaf0 commit 6e33eb6
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 12 deletions.
8 changes: 6 additions & 2 deletions src/NURBS/forcad_nurbs_curve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc, 2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc, 2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension of the control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*3
Expand Down Expand Up @@ -376,8 +378,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg, 2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg, 2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension of the geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*3
Expand Down
8 changes: 6 additions & 2 deletions src/NURBS/forcad_nurbs_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension for control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*5
Expand Down Expand Up @@ -422,8 +424,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension for geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*5
Expand Down
8 changes: 6 additions & 2 deletions src/NURBS/forcad_nurbs_volume.f90
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension for control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*9
Expand Down Expand Up @@ -458,8 +460,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension for geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*9
Expand Down
8 changes: 6 additions & 2 deletions src/Rational_Bezier/forcad_bezier_curve.f90
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension of control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*3
Expand Down Expand Up @@ -339,8 +341,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension of geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*3
Expand Down
8 changes: 6 additions & 2 deletions src/Rational_Bezier/forcad_bezier_surface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension for control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*5
Expand Down Expand Up @@ -361,8 +363,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension for geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*5
Expand Down
8 changes: 6 additions & 2 deletions src/Rational_Bezier/forcad_bezier_volume.f90
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,10 @@ impure subroutine export_Xc(this, filename)

if (size(this%Xc,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), 0.0_rk , i = 1, nc)
else
elseif (size(this%Xc,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xc(i,1), this%Xc(i,2), this%Xc(i,3) , i = 1, nc)
else
error stop 'Invalid dimension for control points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*9
Expand Down Expand Up @@ -382,8 +384,10 @@ impure subroutine export_Xg(this, filename)

if (size(this%Xg,2) == 2) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), 0.0_rk , i = 1, ng)
else
elseif (size(this%Xg,2) == 3) then
write(nunit,'(g0," ",g0," ",g0)') (this%Xg(i,1), this%Xg(i,2), this%Xg(i,3) , i = 1, ng)
else
error stop 'Invalid dimension for geometry points.'
end if

write(nunit,'(a," ",g0," ",g0)') 'CELLS', size(elemConn,1), size(elemConn,1)*9
Expand Down

0 comments on commit 6e33eb6

Please sign in to comment.