-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7d57f6
commit 4423912
Showing
20 changed files
with
513 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
PROGRAM main | ||
USE easifemBase | ||
IMPLICIT NONE | ||
INTEGER(I4B), ALLOCATABLE :: intvec1(:) | ||
REAL(DFP), ALLOCATABLE :: realvec1(:) | ||
|
||
CALL Append(intvec1, 1) | ||
CALL OK(ALL(intvec1 .EQ. [1]), "Append single ENTRY") | ||
|
||
CALL Append(intvec1, [2, 3]) | ||
CALL OK(ALL(intvec1 .EQ. [1, 2, 3]), "Append a vector") | ||
|
||
CALL Append(realvec1, 1.0_DFP) | ||
CALL OK(ALL(realvec1 .EQ. [1.0_DFP]), "Append single ENTRY") | ||
|
||
CALL Append(realvec1, [2.0_DFP, 3.0_DFP]) | ||
CALL OK(ALL(realvec1 .EQ. [1.0_DFP, 2.0_DFP, 3.0_DFP]), "Append a vector") | ||
|
||
DEALLOCATE (intvec1, realvec1) | ||
END PROGRAM main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,38 @@ | ||
# GetMeshPointer | ||
|
||
<!-- markdownlint-disable MD041 MD013 MD033 --> | ||
|
||
This function returns the mesh pointer stored in the domain. | ||
|
||
## Interface | ||
|
||
<Tabs> | ||
<TabItem value="interface" label="Interface" default> | ||
|
||
```fortran | ||
INTERFACE | ||
MODULE FUNCTION Domain_GetMeshPointer1(obj, dim, entityNum) RESULT(Ans) | ||
CLASS(Domain_), INTENT(IN) :: obj | ||
INTEGER(I4B), INTENT(IN) :: dim | ||
!! dimension of mesh entity | ||
INTEGER(I4B), INTENT(IN) :: entityNum | ||
!! entity number | ||
CLASS(Mesh_), POINTER :: ans | ||
END FUNCTION Domain_GetMeshPointer1 | ||
END INTERFACE | ||
``` | ||
|
||
</TabItem> | ||
|
||
<TabItem value="example" label="example"> | ||
|
||
import EXAMPLE10 from "./examples/_GetMeshPointer_test_1.md"; | ||
|
||
<EXAMPLE10 /> | ||
|
||
</TabItem> | ||
|
||
<TabItem value="close" label="↢ close"> | ||
|
||
</TabItem> | ||
</Tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
<!-- markdownlint-disable MD041 MD013 MD033 --> | ||
|
||
```fortran | ||
PROGRAM main | ||
USE easifemBase | ||
|
35 changes: 17 additions & 18 deletions
35
docs/docs-api/FEMesh/examples/_GetElementToElements_test_1.F90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,23 @@ | ||
|
||
PROGRAM main | ||
USE easifemBase | ||
USE easifemClasses | ||
IMPLICIT NONE | ||
TYPE( FEMesh_ ) :: obj | ||
TYPE( HDF5File_ ) :: meshfile | ||
INTEGER( I4B ), ALLOCATABLE :: nptrs( :, : ) | ||
USE easifemBase | ||
USE easifemClasses | ||
IMPLICIT NONE | ||
TYPE(FEMesh_) :: obj | ||
TYPE(HDF5File_) :: meshfile | ||
INTEGER(I4B), ALLOCATABLE :: elem2elem(:, :) | ||
CHARACTER(*), PARAMETER :: filename="../../Mesh/examples/meshdata/small_mesh.h5" | ||
! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. | ||
CALL meshfile%Initiate(filename, "READ" ) | ||
CALL meshfile%Open() | ||
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1" ) | ||
! Initiate and open the mesh file which is in [[HDF5File_]] format. Then, create an instance of mesh. | ||
CALL meshfile%Initiate(filename, "READ") | ||
CALL meshfile%OPEN() | ||
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1") | ||
|
||
nptrs = obj%GetElementToElements( globalElement=23, onlyElements=.FALSE. ) | ||
CALL Display( nptrs, "Element connected to iel=23") | ||
elem2elem = obj%GetElementToElements(globalElement=23, onlyElements=.FALSE.) | ||
CALL Display(elem2elem, "Element connected to iel=23") | ||
|
||
nptrs = obj%GetElementToElements( globalElement=23, onlyElements=.TRUE. ) | ||
CALL Display( nptrs, "Element connected to iel=23") | ||
elem2elem = obj%GetElementToElements(globalElement=23, onlyElements=.TRUE.) | ||
CALL Display(elem2elem, "Element connected to iel=23") | ||
|
||
CALL obj%Deallocate() | ||
CALL meshfile%Close() | ||
CALL meshfile%Deallocate() | ||
CALL obj%DEALLOCATE() | ||
CALL meshfile%CLOSE() | ||
CALL meshfile%DEALLOCATE() | ||
END PROGRAM main |
49 changes: 49 additions & 0 deletions
49
docs/docs-api/Mesh/examples/_GetElementToElements_test_2.F90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
PROGRAM main | ||
USE easifemBase | ||
USE easifemClasses | ||
|
||
IMPLICIT NONE | ||
|
||
CHARACTER(*), PARAMETER :: filename = "./meshdata/small_mesh.h5" | ||
INTEGER(I4B), ALLOCATABLE :: elem2elem(:, :) | ||
INTEGER(I4B) :: globalElement, ii | ||
TYPE(ElemData_) :: elemdata1, elemdata2 | ||
TYPE(FEMesh_) :: obj | ||
TYPE(HDF5File_) :: meshfile | ||
LOGICAL(LGT) :: isok | ||
|
||
CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.) | ||
CALL meshfile%Initiate(filename, "READ") | ||
CALL meshfile%OPEN() | ||
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1") | ||
|
||
globalElement = 23 | ||
elem2elem = obj%GetElementToElements(globalElement=globalElement, & | ||
onlyElements=.FALSE.) | ||
CALL Display(elem2elem, "Element connected to iel="//tostring(globalElement)) | ||
CALL obj%GetElemData(globalElement=globalElement, elemdata=elemdata1, & | ||
islocal=.FALSE.) | ||
CALL Blanklines(nol=2) | ||
|
||
CALL ElemData_Display(elemdata1, "elemdata: ") | ||
|
||
DO ii = 1, SIZE(elem2elem, 1) | ||
|
||
globalElement = elem2elem(ii, 1) | ||
CALL obj%GetElemData(globalElement=globalElement, elemdata=elemdata2, & | ||
islocal=.FALSE.) | ||
|
||
isok = elemdata1%globalFaces(elem2elem(ii, 2)) & | ||
.EQ. elemdata2%globalFaces(elem2elem(ii, 3)) | ||
CALL OK(isok, "GetElementToElements test-a : ") | ||
|
||
isok = (elemdata1%faceOrient(1, elem2elem(ii, 2)) & | ||
+ elemdata2%faceOrient(1, elem2elem(ii, 3))) .EQ. 0 | ||
CALL OK(isok, "GetElementToElements test-b : ") | ||
|
||
END DO | ||
|
||
CALL obj%DEALLOCATE() | ||
CALL meshfile%CLOSE() | ||
CALL meshfile%DEALLOCATE() | ||
END PROGRAM main |
122 changes: 122 additions & 0 deletions
122
docs/docs-api/Mesh/examples/_GetElementToElements_test_2.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<!-- markdownlint-disable MD041 MD013 MD033 --> | ||
|
||
```fortran | ||
PROGRAM main | ||
USE easifemBase | ||
USE easifemClasses | ||
IMPLICIT NONE | ||
CHARACTER(*), PARAMETER :: filename = "./meshdata/small_mesh.h5" | ||
INTEGER(I4B), ALLOCATABLE :: elem2elem(:, :) | ||
INTEGER(I4B) :: globalElement | ||
TYPE(ElemData_) :: elemdata | ||
TYPE(FEMesh_) :: obj | ||
TYPE(HDF5File_) :: meshfile | ||
CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.) | ||
CALL meshfile%Initiate(filename, "READ") | ||
CALL meshfile%OPEN() | ||
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1") | ||
elem2elem = obj%GetElementToElements(globalElement=23, onlyElements=.FALSE.) | ||
CALL Display(elem2elem, "Element connected to iel=23") | ||
CALL obj%GetElemData(globalElement=23, elemdata=elemdata, islocal=.FALSE.) | ||
CALL ElemData_Display(elemdata, "elemdata: ") | ||
CALL Blanklines(nol=2) | ||
globalElement = 22 | ||
elem2elem = obj%GetElementToElements(globalElement=globalElement, & | ||
onlyElements=.FALSE.) | ||
CALL Display(elem2elem, "Element connected to iel="// & | ||
tostring(globalElement)) | ||
CALL obj%GetElemData(globalElement=globalElement, elemdata=elemdata, & | ||
islocal=.FALSE.) | ||
CALL ElemData_Display(elemdata, "elemdata: ") | ||
CALL obj%DEALLOCATE() | ||
CALL meshfile%CLOSE() | ||
CALL meshfile%DEALLOCATE() | ||
END PROGRAM main | ||
``` | ||
|
||
```bash title="results" | ||
Element connected to iel=23 | ||
--------------------------- | ||
22 1 2 | ||
26 2 3 | ||
25 3 1 | ||
elemdata: | ||
isActive: TRUE | ||
globalElemNum: 23 | ||
localElemNum: 11 | ||
elementType:INTERNAL_ELEMENT | ||
elementName:Triangle3 | ||
globalNodes: | ||
------------- | ||
9 | ||
10 | ||
11 | ||
globalEdges: | ||
------------- | ||
22 | ||
23 | ||
24 | ||
edgeOrient: | ||
------------ | ||
1 | ||
1 | ||
1 | ||
globalElements: | ||
---------------- | ||
22 | ||
1 | ||
2 | ||
26 | ||
2 | ||
3 | ||
25 | ||
3 | ||
1 | ||
boundaryData: | ||
-------------- | ||
|
||
|
||
Element connected to iel=22 | ||
--------------------------- | ||
20 1 3 | ||
23 2 1 | ||
14 3 2 | ||
elemdata: | ||
isActive: TRUE | ||
globalElemNum: 22 | ||
localElemNum: 10 | ||
elementType:INTERNAL_ELEMENT | ||
elementName:Triangle3 | ||
globalNodes: | ||
------------- | ||
9 | ||
8 | ||
10 | ||
globalEdges: | ||
------------- | ||
20 | ||
22 | ||
5 | ||
edgeOrient: | ||
------------ | ||
-1 | ||
1 | ||
1 | ||
globalElements: | ||
---------------- | ||
20 | ||
1 | ||
3 | ||
23 | ||
2 | ||
1 | ||
14 | ||
3 | ||
2 | ||
boundaryData: | ||
-------------- | ||
``` |
44 changes: 44 additions & 0 deletions
44
docs/docs-api/Mesh/examples/_GetElementToElements_test_3.F90
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
PROGRAM main | ||
USE easifemBase | ||
USE easifemClasses | ||
|
||
IMPLICIT NONE | ||
|
||
CHARACTER(*), PARAMETER :: filename = "./meshdata/small_mesh.h5" | ||
INTEGER(I4B), ALLOCATABLE :: elem2elem(:, :) | ||
INTEGER(I4B) :: globalElement | ||
TYPE(ElemData_) :: elemdata1, elemdata2 | ||
TYPE(FEMesh_) :: obj | ||
TYPE(HDF5File_) :: meshfile | ||
|
||
CALL e%setQuietMode(EXCEPTION_INFORMATION, .TRUE.) | ||
CALL meshfile%Initiate(filename, "READ") | ||
CALL meshfile%OPEN() | ||
CALL obj%Initiate(hdf5=meshfile, group="/surfaceEntities_1") | ||
|
||
globalElement = 23 | ||
elem2elem = obj%GetElementToElements(globalElement=globalElement, & | ||
onlyElements=.FALSE.) | ||
CALL Display(elem2elem, "Element connected to iel="//tostring(globalElement)) | ||
CALL obj%GetElemData(globalElement=globalElement, elemdata=elemdata1, & | ||
islocal=.FALSE.) | ||
! CALL ElemData_Display(elemdata1, "elemdata: ") | ||
CALL Blanklines(nol=2) | ||
|
||
DO ii = 1, SIZE(elem2elem, 1) | ||
|
||
globalElement = elem2elem(1, ii) | ||
! elem2elem = obj%GetElementToElements(globalElement=globalElement, & | ||
! onlyElements=.FALSE.) | ||
! CALL Display(elem2elem, "Element connected to iel="// & | ||
! tostring(globalElement)) | ||
CALL obj%GetElemData(globalElement=globalElement, elemdata=elemdata, & | ||
islocal=.FALSE.) | ||
! CALL ElemData_Display(elemdata, "elemdata: ") | ||
|
||
END DO | ||
|
||
CALL obj%DEALLOCATE() | ||
CALL meshfile%CLOSE() | ||
CALL meshfile%DEALLOCATE() | ||
END PROGRAM main |
Oops, something went wrong.