Skip to content

Commit d98debf

Browse files
Merge pull request #324 from easifem/vikas-dev
Vikas dev
2 parents 715cf93 + 0d6e943 commit d98debf

File tree

12 files changed

+219
-44
lines changed

12 files changed

+219
-44
lines changed

src/modules/BaseType/src/BaseType.F90

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,11 +1471,15 @@ END SUBROUTINE highorder_refelem
14711471
!! number of shape functions
14721472
REAL(DFP), ALLOCATABLE :: N(:, :)
14731473
!! Shape function value `N(I, ips)`
1474-
!! nrow = nns
1475-
!! ncol = nips
1474+
!! shape: (nns, nips)
1475+
!! dim 1 = number of nodes in element
1476+
!! dim 2 = number of integration points
14761477
REAL(DFP), ALLOCATABLE :: dNdXi(:, :, :)
14771478
!! Local derivative of a shape function
14781479
!! shape = nns, xidim, nips
1480+
!! dim 1 = number of nodes in element
1481+
!! dim 2 = xi dimension (xi, eta, zeta)
1482+
!! dim 3 = number of integration points
14791483
REAL(DFP), ALLOCATABLE :: jacobian(:, :, :)
14801484
!! Jacobian of mapping `J(:,:,ips)` also $\mathbf{F}_{\Xi x}$
14811485
!! shape = nsd, xidim, nips

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/modules/IntVector/src/IntVector_GetMethod.F90

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,21 @@ MODULE FUNCTION intVec_getPointer_2(obj, datatype) RESULT(val)
395395
END FUNCTION intVec_getPointer_2
396396
END INTERFACE GetPointer
397397

398+
!----------------------------------------------------------------------------
399+
! GetPointers@getMethod
400+
!----------------------------------------------------------------------------
401+
402+
!> author: Vikas Sharma, Ph. D.
403+
! date: 2025-05-29
404+
! summary: Get the pointer to the raw data of the IntVector instance.
405+
406+
INTERFACE GetPointer
407+
MODULE FUNCTION intVec_getPointer_3(obj) RESULT(val)
408+
CLASS(IntVector_), INTENT(IN), TARGET :: obj
409+
INTEGER(I4B), POINTER :: val(:)
410+
END FUNCTION intVec_getPointer_3
411+
END INTERFACE GetPointer
412+
398413
!----------------------------------------------------------------------------
399414
! getIndex@getMethod
400415
!----------------------------------------------------------------------------

src/modules/QuadraturePoint/src/QuadraturePoint_Method.F90

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,12 @@ END SUBROUTINE obj_Initiate3
193193

194194
!> author: Vikas Sharma, Ph. D.
195195
! date: 23 July 2021
196-
! summary: This routine Initiates the quadrature points
196+
! summary: This routine Initiates the quadrature points from number of IP
197197
!
198198
!# Introduction
199199
!
200+
! This routine is used to initiate the quadrature points from number of
201+
! integration points.
200202
! We call obj_Initiate6 in this routine
201203

202204
INTERFACE Initiate
@@ -207,7 +209,7 @@ MODULE SUBROUTINE obj_Initiate4(obj, refElem, nips, quadratureType, &
207209
CLASS(ReferenceElement_), INTENT(IN) :: refElem
208210
!! Reference element
209211
INTEGER(I4B), INTENT(IN) :: nips(1)
210-
!! order of integrand
212+
!! number of quadrature points
211213
CHARACTER(*), INTENT(IN) :: quadratureType
212214
!! Total number quadrature points
213215
REAL(DFP), OPTIONAL, INTENT(IN) :: alpha
@@ -366,6 +368,17 @@ END SUBROUTINE obj_Initiate8
366368
!
367369
!----------------------------------------------------------------------------
368370

371+
!> author: Vikas Sharma, Ph. D.
372+
! date: 2025-05-21
373+
! summary: This routine Initiates the quadrature points
374+
!
375+
!# Introduction
376+
!
377+
! This routine is used to initiate the quadrature points from order of
378+
! of integrand.
379+
! This subroutine does not require formation of reference element.
380+
! This routine calls obj_Initiate11 method.
381+
369382
INTERFACE Initiate
370383
MODULE SUBROUTINE obj_Initiate9(obj, elemType, domainName, order, &
371384
quadratureType, alpha, beta, lambda, xij)
@@ -374,9 +387,8 @@ MODULE SUBROUTINE obj_Initiate9(obj, elemType, domainName, order, &
374387
INTEGER(I4B), INTENT(IN) :: elemType
375388
!! element name
376389
CHARACTER(*), INTENT(IN) :: domainName
377-
!! domain name
390+
!! domain name for reference element
378391
!! unit or biunit
379-
!! Reference-element
380392
INTEGER(I4B), INTENT(IN) :: order
381393
!! order of integrand
382394
INTEGER(I4B), INTENT(IN) :: quadratureType
@@ -398,6 +410,17 @@ END SUBROUTINE obj_Initiate9
398410
!
399411
!----------------------------------------------------------------------------
400412

413+
!> author: Vikas Sharma, Ph. D.
414+
! date: 2025-05-21
415+
! summary: This routine Initiates the quadrature points
416+
!
417+
!# Introduction
418+
!
419+
! This routine is used to initiate the quadrature points from number of
420+
! integration points.
421+
! This subroutine does not require formation of reference element.
422+
! This routine calls obj_Initiate12 method.
423+
401424
INTERFACE Initiate
402425
MODULE SUBROUTINE obj_Initiate10(obj, elemType, domainName, nips, &
403426
quadratureType, alpha, beta, lambda, xij)
@@ -406,11 +429,10 @@ MODULE SUBROUTINE obj_Initiate10(obj, elemType, domainName, nips, &
406429
INTEGER(I4B), INTENT(IN) :: elemType
407430
!! element name
408431
CHARACTER(*), INTENT(IN) :: domainName
409-
!! domain name
432+
!! domain name, reference element
410433
!! unit or biunit
411-
!! Reference-element
412434
INTEGER(I4B), INTENT(IN) :: nips(1)
413-
!! order of integrand
435+
!! Number of integration points
414436
!! in the case of quadrangle element nips(1) denotes the
415437
!! number of quadrature points in the x and y direction
416438
!! so the total number of quadrature points are nips(1)*nips(1)

src/modules/String/src/String_Class.F90

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,16 @@ MODULE String_Class
312312
PROCEDURE, PASS(self) :: tempname
313313
!! Return a safe temporary name suitable for temporary file
314314
!! or directories.
315-
GENERIC :: to_number => &
316-
to_integer_I1P, &
315+
GENERIC :: to_number => to_integer_I1P, to_integer_I4P, to_integer_I8P, &
316+
to_real_R8P, to_real_R4P, &
317317
#ifndef _NVF
318318
to_integer_I2P, &
319319
#endif
320-
to_integer_I4P, &
321-
to_integer_I8P, &
322320
#ifdef _R16P
323321
to_real_R16P, &
324322
#endif
325-
to_real_R8P, &
326-
to_real_R4P
323+
to_logical_1
324+
327325
!! Cast string to number.
328326
PROCEDURE, PASS(self) :: unescape
329327
!! Unescape double backslashes (or custom escaped character).
@@ -475,7 +473,7 @@ MODULE String_Class
475473
!! Cast string to real.
476474
PROCEDURE, PRIVATE, PASS(self) :: to_real_R16P
477475
!! Cast string to real.
478-
PROCEDURE, PUBLIC, PASS(self) :: to_logical
476+
PROCEDURE, PUBLIC, PASS(self) :: to_logical, to_logical_1
479477
!! Convert a string to logical
480478
! assignments
481479
PROCEDURE, PRIVATE, PASS(lhs) :: string_assign_string
@@ -3169,6 +3167,25 @@ END FUNCTION tempname
31693167
!
31703168
!----------------------------------------------------------------------------
31713169

3170+
!> author: Vikas Sharma, Ph. D.
3171+
! date: 2025-05-29
3172+
! summary: Cast string to logical
3173+
3174+
ELEMENTAL FUNCTION to_logical_1(self, kind) RESULT(ans)
3175+
CLASS(string), INTENT(IN) :: self
3176+
!! The string.
3177+
LOGICAL, INTENT(IN) :: kind
3178+
!! Mold parameter for kind detection.
3179+
LOGICAL :: ans
3180+
!! The number into the string.
3181+
3182+
ans = self%to_logical()
3183+
END FUNCTION to_logical_1
3184+
3185+
!----------------------------------------------------------------------------
3186+
!
3187+
!----------------------------------------------------------------------------
3188+
31723189
!> author: Vikas Sharma, Ph. D.
31733190
! date: 23 July 2022
31743191
! summary: Cast string to integer (I1P).

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)