Compare commits
No commits in common. "7d4f4b98c37f86a8744fabc699bbba4253bc37e8" and "d5bcf8ce50bde54de3681ec3c2375e5930e9ac2f" have entirely different histories.
7d4f4b98c3
...
d5bcf8ce50
7 changed files with 5 additions and 261 deletions
|
|
@ -9,7 +9,6 @@ OBJECTS = $(OBJDIR)/moduleMesh.o $(OBJDIR)/moduleMeshBoundary.o $(OBJDIR)/module
|
||||||
$(OBJDIR)/moduleMeshInputVTU.o $(OBJDIR)/moduleMeshOutputVTU.o \
|
$(OBJDIR)/moduleMeshInputVTU.o $(OBJDIR)/moduleMeshOutputVTU.o \
|
||||||
$(OBJDIR)/moduleMeshInputGmsh2.o $(OBJDIR)/moduleMeshOutputGmsh2.o \
|
$(OBJDIR)/moduleMeshInputGmsh2.o $(OBJDIR)/moduleMeshOutputGmsh2.o \
|
||||||
$(OBJDIR)/moduleMeshInput0D.o $(OBJDIR)/moduleMeshOutput0D.o \
|
$(OBJDIR)/moduleMeshInput0D.o $(OBJDIR)/moduleMeshOutput0D.o \
|
||||||
$(OBJDIR)/moduleMeshInputText.o $(OBJDIR)/moduleMeshOutputText.o \
|
|
||||||
$(OBJDIR)/moduleMesh3DCart.o \
|
$(OBJDIR)/moduleMesh3DCart.o \
|
||||||
$(OBJDIR)/moduleMesh2DCyl.o \
|
$(OBJDIR)/moduleMesh2DCyl.o \
|
||||||
$(OBJDIR)/moduleMesh2DCart.o \
|
$(OBJDIR)/moduleMesh2DCart.o \
|
||||||
|
|
|
||||||
|
|
@ -910,7 +910,6 @@ MODULE moduleInput
|
||||||
USE moduleMeshInputGmsh2, ONLY: initGmsh2
|
USE moduleMeshInputGmsh2, ONLY: initGmsh2
|
||||||
USE moduleMeshInputVTU, ONLY: initVTU
|
USE moduleMeshInputVTU, ONLY: initVTU
|
||||||
USE moduleMeshInput0D, ONLY: init0D
|
USE moduleMeshInput0D, ONLY: init0D
|
||||||
USE moduleMeshInputText, ONLY: initText
|
|
||||||
USE moduleMesh3DCart
|
USE moduleMesh3DCart
|
||||||
USE moduleMesh2DCyl
|
USE moduleMesh2DCyl
|
||||||
USE moduleMesh2DCart
|
USE moduleMesh2DCart
|
||||||
|
|
@ -1059,20 +1058,6 @@ MODULE moduleInput
|
||||||
|
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
case ("text")
|
|
||||||
!Check if the geometry is right.
|
|
||||||
if (mesh%dimen /= 1) then
|
|
||||||
call criticalError("Text mesh is only allowed for 1D geometries", 'readGeometry')
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
!Read the mesh
|
|
||||||
call initText(mesh)
|
|
||||||
if (doubleMesh) then
|
|
||||||
call initText(meshColl)
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
CASE DEFAULT
|
CASE DEFAULT
|
||||||
CALL criticalError('Mesh format ' // meshFormat // ' not defined.', 'readGeometry')
|
CALL criticalError('Mesh format ' // meshFormat // ' not defined.', 'readGeometry')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
all: vtu.o gmsh2.o 0D.o text.o
|
all: vtu.o gmsh2.o 0D.o
|
||||||
|
|
||||||
vtu.o: moduleMeshInoutCommon.o
|
vtu.o: moduleMeshInoutCommon.o
|
||||||
$(MAKE) -C vtu all
|
$(MAKE) -C vtu all
|
||||||
|
|
@ -9,8 +9,5 @@ gmsh2.o:
|
||||||
0D.o:
|
0D.o:
|
||||||
$(MAKE) -C 0D all
|
$(MAKE) -C 0D all
|
||||||
|
|
||||||
text.o:
|
|
||||||
$(MAKE) -C text all
|
|
||||||
|
|
||||||
%.o: %.f90
|
%.o: %.f90
|
||||||
$(FC) $(FCFLAGS) -c $< -o $(OBJDIR)/$@
|
$(FC) $(FCFLAGS) -c $< -o $(OBJDIR)/$@
|
||||||
|
|
|
||||||
|
|
@ -1,7 +0,0 @@
|
||||||
all: moduleMeshInputText.o moduleMeshOutputText.o
|
|
||||||
|
|
||||||
moduleMeshInputText.o: moduleMeshOutputText.o moduleMeshInputText.f90
|
|
||||||
$(FC) $(FCFLAGS) -c $(subst .o,.f90,$@) -o $(OBJDIR)/$@
|
|
||||||
|
|
||||||
%.o: %.f90
|
|
||||||
$(FC) $(FCFLAGS) -c $< -o $(OBJDIR)/$@
|
|
||||||
|
|
@ -1,163 +0,0 @@
|
||||||
module moduleMeshInputText
|
|
||||||
!The mesh is stored as a column-wise text file.
|
|
||||||
!Aimed for simple geometries in 1D
|
|
||||||
|
|
||||||
contains
|
|
||||||
!Inits the text mesh
|
|
||||||
subroutine initText(self)
|
|
||||||
use moduleMesh
|
|
||||||
use moduleMeshOutputText
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshGeneric), intent(inout), target:: self
|
|
||||||
|
|
||||||
if (associated(meshForMCC,self)) then
|
|
||||||
self%printColl => printCollText
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
select type(self)
|
|
||||||
type is (meshParticles)
|
|
||||||
self%printOutput => printOutputText
|
|
||||||
self%printEM => printEMText
|
|
||||||
self%printAverage => printAverageText
|
|
||||||
|
|
||||||
self%readInitial => readInitialText
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
self%readMesh => readText
|
|
||||||
|
|
||||||
end subroutine initText
|
|
||||||
|
|
||||||
!Reads the text mesh
|
|
||||||
subroutine readText(self, filename)
|
|
||||||
use moduleMesh
|
|
||||||
use moduleMesh1DCart
|
|
||||||
use moduleMesh1DRad
|
|
||||||
use moduleErrors
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshGeneric), intent(inout):: self
|
|
||||||
character(:), allocatable, intent(in):: filename !Dummy file, not used
|
|
||||||
integer:: fileID, reason
|
|
||||||
character(len=256):: line
|
|
||||||
integer:: nNodes
|
|
||||||
real(8):: r(1:3) !dummy 3D coordinate
|
|
||||||
integer:: physicalID
|
|
||||||
integer:: n, c
|
|
||||||
integer, allocatable:: p(:)
|
|
||||||
integer:: bt
|
|
||||||
|
|
||||||
fileID = 10
|
|
||||||
|
|
||||||
open(fileID, file=trim(filename))
|
|
||||||
|
|
||||||
!Skip header
|
|
||||||
read(fileID, *)
|
|
||||||
|
|
||||||
!Get number of nodes
|
|
||||||
nNodes = 0
|
|
||||||
do
|
|
||||||
read(fileID, *, iostat=reason) line
|
|
||||||
|
|
||||||
if (reason > 0) then
|
|
||||||
call criticalError('Error reading mesh file', 'readText')
|
|
||||||
|
|
||||||
else if (reason < 0) then
|
|
||||||
exit
|
|
||||||
|
|
||||||
else if (len(line) > 0) then
|
|
||||||
nNodes = nNodes + 1
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
end do
|
|
||||||
|
|
||||||
if (nNodes == 0) then
|
|
||||||
call criticalError('No nodes read in mesh file', 'readText')
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
self%numNodes = nNodes
|
|
||||||
self%numCells = nNodes - 1
|
|
||||||
allocate(self%nodes(1:self%numNodes))
|
|
||||||
allocate(self%cells(1:self%numCells))
|
|
||||||
|
|
||||||
select type(self)
|
|
||||||
type is (meshParticles)
|
|
||||||
self%numEdges = 2
|
|
||||||
|
|
||||||
allocate(self%edges(1:self%numEdges))
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
!Read the mesh now
|
|
||||||
rewind(fileID)
|
|
||||||
|
|
||||||
!Skip header
|
|
||||||
read(fileID, *)
|
|
||||||
|
|
||||||
!Allocate nodes and edges
|
|
||||||
do n = 1, self%numNodes
|
|
||||||
r = 0.D0
|
|
||||||
|
|
||||||
read(fileID, *) r(1), physicalID
|
|
||||||
|
|
||||||
select case(self%geometry)
|
|
||||||
case("Cart")
|
|
||||||
allocate(meshNode1DCart:: self%nodes(n)%obj)
|
|
||||||
|
|
||||||
case("Rad")
|
|
||||||
allocate(meshNode1DRad:: self%nodes(n)%obj)
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
!Init nodes
|
|
||||||
call self%nodes(n)%obj%init(n, r)
|
|
||||||
|
|
||||||
!Allocate edges if required)
|
|
||||||
select type(self)
|
|
||||||
type is (meshParticles)
|
|
||||||
if ((physicalID == 1) .or. (physicalID == 2)) then
|
|
||||||
select case(self%geometry)
|
|
||||||
case("Cart")
|
|
||||||
allocate(meshEdge1DCart:: self%edges(physicalID)%obj)
|
|
||||||
|
|
||||||
case("Rad")
|
|
||||||
allocate(meshEdge1DRad:: self%edges(physicalID)%obj)
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
allocate(p(1))
|
|
||||||
p(1) = n
|
|
||||||
bt = getBoundaryId(physicalID)
|
|
||||||
call self%edges(physicalID)%obj%init(physicalID, p, physicalID, physicalID)
|
|
||||||
deallocate(p)
|
|
||||||
|
|
||||||
end if
|
|
||||||
|
|
||||||
end select
|
|
||||||
|
|
||||||
end do
|
|
||||||
|
|
||||||
!Allocate cells
|
|
||||||
do c = 1, self%numCells
|
|
||||||
|
|
||||||
end do
|
|
||||||
|
|
||||||
close(fileID)
|
|
||||||
|
|
||||||
end subroutine readText
|
|
||||||
|
|
||||||
subroutine readInitialText(filename, density, velocity, temperature)
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
character(:), allocatable, intent(in):: filename
|
|
||||||
real(8), allocatable, intent(out), dimension(:):: density
|
|
||||||
real(8), allocatable, intent(out), dimension(:,:):: velocity
|
|
||||||
real(8), allocatable, intent(out), dimension(:):: temperature
|
|
||||||
|
|
||||||
end subroutine readInitialText
|
|
||||||
|
|
||||||
end module moduleMeshInputText
|
|
||||||
|
|
@ -1,67 +0,0 @@
|
||||||
module moduleMeshOutputText
|
|
||||||
contains
|
|
||||||
|
|
||||||
subroutine writeSpeciesOutput(self, fileID, speciesIndex)
|
|
||||||
use moduleMesh
|
|
||||||
use moduleOutput
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshParticles), INTENT(in):: self
|
|
||||||
integer, intent(in):: fileID
|
|
||||||
integer, intent(in):: speciesIndex
|
|
||||||
|
|
||||||
end subroutine writeSpeciesOutput
|
|
||||||
|
|
||||||
subroutine writeCollOutput(self, fileID)
|
|
||||||
use moduleMesh
|
|
||||||
use moduleCollisions
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshGeneric), intent(in):: self
|
|
||||||
integer, intent(in):: fileID
|
|
||||||
|
|
||||||
end subroutine writeCollOutput
|
|
||||||
|
|
||||||
subroutine writeEMOutput(self, fileID)
|
|
||||||
use moduleMesh
|
|
||||||
use moduleRefParam
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshParticles), intent(in):: self
|
|
||||||
integer, intent(in):: fileID
|
|
||||||
|
|
||||||
end subroutine writeEMOutput
|
|
||||||
|
|
||||||
subroutine printOutputText(self)
|
|
||||||
use moduleMesh
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshParticles), intent(in):: self
|
|
||||||
|
|
||||||
end subroutine printOutputText
|
|
||||||
|
|
||||||
subroutine printCollText(self)
|
|
||||||
use moduleMesh
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshGeneric), intent(in):: self
|
|
||||||
|
|
||||||
end subroutine printCollText
|
|
||||||
|
|
||||||
subroutine printEMText(self)
|
|
||||||
use moduleMesh
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshParticles), intent(in):: self
|
|
||||||
|
|
||||||
end subroutine printEMText
|
|
||||||
|
|
||||||
subroutine printAverageText(self)
|
|
||||||
use moduleMesh
|
|
||||||
implicit none
|
|
||||||
|
|
||||||
class(meshParticles), intent(in):: self
|
|
||||||
|
|
||||||
end subroutine printAverageText
|
|
||||||
|
|
||||||
end module moduleMeshOutputText
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue