Skip to content

Commit

Permalink
Nox: Silence some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
cgcgcg committed Dec 22, 2022
1 parent 31f03ca commit 55fc70f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,18 +533,18 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(
NOX::Abstract::MultiVector& X,
NOX::Abstract::MultiVector::DenseMatrix& Y) const
{
bool isZeroF = (F == NULL);
bool isZeroG = (G == NULL);
bool isZeroF2 = (F == NULL);
bool isZeroG2 = (G == NULL);

// If F & G are zero, the solution is zero
if (isZeroF && isZeroG) {
if (isZeroF2 && isZeroG2) {
X.init(0.0);
Y.putScalar(0.0);
return NOX::Abstract::Group::Ok;
}

int numColsRHS;
if (!isZeroF)
if (!isZeroF2)
numColsRHS = F->numVectors();
else
numColsRHS = G->numCols();
Expand All @@ -556,7 +556,7 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(

// Concatenate F & G into a single matrix
NOX::LAPACK::Matrix<double> RHS(N,numColsRHS);
if (isZeroF) {
if (isZeroF2) {
for (int j=0; j<numColsRHS; j++)
for (int i=0; i<n; i++)
RHS(i,j) = 0.0;
Expand All @@ -569,7 +569,7 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(
RHS(i,j) = (*v)(i);
}
}
if (isZeroG) {
if (isZeroG2) {
for (int j=0; j<numColsRHS; j++)
for (int i=0; i<m; i++)
RHS(i+n,j) = 0.0;
Expand Down Expand Up @@ -605,7 +605,7 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(
const NOX::LAPACK::Vector *v1, *v2;
NOX::LAPACK::Vector *w1, *w2;

if (!isZeroF) {
if (!isZeroF2) {
cF = dynamic_cast<const LOCA::Hopf::ComplexMultiVector*>(F);
TEUCHOS_ASSERT(cF != NULL);
F_real = cF->getRealMultiVec();
Expand All @@ -618,7 +618,7 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(

// Concatenate F & G into a single matrix
NOX::LAPACK::Matrix< std::complex<double> > RHS(N,numColsRHS);
if (isZeroF) {
if (isZeroF2) {
for (int j=0; j<numColsRHS; j++)
for (int i=0; i<n; i++)
RHS(i,j) = 0.0;
Expand All @@ -633,7 +633,7 @@ LOCA::BorderedSolver::LAPACKDirectSolve::solve(
RHS(i,j) = std::complex<double>((*v1)(i), (*v2)(i));
}
}
if (isZeroG) {
if (isZeroG2) {
for (int j=0; j<numColsRHS; j++)
for (int i=0; i<m; i++)
RHS(i+n,j) = 0.0;
Expand Down
4 changes: 2 additions & 2 deletions packages/nox/src-loca/src/LOCA_DerivUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@

LOCA::DerivUtils::DerivUtils(
const Teuchos::RCP<LOCA::GlobalData>& global_data,
double perturb) :
double _perturb) :
globalData(global_data),
perturb(perturb)
perturb(_perturb)
{
// assert (perturb>0.0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@
LOCA::MultiContinuation::ArcLengthGroup::ArcLengthGroup(
const Teuchos::RCP<LOCA::GlobalData>& global_data,
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& continuationParams,
const Teuchos::RCP<Teuchos::ParameterList>& _continuationParams,
const Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup>& grp,
const Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy>& pred,
const std::vector<int>& paramIDs)
: LOCA::MultiContinuation::ExtendedGroup(global_data, topParams,
continuationParams,
_continuationParams,
grp, pred, paramIDs),
theta(paramIDs.size(), 1.0),
doArcLengthScaling(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@
LOCA::MultiContinuation::NaturalGroup::NaturalGroup(
const Teuchos::RCP<LOCA::GlobalData>& global_data,
const Teuchos::RCP<LOCA::Parameter::SublistParser>& topParams,
const Teuchos::RCP<Teuchos::ParameterList>& continuationParams,
const Teuchos::RCP<Teuchos::ParameterList>& _continuationParams,
const Teuchos::RCP<LOCA::MultiContinuation::AbstractGroup>& grp,
const Teuchos::RCP<LOCA::MultiPredictor::AbstractStrategy>& pred,
const std::vector<int>& paramIDs)
: LOCA::MultiContinuation::ExtendedGroup(global_data, topParams,
continuationParams,
_continuationParams,
grp, pred, paramIDs)
{
bool skip_dfdp = continuationParams->get("Skip Parameter Derivative", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,10 +676,10 @@ getInitialVectors(NOX::Abstract::Vector& aVec,
std::string("Group must implement LOCA::Abstract::TransposeSolveGroup") +
std::string(" to compute initial left null vector"));

Teuchos::RCP<Teuchos::ParameterList> lsParams =
Teuchos::RCP<Teuchos::ParameterList> lsParams2 =
parsedParams->getSublist("Linear Solver");
status =
ts_grp->applyJacobianTransposeInverse(*lsParams, (*fdfdp)[1], aVec);
ts_grp->applyJacobianTransposeInverse(*lsParams2, (*fdfdp)[1], aVec);
finalStatus =
globalData->locaErrorCheck->combineAndCheckReturnTypes(
status,
Expand Down
14 changes: 7 additions & 7 deletions packages/nox/src/NOX_Multiphysics_Solver_FixedPointBased.C
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,14 @@ NOX::Multiphysics::Solver::FixedPointBased::step()
NOX::Abstract::Group& soln = *solnPtr;
NOX::StatusTest::Generic& test = *testPtr;

NOX::StatusTest::StatusType status = NOX::StatusTest::Unconverged;
NOX::StatusTest::StatusType status2 = NOX::StatusTest::Unconverged;

std::vector<Teuchos::RCP<NOX::Solver::Generic> >::iterator iter = (*solversVecPtr).begin();
std::vector<Teuchos::RCP<NOX::Solver::Generic> >::iterator iter_end = (*solversVecPtr).end();

for( int i = 0; iter_end != iter; ++iter, ++i )
{
status = NOX::StatusTest::Unconverged;
status2 = NOX::StatusTest::Unconverged;

// Conditionally bring all data needed from other problems to the current one
if( SEIDEL == solveType )
Expand All @@ -244,7 +244,7 @@ NOX::Multiphysics::Solver::FixedPointBased::step()

(*iter)->reset( sameGrp->getX() );

status = (*iter)->solve();
status2 = (*iter)->solve();

// Check return status
}
Expand All @@ -254,9 +254,9 @@ NOX::Multiphysics::Solver::FixedPointBased::step()
if (rtype != NOX::Abstract::Group::Ok)
{
utilsPtr->out() << "NOX::Multiphysics::Solver::FixedPointBased::step - unable to compute F" << std::endl;
status = NOX::StatusTest::Failed;
status2 = NOX::StatusTest::Failed;
observer->runPostIterate(*this);
return status;
return status2;
}

// Update iteration count.
Expand All @@ -276,12 +276,12 @@ NOX::Multiphysics::Solver::FixedPointBased::step()
}

// Evaluate the current status.
status = test.checkStatus(*this, checkType);
status2 = test.checkStatus(*this, checkType);

observer->runPostIterate(*this);

// Return status.
return status;
return status2;
}

NOX::StatusTest::StatusType
Expand Down

0 comments on commit 55fc70f

Please sign in to comment.