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});
83 Kokkos::parallel_for(
"copy cell nodes from CellGeometry", policy,
84 KOKKOS_LAMBDA (
const int &cellOrdinal,
const int &nodeOrdinalInCell) {
85 const int globalNodeOrdinal = cellOrdinal * numNodes + nodeOrdinalInCell;
86 for (
int d=0; d<spaceDim; d++)
88 nodes(globalNodeOrdinal,d) = anyCellGeometry(cellOrdinal,nodeOrdinalInCell,d);
90 cellToNodes(cellOrdinal,nodeOrdinalInCell) = globalNodeOrdinal;
93 ExecutionSpace().fence();
95 const bool claimAffine = copyAffineness && anyCellGeometry.
affine();
98 const auto cellTopology = anyCellGeometry.
cellTopology();
101 return nodalCellGeometry;
111 const Kokkos::Array<int,spaceDim> &gridCellCounts)
113 Kokkos::Array<PointScalar,spaceDim> origin;
114 for (
int d=0; d<spaceDim; d++)
123 return CellGeometry(origin, domainExtents, gridCellCounts, NO_SUBDIVISION, HYPERCUBE_NODE_ORDER_CLASSIC_SHARDS);
134 Kokkos::Array<PointScalar,spaceDim> origin;
135 Kokkos::Array<PointScalar,spaceDim> domainExtents;
136 Kokkos::Array<int,spaceDim> gridCellCounts;
137 for (
int d=0; d<spaceDim; d++)
140 domainExtents[d] = domainExtent;
141 gridCellCounts[d] = meshWidth;
148 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...