Skip to content

Commit 6e8e883

Browse files
Merge pull request #23 from easifem/dev
Updating docs for year 2025
2 parents 7440b84 + cc343e7 commit 6e8e883

File tree

639 files changed

+41505
-6967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

639 files changed

+41505
-6967
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ First we need to configure our project by modyfing `docusaurus.config.js` file.
5858

5959
- `organizationName`, The GitHub user or organization name.
6060
- `projectName`, The name of the deployment repository.
61-
- `deploymentBranch`, The name of the deployment branch. Bu default it is `gh-pages` for non-organization GitHub pages repositories (that is, `projectName` not ending in `.github.io`). Otherwise, it needs to be explicit as a config field or environment variable.
61+
- `deploymentBranch`, The name of the deployment branch. But default it is `gh-pages` for non-organization GitHub pages repositories (that is, `projectName` not ending in `.github.io`). Otherwise, it needs to be explicit as a config field or environment variable.
6262

6363
In this repository we have set the following parameters in `docusaurus.config.js` file:
6464

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
!> author: Vikas Sharma, Ph. D.
2+
! date: 2025-10-02
3+
! summary: A Simple mesh generator
4+
5+
PROGRAM main
6+
USE Gmsh_Class
7+
USE GlobalData
8+
USE MSHFile_Class
9+
USE HDF5File_Class
10+
USE Display_Method
11+
12+
TYPE(Gmsh_) :: gmsh
13+
14+
CHARACTER(LEN=*), PARAMETER :: prefix = "square"
15+
REAL(DFP), PARAMETER :: lx = 1.0_DFP
16+
REAL(DFP), PARAMETER :: ly = 1.0_DFP
17+
INTEGER(I4B), PARAMETER :: order = 1
18+
19+
REAL(DFP), PARAMETER :: meshSize = 1.0
20+
REAL(DFP), PARAMETER :: corner(3) = 0.0_DFP
21+
INTEGER(I4B), PARAMETER :: nnod(2) = [3, 3]
22+
INTEGER(I4B) :: ierr
23+
REAL(DFP) :: x, y, z, lc
24+
CHARACTER(:), ALLOCATABLE :: suffix, title
25+
26+
TYPE(MSHFile_) :: mshFile
27+
TYPE(HDF5File_) :: hdf5file
28+
29+
suffix = ToString(nnod(1))//"x"//ToString(nnod(2))
30+
31+
title = prefix//"_"//suffix
32+
33+
ierr = gmsh%Initialize()
34+
ierr = gmsh%model%add(title)
35+
36+
x = corner(1); y = corner(2); z = corner(3); lc = meshSize
37+
ierr = gmsh%model%geo%addPoint(x=x, y=y, z=z, meshSize=lc, tag=1)
38+
39+
x = x + lx; y = y; z = z; lc = lc
40+
ierr = gmsh%model%geo%addPoint(x=x, y=y, z=z, meshSize=lc, tag=2)
41+
42+
x = x; y = y + ly; z = z; lc = lc
43+
ierr = gmsh%model%geo%addPoint(x=x, y=y, z=z, meshSize=lc, tag=3)
44+
45+
x = corner(1); y = y; z = z; lc = lc
46+
ierr = gmsh%model%geo%addPoint(x=x, y=y, z=z, meshSize=lc, tag=4)
47+
48+
ierr = gmsh%model%geo%addLine(1, 2, 1)
49+
ierr = gmsh%model%geo%addLine(2, 3, 2)
50+
ierr = gmsh%model%geo%addLine(3, 4, 3)
51+
ierr = gmsh%model%geo%addLine(4, 1, 4)
52+
53+
ierr = gmsh%model%geo%addCurveLoop([1, 2, 3, 4], tag=1)
54+
55+
ierr = gmsh%model%geo%addPlaneSurface([1], 1)
56+
57+
ierr = gmsh%model%geo%mesh%setTransfiniteCurve(1, nnod(1), &
58+
"Progression", 1.0_DFP)
59+
ierr = gmsh%model%geo%mesh%setTransfiniteCurve(3, nnod(1), &
60+
"Progression", 1.0_DFP)
61+
ierr = gmsh%model%geo%mesh%setTransfiniteCurve(2, nnod(2), &
62+
"Progression", 1.0_DFP)
63+
ierr = gmsh%model%geo%mesh%setTransfiniteCurve(4, nnod(2), &
64+
"Progression", 1.0_DFP)
65+
66+
ierr = gmsh%model%geo%mesh%setTransfiniteSurface(1)
67+
ierr = gmsh%model%geo%mesh%setRecombine(2, 1)
68+
69+
ierr = gmsh%model%geo%synchronize()
70+
71+
ierr = gmsh%model%mesh%generate(2)
72+
73+
ierr = gmsh%model%mesh%setOrder(order)
74+
75+
ierr = gmsh%WRITE(title//'.msh')
76+
77+
ierr = gmsh%Finalize()
78+
79+
CALL mshFile%Initiate(filename=title//'.msh', STATUS="OLD", ACTION="READ")
80+
CALL mshFile%OPEN()
81+
CALL mshFile%READ()
82+
CALL hdf5file%Initiate(title//'.h5', MODE="NEW")
83+
CALL hdf5file%OPEN()
84+
CALL mshFile%Export(hdf5=hdf5file, group="")
85+
CALL mshFile%DEALLOCATE()
86+
CALL hdf5file%DEALLOCATE()
87+
88+
END PROGRAM main
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BuildType = "Debug"
2+
BuildDir = "/tmp/easifem-tests/Blog/understanding-fedof/mesh/"
3+
TargetLibs = ["easifemClasses"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BuildType = "Debug"
2+
BuildDir = "/tmp/easifem-tests/Blog/DirichletBC/"
3+
TargetLibs = ["easifemClasses"]
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
!> author: Vikas Sharma, Ph. D.
2+
! date: 2025-10-23
3+
! summary: Study of DirichletBC class
4+
5+
PROGRAM main
6+
USE GlobalData, ONLY: DFP, I4B, LGT
7+
USE ExceptionHandler_Class, ONLY: e, EXCEPTION_INFORMATION
8+
USE DirichletBC_Class
9+
USE FEDomain_Class
10+
USE AbstractMesh_Class
11+
USE FEDOF_Class
12+
USE ScalarField_Class
13+
USE Display_Method
14+
USE ReallocateUtility
15+
16+
IMPLICIT NONE
17+
18+
!----------------------------------------------------------------------------
19+
! Parameters
20+
!----------------------------------------------------------------------------
21+
CHARACTER(*), PARAMETER :: tomlFileName = "./test1.toml"
22+
23+
!----------------------------------------------------------------------------
24+
! Types and variables
25+
!----------------------------------------------------------------------------
26+
TYPE(DirichletBC_) :: obj
27+
TYPE(FEDomain_) :: dom
28+
TYPE(ScalarField_) :: u
29+
TYPE(FEDOF_) :: fedof, geofedof
30+
INTEGER(I4B) :: tsize, iNodeOnNode, iNodeOnEdge, iNodeOnFace, nrow, ncol
31+
32+
!----------------------------------------------------------------------------
33+
! Allocatables and pointers
34+
!----------------------------------------------------------------------------
35+
CLASS(AbstractMesh_), POINTER :: cellMesh, boundaryMesh
36+
INTEGER(I4B), ALLOCATABLE :: nodeNum(:)
37+
REAL(DFP), ALLOCATABLE :: nodalValue(:, :)
38+
39+
!----------------------------------------------------------------------------
40+
! Setting the verbosity
41+
! In Debug mode, there will many messages printed to the screen
42+
! Following code suppress information-exception.
43+
!----------------------------------------------------------------------------
44+
45+
CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.)
46+
47+
!----------------------------------------------------------------------------
48+
! Domain: Initiate FEDomain and print info
49+
!----------------------------------------------------------------------------
50+
51+
CALL dom%ImportFromToml(tomlName="domain", filename=tomlFileName)
52+
! CALL dom%DisplayDomainInfo(msg="DomainInfo: ")
53+
54+
!----------------------------------------------------------------------------
55+
! ScalarField and FEDOF: Initiate scalarField and fedof
56+
!----------------------------------------------------------------------------
57+
58+
CALL u%ImportFromToml(tomlName="u", fedof=fedof, geofedof=geofedof, dom=dom, &
59+
filename=tomlFileName)
60+
! CALL fedof%Display(msg="FEDOF info: ")
61+
62+
!----------------------------------------------------------------------------
63+
! DirichletBC: Import from toml
64+
!----------------------------------------------------------------------------
65+
66+
CALL obj%ImportFromToml(filename=tomlFileName, dom=dom, tomlName="dbc")
67+
! CALL obj%Display("DirichletBC Info: ")
68+
69+
!----------------------------------------------------------------------------
70+
! DirichletBC: Get the total node numbers
71+
!----------------------------------------------------------------------------
72+
tsize = obj%GetTotalNodeNum(fedof=fedof)
73+
CALL Display(tsize, "Total Node Num: ")
74+
75+
!----------------------------------------------------------------------------
76+
! DirichletBC: Get the node numbers
77+
!----------------------------------------------------------------------------
78+
79+
CALL Reallocate(nodeNum, tsize, isExpand=.TRUE., expandFactor=2)
80+
CALL obj%Get(fedof=fedof, nodeNum=nodeNum, tsize=tsize, &
81+
iNodeOnNode=iNodeOnNode, iNodeOnEdge=iNodeOnEdge, &
82+
iNodeOnFace=iNodeOnFace)
83+
CALL Display(tsize, "tsize = ")
84+
CALL Display(nodeNum(1:tsize), "nodeNum", full=.TRUE., orient="ROW")
85+
CALL Display(iNodeOnNode, "iNodeOnNode = ")
86+
CALL Display(iNodeOnFace, "iNodeOnFace = ")
87+
CALL Display(iNodeOnEdge, "iNodeOnEdge = ")
88+
89+
!----------------------------------------------------------------------------
90+
! DirichletBC: Get the nodal values
91+
!----------------------------------------------------------------------------
92+
93+
CALL Reallocate(nodalValue, tsize, 2, isExpand=.TRUE., expandFactor=2)
94+
CALL obj%Get(fedof=fedof, nodeNum=nodeNum, nodalValue=nodalValue, &
95+
nrow=nrow, ncol=ncol)
96+
CALL Display(nodalValue(1:nrow, 1:ncol), "nodalValue: ", &
97+
full=.TRUE.)
98+
CALL Display([nrow, ncol], "[nrow, ncol]: ")
99+
100+
!----------------------------------------------------------------------------
101+
! Cleanup
102+
!----------------------------------------------------------------------------
103+
CALL dom%DEALLOCATE()
104+
END PROGRAM main
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[domain]
2+
filename = "./mesh/square_3x3.h5"
3+
group = "/"
4+
totalMedium = 1
5+
6+
[u]
7+
name = "u"
8+
engine = "NATIVE_SERIAL"
9+
fieldType = "Normal"
10+
spaceCompo = 1
11+
timeCompo = 1
12+
fedofName = "space"
13+
geofedofName = "geofedof"
14+
15+
[u.geofedof]
16+
baseContinuity = "H1"
17+
baseInterpolation = "Lagrange"
18+
ipType = "Equidistance"
19+
baseType = "Monomial"
20+
21+
[u.space]
22+
baseContinuity = "H1"
23+
baseInterpolation = "Hierarchical"
24+
# ipType = "Equidistance"
25+
# baseType = "Monomial"
26+
order = 4
27+
scaleForQuadOrder = 2
28+
quadOptName = "quadOpt"
29+
30+
[u.space.quadOpt]
31+
isHomogeneous = true
32+
quadratureType = "GaussLegendre"
33+
# order = 2
34+
35+
[dbc]
36+
name = "left_bottom_fix"
37+
idof = 1
38+
nodalValueType = "Constant"
39+
value = 10.0
40+
[dbc.boundary]
41+
isSelectionByMeshID = true
42+
[dbc.boundary.meshID]
43+
line = [1, 4]
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
!> author: Vikas Sharma, Ph. D.
2+
! date: 2025-10-23
3+
! summary: Study of DirichletBC class
4+
5+
PROGRAM main
6+
USE GlobalData, ONLY: DFP, I4B, LGT
7+
USE ExceptionHandler_Class, ONLY: e, EXCEPTION_INFORMATION
8+
USE DirichletBC_Class
9+
USE FEDomain_Class
10+
USE AbstractMesh_Class
11+
USE FEDOF_Class
12+
USE ScalarField_Class
13+
USE Display_Method
14+
USE ReallocateUtility
15+
16+
IMPLICIT NONE
17+
18+
!----------------------------------------------------------------------------
19+
! Parameters
20+
!----------------------------------------------------------------------------
21+
CHARACTER(*), PARAMETER :: tomlFileName = "./test2.toml"
22+
23+
!----------------------------------------------------------------------------
24+
! Types and variables
25+
!----------------------------------------------------------------------------
26+
TYPE(DirichletBC_) :: obj
27+
TYPE(FEDomain_) :: dom
28+
TYPE(ScalarField_) :: u
29+
TYPE(FEDOF_) :: fedof, geofedof
30+
INTEGER(I4B) :: tsize, iNodeOnNode, iNodeOnEdge, iNodeOnFace, nrow, ncol
31+
32+
!----------------------------------------------------------------------------
33+
! Allocatables and pointers
34+
!----------------------------------------------------------------------------
35+
CLASS(AbstractMesh_), POINTER :: cellMesh, boundaryMesh
36+
INTEGER(I4B), ALLOCATABLE :: nodeNum(:)
37+
REAL(DFP), ALLOCATABLE :: nodalValue(:, :)
38+
39+
!----------------------------------------------------------------------------
40+
! Setting the verbosity
41+
! In Debug mode, there will many messages printed to the screen
42+
! Following code suppress information-exception.
43+
!----------------------------------------------------------------------------
44+
45+
! CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.)
46+
47+
!----------------------------------------------------------------------------
48+
! Domain: Initiate FEDomain and print info
49+
!----------------------------------------------------------------------------
50+
51+
CALL dom%ImportFromToml(tomlName="domain", filename=tomlFileName)
52+
! CALL dom%DisplayDomainInfo(msg="DomainInfo: ")
53+
54+
!----------------------------------------------------------------------------
55+
! ScalarField and FEDOF: Initiate scalarField and fedof
56+
!----------------------------------------------------------------------------
57+
58+
CALL u%ImportFromToml(tomlName="u", fedof=fedof, geofedof=geofedof, dom=dom, &
59+
filename=tomlFileName)
60+
! CALL fedof%Display(msg="FEDOF info: ")
61+
62+
!----------------------------------------------------------------------------
63+
! DirichletBC: Import from toml
64+
!----------------------------------------------------------------------------
65+
66+
CALL obj%ImportFromToml(filename=tomlFileName, dom=dom, tomlName="dbc")
67+
! CALL obj%Display("DirichletBC Info: ")
68+
69+
!----------------------------------------------------------------------------
70+
! DirichletBC: Get the total node numbers
71+
!----------------------------------------------------------------------------
72+
tsize = obj%GetTotalNodeNum(fedof=fedof)
73+
CALL Display(tsize, "Total Node Num: ")
74+
75+
!----------------------------------------------------------------------------
76+
! DirichletBC: Get the node numbers
77+
!----------------------------------------------------------------------------
78+
79+
CALL Reallocate(nodeNum, tsize, isExpand=.TRUE., expandFactor=2)
80+
CALL obj%Get(fedof=fedof, nodeNum=nodeNum, tsize=tsize, &
81+
iNodeOnNode=iNodeOnNode, iNodeOnEdge=iNodeOnEdge, &
82+
iNodeOnFace=iNodeOnFace)
83+
CALL Display(tsize, "tsize = ")
84+
CALL Display(nodeNum(1:tsize), "nodeNum", full=.TRUE., orient="ROW")
85+
CALL Display(iNodeOnNode, "iNodeOnNode = ")
86+
CALL Display(iNodeOnFace, "iNodeOnFace = ")
87+
CALL Display(iNodeOnEdge, "iNodeOnEdge = ")
88+
89+
!----------------------------------------------------------------------------
90+
! DirichletBC: Get the nodal values
91+
!----------------------------------------------------------------------------
92+
93+
CALL Reallocate(nodalValue, tsize, 2, isExpand=.TRUE., expandFactor=2)
94+
CALL Display(SHAPE(nodalValue), "shape(nodalValue) before Get: ")
95+
nrow = 0; ncol = 0
96+
CALL obj%Get(fedof=fedof, geofedof=geofedof, nodeNum=nodeNum, &
97+
nodalValue=nodalValue, nrow=nrow, ncol=ncol)
98+
99+
CALL Display(nodeNum(1:nrow), "nodeNum(1:nrow): ", &
100+
full=.TRUE., advance="NO")
101+
CALL Display(nodalValue(1:nrow, 1:ncol), "nodalValue: ", &
102+
full=.TRUE.)
103+
CALL Display([nrow, ncol], "[nrow, ncol]: ")
104+
105+
!----------------------------------------------------------------------------
106+
! Cleanup
107+
!----------------------------------------------------------------------------
108+
109+
CALL dom%DEALLOCATE()
110+
111+
END PROGRAM main
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
function BottomFunc(x, y, z, t)
2+
return x ^ 2 + y
3+
end

0 commit comments

Comments
 (0)