[cig-commits] [commit] master: Use introspection in even more places. (a58bcd1)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Thu May 22 06:05:20 PDT 2014
Repository : https://github.com/geodynamics/aspect
On branch : master
Link : https://github.com/geodynamics/aspect/compare/5b2b586a4f29499284711e77f2cb8d5a0bc64afe...80f462a3e073ac705f736fd43243a28f9833c866
>---------------------------------------------------------------
commit a58bcd1737562481e0385b480b6a1e460dffb0bc
Author: Jonathan Perry-Houts <jperryh2 at uoregon.edu>
Date: Thu May 22 00:21:11 2014 -0700
Use introspection in even more places.
>---------------------------------------------------------------
a58bcd1737562481e0385b480b6a1e460dffb0bc
source/simulator/solver.cc | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/source/simulator/solver.cc b/source/simulator/solver.cc
index f2561ff..cef5195 100644
--- a/source/simulator/solver.cc
+++ b/source/simulator/solver.cc
@@ -428,13 +428,13 @@ namespace aspect
// copy current_linearization_point into it, because its distribution
// is different.
- remap.block (0) = current_linearization_point.block (0);
- remap.block (1) = current_linearization_point.block (1);
+ remap.block (introspection.block_indices.velocities) = current_linearization_point.block (introspection.block_indices.velocities);
+ remap.block (introspection.block_indices.pressure) = current_linearization_point.block (introspection.block_indices.pressure);
// before solving we scale the initial solution to the right dimensions
denormalize_pressure (remap);
current_constraints.set_zero (remap);
- remap.block (1) /= pressure_scaling;
+ remap.block (introspection.block_indices.pressure) /= pressure_scaling;
// if the model is compressible then we need to adjust the right hand
// side of the equation to make it compatible with the matrix on the
// left
@@ -454,8 +454,8 @@ namespace aspect
// extract Stokes parts of rhs vector
LinearAlgebra::BlockVector distributed_stokes_rhs(introspection.index_sets.stokes_partitioning);
- distributed_stokes_rhs.block(0) = system_rhs.block(0);
- distributed_stokes_rhs.block(1) = system_rhs.block(1);
+ distributed_stokes_rhs.block(introspection.block_indices.velocities) = system_rhs.block(introspection.block_indices.velocities);
+ distributed_stokes_rhs.block(introspection.block_indices.pressure) = system_rhs.block(introspection.block_indices.pressure);
PrimitiveVectorMemory< LinearAlgebra::BlockVector > mem;
@@ -467,8 +467,8 @@ namespace aspect
1e-12 * initial_residual);
SolverControl solver_control_cheap (parameters.n_cheap_stokes_solver_steps,
solver_tolerance);
- SolverControl solver_control_expensive (system_matrix.block(0,1).m() +
- system_matrix.block(1,0).m(), solver_tolerance);
+ SolverControl solver_control_expensive (system_matrix.block(introspection.block_indices.velocities,introspection.block_indices.pressure).m() +
+ system_matrix.block(introspection.block_indices.pressure,introspection.block_indices.velocities).m(), solver_tolerance);
try
{
@@ -516,12 +516,12 @@ namespace aspect
current_constraints.distribute (distributed_stokes_solution);
// now rescale the pressure back to real physical units
- distributed_stokes_solution.block(1) *= pressure_scaling;
+ distributed_stokes_solution.block(introspection.block_indices.pressure) *= pressure_scaling;
// then copy back the solution from the temporary (non-ghosted) vector
// into the ghosted one with all solution components
- solution.block(0) = distributed_stokes_solution.block(0);
- solution.block(1) = distributed_stokes_solution.block(1);
+ solution.block(introspection.block_indices.velocities) = distributed_stokes_solution.block(introspection.block_indices.velocities);
+ solution.block(introspection.block_indices.pressure) = distributed_stokes_solution.block(introspection.block_indices.pressure);
remove_nullspace(solution, distributed_stokes_solution);
More information about the CIG-COMMITS
mailing list