Skip to content
Merged

Dev #124

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
58 changes: 58 additions & 0 deletions src/submodules/MassMatrix/src/MM_2a.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
! 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/>

!----------------------------------------------------------------------------
! MassMatrix
!----------------------------------------------------------------------------

PURE SUBROUTINE MM_2a(ans, test, trial, rho, opt)
REAL(DFP), ALLOCATABLE, INTENT(INOUT) :: ans(:, :)
CLASS(ElemshapeData_), INTENT(IN) :: test
!! Shapedata for test function
CLASS(ElemshapeData_), INTENT(IN) :: trial
!! Shapedata for trial function
CLASS(FEVariable_), INTENT(IN) :: rho
!! vector variable
INTEGER( I4B ), INTENT( IN ) :: opt
!! 1
!! Define internal variable
REAL(DFP), ALLOCATABLE :: realval(:)
REAL(DFP), ALLOCATABLE :: m2(:, :)
REAL(DFP), ALLOCATABLE :: vbar(:, :)
REAL(DFP), ALLOCATABLE :: m4(:, :, :, :)
INTEGER(I4B) :: ii, ips
!!
!! main
!!
CALL getInterpolation(obj=trial, interpol=vbar, val=rho)
!!
CALL reallocate(m4, SIZE(test%N, 1), SIZE(trial%N, 1), SIZE(vbar, 1), 1)
!!
realval = trial%js * trial%ws * trial%thickness
!!
DO ips = 1, SIZE(realval)
m2 = OUTERPROD(a=test%N(:, ips), b=trial%N(:, ips))
DO ii = 1, SIZE(vbar, 1)
m4(:, :, ii, 1) = m4(:, :, ii, 1) &
& + realval(ips) * vbar(ii, ips) * m2
END DO
END DO
!!
CALL Convert(From=m4, To=ans)
!!
DEALLOCATE (realval, m2, vbar, m4)
!!
END SUBROUTINE MM_2a
61 changes: 61 additions & 0 deletions src/submodules/MassMatrix/src/MM_2b.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
! 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/>
!

!----------------------------------------------------------------------------
! MassMatrix
!----------------------------------------------------------------------------

PURE SUBROUTINE MM_2b(ans, test, trial, rho, opt)
REAL(DFP), ALLOCATABLE, INTENT(INOUT) :: ans(:, :)
CLASS(ElemshapeData_), INTENT(IN) :: test
!! Shapedata for test function
CLASS(ElemshapeData_), INTENT(IN) :: trial
!! Shapedata for trial function
CLASS(FEVariable_), INTENT(IN) :: rho
!! vector variable
INTEGER( I4B ), INTENT( IN ) :: opt
!! 2
!!
!! Define internal variable
!!
REAL(DFP), ALLOCATABLE :: realval(:)
REAL(DFP), ALLOCATABLE :: m2(:, :)
REAL(DFP), ALLOCATABLE :: vbar(:, :)
REAL(DFP), ALLOCATABLE :: m4(:, :, :, :)
INTEGER(I4B) :: ii, ips
!!
!! main
!!
CALL getInterpolation(obj=trial, interpol=vbar, val=rho)
!!
CALL reallocate(m4, SIZE(test%N, 1), SIZE(trial%N, 1), 1, SIZE(vbar, 1))
!!
realval = trial%js * trial%ws * trial%thickness
!!
DO ips = 1, SIZE(realval)
m2 = OUTERPROD(a=test%N(:, ips), b=trial%N(:, ips))
DO ii = 1, SIZE(vbar, 1)
m4(:, :, 1, ii) = m4(:, :, 1, ii) &
& + realval(ips) * vbar(ii, ips) * m2
END DO
END DO
!!
CALL Convert(From=m4, To=ans)
!!
DEALLOCATE (realval, m2, vbar, m4)
!!
END SUBROUTINE MM_2b
59 changes: 59 additions & 0 deletions src/submodules/MassMatrix/src/MM_2c.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
! 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/>

!----------------------------------------------------------------------------
! MassMatrix
!----------------------------------------------------------------------------

PURE SUBROUTINE MM_2c(ans, test, trial, rho, opt)
REAL(DFP), ALLOCATABLE, INTENT(INOUT) :: ans(:, :)
CLASS(ElemshapeData_), INTENT(IN) :: test
!! Shapedata for test function
CLASS(ElemshapeData_), INTENT(IN) :: trial
!! Shapedata for trial function
CLASS(FEVariable_), INTENT(IN) :: rho
!! vector variable
INTEGER( I4B ), INTENT( IN ) :: opt
!! 3
!! Define internal variable
REAL(DFP), ALLOCATABLE :: realval(:)
REAL(DFP), ALLOCATABLE :: m2(:, :)
REAL(DFP), ALLOCATABLE :: vbar(:, :)
REAL(DFP), ALLOCATABLE :: m4(:, :, :, :)
INTEGER(I4B) :: ips, ii
!!
!! main
!!
CALL getInterpolation(obj=trial, interpol=vbar, val=rho)
!!
CALL reallocate(m4, SIZE(test%N, 1), SIZE(trial%N, 1), &
& SIZE(vbar, 1), SIZE(vbar, 1))
!!
realval = trial%js * trial%ws * trial%thickness
!!
DO ips = 1, SIZE(vbar, 2)
m2 = OUTERPROD(a=test%N(:, ips), b=trial%N(:, ips))
DO ii = 1, SIZE(vbar, 1)
m4(:, :, ii, ii) = m4(:, :, ii, ii) &
& + realval(ips) * vbar(ii, ips) * m2
END DO
END DO
!!
CALL Convert(from=m4, to=ans)
!!
DEALLOCATE (realval, m2, vbar, m4)
!!
END SUBROUTINE MM_2c
61 changes: 61 additions & 0 deletions src/submodules/MassMatrix/src/MM_2d.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
! 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/>
!

!----------------------------------------------------------------------------
! MassMatrix
!----------------------------------------------------------------------------

PURE SUBROUTINE MM_2d(ans, test, trial, rho)
REAL(DFP), ALLOCATABLE, INTENT(INOUT) :: ans(:, :)
CLASS(ElemshapeData_), INTENT(IN) :: test
!! Shapedata for test function
CLASS(ElemshapeData_), INTENT(IN) :: trial
!! Shapedata for trial function
CLASS(FEVariable_), INTENT(IN) :: rho
!! vector variable
!! Define internal variable
REAL(DFP), ALLOCATABLE :: realval(:)
REAL(DFP), ALLOCATABLE :: m2(:, :)
REAL(DFP), ALLOCATABLE :: vbar(:, :)
REAL(DFP), ALLOCATABLE :: m4(:, :, :, :)
INTEGER(I4B) :: ips, ii, jj
!!
!! main
!!
CALL getInterpolation(obj=trial, interpol=vbar, val=rho)
!!
CALL reallocate(m4, SIZE(test%N, 1), SIZE(trial%N, 1), &
& SIZE(vbar, 1), SIZE(vbar, 1))
!!
realval = trial%js * trial%ws * trial%thickness
!!
DO ips = 1, SIZE(vbar, 2)
m2 = OUTERPROD(a=test%N(:, ips), b=trial%N(:, ips))
DO jj = 1, SIZE(vbar, 1)
DO ii = 1, SIZE(vbar, 1)
m4(:, :, ii, jj) = m4(:, :, ii, jj) &
& + realval(ips) * vbar(ii, ips) &
& * vbar(jj, ips) * m2
END DO
END DO
END DO
!!
CALL Convert(from=m4, to=ans)
!!
DEALLOCATE (realval, m2, vbar, m4)
!!
END SUBROUTINE MM_2d
62 changes: 62 additions & 0 deletions src/submodules/MassMatrix/src/MM_3.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
! 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/>
!

!----------------------------------------------------------------------------
! MassMatrix
!----------------------------------------------------------------------------

PURE SUBROUTINE MM_3(ans, test, trial, rho, opt)
REAL(DFP), ALLOCATABLE, INTENT(INOUT) :: ans(:, :)
CLASS(ElemshapeData_), INTENT(IN) :: test
!! Shapedata for test function
CLASS(ElemshapeData_), INTENT(IN) :: trial
!! Shapedata for trial function
CLASS(FEVariable_), INTENT(IN) :: rho
!! matrix variable
INTEGER( I4B ), OPTIONAL, INTENT( IN ) :: opt
!! 4
!!
!! Define internal variable
!!
REAL(DFP), ALLOCATABLE :: realval(:)
REAL(DFP), ALLOCATABLE :: m2(:, :)
REAL(DFP), ALLOCATABLE :: kbar(:, :, :)
REAL(DFP), ALLOCATABLE :: m4(:, :, :, :)
INTEGER(I4B) :: ii, jj, ips
!!
!! main
!!
CALL getInterpolation(obj=trial, interpol=kbar, val=rho)
CALL reallocate(m4, SIZE(test%N, 1), SIZE(trial%N, 1), &
& SIZE(kbar, 1), SIZE(kbar, 2))
!!
realval = trial%js * trial%ws * trial%thickness
!!
DO ips = 1, SIZE(realval)
m2 = OUTERPROD(a=test%N(:, ips), b=trial%N(:, ips))
DO jj = 1, SIZE(kbar, 2)
DO ii = 1, SIZE(kbar, 1)
m4(:, :, ii, jj) = m4(:, :, ii, jj) &
& + realval(ips) * kbar(ii, jj, ips) * m2
END DO
END DO
END DO
!!
CALL Convert(From=m4, To=ans)
!!
DEALLOCATE (realval, m2, kbar, m4)
END SUBROUTINE MM_3
13 changes: 13 additions & 0 deletions src/submodules/NitscheMatrix/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file is a part of easifem-base
# (c) 2021, Vikas Sharma, Ph.D.
# All right reserved
#
# log
# 1/03/2021 this file was created
#-----------------------------------------------------------------------

SET(src_path "${CMAKE_CURRENT_LIST_DIR}/src/")
TARGET_SOURCES(
${PROJECT_NAME} PRIVATE
${src_path}/NitscheMatrix_Method@Methods.F90
)
Loading