testMesh_prg Program

program~~testmesh_prg~~UsesGraph program~testmesh_prg testMesh_prg module~kinds_mod kinds_mod module~kinds_mod->program~testmesh_prg module~mesh_mod mesh_mod module~kinds_mod->module~mesh_mod module~mesh_mod->program~testmesh_prg
Help


Test program for mesh_mod

Calls

program~~testmesh_prg~~CallsGraph program~testmesh_prg testMesh_prg proc~testreadgmsh testReadGmsh program~testmesh_prg->proc~testreadgmsh proc~testwritevtk~2 testWriteVTK program~testmesh_prg->proc~testwritevtk~2
Help

Source Code


Subroutines

subroutine testReadGmsh()

Verify operation of readGmsh

Arguments

None

subroutine testWriteVTK()

Verify operation of readGmsh

Arguments

None

Source Code

program testMesh_prg
	!! Test program for mesh_mod
	use kinds_mod
	use mesh_mod
	implicit none
	
	call testReadGmsh
	call testWriteVTK
	
contains

	subroutine testReadGmsh
		!! Verify operation of readGmsh
		type(mesh_t)::m
		
		call execute_command_line('gmsh -2 ./input/square.geo -o square.msh')
		
		call m%readGmsh('square.msh')
	end subroutine testReadGmsh

	subroutine testWriteVTK
		!! Verify operation of readGmsh
		type(mesh_t)::m
		real(wp),dimension(:),allocatable::s
		real(wp),dimension(:,:),allocatable::v
		integer::N,k
		
		call execute_command_line('gmsh -2 ./input/square.geo -o square.msh')
		
		call m%readGmsh('square.msh')
		N = size(m%nodes)
		allocate( s(N) , v(N,3) )
		v(:,3) = 0.0_wp
		do k=1,N
			s(k) = norm2( m%nodes(k)%x )
			v(k,1:2) = m%nodes(k)%x
		end do
		
		call m%writeVTK('square.vtk')
		call m%appendScalarVTK('square.vtk',s,'s')
		call m%appendVectorVTK('square.vtk',v,'v')
	end subroutine testWriteVTK

end program testMesh_prg