Skip to content

Commit

Permalink
LCM: Use & instead of rcp in convergence criterion. Minor changes
Browse files Browse the repository at this point in the history
for validating parameter list. Remove unneeded code. (#53)
  • Loading branch information
lxmota committed Mar 15, 2017
1 parent eddff08 commit 1b31897
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/LCM/Schwarz_Alternating.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,10 +543,6 @@ getValidAppParameters() const
list->sublist("VTK", false, "DEPRECATED VTK sublist");
list->sublist("Piro", false, "Piro sublist");
list->sublist("Coupled System", false, "Coupled system sublist");
list->set<std::string>(
"Matrix-Free Preconditioner",
"",
"Matrix-Free Preconditioner Type");

return list;
}
Expand All @@ -557,7 +553,7 @@ SchwarzAlternating::
getValidProblemParameters() const
{
Teuchos::RCP<Teuchos::ParameterList>
list = Teuchos::createParameterList("ValidCoupledSchwarzProblemParams");
list = Teuchos::createParameterList("ValidSchwarzAlternatingProblemParams");

list->set<std::string>("Name", "", "String to designate Problem Class");

Expand Down Expand Up @@ -607,7 +603,10 @@ SchwarzLoop(
prev_soln = *(app.getX());

auto
diff = Teuchos::rcp(new Tpetra_Vector(prev_soln, Teuchos::Copy));
rcp_diff = Teuchos::rcp(new Tpetra_Vector(prev_soln, Teuchos::Copy));

auto
diff = *rcp_diff;

auto
in_args_m = model.createInArgs();
Expand All @@ -620,9 +619,9 @@ SchwarzLoop(
auto const &
next_soln = *(app.getX());

diff->update(1.0, next_soln, -1.0);
diff.update(1.0, next_soln, -1.0);

norms_diff(m) = diff->norm2();
norms_diff(m) = diff.norm2();
}

converged = minitensor::norm(norms_diff) <= tol;
Expand Down

0 comments on commit 1b31897

Please sign in to comment.