Skip to content

Commit 12ce145

Browse files
committed
Added requested changes
1 parent c537189 commit 12ce145

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

include/aspect/simulator.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,10 +1340,16 @@ namespace aspect
13401340
/**
13411341
* Perform a Newton line search to determine the optimal step length
13421342
* along the search direction. After the update, the current_linearization_point
1343-
* is set to the old current_linearlization_point plus a suitable update.
1343+
* is set to the old current_linearlization_point plus a suitable update.
1344+
*
1345+
* @param dcr The defect correction residuals associated with the current nonlinear
1346+
* iteration.
1347+
* @param use_picard Whether a Picard iteration was used to update the nonlinear
1348+
* iteration (true) or a Newton update (false).
1349+
* @param search_direction The proposed update direction for the solution vector.
13441350
*
1345-
* @return This function returns the updated residual after the line
1346-
* search is performed.
1351+
* @return This function returns the updated residual after the line
1352+
* search is performed.
13471353
*
13481354
* This function is implemented in
13491355
* <code>source/simulator/helper_functions.cc</code>

source/simulator/helper_functions.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2629,9 +2629,8 @@ namespace aspect
26292629
return initial_newton_residual;
26302630
}
26312631

2632-
/**
2633-
* Performs a Newton line search for the do_one_defect_correction_Stokes_step function
2634-
*/
2632+
2633+
26352634
template <int dim>
26362635
double Simulator<dim>::perform_line_search(const DefectCorrectionResiduals &dcr,
26372636
const bool use_picard,
@@ -2640,6 +2639,7 @@ namespace aspect
26402639
LinearAlgebra::BlockVector backup_linearization_point(introspection.index_sets.stokes_partitioning, mpi_communicator);
26412640
double step_length_factor = 1.0;
26422641
unsigned int line_search_iteration = 0;
2642+
26432643
// Many parts of the solver depend on the block layout (velocity = 0,
26442644
// pressure = 1). For example the linearized_stokes_initial_guess vector or the StokesBlock matrix
26452645
// wrapper. Let us make sure that this holds (and shorten their names):
@@ -2650,9 +2650,9 @@ namespace aspect
26502650
Assert(velocity_block_index == 0, ExcNotImplemented());
26512651
Assert(pressure_block_index == 1, ExcNotImplemented());
26522652
(void) pressure_block_index;
2653+
26532654
// Do the loop for the line search at least once with the full step length.
26542655
// If line search is disabled we will exit the loop in the first iteration.
2655-
26562656
do
26572657
{
26582658
if (line_search_iteration == 0)
@@ -2717,6 +2717,7 @@ namespace aspect
27172717
}
27182718

27192719

2720+
27202721
template <int dim>
27212722
double
27222723
Simulator<dim>::compute_Eisenstat_Walker_linear_tolerance(const bool EisenstatWalkerChoiceOne,

source/simulator/solver_schemes.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,10 +709,7 @@ namespace aspect
709709
dcr.stokes_residuals.second,
710710
dcr.residual,
711711
dcr.residual_old);
712-
713-
pcout << " The linear solver tolerance is set to "
714-
<< parameters.linear_stokes_solver_tolerance
715-
<< ". ";
712+
pcout << " The linear solver tolerance is set to " << parameters.linear_stokes_solver_tolerance << std::endl;
716713
}
717714
}
718715

0 commit comments

Comments
 (0)