Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrood-nrel committed Apr 12, 2024
1 parent a7e8966 commit 61fd76c
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 27 deletions.
2 changes: 1 addition & 1 deletion include/master_element/Hex8FEM.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class Hex8FEM : public MasterElement
+glIP, +glIP, +glIP, -glIP, +glIP, +glIP};

// standard integration location +/ sqrt(3)/3
const double gIP = 0.577350269189626; //std::sqrt(3.0) / 3.0;
const double gIP = 0.577350269189626; // std::sqrt(3.0) / 3.0;
const double intgLoc_[numIntPoints_ * nDim_] = {
-gIP, -gIP, -gIP, +gIP, -gIP, -gIP, +gIP, +gIP, -gIP, -gIP, +gIP, -gIP,
-gIP, -gIP, +gIP, +gIP, -gIP, +gIP, +gIP, +gIP, +gIP, -gIP, +gIP, +gIP};
Expand Down
19 changes: 12 additions & 7 deletions include/master_element/MasterElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ class MasterElement
SharedMemView<DoubleType***, DeviceShmem>& /* deriv */,
SharedMemView<DoubleType*, DeviceShmem>& /*det_j*/)
{
STK_NGP_ThrowErrorMsg("MasterElement::grad_op_fem not implemented for element");
STK_NGP_ThrowErrorMsg(
"MasterElement::grad_op_fem not implemented for element");
}

KOKKOS_FUNCTION virtual void shifted_grad_op_fem(
Expand All @@ -121,8 +122,9 @@ class MasterElement
const SharedMemView<DoubleType**, DeviceShmem>& /* coords */,
SharedMemView<DoubleType**, DeviceShmem>& /* areav */)
{
STK_NGP_ThrowErrorMsg("MasterElement::determinant not implemented for element: "
"DoubleType area");
STK_NGP_ThrowErrorMsg(
"MasterElement::determinant not implemented for element: "
"DoubleType area");
}

virtual void determinant(
Expand Down Expand Up @@ -154,8 +156,9 @@ class MasterElement
const SharedMemView<DoubleType**, DeviceShmem>& /* coords */,
SharedMemView<DoubleType*, DeviceShmem>& /* volume */)
{
STK_NGP_ThrowErrorMsg("MasterElement::determinant not implemented for element: "
"DoubleType volume");
STK_NGP_ThrowErrorMsg(
"MasterElement::determinant not implemented for element: "
"DoubleType volume");
}

virtual void determinant(
Expand Down Expand Up @@ -306,11 +309,13 @@ class MasterElement
KOKKOS_FUNCTION virtual void
shape_fcn(SharedMemView<DoubleType**, DeviceShmem>&)
{
STK_NGP_ThrowErrorMsg("MasterElement::shape_fcn not implemented for element");
STK_NGP_ThrowErrorMsg(
"MasterElement::shape_fcn not implemented for element");
}
virtual void shape_fcn(SharedMemView<double**, HostShmem>&)
{
STK_NGP_ThrowErrorMsg("MasterElement::shape_fcn not implemented for element");
STK_NGP_ThrowErrorMsg(
"MasterElement::shape_fcn not implemented for element");
}

KOKKOS_FUNCTION virtual void
Expand Down
6 changes: 4 additions & 2 deletions include/master_element/MasterElementFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ generic_grad_op(
CoordViewType::rank == 2, "Coordinate view assumed to be rank 2");
static_assert(OutputViewType::rank == 3, "Weight view assumed to be rank 3");

STK_ThrowAssert(AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1));
STK_ThrowAssert(
AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1));
STK_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2));
for (int i = 0; i < dim; ++i)
STK_ThrowAssert(weights.extent(i) == referenceGradWeights.extent(i));
Expand Down Expand Up @@ -598,7 +599,8 @@ generic_determinant_3d(
static_assert(OutputViewType::rank == 1, "Weight view assumed to be 1D");
static_assert(AlgTraits::nDim_ == 3, "3D method");

STK_ThrowAssert(AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1));
STK_ThrowAssert(
AlgTraits::nodesPerElement_ == referenceGradWeights.extent(1));
STK_ThrowAssert(AlgTraits::nDim_ == referenceGradWeights.extent(2));

STK_ThrowAssert(detj.extent(0) == referenceGradWeights.extent(0));
Expand Down
32 changes: 16 additions & 16 deletions include/matrix_free/PolynomialOrders.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,27 @@ enum {
#define P_INVOKEABLE(func) \
template <int p, typename... Args> \
auto func(Args&&... args) \
->decltype(IMPLNAME(func) < p > ::invoke(std::forward<Args>(args)...)) \
-> decltype(IMPLNAME(func) < p > ::invoke(std::forward<Args>(args)...)) \
{ \
return IMPLNAME(func)<p>::invoke(std::forward<Args>(args)...); \
}

// can't return a value dependent on template parameter
#define SWITCH_INVOKEABLE(func) \
template <typename... Args> \
auto func(int p, Args&&... args) \
->decltype(IMPLNAME(func) < inst::P1 > ::invoke(std::forward<Args>(args)...)) \
{ \
switch (p) { \
case inst::P2: \
return IMPLNAME(func)<inst::P2>::invoke(std::forward<Args>(args)...); \
case inst::P3: \
return IMPLNAME(func)<inst::P3>::invoke(std::forward<Args>(args)...); \
case inst::P4: \
return IMPLNAME(func)<inst::P4>::invoke(std::forward<Args>(args)...); \
default: \
return IMPLNAME(func)<inst::P1>::invoke(std::forward<Args>(args)...); \
} \
#define SWITCH_INVOKEABLE(func) \
template <typename... Args> \
auto func(int p, Args&&... args) \
-> decltype(IMPLNAME(func) < inst::P1 > ::invoke(std::forward<Args>(args)...)) \
{ \
switch (p) { \
case inst::P2: \
return IMPLNAME(func)<inst::P2>::invoke(std::forward<Args>(args)...); \
case inst::P3: \
return IMPLNAME(func)<inst::P3>::invoke(std::forward<Args>(args)...); \
case inst::P4: \
return IMPLNAME(func)<inst::P4>::invoke(std::forward<Args>(args)...); \
default: \
return IMPLNAME(func)<inst::P1>::invoke(std::forward<Args>(args)...); \
} \
}

} // namespace matrix_free
Expand Down
3 changes: 2 additions & 1 deletion include/utils/AMSUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ template <class T, int dim = 3>
KOKKOS_FUNCTION T
get_M43_constant(T D[dim][dim], const double CMdeg)
{
STK_NGP_ThrowRequireMsg(dim == 3, "Compute of M43 constant requires 3D problem");
STK_NGP_ThrowRequireMsg(
dim == 3, "Compute of M43 constant requires 3D problem");

// Coefficients for the polynomial
double c[15] = {0.971903113666644, 0.065591700544879, 0.071103489538998,
Expand Down

0 comments on commit 61fd76c

Please sign in to comment.