From 16e9016f0cca07defb20baa94c6f3ed2901b1a38 Mon Sep 17 00:00:00 2001 From: easifem Date: Mon, 12 May 2025 17:38:32 +0900 Subject: [PATCH 1/7] Removing swc-loader --- package.json | 1 - pnpm-lock.yaml | 15 --------------- 2 files changed, 16 deletions(-) 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 From ca02bd79303f172b324c9e7e5363e2309cf27892 Mon Sep 17 00:00:00 2001 From: shion Date: Sat, 17 May 2025 13:16:34 +0900 Subject: [PATCH 2/7] Updates in Blog Pages - adding some SNS links for authors - adding css for image of authors --- docs/blog/authors.yml | 4 ++++ src/css/custom.css | 14 ++++++++++++++ 2 files changed, 18 insertions(+) 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/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; +} From aa50380235275ac9db55766b632ac5a181e1072b Mon Sep 17 00:00:00 2001 From: easifem Date: Sun, 18 May 2025 17:33:22 +0900 Subject: [PATCH 3/7] Adding MassMatrix and TomlUtility --- docs/docs-api/MassMatrix/MassMatrix_.md | 31 ++-- docs/docs-api/MassMatrix/MassMatrix_test_1.md | 111 --------------- .../MassMatrix_test_3.F90} | 0 .../MassMatrix/examples/MassMatrix_test_3.md | 133 +++++++++++++++++ .../MassMatrix_test_4.F90} | 0 .../MassMatrix/examples/MassMatrix_test_4.md | 134 ++++++++++++++++++ .../examples/_MassMatrix_test_1.F90 | 49 +++++++ .../MassMatrix/examples/_MassMatrix_test_1.md | 7 + .../_MassMatrix_test_2.F90} | 0 .../MassMatrix/examples/_MassMatrix_test_2.md | 120 ++++++++++++++++ docs/docs-api/TomlUtility/GetValue.md | 123 ++++++++++++++++ docs/docs-api/TomlUtility/index.md | 30 ++++ 12 files changed, 616 insertions(+), 122 deletions(-) delete mode 100644 docs/docs-api/MassMatrix/MassMatrix_test_1.md rename docs/docs-api/MassMatrix/{MassMatrix_test_3.md => examples/MassMatrix_test_3.F90} (100%) create mode 100644 docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md rename docs/docs-api/MassMatrix/{MassMatrix_test_4.md => examples/MassMatrix_test_4.F90} (100%) create mode 100644 docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md create mode 100644 docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 create mode 100644 docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.md rename docs/docs-api/MassMatrix/{MassMatrix_test_2.md => examples/_MassMatrix_test_2.F90} (100%) create mode 100644 docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md create mode 100644 docs/docs-api/TomlUtility/GetValue.md create mode 100644 docs/docs-api/TomlUtility/index.md 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_3.md b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 similarity index 100% rename from docs/docs-api/MassMatrix/MassMatrix_test_3.md rename to docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 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..7f3ae717 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md @@ -0,0 +1,133 @@ +--- +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/examples/MassMatrix_test_4.F90 similarity index 100% rename from docs/docs-api/MassMatrix/MassMatrix_test_4.md rename to docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 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..dc085db5 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md @@ -0,0 +1,134 @@ +--- +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_1.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 new file mode 100644 index 00000000..b41e029e --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 @@ -0,0 +1,49 @@ +PROGRAM main +USE BaseType, ONLY: ElemShapeData_, QuadraturePoint_, ReferenceLine_ +USE GlobalData, ONLY: DFP, I4B +USE QuadraturePoint_Method, ONLY: QuadPoint_Initiate => Initiate, & + Quad_Size => Size + +IMPLICIT NONE + +TYPE(ElemShapeData_) :: test, trial +TYPE(QuadraturePoint_) :: quad +TYPE(ReferenceLine_) :: refelem +REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +INTEGER(I4B), PARAMETER :: order = 2, one_i = 1 +INTEGER(I4B) :: nns, nips, tsize + +! Let us now create the physical coordinate of the line element. + +XiJ = RESHAPE([-1, 1], [1, 2]) + +! Now we create an instance of [[ReferenceLine_]]. + +refelem = ReferenceLine(nsd=1) + +! Here, we create the quadrature points. + +CALL QuadPoint_Initiate(obj=quad, elemType=elem%line, & + domainName="B", order=integralOrder, & + quadratureType=obj%quadTypeForTime) +nips = Quad_Size(quad, 2) +nns = order + 1 + +CALL Elemsd_Allocate(obj=elemsd, nsd=one_i, xidim=one_i, & + nns=nns, nips=nips) + +! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]] + +CALL Initiate(obj=test, & + & quad=quad, & + & refelem=refelem, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) +CALL Set(obj=test, val=xij, N=test%N, dNdXi=test%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_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/MassMatrix_test_2.md b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 similarity index 100% rename from docs/docs-api/MassMatrix/MassMatrix_test_2.md rename to docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 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..cdae59a6 --- /dev/null +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md @@ -0,0 +1,120 @@ +--- +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/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 From d4a9b916501bf37a2d5bf3b1b3265f3ce426ca33 Mon Sep 17 00:00:00 2001 From: vickysharma0812 Date: Sun, 18 May 2025 18:59:12 +0900 Subject: [PATCH 4/7] updating easifemGO install --- docs/guides/easifemGO/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 067509a892667a2fcc636d9c676d1c90c9083449 Mon Sep 17 00:00:00 2001 From: vickysharma0812 Date: Mon, 19 May 2025 00:39:58 +0900 Subject: [PATCH 5/7] adding mass matrix example --- .../examples/_MassMatrix_test_1.F90 | 69 ++++++++++++------- docs/docs-api/MassMatrix/examples/runner.toml | 3 + 2 files changed, 48 insertions(+), 24 deletions(-) create mode 100644 docs/docs-api/MassMatrix/examples/runner.toml diff --git a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 index b41e029e..982754fc 100644 --- a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 @@ -1,49 +1,70 @@ PROGRAM main -USE BaseType, ONLY: ElemShapeData_, QuadraturePoint_, ReferenceLine_ +USE BaseType, ONLY: ElemShapeData_, & + QuadraturePoint_, & + elem => TypeElemNameOpt, & + quadType => TypeQuadratureOpt, & + iptype => TypeInterpolationOpt, & + basisType => 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 + IMPLICIT NONE -TYPE(ElemShapeData_) :: test, trial +TYPE(ElemShapeData_) :: elemsd, linelemsd TYPE(QuadraturePoint_) :: quad -TYPE(ReferenceLine_) :: refelem -REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +REAL(DFP), ALLOCATABLE :: mat(:, :), xij(:, :) INTEGER(I4B), PARAMETER :: order = 2, one_i = 1 -INTEGER(I4B) :: nns, nips, tsize +REAL(DFP), PARAMETER :: refElemCoord(1, 2) = & + RESHAPE([-1.0_DFP, 1.0_DFP], [1, 2]) +INTEGER(I4B) :: nns, nips, tsize, integralOrder +CHARACTER(LEN=*), PARAMETER :: domainName = "B" ! Let us now create the physical coordinate of the line element. - -XiJ = RESHAPE([-1, 1], [1, 2]) - -! Now we create an instance of [[ReferenceLine_]]. - -refelem = ReferenceLine(nsd=1) +xij = RESHAPE([-1, 1], [1, 2]) +integralOrder = 2 * order ! Here, we create the quadrature points. - CALL QuadPoint_Initiate(obj=quad, elemType=elem%line, & - domainName="B", order=integralOrder, & - quadratureType=obj%quadTypeForTime) + domainName=domainName, order=integralOrder, & + quadratureType=quadType%GaussLegendre) nips = Quad_Size(quad, 2) nns = order + 1 +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_]]. You can learn more about it from [[ElemshapeData_test]] +! Initiate an instance of ElemshapeData_ for linear geometry. +CALL LagrangeElemShapeData(obj=linelemsd, quad=quad, nsd=elemsd%nsd, & + xidim=elemsd%xidim, elemtype=elem%line, & + refelemCoord=refelemCoord, domainName=domainName, & + order=one_i) + +CALL LagrangeElemShapeData(obj=elemsd, quad=quad, nsd=elemsd%nsd, xidim=elemsd%xidim, & + elemType=elem%line, refelemCoord=refelemCoord, & + domainName=domainName, order=order, & + ipType=iptype%GaussLegendreLobatto, & + basisType=basisType%Monomial) -CALL Initiate(obj=test, & - & quad=quad, & - & refelem=refelem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -CALL Set(obj=test, val=xij, N=test%N, dNdXi=test%dNdXi) +CALL Elemsd_Set(obj=elemsd, val=xij, N=linelemsd%N, dNdXi=linelemsd%dNdXi) -! Let us now create the mass matrix. +CALL Elemsd_Display(elemsd, "elemsd:") -mat = MassMatrix(test=test, trial=test) -CALL Display(mat, "mat:") +! ! 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/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"] From 6bd5f64f49c6209c74cae4f417e8ef1ed37c08d3 Mon Sep 17 00:00:00 2001 From: shion Date: Sat, 17 May 2025 13:16:34 +0900 Subject: [PATCH 6/7] Updates in Blog Pages - adding some SNS links for authors - adding css for image of authors --- docs/blog/authors.yml | 4 ++++ src/css/custom.css | 14 ++++++++++++++ 2 files changed, 18 insertions(+) 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/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; +} From 8a747609978cd6b1328132149f82b5b63201b48d Mon Sep 17 00:00:00 2001 From: easifem Date: Fri, 23 May 2025 12:34:39 +0900 Subject: [PATCH 7/7] Adding documentation of mass matrix --- .../MassMatrix/examples/MassMatrix_test_3.F90 | 180 ++++++------------ .../MassMatrix/examples/MassMatrix_test_3.md | 123 +----------- .../MassMatrix/examples/MassMatrix_test_4.F90 | 152 ++++----------- .../MassMatrix/examples/MassMatrix_test_4.md | 124 +----------- .../examples/_MassMatrix_test_1.F90 | 46 +++-- .../examples/_MassMatrix_test_2.F90 | 140 ++++---------- .../MassMatrix/examples/_MassMatrix_test_2.md | 112 +---------- 7 files changed, 161 insertions(+), 716 deletions(-) diff --git a/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 index 7f3ae717..9209ed7a 100644 --- a/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.F90 @@ -1,133 +1,59 @@ ---- -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) +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) -``` -!!! note "" - Here, we create the quadrature points. - -```fortran +! Here, we create the quadrature points. 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 + 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 index 7f3ae717..46292e44 100644 --- a/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_3.md @@ -1,31 +1,14 @@ ---- -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 ---- +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. -# 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`. +`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 @@ -33,101 +16,3 @@ $$ 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/examples/MassMatrix_test_4.F90 b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 index dc085db5..cf16c00a 100644 --- a/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.F90 @@ -1,134 +1,58 @@ ---- -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 -``` +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. +! Let us now create the physical coordinate of the line element. -```fortran - XiJ = RESHAPE([-1, 1], [1, 2]) -``` +XiJ = RESHAPE([-1, 1], [1, 2]) -!!! note "" - Now we create an instance of [[ReferenceLine_]]. +! Now we create an instance of [[ReferenceLine_]]. -```fortran - simplexElem = referenceline(nsd=1) +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. +! 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]]. + quadratureType='GaussLegendre') -```fortran - CALL initiate(obj=elemsdForsimplex, & - & quad=quad, & - & refelem=simplexElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -``` +! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. -!!! 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) -``` +CALL initiate(obj=elemsdForsimplex, & + & quad=quad, & + & refelem=simplexElem, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) -!!! 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) -``` +! Initiate an instance of [[ElemeshapeData_]] for test function. -!!! note "" - Let us now create the mass matrix. +CALL initiate(obj=test, & + & quad=quad, & + & refelem=refElemForTest, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) +CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & + & dNdXi=elemsdForSimplex%dNdXi) -```fortran - mat=MassMatrix(test=trial, trial=test) - CALL Display(mat, "mat:") -``` +! Initiate an instance of [[ElemeshapeData_]] for trial function. -??? example "Results" +CALL initiate(obj=trial, & + & quad=quad, & + & refelem=refElemForTrial, & + & ContinuityType=typeH1, & + & InterpolType=typeLagrangeInterpolation) +CALL Set(obj=trial, val=xij, N=elemsdForSimplex%N, & + & dNdXi=elemsdForSimplex%dNdXi) - ```bash - mat: - ---------------- - 0.33333 0.00000 - 0.00000 0.33333 - 0.66667 0.66667 - ``` +! Let us now create the mass matrix. -!!! settings "Cleanup" +mat = MassMatrix(test=trial, trial=test) +CALL Display(mat, "mat:") -```fortran 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 index dc085db5..f9a97f09 100644 --- a/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md +++ b/docs/docs-api/MassMatrix/examples/MassMatrix_test_4.md @@ -1,31 +1,14 @@ ---- -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 ---- +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. -# 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`. +`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 @@ -33,102 +16,3 @@ $$ 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_1.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 index 982754fc..b2987532 100644 --- a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_1.F90 @@ -4,7 +4,7 @@ PROGRAM main elem => TypeElemNameOpt, & quadType => TypeQuadratureOpt, & iptype => TypeInterpolationOpt, & - basisType => TypePolynomialOpt + polyType => TypePolynomialOpt USE GlobalData, ONLY: DFP, I4B @@ -17,28 +17,32 @@ PROGRAM main 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(:, :), xij(:, :) -INTEGER(I4B), PARAMETER :: order = 2, one_i = 1 -REAL(DFP), PARAMETER :: refElemCoord(1, 2) = & - RESHAPE([-1.0_DFP, 1.0_DFP], [1, 2]) -INTEGER(I4B) :: nns, nips, tsize, integralOrder -CHARACTER(LEN=*), PARAMETER :: domainName = "B" +REAL(DFP), ALLOCATABLE :: mat(:, :) +INTEGER(I4B) :: nips, tsize -! Let us now create the physical coordinate of the line element. -xij = RESHAPE([-1, 1], [1, 2]) -integralOrder = 2 * order +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=elem%line, & +CALL QuadPoint_Initiate(obj=quad, elemType=elemType, & domainName=domainName, order=integralOrder, & - quadratureType=quadType%GaussLegendre) + quadratureType=quadratureType) nips = Quad_Size(quad, 2) -nns = order + 1 CALL Display(nips, "number of integration points: ") CALL Display(nns, "number of nodes in space: ") @@ -48,23 +52,23 @@ PROGRAM main ! Initiate an instance of ElemshapeData_ for linear geometry. CALL LagrangeElemShapeData(obj=linelemsd, quad=quad, nsd=elemsd%nsd, & - xidim=elemsd%xidim, elemtype=elem%line, & + 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=elem%line, refelemCoord=refelemCoord, & + elemType=elemType, refelemCoord=refelemCoord, & domainName=domainName, order=order, & - ipType=iptype%GaussLegendreLobatto, & - basisType=basisType%Monomial) + 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=test, trial=test) -! CALL Display(mat, "mat:") +! 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_2.F90 b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 index cdae59a6..4ad28b2f 100644 --- a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.F90 @@ -1,120 +1,44 @@ ---- -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. +USE easifemBase -```fortran - CALL initiate( obj=quad, refelem=refelem, order=order*2, & - & quadratureType='GaussLegendre' ) -``` +IMPLICIT NONE -!!! note "" - Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]]. +TYPE(Elemshapedata_) :: test, elemsdForsimplex +TYPE(Quadraturepoint_) :: quad +TYPE(Referenceline_) :: simplexElem, refElem +REAL(DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :) +INTEGER(I4B), PARAMETER :: order = 2 -```fortran - CALL initiate(obj=elemsdForsimplex, & - & quad=quad, & - & refelem=simplexElem, & - & ContinuityType=typeH1, & - & InterpolType=typeLagrangeInterpolation) -``` +! Let us now create the physical coordinate of the line element. +XiJ = RESHAPE([-1, 1], [1, 2]) -!!! 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) -``` +! Now we create an instance of [[ReferenceLine_]]. +simplexElem = referenceline(nsd=1) +CALL simplexElem%LagrangeElement(order=order, highOrderObj=refelem) -!!! note "" - Let us now create the mass matrix. +! Here, we create the quadrature points. +CALL initiate(obj=quad, refelem=refelem, order=order * 2, & + quadratureType='GaussLegendre') -```fortran - mat=MassMatrix(test=test, trial=test) - CALL Display(mat, "mat:") -``` +! 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) -??? example "Results" +! Initiate an instance of [[ElemeshapeData_]]. +CALL initiate(obj=test, & + quad=quad, & + refelem=refElem, & + ContinuityType=typeH1, & + InterpolType=typeLagrangeInterpolation) - ```bash - mat: - --------------------------- - 0.26667 -0.06667 0.13333 - -0.06667 0.26667 0.13333 - 0.13333 0.13333 1.06667 - ``` +CALL Set(obj=test, val=xij, N=elemsdForSimplex%N, & + dNdXi=elemsdForSimplex%dNdXi) -!!! settings "Cleanup" +! Let us now create the mass matrix. +mat = MassMatrix(test=test, trial=test) +CALL Display(mat, "mat:") -```fortran 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 index cdae59a6..46e0d99a 100644 --- a/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md +++ b/docs/docs-api/MassMatrix/examples/_MassMatrix_test_2.md @@ -1,31 +1,14 @@ ---- -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 ---- +This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain. -# 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. +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`. +`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 @@ -33,88 +16,3 @@ $$ 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 -```