diff --git a/src/makefile b/src/makefile index 83cf8db..247c7d2 100644 --- a/src/makefile +++ b/src/makefile @@ -9,7 +9,6 @@ OBJECTS = $(OBJDIR)/moduleMesh.o $(OBJDIR)/moduleMeshBoundary.o $(OBJDIR)/module $(OBJDIR)/moduleMeshInputVTU.o $(OBJDIR)/moduleMeshOutputVTU.o \ $(OBJDIR)/moduleMeshInputGmsh2.o $(OBJDIR)/moduleMeshOutputGmsh2.o \ $(OBJDIR)/moduleMeshInput0D.o $(OBJDIR)/moduleMeshOutput0D.o \ - $(OBJDIR)/moduleMeshInputText.o $(OBJDIR)/moduleMeshOutputText.o \ $(OBJDIR)/moduleMesh3DCart.o \ $(OBJDIR)/moduleMesh2DCyl.o \ $(OBJDIR)/moduleMesh2DCart.o \ diff --git a/src/modules/init/moduleInput.f90 b/src/modules/init/moduleInput.f90 index 74da279..9a8ace6 100644 --- a/src/modules/init/moduleInput.f90 +++ b/src/modules/init/moduleInput.f90 @@ -910,7 +910,6 @@ MODULE moduleInput USE moduleMeshInputGmsh2, ONLY: initGmsh2 USE moduleMeshInputVTU, ONLY: initVTU USE moduleMeshInput0D, ONLY: init0D - USE moduleMeshInputText, ONLY: initText USE moduleMesh3DCart USE moduleMesh2DCyl USE moduleMesh2DCart @@ -1059,20 +1058,6 @@ MODULE moduleInput 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 CALL criticalError('Mesh format ' // meshFormat // ' not defined.', 'readGeometry') diff --git a/src/modules/mesh/inout/makefile b/src/modules/mesh/inout/makefile index 1b8883d..a93161d 100644 --- a/src/modules/mesh/inout/makefile +++ b/src/modules/mesh/inout/makefile @@ -1,4 +1,4 @@ -all: vtu.o gmsh2.o 0D.o text.o +all: vtu.o gmsh2.o 0D.o vtu.o: moduleMeshInoutCommon.o $(MAKE) -C vtu all @@ -9,8 +9,5 @@ gmsh2.o: 0D.o: $(MAKE) -C 0D all -text.o: - $(MAKE) -C text all - %.o: %.f90 $(FC) $(FCFLAGS) -c $< -o $(OBJDIR)/$@ diff --git a/src/modules/mesh/inout/text/makefile b/src/modules/mesh/inout/text/makefile deleted file mode 100644 index 26d0f10..0000000 --- a/src/modules/mesh/inout/text/makefile +++ /dev/null @@ -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)/$@ diff --git a/src/modules/mesh/inout/text/moduleMeshInputText.f90 b/src/modules/mesh/inout/text/moduleMeshInputText.f90 deleted file mode 100644 index f28de9c..0000000 --- a/src/modules/mesh/inout/text/moduleMeshInputText.f90 +++ /dev/null @@ -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 diff --git a/src/modules/mesh/inout/text/moduleMeshOutputText.f90 b/src/modules/mesh/inout/text/moduleMeshOutputText.f90 deleted file mode 100644 index c1b288d..0000000 --- a/src/modules/mesh/inout/text/moduleMeshOutputText.f90 +++ /dev/null @@ -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 diff --git a/src/modules/mesh/moduleMesh.f90 b/src/modules/mesh/moduleMesh.f90 index 78cc772..7ab3914 100644 --- a/src/modules/mesh/moduleMesh.f90 +++ b/src/modules/mesh/moduleMesh.f90 @@ -344,10 +344,10 @@ MODULE moduleMesh !Array of cell elements TYPE(meshCellCont), ALLOCATABLE:: cells(:) !PROCEDURES SPECIFIC OF FILE TYPE - PROCEDURE(readMesh_interface), POINTER, PASS:: readMesh => NULL() - PROCEDURE(readInitial_interface), POINTER, NOPASS:: readInitial => NULL() - PROCEDURE(connectMesh_interface), POINTER, PASS:: connectMesh => NULL() - PROCEDURE(printColl_interface), POINTER, PASS:: printColl => NULL() + PROCEDURE(readMesh_interface), POINTER, PASS:: readMesh => NULL() + PROCEDURE(readInitial_interface), POINTER, NOPASS:: readInitial => NULL() + PROCEDURE(connectMesh_interface), POINTER, PASS:: connectMesh => NULL() + PROCEDURE(printColl_interface), POINTER, PASS:: printColl => NULL() CONTAINS !GENERIC PROCEDURES PROCEDURE, PASS:: doCollisions