Skip to content

Commit

Permalink
Merge pull request #62 from FluidNumerics/feature/structuredmesh3d
Browse files Browse the repository at this point in the history
Feature/structuredmesh3d
  • Loading branch information
garrettbyrd authored Oct 15, 2024
2 parents 091f424 + 396edea commit 4cf0a2f
Show file tree
Hide file tree
Showing 870 changed files with 11,176 additions and 7,232 deletions.
76 changes: 73 additions & 3 deletions docs/MeshGeneration/StructuredMesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Although SELF uses unstructured mesh data structures, we have provided methods t
## One Dimension (1-D)
In one dimension, the only mesh we use is a structured mesh. To generate a structured mesh in one dimension, use the `StructuredMesh` generic in the [`Mesh1D`](../ford/type/mesh1d.html) class.

At the moment, only uniformly space structured meshes of elements can be generated. This means that all of the elements are of the same width; keep in mind that within each element, there is a quadrature grid. The points in the quadrature grid are spaced so that spectral accuracy is guaranteed.
At the moment, only uniformly spaced structured meshes of elements can be generated. This means that all of the elements are of the same width; keep in mind that within each element, there is a quadrature grid. The points in the quadrature grid are spaced so that spectral accuracy is guaranteed.

To generate a structured grid in 1-D, you need to provide the number of elements and the left and right endpoints of the mesh.

Expand Down Expand Up @@ -40,9 +40,9 @@ Once the geometry is initialized, the physical positions and metric terms can be
## Two Dimensions (2-D)
To generate a structured mesh in two dimensions, use the `StructuredMesh` generic in the [`Mesh2D`](../ford/type/mesh2d.html) class.

At the moment, only uniformly space structured meshes of elements can be generated. This means that all of the elements are of the same width; keep in mind that within each element, there is a quadrature grid. The points in the quadrature grid are spaced so that spectral accuracy is guaranteed.
At the moment, only uniformly spaced structured meshes of elements can be generated. This means that all of the elements are of the same width; keep in mind that within each element, there is a quadrature grid. The points in the quadrature grid are spaced so that spectral accuracy is guaranteed.

SELF uses a tiled structured grid. Tiled grids divide the 2-D grid into `nTilex`x`nTiley` tiles of size `nxPerTile`x`nyPerTile` . The width and height of the elements are defined as `dx` and `dy`. With these parameters,
SELF uses a tiled structured grid. Tiled grids divide the 2-D grid into `nTilex`×`nTiley` tiles of size `nxPerTile`×`nyPerTile` . The width and height of the elements are defined as `dx` and `dy`. With these parameters,

* `nx = nTilex*nxPerTile` is the total number of elements in the x-direction
* `ny = nTiley*nyPerTile` is the total number of elements in the y-direction
Expand Down Expand Up @@ -101,3 +101,73 @@ Notice that initializing the geometry requires an interpolant and the number of
Under the hood, the interpolant for the geometry (`geometry % interp` ) is associated with a pointer to `interp`, ie `geometry % interp => interp`.

Once the geometry is initialized, the physical positions and metric terms can be calculated and stored using the `GenerateFromMesh` method.


## Three Dimensions (3-D)
To generate a structured mesh in three dimensions, use the `StructuredMesh` generic in the [`Mesh3D`](../ford/type/mesh3d.html) class.

At the moment, only uniformly spaced structured meshes of elements can be generated. This means that all of the elements are of the same length, width, and height; though, the length, width, and height can each be their own value. Keep in mind that within each element, there is a quadrature grid. The points in the quadrature grid are spaced so that spectral accuracy is guaranteed.

SELF uses a tiled structured grid. Tiled grids divide the 3-D grid into `nTilex`×`nTiley`×`nTilez` tiles of size `nxPerTile`×`nyPerTile`×`nzPerTile` . The length, width, and height of the elements are defined as `dx`, `dy`, and `dz` respectively. With these parameters,

* `nx = nTilex*nxPerTile` is the total number of elements in the x-direction
* `ny = nTiley*nyPerTile` is the total number of elements in the y-direction
* `nz = nTilez*nzPerTile` is the total number of elements in the z-direction
* `nelem = nx*ny*nz` is the total number of elements
* `Lx = dx*nx` is the domain length in the x-direction
* `Ly = dy*ny` is the domain length in the y-direction
* `Lz = dz*nz` is the domain length in the z-direction

You can set boundary conditions for each of the four sides of the structured mesh using a 1-D array of integers of length 6. The boundary conditions must be provided in CGNS ordering (bottom,south, east, north, west,top). The following built-in flags are available for setting boundary conditions

* `SELF_BC_NONORMALFLOW`
* `SELF_BC_PRESCRIBED`
* `SELF_BC_RADIATION`

The tiled layout is convenient for domain decomposition, when you are wanting to scale up your application for distributed memory platforms. You can further enable domain decomposition by setting the optional `enableDomainDecompisition` input to `.true.` . In this case, when you launch your application with `mpirun`, the domain will be automatically divided as evenly as possible across all MPI ranks.

!!! note
It's good practice to set the total number of tiles equal to the number of MPI ranks that you are running with. Alternatively, you can use fairly small tiles when working with a large number of MPI ranks to increase the chance of minimizing point-to-point communications .

In the example below, we create a 3-D mesh with the following attributes

* $2 × 2 × 2$ tiles for the domain
* $10 × 10 × 10$ elements per tile
* Each element is has dimensions of $0.05 × 0.05 × 0.05$. The domain dimensions are then $L_x × L_y × L_z = 1 × 1 × 1$
* Domain decomposition is enabled

The geometry fields are created from the mesh information and a $7^{th}$ degree interpolant through the Legendre-Gauss points.


```fortran
type(Mesh3D),target :: mesh
type(Lagrange),target :: interp
type(SEMHex),target :: geometry
integer :: bcids(1:6)
bcids(1:6) = [SELF_BC_PRESCRIBED,& ! bottom boundary
SELF_BC_PRESCRIBED,& ! south boundary
SELF_BC_PRESCRIBED,& ! east boundary
SELF_BC_PRESCRIBED,& ! north boundary
SELF_BC_PRESCRIBED,& ! west boundary
SELF_BC_PRESCRIBED] ! yop boundary
call mesh % StructuredMesh( nxPerTile=10, nyPerTile=10, nzPerTile=10&
nTileX=2, nTileY=2, nTileZ=2, &
dx=0.05_prec, dy=0.05_prec, dz=0.05_prec, &
bcids)
call interp % Init(N=7, controlNodeType=GAUSS, &
M=10, targetNodeType=UNIFORM)
call geometry % Init(interp,mesh%nElem)
call geometry % GenerateFromMesh(mesh)
```

Notice that initializing the geometry requires an interpolant and the number of elements as input.

!!! note
Under the hood, the interpolant for the geometry (`geometry % interp` ) is associated with a pointer to `interp`, ie `geometry % interp => interp`.

Once the geometry is initialized, the physical positions and metric terms can be calculated and stored using the `GenerateFromMesh` method.
2 changes: 1 addition & 1 deletion docs/ford/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ <h3>Derived Types</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/almostequal.html
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ <h4>Return Value <small>logical</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/applyflip_2d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/applyflip_3d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/average_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/boundaryinterp_2d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/boundaryinterp_3d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/calculatedsdt_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/calculatetendency.html
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
4 changes: 2 additions & 2 deletions docs/ford/interface/contravariantprojection_2d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h1>ContravariantProjection_2D_gpu
</ul>
<ol class="breadcrumb in-well text-right">
<li><a href='../sourcefile/self_mappedvector_2d.f90.html'>SELF_MappedVector_2D.f90</a></li>
<li><a href='../module/self_mappedvector_2d~2.html'>SELF_MappedVector_2D</a></li>
<li><a href='../module/self_mappedvector_2d.html'>SELF_MappedVector_2D</a></li>
<li class="active">ContravariantProjection_2D_gpu</li>
</ol>
</div>
Expand Down Expand Up @@ -179,7 +179,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/contravariantprojection_3d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/contravariantweight_2d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
4 changes: 2 additions & 2 deletions docs/ford/interface/contravariantweight_3d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ <h1>ContravariantWeight_3D_gpu
</ul>
<ol class="breadcrumb in-well text-right">
<li><a href='../sourcefile/self_mappedscalar_3d.f90.html'>SELF_MappedScalar_3D.f90</a></li>
<li><a href='../module/self_mappedscalar_3d.html'>SELF_MappedScalar_3D</a></li>
<li><a href='../module/self_mappedscalar_3d~2.html'>SELF_MappedScalar_3D</a></li>
<li class="active">ContravariantWeight_3D_gpu</li>
</ol>
</div>
Expand Down Expand Up @@ -185,7 +185,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/dg_boundarycontribution_2d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/dg_boundarycontribution_3d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/gradientnormal_1d_gpu.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ <h3>Arguments</h3>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblascreate.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblascreate~2.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdestroy.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdestroy~2.html
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdgemm.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdgemm~2.html
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdgemvstridedbatched.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
2 changes: 1 addition & 1 deletion docs/ford/interface/hipblasdgemvstridedbatched~2.html
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ <h4>Return Value <small>integer(kind=kind(HIPBLAS_STATUS_SUCCESS))</small></h4>
<p class="text-right">
Documentation generated by
<a href="https://github.com/Fortran-FOSS-Programmers/ford">FORD</a>
on 2024-10-11 12:50 </p>
on 2024-10-14 21:56 </p>
</div>
</div>
<br>
Expand Down
Loading

0 comments on commit 4cf0a2f

Please sign in to comment.