Skip to content
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
2 changes: 1 addition & 1 deletion pages/BaseMethods.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BaseMethods

`BaseMethods` library contains the modules which defines and implements methods (routines) for data types defined in BaseType.
`BaseMethods` library contains the modules which defines and implements methods (routines) for data types defined in BaseType.

At present BaseMethods contains following modules.

Expand Down
30 changes: 19 additions & 11 deletions src/modules/BaseInterpolation/src/BaseInterpolation_Method.F90
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,15 @@ MODULE BaseInterpolation_Method
USE String_Class, ONLY: String
USE StringUtility, ONLY: UpperCase
USE Display_Method, ONLY: Tostring
USE BaseType, ONLY: poly => TypePolynomialOpt, &
ip => TypeQuadratureOpt, &
BaseInterpolation_, &
LagrangeInterpolation_, &
SerendipityInterpolation_, &
HermitInterpolation_, &
HierarchyInterpolation_, &
OrthogonalInterpolation_

USE BaseType, ONLY: poly => TypePolynomialOpt
USE BaseType, ONLY: ip => TypeQuadratureOpt
USE BaseType, ONLY: BaseInterpolation_
USE BaseType, ONLY: LagrangeInterpolation_
USE BaseType, ONLY: SerendipityInterpolation_
USE BaseType, ONLY: HermitInterpolation_
USE BaseType, ONLY: HierarchyInterpolation_
USE BaseType, ONLY: OrthogonalInterpolation_
IMPLICIT NONE

PRIVATE

PUBLIC :: ASSIGNMENT(=)
Expand Down Expand Up @@ -226,8 +224,11 @@ FUNCTION InterpolationPoint_ToInteger(name) RESULT(ans)

SELECT CASE (astr)

CASE ("CENTER")
ans = ip%Center

CASE ("EQUIDISTANCE")
ans = ip%equidistance
ans = ip%Equidistance

CASE ("GAUSSLEGENDRE")
ans = ip%GaussLegendre
Expand Down Expand Up @@ -580,6 +581,13 @@ FUNCTION InterpolationPoint_ToChar(name, isUpper) RESULT(ans)
IF (PRESENT(isUpper)) isUpper0 = isUpper

SELECT CASE (name)
CASE (ip%Center)
IF (isUpper0) THEN
ans = "CENTER"
ELSE
ans = "Center"
END IF

CASE (ip%equidistance)
IF (isUpper0) THEN
ans = "EQUIDISTANCE"
Expand Down
1 change: 0 additions & 1 deletion src/modules/BaseMethod/src/BaseMethod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ MODULE BaseMethod
USE IntVector_Method
USE IndexValue_Method
USE KeyValue_Method
USE IterationData_Method
USE Vector3D_Method
USE RealVector_Method
USE DOF_Method
Expand Down
88 changes: 16 additions & 72 deletions src/modules/BaseType/src/BaseType.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ MODULE BaseType

USE GlobalData, ONLY: RelativeConvergence, ConvergenceInRes, &
ConvergenceInSol, ConvergenceInResSol, &
AbsoluteConvergence, NormL2, &
AbsoluteConvergence, NormL1, NormL2, NormInfinity, &
StressTypeVoigt, OMP_THREADS_JOINED

USE GlobalData, ONLY: Equidistance, EquidistanceQP, GaussQP, &
USE GlobalData, ONLY: Equidistance, CenterQP, EquidistanceQP, GaussQP, &
GaussLegendreQP, GaussLegendreLobattoQP, &
GaussLegendreRadau, GaussLegendreRadauLeft, &
GaussLegendreRadauRight, GaussRadauQP, &
Expand Down Expand Up @@ -141,9 +141,6 @@ MODULE BaseType
PUBLIC :: CSRMatrix_
PUBLIC :: TypeCSRMatrix
PUBLIC :: CSRMatrixPointer_
PUBLIC :: IterationData_
PUBLIC :: TypeIterationData
PUBLIC :: IterationDataPointer_
PUBLIC :: VoigtRank2Tensor_
PUBLIC :: TypeVoigtRank2Tensor
PUBLIC :: VoigtRank2TensorPointer
Expand Down Expand Up @@ -312,6 +309,8 @@ MODULE BaseType
REAL(DFP) :: minus_one = -1.0_DFP
REAL(DFP) :: two = 2.0_DFP
REAL(DFP) :: minus_two = -2.0_DFP
REAL(DFP) :: three = 3.0_DFP
REAL(DFP) :: minus_three = -3.0_DFP
REAL(DFP) :: pi = 3.14159265359_DFP
REAL(DFP) :: two_pi = 2.0_DFP * 3.14159265359_DFP
REAL(DFP) :: pi_by_two = 0.5_DFP * 3.14159265359_DFP
Expand Down Expand Up @@ -439,7 +438,7 @@ MODULE BaseType

TYPE :: RealVector_
INTEGER(I4B) :: tDimension = 1_I4B
REAL(DFP), ALLOCATABLE :: Val(:)
REAL(DFP), ALLOCATABLE :: val(:)
END TYPE RealVector_

TYPE(RealVector_), PARAMETER :: TypeRealVector = RealVector_(Val=NULL())
Expand Down Expand Up @@ -534,6 +533,13 @@ MODULE BaseType
! summary: Degree of freedom object type

TYPE :: DOF_
INTEGER(I4B) :: storageFMT = FMT_NODES
!! Storage format
INTEGER(I4B) :: mapRow = 0
!! Number of rows in map which contains useful data
!! Number of physical variables = mapRow - 1
INTEGER(I4B) :: valMapSize = 0
!! The size of valMap which contains useful data
INTEGER(I4B), ALLOCATABLE :: map(:, :)
!! Encapsulation of information of DOF
!! map contains 6 columns
Expand All @@ -550,13 +556,6 @@ MODULE BaseType
!! For example, map(n+1, 4) contains the total DOF
INTEGER(I4B), ALLOCATABLE :: valMap(:)
!! Val map
INTEGER(I4B) :: storageFMT = FMT_NODES
!! Storage format
INTEGER(I4B) :: mapRow = 0
!! Number of rows in map which contains useful data
!! Number of physical variables = mapRow - 1
INTEGER(I4B) :: valMapSize = 0
!! The size of valMap which contains useful data
END TYPE DOF_

TYPE(DOF_), PARAMETER :: TypeDOF = DOF_(map=NULL(), valMap=NULL())
Expand Down Expand Up @@ -705,65 +704,6 @@ MODULE BaseType
CLASS(CSRMatrix_), POINTER :: ptr => NULL()
END TYPE CSRMatrixPointer_

!----------------------------------------------------------------------------
! IterationData_
!----------------------------------------------------------------------------

!> author: Vikas Sharma, Ph. D.
! date: 14 June 2022
! summary: Iteration data

TYPE :: IterationData_
INTEGER(I4B) :: maxIter = 100
!! Maximum number of iterations allowed
INTEGER(I4B) :: iterationNumber = 1
!! Iteration number
REAL(DFP) :: residualError0 = 0.0
!! Initial Residual error
REAL(DFP) :: residualError = 0.0
!! Current residual error
REAL(DFP) :: residualTolerance = 1.0E-5
!! Tolerance for checking convergence in residual
REAL(DFP) :: solutionError0 = 0.0
!! Initial solution error
REAL(DFP) :: solutionError = 0.0
!! Current solution error
REAL(DFP) :: solutionTolerance = 1.0E-5
!! Tolerance for checking convergence in solution
INTEGER(I4B) :: convergenceType = RelativeConvergence
!! Type of convergence
INTEGER(I4B) :: convergenceIn = ConvergenceInRes
!! Check Convergence in solution and/or residual
INTEGER(I4B) :: normType = NormL2
!! Error norm type
LOGICAL(LGT) :: converged = .FALSE.
!! Status of convergence
REAL(DFP) :: timeAtStart = 0.0
!! Starting time
REAL(DFP) :: timeAtEnd = 0.0
!! Present time
REAL(DFP), ALLOCATABLE :: convergenceData(:, :)
!! history of convergence data
!! each column corresponding to a iteration
TYPE(String), ALLOCATABLE :: header(:)
!! header for convergenceData
END TYPE IterationData_

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

TYPE(IterationData_), PARAMETER :: TypeIterationData = &
IterationData_(header=NULL())

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

TYPE :: IterationDataPointer_
CLASS(IterationData_), POINTER :: ptr => NULL()
END TYPE IterationDataPointer_

!----------------------------------------------------------------------------
! VoigtRank2Tensor_
!----------------------------------------------------------------------------
Expand Down Expand Up @@ -2171,6 +2111,9 @@ END SUBROUTINE InterfaceMatrixSubroutine
INTEGER(I4B) :: both = convergenceInResSol
INTEGER(I4B) :: relative = relativeConvergence
INTEGER(I4B) :: absolute = absoluteConvergence
INTEGER(I4B) :: normL1 = NormL1
INTEGER(I4B) :: normL2 = NormL2
INTEGER(I4B) :: normInfinity = NormInfinity
END TYPE ConvergenceOpt_

TYPE(ConvergenceOpt_), PARAMETER :: TypeConvergenceOpt = ConvergenceOpt_()
Expand Down Expand Up @@ -2472,6 +2415,7 @@ END SUBROUTINE InterfaceMatrixSubroutine
INTEGER(I4B) :: BlythPozChebyshev = BlythPozChebyshevQP
INTEGER(I4B) :: IsaacLegendre = IsaacLegendreQP
INTEGER(I4B) :: IsaacChebyshev = IsaacChebyshevQP
INTEGER(I4B) :: Center = CenterQP
INTEGER(I4B) :: default = GaussLegendreQP
END TYPE QuadratureOpt_

Expand Down
6 changes: 3 additions & 3 deletions src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,6 @@ include(${CMAKE_CURRENT_LIST_DIR}/IntVector/CMakeLists.txt)
# IndexValue
include(${CMAKE_CURRENT_LIST_DIR}/IndexValue/CMakeLists.txt)

# IndexValue
include(${CMAKE_CURRENT_LIST_DIR}/IterationData/CMakeLists.txt)

# KeyValue
include(${CMAKE_CURRENT_LIST_DIR}/KeyValue/CMakeLists.txt)

Expand Down Expand Up @@ -227,6 +224,9 @@ include(${CMAKE_CURRENT_LIST_DIR}/CSRSparsity/CMakeLists.txt)
# CSRMatrix
include(${CMAKE_CURRENT_LIST_DIR}/CSRMatrix/CMakeLists.txt)

# ConvergenceOpt
include(${CMAKE_CURRENT_LIST_DIR}/ConvergenceOpt/CMakeLists.txt)

# BaseMethod
include(${CMAKE_CURRENT_LIST_DIR}/BaseMethod/CMakeLists.txt)

Expand Down
19 changes: 19 additions & 0 deletions src/modules/ConvergenceOpt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# This program is a part of EASIFEM library
# Copyright (C) 2020-2021 Vikas Sharma, Ph.D
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https: //www.gnu.org/licenses/>
#

set(src_path "${CMAKE_CURRENT_LIST_DIR}/src/")
target_sources(${PROJECT_NAME} PRIVATE ${src_path}/ConvergenceOptUtility.F90)
Loading
Loading