Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export_1d_elem_field numbering fixed #164

Merged
merged 3 commits into from
Mar 27, 2024
Merged
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
72 changes: 36 additions & 36 deletions src/lib/exports.f90
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ module exports
use diagnostics
use indices
use other_consts

implicit none

private
public &
export_1d_elem_geometry, &
Expand Down Expand Up @@ -47,7 +47,7 @@ subroutine export_cubic_lagrange_2d(EXFILE,groupname)
use geometry,only: coord_at_xi
character(len=*) :: EXFILE
character(len=*) :: groupname

integer,allocatable :: nodes_at_centre(:),nodes_on_lines(:), &
node_xyz_2d_temp(:,:,:,:)
integer,allocatable :: nodes_cl(:),nodes_cl_elems(:,:)
Expand All @@ -60,7 +60,7 @@ subroutine export_cubic_lagrange_2d(EXFILE,groupname)
character(len=300) :: writefile

call enter_exit(sub_name,1)

! overallocating the minimum required memory, just to make indexing of nodes easy
allocate(nodes_on_lines(num_nodes_2d+num_lines_2d))
nodes_on_lines = 0
Expand Down Expand Up @@ -178,12 +178,12 @@ subroutine export_cubic_lagrange_2d(EXFILE,groupname)
enddo
close(10)
close(20)

deallocate(nodes_on_lines)
deallocate(nodes_at_centre)
deallocate(nodes_cl_elems)
deallocate(xyz)

call enter_exit(sub_name,2)

end subroutine export_cubic_lagrange_2d
Expand All @@ -202,12 +202,12 @@ subroutine export_triangle_elements(EXELEMFILE,groupname)
character(len=1) :: char1
character(len=100) :: writefile
character(len=60) :: sub_name

! --------------------------------------------------------------------------

sub_name = 'export_triangle_elements'
call enter_exit(sub_name,1)

if(index(EXELEMFILE, ".exelem")> 0) then !full filename is given
writefile = EXELEMFILE(1:100)
else ! need to append the correct filename extension
Expand All @@ -225,15 +225,15 @@ subroutine export_triangle_elements(EXELEMFILE,groupname)
write(10,'( '' Element: 0 0 '',I5)') nline+3
nline = nline+3
enddo !ne

!** write the elements
write(10,'( '' Shape. Dimension=2, line*line'' )')
write(10,'( '' #Scale factor sets=1'' )')
write(10,'( '' l.Lagrange*l.Lagrange, #Scale factors=4'' )')
write(10,'( '' #Nodes= '',I2 )') 4
write(10,'( '' #Fields=1'' )')
write(10,'( '' 1) coordinates, coordinate, rectangular cartesian, #Components=3'')')

do nj = 1,3
if(nj==1) char1='x'; if(nj==2) char1='y'; if(nj==3) char1='z';
write(10,'('' '',A2,''. l.Lagrange*l.Lagrange, no modify, standard node based.'')') char1
Expand All @@ -244,7 +244,7 @@ subroutine export_triangle_elements(EXELEMFILE,groupname)
write(10,'('' Scale factor indices: '',I4)') nn
enddo !nn
enddo !nj

nline = 0
do ne = 1,num_triangles
!** write the element
Expand All @@ -268,7 +268,7 @@ subroutine export_triangle_elements(EXELEMFILE,groupname)
call enter_exit(sub_name,2)

end subroutine export_triangle_elements

!
!##############################################################################
!
Expand All @@ -283,12 +283,12 @@ subroutine export_triangle_nodes(EXNODEFILE, groupname)
integer :: i,nj
character(len=100) :: writefile
character(len=60) :: sub_name

! --------------------------------------------------------------------------

sub_name = 'export_triangle_nodes'
call enter_exit(sub_name,1)

if(index(EXNODEFILE, ".exnode")> 0) then !full filename is given
writefile = EXNODEFILE(1:100)
else ! need to append the correct filename extension
Expand Down Expand Up @@ -316,7 +316,7 @@ subroutine export_triangle_nodes(EXNODEFILE, groupname)
write(10,'(2x,3(f12.6))') vertex_xyz(:,i)
enddo
close(10)

call enter_exit(sub_name,2)

end subroutine export_triangle_nodes
Expand All @@ -338,9 +338,9 @@ subroutine export_1d_elem_field(ne_field, EXELEMFILE, group_name, field_name )
logical :: CHANGED
character(len=300) :: writefile
character(len=60) :: sub_name

! --------------------------------------------------------------------------

sub_name = 'export_1d_elem_field'
call enter_exit(sub_name,1)

Expand All @@ -349,7 +349,7 @@ subroutine export_1d_elem_field(ne_field, EXELEMFILE, group_name, field_name )
else ! need to append the correct filename extension
writefile = trim(EXELEMFILE)//'.exelem'
endif

open(10, file=writefile, status='replace')

len_end=len_trim(group_name)
Expand Down Expand Up @@ -398,9 +398,9 @@ subroutine export_1d_elem_geometry(EXELEMFILE, name)
logical :: CHANGED
character(len=300) :: writefile
character(len=60) :: sub_name

! --------------------------------------------------------------------------

sub_name = 'export_1d_elem_geometry'
call enter_exit(sub_name,1)

Expand All @@ -409,9 +409,9 @@ subroutine export_1d_elem_geometry(EXELEMFILE, name)
else ! need to append the correct filename extension
writefile = trim(EXELEMFILE)//'.exelem'
endif

open(10, file=writefile, status='replace')

len_end=len_trim(name)
!** write the group name
write(10,'( '' Group name: '',A)') name(:len_end)
Expand Down Expand Up @@ -450,7 +450,7 @@ subroutine export_1d_elem_geometry(EXELEMFILE, name)
close(10)

call enter_exit(sub_name,2)

end subroutine export_1d_elem_geometry

!
Expand Down Expand Up @@ -478,7 +478,7 @@ subroutine export_elem_geometry_2d(EXELEMFILE, name, offset_elem, offset_node)
else ! need to append the correct filename extension
writefile = trim(EXELEMFILE)//'.exelem'
endif

open(10, file=writefile, status='replace')

!** write the group name
Expand Down Expand Up @@ -535,7 +535,7 @@ subroutine export_elem_geometry_2d(EXELEMFILE, name, offset_elem, offset_node)
WRITE(10,'( '' #Nodes= '',I2 )') numnodes_ex
WRITE(10,'( '' #Fields= 1'' )')
WRITE(10,'( '' 1) coordinates, coordinate, rectangular cartesian, #Components=3'')')

do nj=1,3
if(nj==1) char1='x'; if(nj==2) char1='y'; if(nj==3) char1='z';
WRITE(10,'('' '',A2,''. c.Hermite*c.Hermite, no modify, standard node based.'')') char1
Expand Down Expand Up @@ -589,9 +589,9 @@ subroutine export_node_geometry(EXNODEFILE, name)
logical :: FIRST_NODE
character(len=300) :: writefile
character(len=60) :: sub_name

! --------------------------------------------------------------------------

sub_name = 'export_node_geometry'
call enter_exit(sub_name,1)

Expand All @@ -600,7 +600,7 @@ subroutine export_node_geometry(EXNODEFILE, name)
else ! need to append the correct filename extension
writefile = trim(EXNODEFILE)//'.exnode'
endif

len_end=len_trim(name)
if(num_nodes.GT.0) THEN
open(10, file=writefile, status='replace')
Expand Down Expand Up @@ -636,7 +636,7 @@ subroutine export_node_geometry(EXNODEFILE, name)
close(10)

call enter_exit(sub_name,2)

end subroutine export_node_geometry

!
Expand All @@ -663,7 +663,7 @@ subroutine export_node_geometry_2d(EXNODEFILE, name, offset)
else ! need to append the correct filename extension
writefile = trim(EXNODEFILE)//'.exnode'
endif

if(num_nodes_2d.gt.0)then
open(10, file=writefile, status='replace')

Expand Down Expand Up @@ -786,9 +786,9 @@ subroutine export_terminal_solution(EXNODEFILE, name)
else ! need to append the correct filename extension
writefile = trim(EXNODEFILE)//'.exnode'
endif

len_end=len_trim(name)

if(num_units.GT.0) THEN
open(10, file=writefile, status='replace')
!** write the group name
Expand Down Expand Up @@ -859,7 +859,7 @@ subroutine export_terminal_solution(EXNODEFILE, name)
close(10)

end subroutine export_terminal_solution

!
!##############################################################################
!
Expand Down Expand Up @@ -997,7 +997,7 @@ subroutine export_terminal_ssgexch(EXNODEFILE, name)
close(10)

end subroutine export_terminal_ssgexch

!
!##############################################################################
!
Expand Down
Loading
Loading