Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
with:
repo-name: 'meshFields-openmpi'
repo-path: 'SCOREC/meshFields'
repo-ref: 'b9984520c20f73955a3b4e25e4907780b91d430f'
repo-ref: 'f7c97cf3bee466ecb6ae5afa33e662953e96cc43'
cache: true
options: '-DCMAKE_CXX_COMPILER=`which mpicxx`
-DCMAKE_C_COMPILER=`which mpicc`
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cmake-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ jobs:
with:
repo-name: 'meshFields'
repo-path: 'SCOREC/meshFields'
repo-ref: 'b9984520c20f73955a3b4e25e4907780b91d430f'
repo-ref: 'f7c97cf3bee466ecb6ae5afa33e662953e96cc43'
cache: true
cache-suffix: ${{ env.DEP_CACHE_SUFFIX }}
options: '-DCMAKE_CXX_COMPILER=`which mpicxx`
Expand Down
6 changes: 3 additions & 3 deletions src/pcms/field/evaluator/mesh_fields_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ struct FillCoordinatesAndIndicesFunctor
LO count = Kokkos::atomic_sub_fetch(&elem_counts_(owner_idx), 1);
LO index = offsets_(owner_idx) + count - 1;
for (int j = 0; j < dim_; ++j) {
coordinates_(index, j) = coord[j];
coordinates_(index, j) = coord[j + 1];
}
indices_(index) = i;
}
Expand Down Expand Up @@ -442,7 +442,7 @@ struct FillCoordinatesDeviceFunctor
const auto local =
Omega_h::barycentric_from_global<2, 2>(point, vertex_coords);
for (int j = 0; j < dim_; ++j) {
coordinates_(index, j) = local[j];
coordinates_(index, j) = local[j + 1];
}
indices_(index) = orig_idx;
}
Expand Down Expand Up @@ -576,7 +576,7 @@ struct MeshFieldsAdapter2LocalizationHint
const auto local =
Omega_h::barycentric_from_global<2, 2>(point, vertex_coords);
for (int j = 0; j < mesh.dim(); ++j) {
coordinates_(index, j) = local[j];
coordinates_(index, j) = local[j + 1];
}
indices_(index) = static_cast<LO>(orig_idx);
}
Expand Down
9 changes: 4 additions & 5 deletions src/pcms/transfer/mass_matrix_integrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ class MassMatrixIntegrator : public MeshField::Integrator
Kokkos::View<MeshField::Real*> dV) override
{
// std::cerr << "MassMatrixIntegrator::atPoints(...)\n";
const size_t numPtsPerElem = p.extent(0) / mesh.nelems();
const size_t numPtsPerElem = p.extent(0);
// std::cerr << " Number points per Elem : " << numPtsPerElem << "\n";
assert(numPtsPerElem >= 1);
const size_t ptDim = p.extent(1);
assert(ptDim == fe.MeshEntDim);
assert(dV.extent(0) == mesh.nelems() * numPtsPerElem);
// Copy values needed in the kernel to avoid capturing host references
// (mesh and fe are host objects and cannot be dereferenced on the device)
const auto numElems = mesh.nelems();
Expand All @@ -51,9 +52,7 @@ class MassMatrixIntegrator : public MeshField::Integrator
auto massMatrix = elmMassMatrix;
Kokkos::parallel_for(
"eval", numElems, KOKKOS_LAMBDA(const int& elm) {
const auto first = elm * numPtsPerElem;
const auto last = first + numPtsPerElem;
for (auto pt = first; pt < last; pt++) {
for (size_t pt = 0; pt < numPtsPerElem; pt++) {
// FIXME better way to fill? pass kokkos::subview to getValues?
Kokkos::Array<MeshField::Real, FieldElement::MeshEntDim> localCoord;
for (auto i = 0; i < localCoord.size(); i++) {
Expand All @@ -66,7 +65,7 @@ class MassMatrixIntegrator : public MeshField::Integrator
// ordering has negative orientation. A mass matrix integrates against
// the positive volume measure, so take the magnitude (a no-op in 2D
// where the differential area is already positive).
const auto dVPt = Kokkos::fabs(dV(pt));
const auto dVPt = Kokkos::fabs(dV(elm * numPtsPerElem + pt));
// printf("Shape Functions: %f, %f, %f \n", N[0], N[1], N[2]);
// printf("wPt, dVPt: %f, %f \n", wPt, dVPt);
for (auto i = 0; i < N.size(); i++) {
Expand Down
Loading