Skip to content

Commit

Permalink
Instead of localizing the solution vector on all procs, just
Browse files Browse the repository at this point in the history
use current_local_solution to build up the nodal solution vector.
  • Loading branch information
jwpeterson committed Nov 11, 2013
1 parent eef3af5 commit 54e8db3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/systems/equation_systems.C
Expand Up @@ -735,8 +735,6 @@ void EquationSystems::build_solution_vector (std::vector<Number>& soln,
// Zero out the soln vector // Zero out the soln vector
std::fill (soln.begin(), soln.end(), libMesh::zero); std::fill (soln.begin(), soln.end(), libMesh::zero);


std::vector<Number> sys_soln;

// (Note that we use an unsigned short int here even though an // (Note that we use an unsigned short int here even though an
// unsigned char would be more that sufficient. The MPI 1.1 // unsigned char would be more that sufficient. The MPI 1.1
// standard does not require that MPI_SUM, MPI_PROD etc... be // standard does not require that MPI_SUM, MPI_PROD etc... be
Expand Down Expand Up @@ -799,7 +797,7 @@ void EquationSystems::build_solution_vector (std::vector<Number>& soln,
// as the mesh dimension. Will break for mixed dimension meshes. // as the mesh dimension. Will break for mixed dimension meshes.
unsigned int nv_sys_split = n_scalar_vars + dim*n_vector_vars; unsigned int nv_sys_split = n_scalar_vars + dim*n_vector_vars;


system.update_global_solution (sys_soln); NumericVector<Number>& sys_soln = *(system.current_local_solution);


std::vector<Number> elem_soln; // The finite element solution std::vector<Number> elem_soln; // The finite element solution
std::vector<Number> nodal_soln; // The FE solution interpolated to the nodes std::vector<Number> nodal_soln; // The FE solution interpolated to the nodes
Expand Down Expand Up @@ -828,7 +826,7 @@ void EquationSystems::build_solution_vector (std::vector<Number>& soln,
elem_soln.resize(dof_indices.size()); elem_soln.resize(dof_indices.size());


for (unsigned int i=0; i<dof_indices.size(); i++) for (unsigned int i=0; i<dof_indices.size(); i++)
elem_soln[i] = sys_soln[dof_indices[i]]; elem_soln[i] = sys_soln(dof_indices[i]);


FEInterface::nodal_soln (dim, FEInterface::nodal_soln (dim,
fe_type, fe_type,
Expand Down

0 comments on commit 54e8db3

Please sign in to comment.