Skip to content

Commit

Permalink
Apply style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Agent Style committed Jan 3, 2025
1 parent 4fe9a07 commit d5747e1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
22 changes: 12 additions & 10 deletions src/serac/numerics/functional/element_restriction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ std::vector<Array2D<int> > geom_local_face_dofs(int p)
return output;
}

axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementRestriction(const serac::fes_t* fes, mfem::Geometry::Type geom)
axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementRestriction(const serac::fes_t* fes,
mfem::Geometry::Type geom)
{
std::vector<DoF> elem_dofs{};
mfem::Mesh* mesh = fes->GetMesh();
Expand Down Expand Up @@ -271,15 +272,15 @@ axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementRestriction(cons
if (n == 0) {
return axom::Array<DoF, 2, serac::detail::host_memory_space>{};
} else {
uint64_t dofs_per_elem = elem_dofs.size() / n;
uint64_t dofs_per_elem = elem_dofs.size() / n;
axom::Array<DoF, 2, serac::detail::host_memory_space> output(n, dofs_per_elem);
std::memcpy(output.data(), elem_dofs.data(), sizeof(DoF) * n * dofs_per_elem);
return output;
}
}

axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementDofs(const serac::fes_t* fes, mfem::Geometry::Type geom,
const std::vector<int>& mfem_elem_ids)
const std::vector<int>& mfem_elem_ids)

{
std::vector<DoF> elem_dofs{};
Expand Down Expand Up @@ -337,15 +338,15 @@ axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementDofs(const serac
if (n == 0) {
return axom::Array<DoF, 2, serac::detail::host_memory_space>{};
} else {
uint64_t dofs_per_elem = elem_dofs.size() / n;
uint64_t dofs_per_elem = elem_dofs.size() / n;
axom::Array<DoF, 2, serac::detail::host_memory_space> output(n, dofs_per_elem);
std::memcpy(output.data(), elem_dofs.data(), sizeof(DoF) * n * dofs_per_elem);
return output;
}
}

axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes, mfem::Geometry::Type face_geom,
FaceType type)
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes,
mfem::Geometry::Type face_geom, FaceType type)
{
std::vector<DoF> face_dofs;
mfem::Mesh* mesh = fes->GetMesh();
Expand Down Expand Up @@ -452,15 +453,16 @@ axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::f
if (n == 0) {
return axom::Array<DoF, 2, serac::detail::host_memory_space>{};
} else {
uint64_t dofs_per_face = face_dofs.size() / n;
uint64_t dofs_per_face = face_dofs.size() / n;
axom::Array<DoF, 2, serac::detail::host_memory_space> output(n, dofs_per_face);
std::memcpy(output.data(), face_dofs.data(), sizeof(DoF) * n * dofs_per_face);
return output;
}
}

axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes, mfem::Geometry::Type face_geom,
const std::vector<int>& mfem_face_ids)
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes,
mfem::Geometry::Type face_geom,
const std::vector<int>& mfem_face_ids)
{
std::vector<DoF> face_dofs;
mfem::Mesh* mesh = fes->GetMesh();
Expand Down Expand Up @@ -619,7 +621,7 @@ axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::f
if (n == 0) {
return axom::Array<DoF, 2, serac::detail::host_memory_space>{};
} else {
uint64_t dofs_per_face = face_dofs.size() / n;
uint64_t dofs_per_face = face_dofs.size() / n;
axom::Array<DoF, 2, serac::detail::host_memory_space> output(n, dofs_per_face);
std::memcpy(output.data(), face_dofs.data(), sizeof(DoF) * n * dofs_per_face);
return output;
Expand Down
12 changes: 7 additions & 5 deletions src/serac/numerics/functional/element_restriction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ struct BlockElementRestriction {
* @param fes the finite element space containing the dof information
* @param geom the kind of element geometry
*/
axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementDofs(const serac::fes_t* fes, mfem::Geometry::Type geom);
axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementDofs(const serac::fes_t* fes,
mfem::Geometry::Type geom);

/**
* @brief Get the list of dofs for each face element (of the specified geometry) from the fes_t
Expand All @@ -252,9 +253,10 @@ axom::Array<DoF, 2, serac::detail::host_memory_space> GetElementDofs(const serac
* @param geom the kind of element geometry
* @param type whether the face is of interior or boundary type
*/
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes, mfem::Geometry::Type face_geom,
FaceType type);
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes,
mfem::Geometry::Type face_geom, FaceType type);

/// @overload
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes, mfem::Geometry::Type face_geom,
const std::vector<int>& mfem_face_ids);
axom::Array<DoF, 2, serac::detail::host_memory_space> GetFaceDofs(const serac::fes_t* fes,
mfem::Geometry::Type face_geom,
const std::vector<int>& mfem_face_ids);

0 comments on commit d5747e1

Please sign in to comment.