Skip to content

Commit

Permalink
Fix compilation warnings in demoPDEs
Browse files Browse the repository at this point in the history
  • Loading branch information
bartgol committed Oct 8, 2024
1 parent 5fbc479 commit 42be199
Show file tree
Hide file tree
Showing 28 changed files with 81 additions and 85 deletions.
104 changes: 51 additions & 53 deletions src/demoPDEs/evaluators/PHAL_AdvDiffResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AdvDiffResid(const Teuchos::ParameterList& p) :
UDot (p.get<std::string> ("QP Time Derivative Variable Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("QP Vector Data Layout") ),
Residual (p.get<std::string> ("Residual Name"),
p.get<Teuchos::RCP<PHX::DataLayout> >("Node Vector Data Layout") )
p.get<Teuchos::RCP<PHX::DataLayout> >("Node Vector Data Layout") )
{


Expand Down Expand Up @@ -59,34 +59,34 @@ AdvDiffResid(const Teuchos::ParameterList& p) :
vecDim = dims[2];


a = bf_list->get("Advection a", 1.0);
b = bf_list->get("Advection b", 1.0);
mu = bf_list->get("Viscosity mu", 0.1);
useAugForm = bf_list->get("Use Augmented Form", false);
a = bf_list->get("Advection a", 1.0);
b = bf_list->get("Advection b", 1.0);
mu = bf_list->get("Viscosity mu", 0.1);
useAugForm = bf_list->get("Use Augmented Form", false);
formType = bf_list->get("Augmented Form Type", 1);

bool error = true;
if (formType == 1 || formType == 2)
error = false;
bool error = true;
if (formType == 1 || formType == 2)
error = false;

TEUCHOS_TEST_FOR_EXCEPTION(error, std::logic_error,
"Invalid Augmented Form Type: " << formType << "; valid options are 1 and 2");


std::cout << "a, b, mu: " << a << ", " << b << ", " << mu << std::endl;

std::cout << "a, b, mu: " << a << ", " << b << ", " << mu << std::endl;
std::cout << " vecDim = " << vecDim << std::endl;
std::cout << " numDims = " << numDims << std::endl;
std::cout << "Augmented Form? " << useAugForm << std::endl;
if (useAugForm == true)
std::cout << " Augmented form type: " << formType << std::endl;
std::cout << "Augmented Form? " << useAugForm << std::endl;
if (useAugForm == true)
std::cout << " Augmented form type: " << formType << std::endl;


}

//**********************************************************************
template<typename EvalT, typename Traits>
void AdvDiffResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(U,fm);
Expand All @@ -103,64 +103,62 @@ template<typename EvalT, typename Traits>
void AdvDiffResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
typedef Intrepid2::FunctionSpaceTools<PHX::Device> FST;

if (useAugForm == false) { //standard form of advection-diffusion equation
for (std::size_t cell=0; cell < workset.numCells; ++cell) {
for (std::size_t node=0; node < numNodes; ++node) {
for (std::size_t i=0; i<vecDim; i++)
for (std::size_t i=0; i<vecDim; i++)
Residual(cell,node,i) = 0.0;
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + a*du/dx + b*du/dy - mu*delta(u) = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
a*UGrad(cell,qp,0,0)*wBF(cell,node,qp) +
b*UGrad(cell,qp,0,1)*wBF(cell,node,qp) +
mu*UGrad(cell,qp,0,0)*wGradBF(cell,node,qp,0) +
mu*UGrad(cell,qp,0,1)*wGradBF(cell,node,qp,1);
}
}
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + a*du/dx + b*du/dy - mu*delta(u) = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
a*UGrad(cell,qp,0,0)*wBF(cell,node,qp) +
b*UGrad(cell,qp,0,1)*wBF(cell,node,qp) +
mu*UGrad(cell,qp,0,0)*wGradBF(cell,node,qp,0) +
mu*UGrad(cell,qp,0,1)*wGradBF(cell,node,qp,1);
}
}
}
}
else { //augmented form of advection diffusion equation
if (formType == 1) {
for (std::size_t cell=0; cell < workset.numCells; ++cell) {
for (std::size_t node=0; node < numNodes; ++node) {
for (std::size_t i=0; i<vecDim; i++)
for (std::size_t i=0; i<vecDim; i++)
Residual(cell,node,i) = 0.0;
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + (a,b).q - mu*div(q) = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
a*U(cell,qp,1)*wBF(cell,node,qp) +
b*U(cell,qp,2)*wBF(cell,node,qp) +
mu*U(cell,qp,1)*wGradBF(cell,node,qp,0) +
mu*U(cell,qp,2)*wGradBF(cell,node,qp,1);
//q - grad(u) = 0
Residual(cell,node,1) += U(cell,qp,1)*wBF(cell,node,qp) - UGrad(cell,qp,0,0)*wBF(cell,node,qp);
Residual(cell,node,2) += U(cell,qp,2)*wBF(cell,node,qp) - UGrad(cell,qp,0,1)*wBF(cell,node,qp);
}
}
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + (a,b).q - mu*div(q) = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
a*U(cell,qp,1)*wBF(cell,node,qp) +
b*U(cell,qp,2)*wBF(cell,node,qp) +
mu*U(cell,qp,1)*wGradBF(cell,node,qp,0) +
mu*U(cell,qp,2)*wGradBF(cell,node,qp,1);
//q - grad(u) = 0
Residual(cell,node,1) += U(cell,qp,1)*wBF(cell,node,qp) - UGrad(cell,qp,0,0)*wBF(cell,node,qp);
Residual(cell,node,2) += U(cell,qp,2)*wBF(cell,node,qp) - UGrad(cell,qp,0,1)*wBF(cell,node,qp);
}
}
}
}
else if (formType == 2) {
else if (formType == 2) {
for (std::size_t cell=0; cell < workset.numCells; ++cell) {
for (std::size_t node=0; node < numNodes; ++node) {
for (std::size_t i=0; i<vecDim; i++)
for (std::size_t i=0; i<vecDim; i++)
Residual(cell,node,i) = 0.0;
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + q = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
U(cell,qp,1)*wBF(cell,node,qp) +
U(cell,qp,2)*wBF(cell,node,qp);
//q - (a,b).grad(u) + mu*delta(u) = 0
Residual(cell,node,1) += U(cell,qp,1)*wBF(cell,node,qp) - a*UGrad(cell,qp,0,0)*wBF(cell,node,qp)
- mu*UGrad(cell,qp,0,0)*wGradBF(cell,node,qp,0);
Residual(cell,node,2) += U(cell,qp,2)*wBF(cell,node,qp) - b*UGrad(cell,qp,0,1)*wBF(cell,node,qp)
- mu*UGrad(cell,qp,0,1)*wGradBF(cell,node,qp,1);
}
}
for (std::size_t qp=0; qp < numQPs; ++qp) {
//du/dt + q = 0
Residual(cell,node,0) += UDot(cell,qp,0)*wBF(cell,node,qp) +
U(cell,qp,1)*wBF(cell,node,qp) +
U(cell,qp,2)*wBF(cell,node,qp);
//q - (a,b).grad(u) + mu*delta(u) = 0
Residual(cell,node,1) += U(cell,qp,1)*wBF(cell,node,qp) - a*UGrad(cell,qp,0,0)*wBF(cell,node,qp)
- mu*UGrad(cell,qp,0,0)*wGradBF(cell,node,qp,0);
Residual(cell,node,2) += U(cell,qp,2)*wBF(cell,node,qp) - b*UGrad(cell,qp,0,1)*wBF(cell,node,qp)
- mu*UGrad(cell,qp,0,1)*wGradBF(cell,node,qp,1);
}
}
}
}
}
}

//**********************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_AdvectionResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ AdvectionResid(const Teuchos::ParameterList& p,
//**********************************************************************
template<typename EvalT, typename Traits>
void AdvectionResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF, fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_HelmholtzResid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class HelmholtzResid : public PHX::EvaluatorWithBaseImpl<Traits>,

void evaluateFields(typename Traits::EvalData d);

virtual ScalarT& getValue(const std::string &n) {return ksqr;};
virtual ScalarT& getValue(const std::string &/* n */) {return ksqr;};

private:

Expand Down
4 changes: 2 additions & 2 deletions src/demoPDEs/evaluators/PHAL_HelmholtzResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ HelmholtzResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void HelmholtzResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand All @@ -86,7 +86,7 @@ postRegistrationSetup(typename Traits::SetupData d,
//**********************************************************************
template<typename EvalT, typename Traits>
void HelmholtzResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
evaluateFields(typename Traits::EvalData /* workset */)
{
typedef Intrepid2::FunctionSpaceTools<PHX::Device> FST;
typedef Intrepid2::RealSpaceTools<PHX::Device> RST;
Expand Down
4 changes: 2 additions & 2 deletions src/demoPDEs/evaluators/PHAL_JouleHeating_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ JouleHeating(Teuchos::ParameterList& p) :
// **********************************************************************
template<typename EvalT, typename Traits>
void JouleHeating<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(jouleHeating,fm);
Expand All @@ -49,7 +49,7 @@ postRegistrationSetup(typename Traits::SetupData d,
// **********************************************************************
template<typename EvalT, typename Traits>
void JouleHeating<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
evaluateFields(typename Traits::EvalData /* workset */)
{
Intrepid2::FunctionSpaceTools<PHX::Device>::dotMultiplyDataData
(jouleHeating.get_view(), potentialFlux.get_view(), potentialGrad.get_view());
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSBodyForce_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ NSBodyForce(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSBodyForce<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
if (bf_type == CONSTANT) {
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSContinuityResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ NSContinuityResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSContinuityResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NSContravarientMetricTensor(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSContravarientMetricTensor<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(coordVec,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSForchheimerTerm_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ NSForchheimerTerm(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSForchheimerTerm<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(V,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSMaterialProperty_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ NSMaterialProperty(Teuchos::ParameterList& p) :
// **********************************************************************
template<typename EvalT, typename Traits>
void NSMaterialProperty<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(matprop,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSMomentumResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ NSMomentumResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSMomentumResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSNeutronEqResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ NSNeutronEqResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSNeutronEqResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSPermeabilityTerm_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ NSPermeabilityTerm(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSPermeabilityTerm<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(V,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSRm_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ NSRm(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSRm<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(pGrad,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSTauM_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ NSTauM(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSTauM<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(V,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSTauT_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ NSTauT(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSTauT<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(V,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_NSThermalEqResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ NSThermalEqResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void NSThermalEqResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_ODEResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ODEResid<EvalT, Traits>::ODEResid(Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void ODEResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& vm)
{
this->utils.setFieldData(X,vm);
Expand Down
4 changes: 2 additions & 2 deletions src/demoPDEs/evaluators/PHAL_PoissonResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ PoissonResid(const Teuchos::ParameterList& p,
//**********************************************************************
template<typename EvalT, typename Traits>
void PHAL::PoissonResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF,fm);
Expand All @@ -58,7 +58,7 @@ postRegistrationSetup(typename Traits::SetupData d,
//**********************************************************************
template<typename EvalT, typename Traits>
void PHAL::PoissonResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
evaluateFields(typename Traits::EvalData /* workset */)
{
typedef Intrepid2::FunctionSpaceTools<PHX::Device> FST;

Expand Down
4 changes: 1 addition & 3 deletions src/demoPDEs/evaluators/PHAL_ReactDiffSystemResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ReactDiffSystemResid(const Teuchos::ParameterList& p) :
//**********************************************************************
template<typename EvalT, typename Traits>
void ReactDiffSystemResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(U,fm);
Expand All @@ -123,8 +123,6 @@ template<typename EvalT, typename Traits>
void ReactDiffSystemResid<EvalT, Traits>::
evaluateFields(typename Traits::EvalData workset)
{
typedef Intrepid2::FunctionSpaceTools<PHX::Device> FST;

for (std::size_t cell=0; cell < workset.numCells; ++cell) {
for (std::size_t node=0; node < numNodes; ++node) {
for (std::size_t i=0; i<vecDim; i++) Residual(cell,node,i) = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_TEProp_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ TEProp(Teuchos::ParameterList& p) :
// **********************************************************************
template<typename EvalT, typename Traits>
void PHAL::TEProp<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(permittivity,fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/evaluators/PHAL_ThermalResid_Def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ ThermalResid(const Teuchos::ParameterList& p,
//**********************************************************************
template<typename EvalT, typename Traits>
void ThermalResid<EvalT, Traits>::
postRegistrationSetup(typename Traits::SetupData d,
postRegistrationSetup(typename Traits::SetupData /* d */,
PHX::FieldManager<Traits>& fm)
{
this->utils.setFieldData(wBF, fm);
Expand Down
2 changes: 1 addition & 1 deletion src/demoPDEs/problems/Albany_AdvDiffProblem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Teuchos::RCP<const PHX::FieldTag>
Albany::AdvDiffProblem::constructEvaluators(
PHX::FieldManager<PHAL::AlbanyTraits>& fm0,
const Albany::MeshSpecsStruct& meshSpecs,
Albany::StateManager& stateMgr,
Albany::StateManager& /* stateMgr */,
Albany::FieldManagerChoice fieldManagerChoice,
const Teuchos::RCP<Teuchos::ParameterList>& responseList)
{
Expand Down
Loading

0 comments on commit 42be199

Please sign in to comment.