Skip to content

Commit 0d6e943

Browse files
Bug fixes in elemshape data
Using the range of matrices in methods related to Set1 and Set4. This is because, we get node coord from mesh, we get the 3 components even for a 2D problem. It causes some issue in while setting global element shape data.
1 parent 815607a commit 0d6e943

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

src/modules/ElemshapeData/src/ElemshapeData_Method.F90

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ MODULE ElemshapeData_Method
2020
USE ElemshapeData_GetMethods
2121
USE ElemshapeData_GradientMethods
2222

23-
! USE ElemshapeData_H1Methods
24-
! USE ElemshapeData_HCurlMethods
25-
! USE ElemshapeData_HDivMethods
26-
! USE ElemshapeData_DGMethods
27-
28-
USE ElemshapeData_Lagrange
29-
USE ElemshapeData_Hierarchical
30-
USE ElemshapeData_Orthogonal
31-
3223
USE ElemshapeData_HRGNParamMethods
3324
USE ElemshapeData_HRQIParamMethods
3425
USE ElemshapeData_HminHmaxMethods
@@ -41,4 +32,14 @@ MODULE ElemshapeData_Method
4132
USE ElemshapeData_StabilizationParamMethods
4233
USE ElemshapeData_UnitNormalMethods
4334

35+
! USE ElemshapeData_H1Methods
36+
! USE ElemshapeData_HCurlMethods
37+
! USE ElemshapeData_HDivMethods
38+
! USE ElemshapeData_DGMethods
39+
40+
USE ElemshapeData_Lagrange
41+
USE ElemshapeData_Hierarchical
42+
USE ElemshapeData_Orthogonal
43+
44+
4445
END MODULE ElemshapeData_Method

src/modules/ElemshapeData/src/ElemshapeData_SetMethods.F90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ MODULE PURE SUBROUTINE stsd_SetJacobian(obj, val, dNdXi, T)
242242
CLASS(STElemshapeData_), INTENT(INOUT) :: obj
243243
REAL(DFP), INTENT(IN) :: val(:, :, :)
244244
!! Space time nodal values of coordinates
245+
!! dim1 = spatial coordinates
246+
!! dim2 = space nodes
247+
!! dim3 = time nodes
245248
REAL(DFP), INTENT(IN) :: dNdXi(:, :, :)
246249
!! Local derivative of shape function for geometry
247250
REAL(DFP), INTENT(IN) :: T(:)

src/submodules/ElemshapeData/src/[email protected]

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@
4949
!----------------------------------------------------------------------------
5050

5151
MODULE PROCEDURE elemsd_SetBarycentricCoord
52-
obj%coord(1:obj%nsd, 1:obj%nips) = MATMUL(val, N)
52+
INTEGER(I4B) :: nns
53+
nns = SIZE(N, 1)
54+
obj%coord(1:obj%nsd, 1:obj%nips) = MATMUL(val(1:obj%nsd, 1:nns), &
55+
N(1:nns, 1:obj%nips))
5356
END PROCEDURE elemsd_SetBarycentricCoord
5457

5558
!----------------------------------------------------------------------------
5659
! SetBarycentricCoord
5760
!----------------------------------------------------------------------------
5861

5962
MODULE PROCEDURE stsd_SetBarycentricCoord
63+
! TODO: Improve this function by removing the temporary variable
64+
! It is better to store a temporary variable in obj itself
6065
CALL SetBarycentricCoord(obj=obj, val=MATMUL(val, T), N=N)
6166
END PROCEDURE stsd_SetBarycentricCoord
6267

@@ -136,15 +141,18 @@
136141
!----------------------------------------------------------------------------
137142

138143
MODULE PROCEDURE elemsd_SetJacobian
139-
obj%jacobian(1:obj%nsd, 1:obj%xidim, 1:obj%nips) = MATMUL(val, dNdXi)
144+
obj%jacobian(1:obj%nsd, 1:obj%xidim, 1:obj%nips) = &
145+
MATMUL(val(1:obj%nsd, 1:obj%nns), dNdXi(1:obj%nns, 1:obj%xidim, 1:obj%nips))
140146
END PROCEDURE elemsd_SetJacobian
141147

142148
!----------------------------------------------------------------------------
143149
! SetJacobian
144150
!----------------------------------------------------------------------------
145151

146152
MODULE PROCEDURE stsd_SetJacobian
147-
obj%jacobian = MATMUL(MATMUL(val, T), dNdXi)
153+
obj%jacobian(1:obj%nsd, 1:obj%xidim, 1:obj%nips) = &
154+
MATMUL(MATMUL(val(1:obj%nsd, 1:obj%nns, :), T), &
155+
dNdXi(1:obj%nns, 1:obj%xidim, 1:obj%nips))
148156
END PROCEDURE stsd_SetJacobian
149157

150158
!----------------------------------------------------------------------------

0 commit comments

Comments
 (0)