67 const bool ©Affineness)
70 const int numCells = anyCellGeometry.
extent_int(0);
71 const int numNodes = anyCellGeometry.
extent_int(1);
73 using PointScalarView = ScalarView<PointScalar, DeviceType >;
74 using intView = ScalarView< int, DeviceType >;
76 auto cellToNodes = intView (
"cell to nodes", numCells, numNodes);
77 PointScalarView nodes = getView<PointScalar,DeviceType>(
"nodes", numCells * numNodes, spaceDim);
79 using ExecutionSpace =
typename DeviceType::execution_space;
80 auto policy = Kokkos::MDRangePolicy<ExecutionSpace,Kokkos::Rank<2>>({0,0},{numCells,numNodes});
82 Kokkos::parallel_for(
"copy cell nodes from CellGeometry", policy,
83 KOKKOS_LAMBDA (
const int &cellOrdinal,
const int &nodeOrdinalInCell) {
84 const int globalNodeOrdinal = cellOrdinal * numNodes + nodeOrdinalInCell;
85 for (
int d=0; d<spaceDim; d++)
87 nodes(globalNodeOrdinal,d) = anyCellGeometry(cellOrdinal,nodeOrdinalInCell,d);
89 cellToNodes(cellOrdinal,nodeOrdinalInCell) = globalNodeOrdinal;
92 ExecutionSpace().fence();
94 const bool claimAffine = copyAffineness && anyCellGeometry.
affine();
97 const auto cellTopology = anyCellGeometry.
cellTopology();
100 return nodalCellGeometry;
110 const Kokkos::Array<int,spaceDim> &gridCellCounts)
112 Kokkos::Array<PointScalar,spaceDim> origin;
113 for (
int d=0; d<spaceDim; d++)
122 return CellGeometry(origin, domainExtents, gridCellCounts, NO_SUBDIVISION, HYPERCUBE_NODE_ORDER_CLASSIC_SHARDS);
133 Kokkos::Array<PointScalar,spaceDim> origin;
134 Kokkos::Array<PointScalar,spaceDim> domainExtents;
135 Kokkos::Array<int,spaceDim> gridCellCounts;
136 for (
int d=0; d<spaceDim; d++)
139 domainExtents[d] = domainExtent;
140 gridCellCounts[d] = meshWidth;
147 return CellGeometry(origin, domainExtents, gridCellCounts, NO_SUBDIVISION, HYPERCUBE_NODE_ORDER_CLASSIC_SHARDS);
CellGeometry< PointScalar, spaceDim, DeviceType > uniformCartesianMesh(const Kokkos::Array< PointScalar, spaceDim > &domainExtents, const Kokkos::Array< int, spaceDim > &gridCellCounts)
Create a uniform Cartesian mesh, with origin at 0, and domain extents and mesh widths that can be dif...
CellGeometry< PointScalar, spaceDim, DeviceType > getNodalCellGeometry(CellGeometry< PointScalar, spaceDim, DeviceType > &anyCellGeometry, const bool ©Affineness)
Use the cell nodes provided by one cell geometry object to create another CellGeometry that is node-b...