-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'pvidal_296-create-a-patch-class-and-sample-patch-geomet…
…ries' into 'main' Resolve "Create a Patch class and sample patch geometries" Closes #296 See merge request gysela-developpers/gyselalibxx!599
- Loading branch information
1 parent
63bb162
commit 12a6a20
Showing
11 changed files
with
473 additions
and
99 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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
|
||
|
||
add_subdirectory(connectivity) | ||
add_subdirectory(interfaces) | ||
add_subdirectory(spline) | ||
|
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
add_library("multipatch_connectivity" INTERFACE) | ||
target_include_directories("multipatch_connectivity" | ||
INTERFACE | ||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" | ||
) | ||
target_link_libraries("multipatch_connectivity" INTERFACE | ||
DDC::DDC | ||
) | ||
add_library("gslx::multipatch_connectivity" ALIAS "multipatch_connectivity") |
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,15 @@ | ||
# Multipatch connectivity | ||
|
||
## Patch tag | ||
The tag Patch refers to a single 2D patch geometry. The tag contains aliases (or shortcuts) to the DDC geometry elements, such as: | ||
|
||
* Grids (or points sequence along one dimension) on both dimensions (`Grid1` and `Grid2`); | ||
* Associated continuous dimensions (`Dim1` and `Dim2`); | ||
* Dimensions for B-splines coefficients (`Bsplines1` and `Bsplines2`); | ||
* Coordinates of objects represented on the dimensions (`Coord1`, `Coord2` and `Coord12`); | ||
* The type which describes the index of a grid point (e.g. `Idx1`); | ||
* The type which describes a distance between grid points (e.g. `IdxStep1`); | ||
* The type which describes the index range of a grid (e.g. `IdxRange1`). | ||
* The type which describes the index range of a spline coefficients grid (e.g. `BSIdxRange1`). | ||
|
||
The domain defined on this patch is called *logical domain*. |
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,78 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
#pragma once | ||
|
||
#include <ddc/ddc.hpp> | ||
|
||
/** | ||
* @brief Base tag for a patch. | ||
* @tparam T Variadic template parameter allowing us to use Patch struct | ||
* for different numbers of dimensions. | ||
*/ | ||
template <class... T> | ||
struct Patch; | ||
|
||
/** | ||
* @brief Tag for a patch. | ||
* | ||
* @tparam grid1 Grid on the first logical dimension associated to the patch. | ||
* @tparam grid2 Grid on the second logical dimension associated to the patch. | ||
* @tparam bsplines_dim1 Bspline dimension defined on the first logical continuous dimension associated to the patch. | ||
* @tparam bsplines_dim2 Bspline dimension defined on the second logical continuous dimension associated to the patch. | ||
*/ | ||
template <class grid1, class grid2, class bsplines_dim1, class bsplines_dim2> | ||
struct Patch<grid1, grid2, bsplines_dim1, bsplines_dim2> | ||
{ | ||
/// @brief The number of dimensions of the patch. | ||
static int constexpr n_dims = 2; | ||
|
||
/// @brief Grid on the first logical dimension. | ||
using Grid1 = grid1; | ||
/// @brief Grid on the second logical dimension. | ||
using Grid2 = grid2; | ||
|
||
/// @brief First continuous dimension. | ||
using Dim1 = typename grid1::continuous_dimension_type; | ||
/// @brief Second continuous dimension. | ||
using Dim2 = typename grid2::continuous_dimension_type; | ||
|
||
/// @brief B-splines defined along the first dimension. | ||
using BSplines1 = bsplines_dim1; | ||
/// @brief B-splines defined along the second dimension. | ||
using BSplines2 = bsplines_dim2; | ||
|
||
/// @brief Coordinate type on the first continuous dimension. | ||
using Coord1 = ddc::Coordinate<Dim1>; | ||
/// @brief Coordinate type on the second continuous dimension. | ||
using Coord2 = ddc::Coordinate<Dim2>; | ||
/// @brief Coordinate type on the 2D continuous domain. | ||
using Coord12 = ddc::Coordinate<Dim1, Dim2>; | ||
|
||
/// @brief 1D index of a grid point along the first dimension. | ||
using Idx1 = ddc::DiscreteElement<Grid1>; | ||
/// @brief 1D index of a grid point along the second dimension. | ||
using Idx2 = ddc::DiscreteElement<Grid2>; | ||
/// @brief 2D index of a grid point along the first and second dimensions. | ||
using Idx12 = ddc::DiscreteElement<Grid1, Grid2>; | ||
|
||
/// @brief 1D index step between grid points along the first dimension. | ||
using IdxStep1 = ddc::DiscreteVector<Grid1>; | ||
/// @brief 1D index step between grid points along the second dimension. | ||
using IdxStep2 = ddc::DiscreteVector<Grid2>; | ||
/// @brief 2D index step between grid points along the first and second dimensions. | ||
using IdxStep12 = ddc::DiscreteVector<Grid1, Grid2>; | ||
|
||
/// @brief Index range of a grids over the first dimension. | ||
using IdxRange1 = ddc::DiscreteDomain<Grid1>; | ||
/// @brief Index range of a grids over the second dimension. | ||
using IdxRange2 = ddc::DiscreteDomain<Grid2>; | ||
/// @brief Index range of a grids over the first and second dimension. | ||
using IdxRange12 = ddc::DiscreteDomain<Grid1, Grid2>; | ||
|
||
/// @brief Index range of a grids over the first spline dimension. | ||
using BSIdxRange1 = ddc::DiscreteDomain<BSplines1>; | ||
/// @brief Index range of a grids over the second spline dimension. | ||
using BSIdxRange2 = ddc::DiscreteDomain<BSplines2>; | ||
/// @brief Index range of a grids over the first and second spline dimension. | ||
using BSIdxRange12 = ddc::DiscreteDomain<BSplines1, BSplines2>; | ||
}; |
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
Oops, something went wrong.