1- <<<<<<< HEAD
2- ---
3- title: MassMatrix example 4
4- author: Vikas Sharma, Ph.D.
5- date: 20 Nov 2021
6- update: 20 Nov 2021
7- tags:
8- - ReferenceLine
9- - ReferenceLine/ Initiate
10- - QuadraturePoint/ Initiate
11- - ElemshapeData/ Initiate
12- - MassMatrix
13- ---
14-
15- # MassMatrix example 4
16-
17- ! !! note ""
18- This example shows how to USE the SUBROUTINE called `MassMatrix` to create a mass matrix in space domain.
19-
20- Here, we want to DO the following.
21-
22- $$
23- \int_{\Omega } N^{I}\rho N^{J}d\Omega
24- $$
25-
26- ! !! warning ""
27- `rho` can be a constant, or a FUNCTION of spatial coordinates, or some nonlinear FUNCTION.
28-
29- In this example, following mass matrix is formed for [[ReferenceLine_]] element, [[QuadraturePoint_]] are `GaussLegendre`.
30-
31- $$
32- \int_{\Omega } N^{I} N^{J}d\Omega
33- $$
34-
35- This TYPE of mass matrix is useful when $rho$ is a constant.
36-
37- ## Modules and classes
38-
39- ## Usage
40-
41- ```fortran
42- =======
43- >>>>>>> 8a747609 (Adding documentation of mass matrix)
441PROGRAM main
452USE easifemBase
463IMPLICIT NONE
@@ -50,36 +7,6 @@ PROGRAM main
507REAL (DFP), ALLOCATABLE :: mat(:, :), XiJ(:, :)
518INTEGER (I4B), PARAMETER :: orderFortest = 1 , orderForTrial = 2
529
53- <<<<<<< HEAD
54- ! !! note ""
55- Let us now create the physical coordinate of the line element.
56-
57- ```fortran
58- XiJ = RESHAPE ([- 1 , 1 ], [1 , 2 ])
59- ```
60-
61- ! !! note ""
62- Now we create an instance of [[ReferenceLine_]].
63-
64- ```fortran
65- simplexElem = referenceline(nsd= 1 )
66- CALL simplexElem% LagrangeElement(order= orderForTest, highOrderObj= refElemForTest)
67- CALL simplexElem% LagrangeElement(order= orderForTrial, highOrderObj= refElemForTrial)
68- ```
69-
70- ! !! note ""
71- Here, we create the quadrature points.
72-
73- ```fortran
74- CALL initiate( obj= quad, refelem= simplexElem, order= orderForTest+ orderForTrial, &
75- & quadratureType= ' GaussLegendre' )
76- ```
77-
78- ! !! note ""
79- Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]].
80-
81- ```fortran
82- =======
8310! Let us now create the physical coordinate of the line element.
8411
8512XiJ = RESHAPE ([- 1 , 1 ], [1 , 2 ])
@@ -97,49 +24,11 @@ PROGRAM main
9724
9825! Initiate an instance of [[ElemshapeData_]]. You can learn more about it from [[ElemshapeData_test]].
9926
100- >>>>>>> 8a747609 (Adding documentation of mass matrix)
10127CALL initiate(obj= elemsdForsimplex, &
10228 & quad= quad, &
10329 & refelem= simplexElem, &
10430 & ContinuityType= typeH1, &
10531 & InterpolType= typeLagrangeInterpolation)
106- <<<<<<< HEAD
107- ```
108-
109- ! !! note ""
110- Initiate an instance of [[ElemeshapeData_]] for test function.
111-
112- ```fortran
113- CALL initiate(obj= test, &
114- & quad= quad, &
115- & refelem= refElemForTest, &
116- & ContinuityType= typeH1, &
117- & InterpolType= typeLagrangeInterpolation)
118- CALL Set(obj= test, val= xij, N= elemsdForSimplex% N, &
119- & dNdXi= elemsdForSimplex% dNdXi)
120- ```
121-
122- ! !! note ""
123- Initiate an instance of [[ElemeshapeData_]] for trial function.
124-
125- ```fortran
126- CALL initiate(obj= trial, &
127- & quad= quad, &
128- & refelem= refElemForTrial, &
129- & ContinuityType= typeH1, &
130- & InterpolType= typeLagrangeInterpolation)
131- CALL Set(obj= trial, val= xij, N= elemsdForSimplex% N, &
132- & dNdXi= elemsdForSimplex% dNdXi)
133- ```
134-
135- ! !! note ""
136- Let us now create the mass matrix.
137-
138- ```fortran
139- mat= MassMatrix(test= trial, trial= test)
140- CALL Display(mat, " mat:" )
141- ```
142- =======
14332
14433! Initiate an instance of [[ElemeshapeData_]] for test function.
14534
@@ -160,7 +49,6 @@ PROGRAM main
16049 & InterpolType= typeLagrangeInterpolation)
16150CALL Set(obj= trial, val= xij, N= elemsdForSimplex% N, &
16251 & dNdXi= elemsdForSimplex% dNdXi)
163- >>>>>>> 8a747609 (Adding documentation of mass matrix)
16452
16553! Let us now create the mass matrix.
16654
0 commit comments