diff --git a/docs/blog/authors.yml b/docs/blog/authors.yml index beb0d6a4..2d7b0307 100644 --- a/docs/blog/authors.yml +++ b/docs/blog/authors.yml @@ -6,6 +6,8 @@ vickysharma0812: socials: x: vickysharma0812 github: vickysharma0812 + linkedin: vickysharma0812 + researchgate: https://www.researchgate.net/profile/Vikas-Sharma-41 shishiousan: name: Shion Shimizu @@ -14,3 +16,5 @@ shishiousan: image_url: https://raw.githubusercontent.com/easifem/authors/refs/heads/main/images/shishiousan.jpg socials: github: shishiousan + linkedin: shion-shimizu-838997340 + researchgate: https://www.researchgate.net/profile/Shion-Shimizu diff --git a/docs/docs-api/MassMatrix/MassMatrix_.md b/docs/docs-api/MassMatrix/MassMatrix_.md index e51474ce..d08cea63 100644 --- a/docs/docs-api/MassMatrix/MassMatrix_.md +++ b/docs/docs-api/MassMatrix/MassMatrix_.md @@ -5,10 +5,11 @@ date: 20 Nov 2021 update: 20 Nov 2021 tags: - MassMatrix +category: + - MassMatrix + - Finite Element --- -# MassMatrix - ## Theory $$ @@ -19,19 +20,27 @@ $$ \int_{\Omega } \rho N^{I} N^{J}d\Omega $$ -## Constructor methods +## Example 1 + +This example shows how to use the subroutine called `MassMatrix` to create a mass matrix in space domain. + +Here, we want to do the following. + +$$ +\int_{\Omega } N^{I}\rho N^{J}d\Omega +$$ + +`rho` can be a constant, or a function of spatial coordinates, or some nonlinear function. + +In this example, we use -!!! note "MassMatrix" +- ReferenceLine element, +- QuadraturePoint are `GaussLegendre` +- order of integrand is 2. $$ \int_{\Omega } N^{I} N^{J}d\Omega $$ - - You can learn more about this in - - - [[MassMatrix_test_1]] for [[ReferenceLine_]] `Line2` - - [[MassMatrix_test_2]] for [[ReferenceLine_]] `Line3` - - [[MassMatrix_test_3]] for mixed FEM type, Line2 and Line3 [[ReferenceLine_]] -- [ ] TODO add examples for creating mass matrix for triangle3 and triangle6 and 3D elements. +This type of mass matrix is useful in cases where $rho$ is a constant. diff --git a/docs/docs-api/MassMatrix/MassMatrix_test_1.md b/docs/docs-api/MassMatrix/MassMatrix_test_1.md deleted file mode 100644 index b2593895..00000000 --- a/docs/docs-api/MassMatrix/MassMatrix_test_1.md +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: MassMatrix example 1 -author: Vikas Sharma, Ph.D. -date: 20 Nov 2021 -update: 20 Nov 2021 -tags: - - ReferenceLine - - ReferenceLine/Initiate - - QuadraturePoint/Initiate - - ElemshapeData/Initiate - - MassMatrix ---- - -# MassMatrix example 1 - -!!! note "" - This example shows how to use the subroutine called `MassMatrix` to create a mass matrix in space domain. - -Here, we want to do the following. - -$$ -\int_{\Omega } N^{I}\rho N^{J}d\Omega -$$ - -!!! warning "" - `rho` can be a constant, or a function of spatial coordinates, or some nonlinear function. - -In this example, we use - -- [[ReferenceLine_]] element, -- [[QuadraturePoint_]] are `GaussLegendre` -- order of integrand is 2. - -$$ -\int_{\Omega } N^{I} N^{J}d\Omega -$$ - -This type of mass matrix is useful in cases where $rho$ is a constant. - -## Modules and classes - -## Usage - -```fortran -PROGRAM main - USE easifemBase - IMPLICIT NONE - TYPE(elemshapedata_) :: test, trial - TYPE(quadraturepoint_) :: quad - TYPE(referenceline_) :: refelem - REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) - integer( I4B ), parameter :: order = 2 -``` - -!!! note "" - Let us now create the physical coordinate of the line element. - -```fortran - XiJ = RESHAPE([-1, 1], [1, 2]) -``` - -!!! note "" - Now we create an instance of [[ReferenceLine_]]. - -```fortran - refelem = referenceline(nsd=1) -``` - -!!! note "" - Here, we create the quadrature points. - -```fortran - CALL initiate( obj=quad, refelem=refelem, order=order, & - & quadratureType='GaussLegendre' ) -``` - -!!! note "" - Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]] - -```fortran - CALL initiate(obj=test, & - & quad=quad, & - & refelem=refelem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set( obj=test, val=xij, N=test%N, dNdXi=test%dNdXi) -``` - -!!! note "" - Let us now create the mass matrix. - -```fortran - mat=MassMatrix(test=test, trial=test) - CALL Display(mat, "mat:") -``` - -??? example "Results" - - ```bash - mat: - ------------------ - 0.666667 0.333333 - 0.333333 0.666667 - ``` - - -!!! settings "Cleanup" - -```fortran -END PROGRAM main -``` diff --git a/docs/docs-api/MassMatrix/MassMatrix_test_2.md b/docs/docs-api/MassMatrix/MassMatrix_test_2.md deleted file mode 100644 index cdae59a6..00000000 --- a/docs/docs-api/MassMatrix/MassMatrix_test_2.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: MassMatrix example 2 -author: Vikas Sharma, Ph.D. -date: 20 Nov 2021 -update: 20 Nov 2021 -tags: - - ReferenceLine - - ReferenceLine/Initiate - - QuadraturePoint/Initiate - - ElemshapeData/Initiate - - MassMatrix ---- - -# MassMatrix example 2 - -!!! note "" - This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. - -Here, we want to DO the following. - -$$ -\int_{\Omega } N^{I}\rho N^{J}d\Omega -$$ - -!!! warning "" - `rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. - -In this example, following mass matrix is formed for [[ReferenceLine_]] element, [[QuadraturePoint_]] are `GaussLegendre`. - -$$ -\int_{\Omega } N^{I} N^{J}d\Omega -$$ - -This TYPE of mass matrix is useful in cases WHERE $rho$ is a constant. - -## Modules and classes - -## Usage - -```fortran -PROGRAM main - USE easifemBase - IMPLICIT NONE - TYPE(Elemshapedata_) :: test, elemsdForsimplex - TYPE(Quadraturepoint_) :: quad - TYPE(Referenceline_) :: simplexElem, refElem - REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) - INTEGER( I4B ), PARAMETER :: order = 2 -``` - -!!! note "" - Let us now create the physical coordinate of the line element. - -```fortran - XiJ = RESHAPE([-1, 1], [1, 2]) -``` - -!!! note "" - Now we create an instance of [[ReferenceLine_]]. - -```fortran - simplexElem = referenceline(nsd=1) - CALL simplexElem%LagrangeElement(order=order, highOrderObj=refelem) -``` - -!!! note "" - Here, we create the quadrature points. - -```fortran - CALL initiate( obj=quad, refelem=refelem, order=order*2, & - & quadratureType='GaussLegendre' ) -``` - -!!! note "" - Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. - -```fortran - CALL initiate(obj=elemsdForsimplex, & - & quad=quad, & - & refelem=simplexElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -``` - -!!! note "" - Initiate an instance of [[ElemeshapeData_]]. - -```fortran - CALL initiate(obj=test, & - & quad=quad, & - & refelem=refElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & - & dNdXi=elemsdForSimplex%dNdXi) -``` - -!!! note "" - Let us now create the mass matrix. - -```fortran - mat=MassMatrix(test=test, trial=test) - CALL Display(mat, "mat:") -``` - -??? example "Results" - - ```bash - mat: - --------------------------- - 0.26667 -0.06667 0.13333 - -0.06667 0.26667 0.13333 - 0.13333 0.13333 1.06667 - ``` - -!!! settings "Cleanup" - -```fortran -END PROGRAM main -``` diff --git a/docs/docs-api/MassMatrix/MassMatrix_test_3.md b/docs/docs-api/MassMatrix/MassMatrix_test_3.md deleted file mode 100644 index 7f3ae717..00000000 --- a/docs/docs-api/MassMatrix/MassMatrix_test_3.md +++ /dev/null @@ -1,133 +0,0 @@ ---- -title: MassMatrix example 3 -author: Vikas Sharma, Ph.D. -date: 20 Nov 2021 -update: 20 Nov 2021 -tags: - - ReferenceLine - - ReferenceLine/Initiate - - QuadraturePoint/Initiate - - ElemshapeData/Initiate - - MassMatrix ---- - -# MassMatrix example 3 - -!!! note "" - This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. - -Here, we want to DO the following. - -$$ -\int_{\Omega } N^{I}\rho N^{J}d\Omega -$$ - -!!! warning "" - `rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. - -In this example, following mass matrix is formed for [[ReferenceLine_]] element, [[QuadraturePoint_]] are `GaussLegendre`. - -$$ -\int_{\Omega } N^{I} N^{J}d\Omega -$$ - -This TYPE of mass matrix is useful when $rho$ is a constant. - -## Modules and classes - -## Usage - -```fortran -PROGRAM main - USE easifemBase - IMPLICIT NONE - TYPE(Elemshapedata_) :: test, elemsdForsimplex, trial - TYPE(Quadraturepoint_) :: quad - TYPE(Referenceline_) :: simplexElem, refElemFortest, refElemFortrial - REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) - INTEGER( I4B ), PARAMETER :: orderFortest = 1, orderForTrial = 2 -``` - -!!! note "" - Let us now create the physical coordinate of the line element. - -```fortran - XiJ = RESHAPE([-1, 1], [1, 2]) -``` - -!!! note "" - Now we create an instance of [[ReferenceLine_]]. - -```fortran - simplexElem = referenceline(nsd=1) - CALL simplexElem%LagrangeElement(order=orderForTest, highOrderObj=refElemForTest) - CALL simplexElem%LagrangeElement(order=orderForTrial, highOrderObj=refElemForTrial) -``` - -!!! note "" - Here, we create the quadrature points. - -```fortran - CALL initiate( obj=quad, refelem=simplexElem, order=orderForTest+orderForTrial, & - & quadratureType='GaussLegendre' ) -``` - -!!! note "" - Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. - -```fortran - CALL initiate(obj=elemsdForsimplex, & - & quad=quad, & - & refelem=simplexElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -``` - -!!! note "" - Initiate an instance of [[ElemeshapeData_]] for test function. - -```fortran - CALL initiate(obj=test, & - & quad=quad, & - & refelem=refElemForTest, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & - & dNdXi=elemsdForSimplex%dNdXi) -``` - -!!! note "" - Initiate an instance of [[ElemeshapeData_]] for trial function. - -```fortran - CALL initiate(obj=trial, & - & quad=quad, & - & refelem=refElemForTrial, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set(obj=trial, val=xij, N=elemsdForSimplex%N, & - & dNdXi=elemsdForSimplex%dNdXi) -``` - -!!! note "" - Let us now create the mass matrix. - -```fortran - mat=MassMatrix(test=test, trial=trial) - CALL Display(mat, "mat:") -``` - -??? example "Results" - - ```bash - mat: - ------------------------- - 0.33333 0.00000 0.66667 - 0.00000 0.33333 0.66667 - ``` - -!!! settings "Cleanup" - -```fortran -END PROGRAM main -``` diff --git a/docs/docs-api/MassMatrix/MassMatrix_test_4.md b/docs/docs-api/MassMatrix/MassMatrix_test_4.md deleted file mode 100644 index dc085db5..00000000 --- a/docs/docs-api/MassMatrix/MassMatrix_test_4.md +++ /dev/null @@ -1,134 +0,0 @@ ---- -title: MassMatrix example 4 -author: Vikas Sharma, Ph.D. -date: 20 Nov 2021 -update: 20 Nov 2021 -tags: - - ReferenceLine - - ReferenceLine/Initiate - - QuadraturePoint/Initiate - - ElemshapeData/Initiate - - MassMatrix ---- - -# MassMatrix example 4 - -!!! note "" - This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. - -Here, we want to DO the following. - -$$ -\int_{\Omega } N^{I}\rho N^{J}d\Omega -$$ - -!!! warning "" - `rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. - -In this example, following mass matrix is formed for [[ReferenceLine_]] element, [[QuadraturePoint_]] are `GaussLegendre`. - -$$ -\int_{\Omega } N^{I} N^{J}d\Omega -$$ - -This TYPE of mass matrix is useful when $rho$ is a constant. - -## Modules and classes - -## Usage - -```fortran -PROGRAM main - USE easifemBase - IMPLICIT NONE - TYPE(Elemshapedata_) :: test, elemsdForsimplex, trial - TYPE(Quadraturepoint_) :: quad - TYPE(Referenceline_) :: simplexElem, refElemFortest, refElemFortrial - REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) - INTEGER( I4B ), PARAMETER :: orderFortest = 1, orderForTrial = 2 -``` - -!!! note "" - Let us now create the physical coordinate of the line element. - -```fortran - XiJ = RESHAPE([-1, 1], [1, 2]) -``` - -!!! note "" - Now we create an instance of [[ReferenceLine_]]. - -```fortran - simplexElem = referenceline(nsd=1) - CALL simplexElem%LagrangeElement(order=orderForTest, highOrderObj=refElemForTest) - CALL simplexElem%LagrangeElement(order=orderForTrial, highOrderObj=refElemForTrial) -``` - -!!! note "" - Here, we create the quadrature points. - -```fortran - CALL initiate( obj=quad, refelem=simplexElem, order=orderForTest+orderForTrial, & - & quadratureType='GaussLegendre' ) -``` - -!!! note "" - Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. - -```fortran - CALL initiate(obj=elemsdForsimplex, & - & quad=quad, & - & refelem=simplexElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -``` - -!!! note "" - Initiate an instance of [[ElemeshapeData_]] for test function. - -```fortran - CALL initiate(obj=test, & - & quad=quad, & - & refelem=refElemForTest, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & - & dNdXi=elemsdForSimplex%dNdXi) -``` - -!!! note "" - Initiate an instance of [[ElemeshapeData_]] for trial function. - -```fortran - CALL initiate(obj=trial, & - & quad=quad, & - & refelem=refElemForTrial, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) - CALL Set(obj=trial, val=xij, N=elemsdForSimplex%N, & - & dNdXi=elemsdForSimplex%dNdXi) -``` - -!!! note "" - Let us now create the mass matrix. - -```fortran - mat=MassMatrix(test=trial, trial=test) - CALL Display(mat, "mat:") -``` - -??? example "Results" - - ```bash - mat: - ---------------- - 0.33333 0.00000 - 0.00000 0.33333 - 0.66667 0.66667 - ``` - -!!! settings "Cleanup" - -```fortran -END PROGRAM main -``` diff --git a/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 new file mode 100644 index 00000000..9209ed7a --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 @@ -0,0 +1,59 @@ +PROGRAM main +USE easifemBase +IMPLICIT NONE +TYPE(Elemshapedata_) :: test, elemsdForsimplex, trial +TYPE(Quadraturepoint_) :: quad +TYPE(Referenceline_) :: simplexElem, refElemFortest, refElemFortrial +REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +INTEGER(I4B), PARAMETER :: orderFortest = 1, orderForTrial = 2 + +! Let us now create the physical coordinate of the line element. + +XiJ = RESHAPE([-1, 1], [1, 2]) + +! Now we create an instance of [[ReferenceLine_]]. + +simplexElem = referenceline(nsd=1) + CALL simplexElem%LagrangeElement(order=orderForTest, highOrderObj=refElemForTest) + CALL simplexElem%LagrangeElement(order=orderForTrial, highOrderObj=refElemForTrial) + +! Here, we create the quadrature points. + CALL initiate( obj=quad, refelem=simplexElem, order=orderForTest+orderForTrial, & + quadratureType='GaussLegendre') + +! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. + +CALL initiate(obj=elemsdForsimplex, & + quad=quad, & + refelem=simplexElem, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) + +! Initiate an instance of [[ElemeshapeData_]] for test function. + +CALL initiate(obj=test, & + quad=quad, & + refelem=refElemForTest, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) + +CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & + dNdXi=elemsdForSimplex%dNdXi) + +! Initiate an instance of [[ElemeshapeData_]] for trial function. + +CALL initiate(obj=trial, & + quad=quad, & + refelem=refElemForTrial, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) + +CALL Set(obj=trial, val=xij, N=elemsdForSimplex%N, & + dNdXi=elemsdForSimplex%dNdXi) + +! Let us now create the mass matrix. + +mat = MassMatrix(test=test, trial=trial) +CALL Display(mat, "mat:") + +END PROGRAM main diff --git a/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md new file mode 100644 index 00000000..46292e44 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md @@ -0,0 +1,18 @@ +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. + +Here, we want to DO the following. + +$$ +\int_{\Omega } N^{I}\rho N^{J}d\Omega +$$ + +`rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. + +In this example, following mass matrix is formed for ReferenceLine element, QuadraturePoint are `GaussLegendre`. + +$$ +\int_{\Omega } N^{I} N^{J}d\Omega +$$ + +This TYPE of mass matrix is useful when $rho$ is a constant. + diff --git a/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 new file mode 100644 index 00000000..cf16c00a --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 @@ -0,0 +1,58 @@ +PROGRAM main +USE easifemBase +IMPLICIT NONE +TYPE(Elemshapedata_) :: test, elemsdForsimplex, trial +TYPE(Quadraturepoint_) :: quad +TYPE(Referenceline_) :: simplexElem, refElemFortest, refElemFortrial +REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +INTEGER(I4B), PARAMETER :: orderFortest = 1, orderForTrial = 2 + +! Let us now create the physical coordinate of the line element. + +XiJ = RESHAPE([-1, 1], [1, 2]) + +! Now we create an instance of [[ReferenceLine_]]. + +simplexElem = referenceline(nsd=1) + CALL simplexElem%LagrangeElement(order=orderForTest, highOrderObj=refElemForTest) + CALL simplexElem%LagrangeElement(order=orderForTrial, highOrderObj=refElemForTrial) + +! Here, we create the quadrature points. + + CALL initiate( obj=quad, refelem=simplexElem, order=orderForTest+orderForTrial, & + quadratureType='GaussLegendre') + +! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. + +CALL initiate(obj=elemsdForsimplex, & + & quad=quad, & + & refelem=simplexElem, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) + +! Initiate an instance of [[ElemeshapeData_]] for test function. + +CALL initiate(obj=test, & + & quad=quad, & + & refelem=refElemForTest, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) +CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & + & dNdXi=elemsdForSimplex%dNdXi) + +! Initiate an instance of [[ElemeshapeData_]] for trial function. + +CALL initiate(obj=trial, & + & quad=quad, & + & refelem=refElemForTrial, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) +CALL Set(obj=trial, val=xij, N=elemsdForSimplex%N, & + & dNdXi=elemsdForSimplex%dNdXi) + +! Let us now create the mass matrix. + +mat = MassMatrix(test=trial, trial=test) +CALL Display(mat, "mat:") + +END PROGRAM main diff --git a/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md new file mode 100644 index 00000000..f9a97f09 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md @@ -0,0 +1,18 @@ +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. + +Here, we want to DO the following. + +$$ +\int_{\Omega } N^{I}\rho N^{J}d\Omega +$$ + +`rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. + +In this example, following mass matrix is formed for ReferenceLine element, QuadraturePoint are `GaussLegendre`. + +$$ +\int_{\Omega } N^{I} N^{J}d\Omega +$$ + +This TYPE of mass matrix is useful when $rho$ is a constant. + diff --git a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 new file mode 100644 index 00000000..b2987532 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 @@ -0,0 +1,74 @@ +PROGRAM main +USE BaseType, ONLY: ElemShapeData_, & + QuadraturePoint_, & + elem => TypeElemNameOpt, & + quadType => TypeQuadratureOpt, & + iptype => TypeInterpolationOpt, & + polyType => TypePolynomialOpt + +USE GlobalData, ONLY: DFP, I4B + +USE QuadraturePoint_Method, ONLY: QuadPoint_Initiate => Initiate, & + Quad_Size => Size + +USE Display_Method, ONLY: Display + +USE ElemshapeData_Method, ONLY: LagrangeElemShapeData, & + Elemsd_Allocate => ALLOCATE, & + Elemsd_Set => Set, & + Elemsd_Display => Display +USE MassMatrix_Method, ONLY: MassMatrix + +IMPLICIT NONE + +TYPE(ElemShapeData_) :: elemsd, linelemsd +TYPE(QuadraturePoint_) :: quad +REAL(DFP), ALLOCATABLE :: mat(:, :) +INTEGER(I4B) :: nips, tsize + +CHARACTER(LEN=*), PARAMETER :: domainName = "B" +INTEGER(I4B), PARAMETER :: order = 2, & + one_i = 1, & + integralOrder = 2 * order, & + nns = order + 1 +INTEGER(I4B), PARAMETER :: elemType = elem%line +INTEGER(I4B), PARAMETER :: quadratureType = quadType%GaussLegendre +INTEGER( I4B ), PARAMETER :: interpolationType = iptype%GaussLegendreLobatto +INTEGER( I4B ), PARAMETER :: basisType = polyType%Monomial +REAL(DFP), PARAMETER :: refElemCoord(1, 2) = RESHAPE([-1.0_DFP, 1.0_DFP], [1, 2]) +REAL(DFP), PARAMETER :: xij(1, 2) = RESHAPE([-1.0_DFP, 1.0_DFP], [1, 2]) + +! Here, we create the quadrature points. +CALL QuadPoint_Initiate(obj=quad, elemType=elemType, & + domainName=domainName, order=integralOrder, & + quadratureType=quadratureType) +nips = Quad_Size(quad, 2) + +CALL Display(nips, "number of integration points: ") +CALL Display(nns, "number of nodes in space: ") + +CALL Elemsd_Allocate(obj=elemsd, nsd=one_i, xidim=one_i, & + nns=nns, nips=nips) + +! Initiate an instance of ElemshapeData_ for linear geometry. +CALL LagrangeElemShapeData(obj=linelemsd, quad=quad, nsd=elemsd%nsd, & + xidim=elemsd%xidim, elemType=elemType, & + refelemCoord=refelemCoord, domainName=domainName, & + order=one_i) + +CALL LagrangeElemShapeData(obj=elemsd, quad=quad, nsd=elemsd%nsd, xidim=elemsd%xidim, & + elemType=elemType, refelemCoord=refelemCoord, & + domainName=domainName, order=order, & + ipType=interpolationType, & + basisType=polyType%Monomial) + +CALL Elemsd_Set(obj=elemsd, val=xij, N=linelemsd%N, dNdXi=linelemsd%dNdXi) + +CALL Elemsd_Display(elemsd, "elemsd:") + +! Let us now create the mass matrix. +mat = MassMatrix(test=elemsd, trial=elemsd) +CALL Display(mat, "mass matrix:") +CALL Display(SUM(mat, dim=2), "row sum of mass matrix:") + +END PROGRAM main diff --git a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.md b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.md new file mode 100644 index 00000000..c276616f --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.md @@ -0,0 +1,7 @@ + +import CodeBlock from '@theme/CodeBlock'; + +import CodeSnippet from '!!raw-loader!./_MassMatrix_test_1.F90'; + +{CodeSnippet} + diff --git a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 new file mode 100644 index 00000000..4ad28b2f --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 @@ -0,0 +1,44 @@ +PROGRAM main +USE easifemBase + +IMPLICIT NONE + +TYPE(Elemshapedata_) :: test, elemsdForsimplex +TYPE(Quadraturepoint_) :: quad +TYPE(Referenceline_) :: simplexElem, refElem +REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +INTEGER(I4B), PARAMETER :: order = 2 + +! Let us now create the physical coordinate of the line element. +XiJ = RESHAPE([-1, 1], [1, 2]) + +! Now we create an instance of [[ReferenceLine_]]. +simplexElem = referenceline(nsd=1) +CALL simplexElem%LagrangeElement(order=order, highOrderObj=refelem) + +! Here, we create the quadrature points. +CALL initiate(obj=quad, refelem=refelem, order=order * 2, & + quadratureType='GaussLegendre') + +! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. +CALL initiate(obj=elemsdForsimplex, & + quad=quad, & + refelem=simplexElem, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) + +! Initiate an instance of [[ElemeshapeData_]]. +CALL initiate(obj=test, & + quad=quad, & + refelem=refElem, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) + +CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & + dNdXi=elemsdForSimplex%dNdXi) + +! Let us now create the mass matrix. +mat = MassMatrix(test=test, trial=test) +CALL Display(mat, "mat:") + +END PROGRAM main diff --git a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md new file mode 100644 index 00000000..46e0d99a --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md @@ -0,0 +1,18 @@ +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. + +Here, we want to DO the following. + +$$ +\int_{\Omega } N^{I}\rho N^{J}d\Omega +$$ + +`rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION. + +In this example, following mass matrix is formed for ReferenceLine element, QuadraturePoint are `GaussLegendre`. + +$$ +\int_{\Omega } N^{I} N^{J}d\Omega +$$ + +This TYPE of mass matrix is useful in cases WHERE $rho$ is a constant. + diff --git a/docs/docs-api/MassMatrix/examples/runner.toml b/docs/docs-api/MassMatrix/examples/runner.toml new file mode 100644 index 00000000..caff4e92 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/runner.toml @@ -0,0 +1,3 @@ +BuildType="Debug" +BuildDir="/tmp/MassMatrix/build" +TargetLibs = ["easifemClasses"] diff --git a/docs/docs-api/TomlUtility/GetValue.md b/docs/docs-api/TomlUtility/GetValue.md new file mode 100644 index 00000000..1e5810f0 --- /dev/null +++ b/docs/docs-api/TomlUtility/GetValue.md @@ -0,0 +1,123 @@ +--- +sidebar_position: 2 +title: GetValue +--- + +## Getting scalar values + +```fortran +INTERFACE GetValue + MODULE SUBROUTINE GetValue(table, key, VALUE, default_value, & + origin, stat, isFound) + TYPE(toml_table), INTENT(INOUT) :: table + !! Toml table + CHARACTER(*), INTENT(IN) :: key + !! key + {DATA_TYPE}, INTENT(INOUT) :: VALUE + !! value in string + {DATA_TYPE}, INTENT(IN) :: default_value + !! default value + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: origin + !! origin, necessary for debugging + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: stat + !! To check the status of getting the value + LOGICAL(LGT), OPTIONAL, INTENT(INOUT) :: isFound + !! If key is found then isFound is set to true + END SUBROUTINE GetValue +END INTERFACE GetValue +``` + +Following data types are supported. + +- String +- INTEGER(Int8 | Int16 | Int32 | Int64) +- REAL(Real32 | Real64) + +:::note Default value +The data type of default value should be same as the data type of value. However, in case value is String type, then the default value can be Character type also. +::: + +## Get the vector values + +The generic interface for getting the vector values is as follows: + +```fortran +INTERFACE GetValue + MODULE SUBROUTINE GetValue(table, key, VALUE, origin, stat, & + isFound) + TYPE(toml_table), INTENT(INOUT) :: table + CHARACTER(*), INTENT(IN) :: key + DATA_TYPE, ALLOCATABLE, INTENT(INOUT) :: VALUE(:) + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: origin + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: stat + LOGICAL(LGT), OPTIONAL, INTENT(INOUT) :: isFound + END SUBROUTINE GetValue +END INTERFACE GetValue +``` + +The above method will allocate the value. If you want to avoid the allocation, then use the following method. + +```fortran +INTERFACE GetValue_ + MODULE SUBROUTINE GetValue_(table, key, VALUE, tsize, origin, stat, & + isFound) + TYPE(toml_table), INTENT(INOUT) :: table + CHARACTER(*), INTENT(IN) :: key + DATA_TYPE, ALLOCATABLE, INTENT(INOUT) :: VALUE(:) + INTEGER(I4B), INTENT(OUT) :: tsize + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: origin + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: stat + LOGICAL(LGT), OPTIONAL, INTENT(INOUT) :: isFound + END SUBROUTINE GetValue_ +END INTERFACE GetValue_ +``` + +- tsize is the number of data written in the value. + +The value can have following data types: + +- INTEGER(Int8 | Int16 | Int32 | Int64) +- REAL(Real32 | Real64) + +## Get the matrix values + +The generic interface for getting the matrix values is as follows: + +```fortran +INTERFACE GetValue + MODULE SUBROUTINE GetValue(table, key, VALUE, origin, stat, & + isFound) + TYPE(toml_table), INTENT(INOUT) :: table + CHARACTER(*), INTENT(IN) :: key + DATA_TYPE, ALLOCATABLE, INTENT(INOUT) :: VALUE(:, :) + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: origin + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: stat + LOGICAL(LGT), OPTIONAL, INTENT(INOUT) :: isFound + END SUBROUTINE GetValue +END INTERFACE GetValue +``` + +The above method will allocate the value. If you want to avoid the allocation, then use the following method. + +```fortran +INTERFACE GetValue_ + MODULE SUBROUTINE GetValue_(table, key, VALUE, origin, stat, & + isFound, nrow, ncol) + TYPE(toml_table), INTENT(INOUT) :: table + CHARACTER(*), INTENT(IN) :: key + INTEGER(INT8), INTENT(INOUT) :: VALUE(:, :) + INTEGER(I4B), INTENT(OUT) :: nrow, ncol + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: origin + INTEGER(I4B), OPTIONAL, INTENT(INOUT) :: stat + LOGICAL(LGT), OPTIONAL, INTENT(INOUT) :: isFound + END SUBROUTINE GetValue_ +END INTERFACE GetValue_ +``` + +- nrow is the number of rows written in the value. +- ncol is the number of columns written in the value. + +The value can have following data types: + +- INTEGER(Int8 | Int16 | Int32 | Int64) +- REAL(Real32 | Real64) diff --git a/docs/docs-api/TomlUtility/index.md b/docs/docs-api/TomlUtility/index.md new file mode 100644 index 00000000..011babc4 --- /dev/null +++ b/docs/docs-api/TomlUtility/index.md @@ -0,0 +1,30 @@ +--- +sidebar_position: 1 +date: 2025-05-17 +update: 2025-05-17 +status: stable +docs: done +extpkgs: none +category: + - Utility + - Configuration + - TOML + - File + - Parsing +tags: + - Utility + - Configuration + - TOML + - File + - Parsing +--- + +# TomlUtility + +This module contains useful functions for gettin data from TOML files. It is designed to be used with the `tomlf` module. + +It provides following methods: + +- [GetValue](./GetValue.md) : Generic method for getting the values from a toml file +- [GetValue](./GetValue.md): Generic method for getting the values form a toml file without allocation. +- TomlArrayLength : Get the lengtth of a toml array diff --git a/docs/guides/easifemGO/index.mdx b/docs/guides/easifemGO/index.mdx index 33361761..71a861d4 100644 --- a/docs/guides/easifemGO/index.mdx +++ b/docs/guides/easifemGO/index.mdx @@ -29,7 +29,7 @@ Usage: First download golang on your system by following the instruction given on the official website of [go](https://go.dev/https://go.dev/). After that run the following command. ```bash -go install github.com/easifem/easifemGO@latest +go install github.com/easifem/easifemGO/cmd/easifem@latest ``` ## Available Commands: diff --git a/package.json b/package.json index f1efef35..24d0589b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "process": "^0.11.10", "react-markdown": "^8.0.7", "stream-browserify": "^3.0.0", - "swc-loader": "^0.2.6", "tailwindcss": "^3.4.3", "typedoc": "^0.26.6", "typedoc-plugin-markdown": "^4.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 976670e9..c099e463 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -138,9 +138,6 @@ importers: stream-browserify: specifier: ^3.0.0 version: 3.0.0 - swc-loader: - specifier: ^0.2.6 - version: 0.2.6(@swc/core@1.4.13(@swc/helpers@0.5.17))(webpack@5.91.0(@swc/core@1.4.13(@swc/helpers@0.5.17))) tailwindcss: specifier: ^3.4.3 version: 3.4.17 @@ -6482,12 +6479,6 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - swc-loader@0.2.6: - resolution: {integrity: sha512-9Zi9UP2YmDpgmQVbyOPJClY0dwf58JDyDMQ7uRc4krmc72twNI2fvlBWHLqVekBpPc7h5NJkGVT1zNDxFrqhvg==} - peerDependencies: - '@swc/core': ^1.2.147 - webpack: '>=2' - tailwindcss@3.4.17: resolution: {integrity: sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==} engines: {node: '>=14.0.0'} @@ -15070,12 +15061,6 @@ snapshots: csso: 5.0.5 picocolors: 1.0.0 - swc-loader@0.2.6(@swc/core@1.4.13(@swc/helpers@0.5.17))(webpack@5.91.0(@swc/core@1.4.13(@swc/helpers@0.5.17))): - dependencies: - '@swc/core': 1.4.13(@swc/helpers@0.5.17) - '@swc/counter': 0.1.3 - webpack: 5.91.0(@swc/core@1.4.13(@swc/helpers@0.5.17)) - tailwindcss@3.4.17: dependencies: '@alloc/quick-lru': 5.2.0 diff --git a/src/css/custom.css b/src/css/custom.css index 5f186cf0..cecd24b7 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -1315,3 +1315,17 @@ html[data-theme='dark'] .video_sidebar_header > div > a::before { content: ' ‹'; margin-right: 4px; } + +.blog-wrapper .avatar__photo, +.blogPost .avatar__photo, +.blog article .avatar__photo, +[class*='blogPost'] .avatar__photo { + border-radius: 30%; /* Make it perfectly round */ + box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15); + transition: transform 0.3s ease; + + object-fit: cover; + aspect-ratio: 1 / 1; + width: 60px; + height: 60px; +}