Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Optionally disable default CommWorld args #85

Merged
merged 8 commits into from

4 participants

@roystgnr
Owner

The library doesn't yet compile with all new default Communicator
arguments disabled, because some of those arguments follow other
arguments with defaults. We'll need to add some overload shims to fix
that.

@roystgnr
Owner

Let's not actually pull this until the overload shims are ready, but it's at a stage worth perusing now, if only to see if anyone dislikes my choice of macro name.

@roystgnr
Owner

Hmm... the trick with shims is that, if we really want to catch every --disable-default-comm-world error at compile time, we're going to need to ifdef out some of the old APIs entirely. There's no way for a "Mesh mesh(3);" construction to be caught without actually disabling the API whose first argument is an integer-with-a-default, for example, because you can't follow an integer-with-a-default argument with an anything-without-a-default argument.

So we might as well leave the Mesh(int dim=1) constructor as it was, in that case, and then add our new canonical constructor as a separate overload, which would either be (A) "Mesh(int dim, Communicator comm)" or (B) "Mesh(Communicator comm, int dim=1)". Option (C) would be to just never disable the default comm at compile time for that method and others, so we'd keep the new API as-is but we'd only catch errors in those methods at runtime.

I'd choose option (B), but I'll implement (A) or (C) instead if others prefer.

@benkirk
Owner

I'm fine with the macro name.

I prefer (B), but would be OK implementing (B) only without the Mesh(int dim=1) constructor fallback. Since we can't use delegating constructors without C++ 2011 multiple, redundant constructors for these classes is a pain. (B) still provides the default constructor we've been pushing as best practices now for a while.

For things like

  PetscVector (
const numeric_index_type n,
const numeric_index_type n_local,
const ParallelType type = AUTOMATIC,
const Parallel::Communicator &comm = libMesh::CommWorld);

which are hid behind a build() member, I agree with Derek that I'd just as soon reorder the constructor to

  PetscVector (
const Parallel::Communicator &comm,
const numeric_index_type n, 
const numeric_index_type n_local,
const ParallelType type = AUTOMATIC);

than maintain redundant constructor for advanced, non-demonstrated usage.

@roystgnr
Owner
@friedmud
Owner
roystgnr added some commits
@roystgnr roystgnr Optionally disable default CommWorld args
The library doesn't yet compile with all new default Communicator
arguments disabled, because some of those arguments follow other
arguments with defaults.  We'll need to add some overload shims to fix
that.
81ce5ab
@roystgnr roystgnr Add LIBMESH_CAN_DEFAULT_TO_COMMWORLD macro
And reorder new method args as necessary to support it.

Because I just redid our examples to use the new methods on Mesh
classes and because that was one of the necessary reorderings, this
won't pass "make check" yet; a subsequent commit should fix that.
fd41d47
roystgnr added some commits
@roystgnr roystgnr Reorder one more communicator argument
Not sure how I missed this before, but we need another reordering to
make things workable with disabled default comm arguments.
f15e97b
@roystgnr roystgnr Fix bugs caught by disable-default-comm-world
This new feature is already paying for itself!
27b9e3a
@roystgnr roystgnr Make apps disable-default-comm-world compatible 97001cf
@roystgnr
Owner

I did a pull --rebase and push --force to bring in the other branch's examples changes after they went into master; apologies if anyone was pulling from this branch.

We appear to be passing "make check" with both the default config and with --disable-default-comm-world as of d5d29fb. Ready to pull whenever.

@benkirk
Owner

Awesome, thanks for doing this. I'm OK with merging this now.

Just to force the issue, how would you feel about #ifdef - disabling e.g. the Parallel::send() wrappers too when configuring with this option?

I'll be happy to do that after you merge this, though...

@roystgnr
Owner
@roystgnr roystgnr merged commit c112ea2 into libMesh:master
@roystgnr roystgnr deleted the roystgnr:disable_default_args branch
@roystgnr roystgnr referenced this pull request in libantioch/antioch
Closed

A couple of improvements for VexCL utilities #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2013
  1. @roystgnr

    Optionally disable default CommWorld args

    roystgnr authored
    The library doesn't yet compile with all new default Communicator
    arguments disabled, because some of those arguments follow other
    arguments with defaults.  We'll need to add some overload shims to fix
    that.
  2. @roystgnr

    Add LIBMESH_CAN_DEFAULT_TO_COMMWORLD macro

    roystgnr authored
    And reorder new method args as necessary to support it.
    
    Because I just redid our examples to use the new methods on Mesh
    classes and because that was one of the necessary reorderings, this
    won't pass "make check" yet; a subsequent commit should fix that.
  3. @roystgnr
  4. @roystgnr
  5. @roystgnr

    Reorder one more communicator argument

    roystgnr authored
    Not sure how I missed this before, but we need another reordering to
    make things workable with disabled default comm arguments.
  6. @roystgnr

    Fix bugs caught by disable-default-comm-world

    roystgnr authored
    This new feature is already paying for itself!
  7. @roystgnr
  8. @roystgnr
This page is out of date. Refresh to see the latest.
Showing with 551 additions and 316 deletions.
  1. +1 −1  examples/adaptivity/adaptivity_ex1/adaptivity_ex1.C
  2. +1 −1  examples/adaptivity/adaptivity_ex2/adaptivity_ex2.C
  3. +1 −1  examples/adaptivity/adaptivity_ex3/adaptivity_ex3.C
  4. +1 −1  examples/adaptivity/adaptivity_ex4/adaptivity_ex4.C
  5. +1 −1  examples/adaptivity/adaptivity_ex5/adaptivity_ex5.C
  6. +1 −1  examples/adjoints/adjoints_ex1/adjoints_ex1.C
  7. +1 −1  examples/adjoints/adjoints_ex2/adjoints_ex2.C
  8. +1 −1  examples/adjoints/adjoints_ex3/adjoints_ex3.C
  9. +1 −1  examples/adjoints/adjoints_ex4/adjoints_ex4.C
  10. +1 −1  examples/adjoints/adjoints_ex5/adjoints_ex5.C
  11. +1 −1  examples/eigenproblems/eigenproblems_ex1/eigenproblems_ex1.C
  12. +1 −1  examples/eigenproblems/eigenproblems_ex2/eigenproblems_ex2.C
  13. +1 −1  examples/eigenproblems/eigenproblems_ex3/eigenproblems_ex3.C
  14. +1 −1  examples/fem_system/fem_system_ex1/fem_system_ex1.C
  15. +1 −1  examples/fem_system/fem_system_ex2/fem_system_ex2.C
  16. +1 −1  examples/introduction/introduction_ex1/introduction_ex1.C
  17. +1 −1  examples/introduction/introduction_ex2/introduction_ex2.C
  18. +1 −1  examples/introduction/introduction_ex3/introduction_ex3.C
  19. +1 −1  examples/introduction/introduction_ex4/introduction_ex4.C
  20. +1 −1  examples/introduction/introduction_ex5/introduction_ex5.C
  21. +1 −1  examples/miscellaneous/miscellaneous_ex1/miscellaneous_ex1.C
  22. +1 −1  examples/miscellaneous/miscellaneous_ex2/miscellaneous_ex2.C
  23. +1 −1  examples/miscellaneous/miscellaneous_ex3/miscellaneous_ex3.C
  24. +1 −1  examples/miscellaneous/miscellaneous_ex4/miscellaneous_ex4.C
  25. +1 −1  examples/miscellaneous/miscellaneous_ex5/miscellaneous_ex5.C
  26. +3 −3 examples/miscellaneous/miscellaneous_ex6/miscellaneous_ex6.C
  27. +1 −1  examples/miscellaneous/miscellaneous_ex7/biharmonic.C
  28. +7 −5 examples/miscellaneous/miscellaneous_ex8/miscellaneous_ex8.C
  29. +1 −1  examples/reduced_basis/reduced_basis_ex1/reduced_basis_ex1.C
  30. +1 −1  examples/reduced_basis/reduced_basis_ex2/reduced_basis_ex2.C
  31. +1 −1  examples/reduced_basis/reduced_basis_ex3/reduced_basis_ex3.C
  32. +1 −1  examples/reduced_basis/reduced_basis_ex4/reduced_basis_ex4.C
  33. +1 −1  examples/reduced_basis/reduced_basis_ex5/reduced_basis_ex5.C
  34. +1 −1  examples/reduced_basis/reduced_basis_ex6/reduced_basis_ex6.C
  35. +1 −1  examples/reduced_basis/reduced_basis_ex7/reduced_basis_ex7.C
  36. +1 −1  examples/solution_transfer/solution_transfer_ex1/main.C
  37. +1 −1  examples/subdomains/subdomains_ex1/subdomains_ex1.C
  38. +1 −1  examples/subdomains/subdomains_ex2/subdomains_ex2.C
  39. +1 −1  examples/systems_of_equations/systems_of_equations_ex1/systems_of_equations_ex1.C
  40. +1 −1  examples/systems_of_equations/systems_of_equations_ex2/systems_of_equations_ex2.C
  41. +1 −1  examples/systems_of_equations/systems_of_equations_ex3/systems_of_equations_ex3.C
  42. +1 −1  examples/systems_of_equations/systems_of_equations_ex4/systems_of_equations_ex4.C
  43. +1 −1  examples/systems_of_equations/systems_of_equations_ex5/systems_of_equations_ex5.C
  44. +1 −1  examples/systems_of_equations/systems_of_equations_ex6/systems_of_equations_ex6.C
  45. +1 −1  examples/transient/transient_ex1/transient_ex1.C
  46. +1 −1  examples/transient/transient_ex2/transient_ex2.C
  47. +1 −1  examples/vector_fe/vector_fe_ex1/vector_fe_ex1.C
  48. +1 −1  examples/vector_fe/vector_fe_ex2/vector_fe_ex2.C
  49. +1 −1  examples/vector_fe/vector_fe_ex3/vector_fe_ex3.C
  50. +2 −1  include/error_estimation/error_estimator.h
  51. +14 −1 include/mesh/boundary_mesh.h
  52. +14 −1 include/mesh/mesh.h
  53. +11 −1 include/mesh/mesh_base.h
  54. +13 −1 include/mesh/parallel_mesh.h
  55. +13 −1 include/mesh/serial_mesh.h
  56. +11 −1 include/mesh/unstructured_mesh.h
  57. +30 −27 include/numerics/distributed_vector.h
  58. +2 −1  include/numerics/eigen_preconditioner.h
  59. +2 −1  include/numerics/eigen_sparse_matrix.h
  60. +30 −27 include/numerics/eigen_sparse_vector.h
  61. +2 −1  include/numerics/laspack_matrix.h
  62. +30 −28 include/numerics/laspack_vector.h
  63. +35 −23 include/numerics/numeric_vector.h
  64. +6 −2 include/numerics/petsc_matrix.h
  65. +2 −1  include/numerics/petsc_preconditioner.h
  66. +35 −30 include/numerics/petsc_vector.h
  67. +3 −2 include/numerics/preconditioner.h
  68. +2 −1  include/numerics/shell_matrix.h
  69. +3 −1 include/numerics/sparse_matrix.h
  70. +4 −2 include/numerics/sum_shell_matrix.h
  71. +4 −2 include/numerics/trilinos_epetra_matrix.h
  72. +34 −31 include/numerics/trilinos_epetra_vector.h
  73. +2 −1  include/numerics/trilinos_preconditioner.h
  74. +13 −1 include/parallel/parallel.h
  75. +2 −1  include/reduced_basis/derived_rb_construction.h
  76. +2 −1  include/reduced_basis/derived_rb_evaluation.h
  77. +2 −1  include/reduced_basis/rb_eim_evaluation.h
  78. +2 −1  include/reduced_basis/rb_evaluation.h
  79. +2 −1  include/reduced_basis/rb_scm_evaluation.h
  80. +2 −1  include/reduced_basis/transient_rb_evaluation.h
  81. +2 −1  include/solution_transfer/direct_solution_transfer.h
  82. +2 −1  include/solution_transfer/dtk_solution_transfer.h
  83. +5 −4 include/solution_transfer/meshfree_interpolation.h
  84. +2 −1  include/solution_transfer/meshfree_solution_transfer.h
  85. +2 −1  include/solution_transfer/meshfunction_solution_transfer.h
  86. +3 −3 include/solution_transfer/radial_basis_interpolation.h
  87. +2 −1  include/solution_transfer/solution_transfer.h
  88. +4 −2 include/solvers/eigen_solver.h
  89. +2 −1  include/solvers/eigen_sparse_linear_solver.h
  90. +2 −1  include/solvers/laspack_linear_solver.h
  91. +2 −1  include/solvers/linear_solver.h
  92. +2 −1  include/solvers/petsc_linear_solver.h
  93. +2 −1  include/solvers/slepc_eigen_solver.h
  94. +2 −1  include/solvers/trilinos_aztec_linear_solver.h
  95. +1 −1  src/apps/amr.C
  96. +2 −2 src/apps/compare.C
  97. +2 −2 src/apps/grid2grid.C
  98. +1 −1  src/apps/meshbcid.C
  99. +1 −1  src/apps/meshdiff.C
  100. +1 −1  src/apps/meshnorm.C
  101. +1 −1  src/apps/meshplot.C
  102. +5 −4 src/apps/meshtool.C
  103. +3 −3 src/apps/projection.C
  104. +1 −1  src/apps/solution_components.C
  105. +13 −3 src/mesh/boundary_mesh.C
  106. +2 −1  src/mesh/diva_io.C
  107. +21 −2 src/mesh/mesh_base.C
  108. +20 −3 src/mesh/parallel_mesh.C
  109. +13 −3 src/mesh/serial_mesh.C
  110. +13 −3 src/mesh/unstructured_mesh.C
  111. +1 −1  src/numerics/distributed_vector.C
  112. +16 −5 src/numerics/numeric_vector.C
  113. +1 −1  src/numerics/petsc_vector.C
  114. +1 −1  src/numerics/trilinos_epetra_vector.C
  115. +2 −1  src/solution_transfer/meshfree_solution_transfer.C
  116. +1 −1  src/solvers/petsc_diff_solver.C
  117. +6 −3 src/solvers/petsc_linear_solver.C
  118. +3 −1 tests/numerics/numeric_vector_test.h
View
2  examples/adaptivity/adaptivity_ex1/adaptivity_ex1.C
@@ -67,7 +67,7 @@ int main(int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
GetPot command_line (argc, argv);
View
2  examples/adaptivity/adaptivity_ex2/adaptivity_ex2.C
@@ -193,7 +193,7 @@ int main (int argc, char** argv)
// Create a new mesh on the default MPI communicator.
// We still need some work on automatic parallel restarts with
// ParallelMesh
- SerialMesh mesh(0,init.communicator());
+ SerialMesh mesh(init.communicator());
// Create an equation systems object.
EquationSystems equation_systems (mesh);
View
2  examples/adaptivity/adaptivity_ex3/adaptivity_ex3.C
@@ -168,7 +168,7 @@ int main(int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Read in the mesh
if (dim == 1)
View
2  examples/adaptivity/adaptivity_ex4/adaptivity_ex4.C
@@ -159,7 +159,7 @@ int main(int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Output file for plotting the error
std::string output_file = "";
View
2  examples/adaptivity/adaptivity_ex5/adaptivity_ex5.C
@@ -217,7 +217,7 @@ int main (int argc, char** argv)
// Create a new mesh on the default MPI communicator.
// ParallelMesh doesn't yet understand periodic BCs, plus
// we still need some work on automatic parallel restarts
- SerialMesh mesh(0,init.communicator());
+ SerialMesh mesh(init.communicator());
// Create an equation systems object.
EquationSystems equation_systems (mesh);
View
2  examples/adjoints/adjoints_ex1/adjoints_ex1.C
@@ -266,7 +266,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// And an object to refine it
AutoPtr<MeshRefinement> mesh_refinement =
View
2  examples/adjoints/adjoints_ex2/adjoints_ex2.C
@@ -273,7 +273,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// And an object to refine it
AutoPtr<MeshRefinement> mesh_refinement =
View
2  examples/adjoints/adjoints_ex3/adjoints_ex3.C
@@ -730,7 +730,7 @@ int main (int argc, char** argv)
// Create a mesh with the given dimension, distributed
// across the default MPI communicator.
- Mesh mesh(param.dimension, init.communicator());
+ Mesh mesh(init.communicator(), param.dimension);
// And an object to refine it
AutoPtr<MeshRefinement> mesh_refinement =
View
2  examples/adjoints/adjoints_ex4/adjoints_ex4.C
@@ -233,7 +233,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// And an object to refine it
AutoPtr<MeshRefinement> mesh_refinement =
View
2  examples/adjoints/adjoints_ex5/adjoints_ex5.C
@@ -273,7 +273,7 @@ int main (int argc, char** argv)
// Create a mesh with the given dimension, distributed
// across the default MPI communicator.
- Mesh mesh(param.dimension, init.communicator());
+ Mesh mesh(init.communicator(), param.dimension);
// And an object to refine it
AutoPtr<MeshRefinement> mesh_refinement(new MeshRefinement(mesh));
View
2  examples/eigenproblems/eigenproblems_ex1/eigenproblems_ex1.C
@@ -102,7 +102,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the internal mesh generator to create a uniform
// 2D grid on a square.
View
2  examples/eigenproblems/eigenproblems_ex2/eigenproblems_ex2.C
@@ -106,7 +106,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the internal mesh generator to create a uniform
// 2D grid on a square.
View
2  examples/eigenproblems/eigenproblems_ex3/eigenproblems_ex3.C
@@ -149,7 +149,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden by the file, on
// the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
mesh.read(mesh_name_exodus.str());
View
2  examples/fem_system/fem_system_ex1/fem_system_ex1.C
@@ -92,7 +92,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// And an object to refine it
MeshRefinement mesh_refinement(mesh);
View
2  examples/fem_system/fem_system_ex2/fem_system_ex2.C
@@ -164,7 +164,7 @@ int main(int argc, char** argv)
libmesh_example_assert(dim <= LIBMESH_DIM, "3D support");
// Create a mesh distributed across the default MPI communicator.
- Mesh mesh(dim,init.communicator());
+ Mesh mesh(init.communicator(), dim);
EquationSystems systems(mesh);
View
2  examples/introduction/introduction_ex1/introduction_ex1.C
@@ -66,7 +66,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Read the input mesh.
mesh.read (argv[3]);
View
2  examples/introduction/introduction_ex2/introduction_ex2.C
@@ -76,7 +76,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the unit square. By default a mesh of QUAD4
View
2  examples/introduction/introduction_ex3/introduction_ex3.C
@@ -93,7 +93,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the square [-1,1]^2. We instruct the mesh generator
View
2  examples/introduction/introduction_ex4/introduction_ex4.C
@@ -185,7 +185,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// grid on the square [-1,1]^D. We instruct the mesh generator
View
2  examples/introduction/introduction_ex5/introduction_ex5.C
@@ -156,7 +156,7 @@ int main (int argc, char** argv)
// The following is identical to example 4, and therefore
// not commented. Differences are mentioned when present.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// We will use a linear approximation space in this example,
// hence 8-noded hexahedral elements are sufficient. This
View
2  examples/miscellaneous/miscellaneous_ex1/miscellaneous_ex1.C
@@ -100,7 +100,7 @@ int main (int argc, char** argv)
// InfElemBuilder still requires some updates to be ParallelMesh
// compatible
- SerialMesh mesh(0, init.communicator());
+ SerialMesh mesh(init.communicator());
// Use the internal mesh generator to create elements
// on the square [-1,1]^3, of type Hex8.
View
2  examples/miscellaneous/miscellaneous_ex2/miscellaneous_ex2.C
@@ -160,7 +160,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Create a corresponding MeshData
// and activate it. For more information on this object
View
2  examples/miscellaneous/miscellaneous_ex3/miscellaneous_ex3.C
@@ -477,7 +477,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden by the file,
// distributed across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
mesh.read ("lshaped.xda");
View
2  examples/miscellaneous/miscellaneous_ex4/miscellaneous_ex4.C
@@ -107,7 +107,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Create an equation systems object.
EquationSystems equation_systems (mesh);
View
2  examples/miscellaneous/miscellaneous_ex5/miscellaneous_ex5.C
@@ -479,7 +479,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
if (dim == 1)
MeshTools::Generation::build_line(mesh,1,-1.,0.);
View
6 examples/miscellaneous/miscellaneous_ex6/miscellaneous_ex6.C
@@ -83,7 +83,7 @@ void triangulate_domain(const Parallel::Communicator& comm)
typedef TriangleInterface::ArbitraryHole ArbitraryHole;
// Libmesh mesh that will eventually be created.
- Mesh mesh(2, comm);
+ Mesh mesh(comm, 2);
// The points which make up the L-shape:
mesh.add_point(Point( 0. , 0.));
@@ -171,7 +171,7 @@ void tetrahedralize_domain(const Parallel::Communicator& comm)
// 5.) The domain is tetrahedralized, the mesh is written out, etc.
// The mesh we will eventually generate
- SerialMesh mesh(3,comm);
+ SerialMesh mesh(comm,3);
// Lower and Upper bounding box limits for a rectangular hole within the unit cube.
Point hole_lower_limit(0.2, 0.2, 0.4);
@@ -229,7 +229,7 @@ void tetrahedralize_domain(const Parallel::Communicator& comm)
void add_cube_convex_hull_to_mesh(MeshBase& mesh, Point lower_limit, Point upper_limit)
{
#ifdef LIBMESH_HAVE_TETGEN
- SerialMesh cube_mesh(3,mesh.communicator());
+ SerialMesh cube_mesh(mesh.communicator(),3);
unsigned n_elem = 1;
View
2  examples/miscellaneous/miscellaneous_ex7/biharmonic.C
@@ -12,7 +12,7 @@ using namespace libMesh;
void Biharmonic::Create(Biharmonic** b, const Parallel::Communicator &comm)
{
// ParallelMesh doesn't yet understand periodic BCs
- SerialMesh* mesh = new SerialMesh(0,comm);
+ SerialMesh* mesh = new SerialMesh(comm);
Biharmonic *biharmonic = new Biharmonic(mesh);
*b = biharmonic;
}
View
12 examples/miscellaneous/miscellaneous_ex8/miscellaneous_ex8.C
@@ -133,10 +133,11 @@ int main(int argc, char** argv)
field_vars.push_back("u");
field_vars.push_back("v");
- InverseDistanceInterpolation<3> idi (/* n_interp_pts = */ 8,
+ InverseDistanceInterpolation<3> idi (init.communicator(),
+ /* n_interp_pts = */ 8,
/* power = */ 2);
- RadialBasisInterpolation<3> rbi;
+ RadialBasisInterpolation<3> rbi (init.communicator());
idi.set_field_variables (field_vars);
rbi.set_field_variables (field_vars);
@@ -210,7 +211,7 @@ int main(int argc, char** argv)
// Demonstration case 2
{
- Mesh mesh_a(0,init.communicator()), mesh_b(0,init.communicator());
+ Mesh mesh_a(init.communicator()), mesh_b(init.communicator());
mesh_a.read("struct.ucd.gz"); mesh_b.read("unstruct.ucd.gz");
@@ -232,9 +233,10 @@ int main(int argc, char** argv)
TecplotIO(mesh_a).write_equation_systems ("src.dat",
es_a);
- InverseDistanceInterpolation<3> idi (/* n_interp_pts = */ 4,
+ InverseDistanceInterpolation<3> idi (init.communicator(),
+ /* n_interp_pts = */ 4,
/* power = */ 2);
- RadialBasisInterpolation<3> rbi;
+ RadialBasisInterpolation<3> rbi (init.communicator());
std::vector<Point> &src_pts (idi.get_source_points());
std::vector<Number> &src_vals (idi.get_source_vals());
View
2  examples/reduced_basis/reduced_basis_ex1/reduced_basis_ex1.C
@@ -96,7 +96,7 @@ int main (int argc, char** argv)
online_mode = command_line.next(online_mode);
// Build a mesh on the default MPI communicator.
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
n_elem, n_elem,
0., 1.,
View
2  examples/reduced_basis/reduced_basis_ex2/reduced_basis_ex2.C
@@ -102,7 +102,7 @@ int main (int argc, char** argv)
online_mode = command_line.next(online_mode);
// Build a mesh on the default MPI communicator.
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
n_elem, n_elem,
0., 1.,
View
2  examples/reduced_basis/reduced_basis_ex3/reduced_basis_ex3.C
@@ -80,7 +80,7 @@ int main (int argc, char** argv)
online_mode = command_line.next(online_mode);
// Build a mesh on the default MPI communicator.
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
n_elem, n_elem,
0., 1.,
View
2  examples/reduced_basis/reduced_basis_ex4/reduced_basis_ex4.C
@@ -77,7 +77,7 @@ int main (int argc, char** argv)
// Create a mesh (just a simple square) on the default MPI
// communicator
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
n_elem, n_elem,
-1., 1.,
View
2  examples/reduced_basis/reduced_basis_ex5/reduced_basis_ex5.C
@@ -95,7 +95,7 @@ int main(int argc, char** argv) {
}
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
MeshTools::Generation::build_cube (mesh,
n_elem_x,
n_elem_y,
View
2  examples/reduced_basis/reduced_basis_ex6/reduced_basis_ex6.C
@@ -125,7 +125,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden by build_cube, on
// the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
MeshTools::Generation::build_cube (mesh,
n_elem_xy, n_elem_xy, n_elem_z,
View
2  examples/reduced_basis/reduced_basis_ex7/reduced_basis_ex7.C
@@ -88,7 +88,7 @@ int main (int argc, char** argv)
online_mode = command_line.next(online_mode);
// Create a mesh on the default MPI communicator.
- Mesh mesh(dim,init.communicator());
+ Mesh mesh(init.communicator(), dim);
mesh.read("horn.msh");
// Create an equation systems object.
View
2  examples/solution_transfer/solution_transfer_ex1/main.C
@@ -37,7 +37,7 @@ int main(int argc, char* argv[])
#ifdef LIBMESH_HAVE_DTK
- Mesh from_mesh(0,init.communicator());
+ Mesh from_mesh(init.communicator());
MeshTools::Generation::build_cube(from_mesh, 4, 4, 4, 0, 1, 0, 1, 0, 1, HEX8);
from_mesh.print_info();
EquationSystems from_es(from_mesh);
View
2  examples/subdomains/subdomains_ex1/subdomains_ex1.C
@@ -174,7 +174,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// grid on the square [-1,1]^D. We instruct the mesh generator
View
2  examples/subdomains/subdomains_ex2/subdomains_ex2.C
@@ -136,7 +136,7 @@ int main (int argc, char** argv)
// Create a mesh with user-defined dimension on the default MPI
// communicator.
- Mesh mesh (dim, init.communicator());
+ Mesh mesh (init.communicator(), dim);
// Read number of elements from command line
int ps = 15;
View
2  examples/systems_of_equations/systems_of_equations_ex1/systems_of_equations_ex1.C
@@ -70,7 +70,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the square [-1,1]^2. We instruct the mesh generator
View
2  examples/systems_of_equations/systems_of_equations_ex2/systems_of_equations_ex2.C
@@ -94,7 +94,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the square [-1,1]^2. We instruct the mesh generator
View
2  examples/systems_of_equations/systems_of_equations_ex3/systems_of_equations_ex3.C
@@ -85,7 +85,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, distributed
// across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the square [-1,1]^2. We instruct the mesh generator
View
2  examples/systems_of_equations/systems_of_equations_ex4/systems_of_equations_ex4.C
@@ -83,7 +83,7 @@ int main (int argc, char** argv)
libmesh_example_assert(dim <= LIBMESH_DIM, "2D support");
// Create a 2D mesh distributed across the default MPI communicator.
- Mesh mesh(dim, init.communicator());
+ Mesh mesh(init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
50, 10,
0., 1.,
View
2  examples/systems_of_equations/systems_of_equations_ex5/systems_of_equations_ex5.C
@@ -87,7 +87,7 @@ int main (int argc, char** argv)
libmesh_example_assert(dim <= LIBMESH_DIM, "2D support");
// Create a 2D mesh distributed across the default MPI communicator.
- Mesh mesh(dim, init.communicator());
+ Mesh mesh(init.communicator(), dim);
MeshTools::Generation::build_square (mesh,
50, 10,
0., 1.,
View
2  examples/systems_of_equations/systems_of_equations_ex6/systems_of_equations_ex6.C
@@ -101,7 +101,7 @@ int main (int argc, char** argv)
libmesh_example_assert(dim == LIBMESH_DIM, "3D support");
// Create a 3D mesh distributed across the default MPI communicator.
- Mesh mesh(dim, init.communicator());
+ Mesh mesh(init.communicator(), dim);
MeshTools::Generation::build_cube (mesh,
40,
8,
View
2  examples/transient/transient_ex1/transient_ex1.C
@@ -119,7 +119,7 @@ int main (int argc, char** argv)
//
// Create a mesh object, with dimension to be overridden later,
// distributed across the default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
mesh.read ("mesh.xda");
View
2  examples/transient/transient_ex2/transient_ex2.C
@@ -162,7 +162,7 @@ int main (int argc, char** argv)
//
// Create a SerialMesh object, with dimension to be overridden
// later, distributed across the default MPI communicator.
- SerialMesh mesh(0,init.communicator());
+ SerialMesh mesh(init.communicator());
MeshData mesh_data(mesh);
// Read the meshfile specified in the command line or
View
2  examples/vector_fe/vector_fe_ex1/vector_fe_ex1.C
@@ -91,7 +91,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// 2D grid on the square [-1,1]^2. We instruct the mesh generator
View
2  examples/vector_fe/vector_fe_ex2/vector_fe_ex2.C
@@ -56,7 +56,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// grid on the square [-1,1]^D. We instruct the mesh generator
View
2  examples/vector_fe/vector_fe_ex3/vector_fe_ex3.C
@@ -56,7 +56,7 @@ int main (int argc, char** argv)
// Create a mesh, with dimension to be overridden later, on the
// default MPI communicator.
- Mesh mesh(0,init.communicator());
+ Mesh mesh(init.communicator());
// Use the MeshTools::Generation mesh generator to create a uniform
// grid on the square [-1,1]^D. We must use TRI6 elements for the
View
3  include/error_estimation/error_estimator.h
@@ -148,7 +148,8 @@ template <typename T> class NumericVector;
* them to get the global error vector.
*/
void reduce_error (std::vector<float>& error_per_cell,
- const Parallel::Communicator &comm = libMesh::CommWorld) const;
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD) const;
};
View
15 include/mesh/boundary_mesh.h
@@ -46,7 +46,20 @@ class BoundaryMesh : public Mesh
/**
* Constructor. Initializes dimenstion and processor id.
*/
- BoundaryMesh (unsigned int d, const Parallel::Communicator &comm = libMesh::CommWorld);
+ explicit
+ BoundaryMesh (const Parallel::Communicator &comm,
+ unsigned int dim=1);
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ explicit
+ BoundaryMesh (unsigned int dim=1);
+#endif
+
/**
* Destructor.
View
15 include/mesh/mesh.h
@@ -57,7 +57,20 @@ class Mesh : public DefaultMesh
* changed by mesh generation/loading) later.
*/
explicit
- Mesh (unsigned int dim=1, const Parallel::Communicator &comm = libMesh::CommWorld) : DefaultMesh(dim,comm) {}
+ Mesh (const Parallel::Communicator &comm,
+ unsigned int dim=1)
+ : DefaultMesh(comm,dim) {}
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ explicit
+ Mesh (unsigned int dim=1)
+ : DefaultMesh(dim) {}
+#endif
/**
* Copy-constructor. This should be able to take a
View
12 include/mesh/mesh_base.h
@@ -75,7 +75,17 @@ class MeshBase : public ParallelObject
* The mesh dimension can be changed (and may automatically be
* changed by mesh generation/loading) later.
*/
- MeshBase (unsigned int dim=1, const Parallel::Communicator &comm = libMesh::CommWorld);
+ MeshBase (const Parallel::Communicator &comm,
+ unsigned int dim=1);
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ MeshBase (unsigned int dim=1);
+#endif
/**
* Copy-constructor.
View
14 include/mesh/parallel_mesh.h
@@ -56,7 +56,19 @@ class ParallelMesh : public UnstructuredMesh
* changed by mesh generation/loading) later.
*/
explicit
- ParallelMesh (unsigned int dim=1, const Parallel::Communicator &comm = libMesh::CommWorld);
+ ParallelMesh (const Parallel::Communicator &comm,
+ unsigned int dim=1);
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ explicit
+ ParallelMesh (unsigned int dim=1);
+#endif
+
/**
* Copy-constructor. This should be able to take a
View
14 include/mesh/serial_mesh.h
@@ -54,7 +54,19 @@ class SerialMesh : public UnstructuredMesh
* changed by mesh generation/loading) later.
*/
explicit
- SerialMesh (unsigned int dim=1, const Parallel::Communicator &comm = libMesh::CommWorld);
+ SerialMesh (const Parallel::Communicator &comm,
+ unsigned int dim=1);
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ explicit
+ SerialMesh (unsigned int dim=1);
+#endif
+
/**
* Copy-constructor. This should be able to take a
View
12 include/mesh/unstructured_mesh.h
@@ -58,7 +58,17 @@ class UnstructuredMesh : public MeshBase
* changed by mesh generation/loading) later.
*/
explicit
- UnstructuredMesh (unsigned int dim=1, const Parallel::Communicator &comm = libMesh::CommWorld);
+ UnstructuredMesh (const Parallel::Communicator &comm,
+ unsigned int dim=1);
+
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Deprecated constructor. Takes \p dim, the dimension of the mesh.
+ * The mesh dimension can be changed (and may automatically be
+ * changed by mesh generation/loading) later.
+ */
+ UnstructuredMesh (unsigned int dim=1);
+#endif
/**
* Destructor.
View
57 include/numerics/distributed_vector.h
@@ -57,36 +57,36 @@ class DistributedVector : public NumericVector<T>
* Dummy-Constructor. Dimension=0
*/
explicit
- DistributedVector (const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ DistributedVector (const Parallel::Communicator &comm,
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- DistributedVector (const numeric_index_type n,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- DistributedVector (const numeric_index_type n,
+ DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType ptype = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- DistributedVector (const numeric_index_type N,
+ DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType ptype = AUTOMATIC);
/**
* Destructor, deallocates memory. Made virtual to allow
@@ -480,8 +480,9 @@ class DistributedVector : public NumericVector<T>
// DistributedVector inline methods
template <typename T>
inline
-DistributedVector<T>::DistributedVector (const ParallelType ptype, const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm),
+DistributedVector<T>::DistributedVector (const Parallel::Communicator &comm,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype),
_global_size (0),
_local_size (0),
_first_local_index(0),
@@ -494,10 +495,10 @@ DistributedVector<T>::DistributedVector (const ParallelType ptype, const Paralle
template <typename T>
inline
-DistributedVector<T>::DistributedVector (const numeric_index_type n,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+DistributedVector<T>::DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n, false, ptype);
}
@@ -506,11 +507,11 @@ DistributedVector<T>::DistributedVector (const numeric_index_type n,
template <typename T>
inline
-DistributedVector<T>::DistributedVector (const numeric_index_type n,
+DistributedVector<T>::DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n_local, false, ptype);
}
@@ -519,12 +520,12 @@ DistributedVector<T>::DistributedVector (const numeric_index_type n,
template <typename T>
inline
-DistributedVector<T>::DistributedVector (const numeric_index_type n,
+DistributedVector<T>::DistributedVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n_local, ghost, false, ptype);
}
@@ -708,7 +709,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > DistributedVector<T>::zero_clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new DistributedVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new DistributedVector<T>(this->communicator()));
cloned_vector->init(*this);
@@ -721,7 +723,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > DistributedVector<T>::clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new DistributedVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new DistributedVector<T>(this->communicator()));
cloned_vector->init(*this, true);
View
3  include/numerics/eigen_preconditioner.h
@@ -61,7 +61,8 @@ class EigenPreconditioner : public Preconditioner<T>
/**
* Constructor. Initializes EigenPreconditioner data structures
*/
- EigenPreconditioner (const libMesh::Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ EigenPreconditioner (const libMesh::Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor.
View
3  include/numerics/eigen_sparse_matrix.h
@@ -73,7 +73,8 @@ class EigenSparseMatrix : public SparseMatrix<T>
* the matrix before usage with
* \p init(...).
*/
- EigenSparseMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ EigenSparseMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor. Free all memory, but do not
View
57 include/numerics/eigen_sparse_vector.h
@@ -61,36 +61,36 @@ class EigenSparseVector : public NumericVector<T>
* Dummy-Constructor. Dimension=0
*/
explicit
- EigenSparseVector (const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ EigenSparseVector (const Parallel::Communicator &comm,
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- EigenSparseVector (const numeric_index_type n,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- EigenSparseVector (const numeric_index_type n,
+ EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- EigenSparseVector (const numeric_index_type N,
+ EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType = AUTOMATIC);
/**
* Destructor, deallocates memory. Made virtual to allow
@@ -478,8 +478,9 @@ class EigenSparseVector : public NumericVector<T>
// EigenSparseVector inline methods
template <typename T>
inline
-EigenSparseVector<T>::EigenSparseVector (const ParallelType ptype, const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+EigenSparseVector<T>::EigenSparseVector (const Parallel::Communicator &comm,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->_type = ptype;
}
@@ -488,10 +489,10 @@ EigenSparseVector<T>::EigenSparseVector (const ParallelType ptype, const Paralle
template <typename T>
inline
-EigenSparseVector<T>::EigenSparseVector (const numeric_index_type n,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+EigenSparseVector<T>::EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n, false, ptype);
}
@@ -500,11 +501,11 @@ EigenSparseVector<T>::EigenSparseVector (const numeric_index_type n,
template <typename T>
inline
-EigenSparseVector<T>::EigenSparseVector (const numeric_index_type n,
+EigenSparseVector<T>::EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n_local, false, ptype);
}
@@ -513,12 +514,12 @@ EigenSparseVector<T>::EigenSparseVector (const numeric_index_type n,
template <typename T>
inline
-EigenSparseVector<T>::EigenSparseVector (const numeric_index_type N,
+EigenSparseVector<T>::EigenSparseVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(N, n_local, ghost, false, ptype);
}
@@ -644,7 +645,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > EigenSparseVector<T>::zero_clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new EigenSparseVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new EigenSparseVector<T>(this->communicator()));
cloned_vector->init(*this);
@@ -657,7 +659,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > EigenSparseVector<T>::clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new EigenSparseVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new EigenSparseVector<T>(this->communicator()));
cloned_vector->init(*this, true);
View
3  include/numerics/laspack_matrix.h
@@ -75,7 +75,8 @@ class LaspackMatrix : public SparseMatrix<T>
* the matrix before usage with
* \p init(...).
*/
- LaspackMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ LaspackMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor. Free all memory, but do not
View
58 include/numerics/laspack_vector.h
@@ -62,36 +62,36 @@ class LaspackVector : public NumericVector<T>
* Dummy-Constructor. Dimension=0
*/
explicit
- LaspackVector (const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ LaspackVector (const Parallel::Communicator &comm,
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- LaspackVector (const numeric_index_type n,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- LaspackVector (const numeric_index_type n,
+ LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- LaspackVector (const numeric_index_type N,
+ LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType = AUTOMATIC);
/**
* Destructor, deallocates memory. Made virtual to allow
@@ -467,9 +467,9 @@ class LaspackVector : public NumericVector<T>
// LaspackVector inline methods
template <typename T>
inline
-LaspackVector<T>::LaspackVector (const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+LaspackVector<T>::LaspackVector (const Parallel::Communicator &comm,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->_type = ptype;
}
@@ -478,10 +478,10 @@ LaspackVector<T>::LaspackVector (const ParallelType ptype,
template <typename T>
inline
-LaspackVector<T>::LaspackVector (const numeric_index_type n,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+LaspackVector<T>::LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n, false, ptype);
}
@@ -490,11 +490,11 @@ LaspackVector<T>::LaspackVector (const numeric_index_type n,
template <typename T>
inline
-LaspackVector<T>::LaspackVector (const numeric_index_type n,
+LaspackVector<T>::LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(n, n_local, false, ptype);
}
@@ -503,12 +503,12 @@ LaspackVector<T>::LaspackVector (const numeric_index_type n,
template <typename T>
inline
-LaspackVector<T>::LaspackVector (const numeric_index_type N,
+LaspackVector<T>::LaspackVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm)
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype)
{
this->init(N, n_local, ghost, false, ptype);
}
@@ -643,7 +643,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > LaspackVector<T>::zero_clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new LaspackVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new LaspackVector<T>(this->communicator()));
cloned_vector->init(*this);
@@ -656,7 +657,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > LaspackVector<T>::clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new LaspackVector<T>);
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new LaspackVector<T>(this->communicator()));
cloned_vector->init(*this, true);
View
58 include/numerics/numeric_vector.h
@@ -64,36 +64,36 @@ class NumericVector : public ReferenceCountedObject<NumericVector<T> >,
* Dummy-Constructor. Dimension=0
*/
explicit
- NumericVector (const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ NumericVector (const Parallel::Communicator &comm,
+ const ParallelType ptype = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- NumericVector (const numeric_index_type n,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- NumericVector (const numeric_index_type n,
+ NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType ptype = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- NumericVector (const numeric_index_type N,
+ NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType ptype = AUTOMATIC);
public:
@@ -104,13 +104,24 @@ class NumericVector : public ReferenceCountedObject<NumericVector<T> >,
virtual ~NumericVector ();
/**
- * Builds a \p NumericVector using the linear solver package specified by
+ * Builds a \p NumericVector on the processors in communicator
+ * \p comm using the linear solver package specified by
* \p solver_package
*/
static AutoPtr<NumericVector<T> >
- build(const Parallel::Communicator &comm = libMesh::CommWorld,
+ build(const Parallel::Communicator &comm,
const SolverPackage solver_package = libMesh::default_solver_package());
+#ifndef LIBMESH_DISABLE_COMMWORLD
+ /**
+ * Builds a \p NumericVector on the processors in communicator
+ * CommWorld using the linear solver package specified by \p
+ * solver_package. Deprecated.
+ */
+ static AutoPtr<NumericVector<T> >
+ build(const SolverPackage solver_package = libMesh::default_solver_package());
+#endif
+
/**
* @returns true if the vector has been initialized,
* false otherwise.
@@ -653,7 +664,8 @@ class NumericVector : public ReferenceCountedObject<NumericVector<T> >,
template <typename T>
inline
-NumericVector<T>::NumericVector (const ParallelType ptype, const Parallel::Communicator &comm) :
+NumericVector<T>::NumericVector (const Parallel::Communicator &comm,
+ const ParallelType ptype) :
ParallelObject(comm),
_is_closed(false),
_is_initialized(false),
@@ -665,9 +677,9 @@ NumericVector<T>::NumericVector (const ParallelType ptype, const Parallel::Commu
template <typename T>
inline
-NumericVector<T>::NumericVector (const numeric_index_type /*n*/,
- const ParallelType ptype,
- const Parallel::Communicator &comm) :
+NumericVector<T>::NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type /*n*/,
+ const ParallelType ptype) :
ParallelObject(comm),
_is_closed(false),
_is_initialized(false),
@@ -681,10 +693,10 @@ NumericVector<T>::NumericVector (const numeric_index_type /*n*/,
template <typename T>
inline
-NumericVector<T>::NumericVector (const numeric_index_type /*n*/,
+NumericVector<T>::NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type /*n*/,
const numeric_index_type /*n_local*/,
- const ParallelType ptype,
- const Parallel::Communicator &comm) :
+ const ParallelType ptype) :
ParallelObject(comm),
_is_closed(false),
_is_initialized(false),
@@ -698,11 +710,11 @@ NumericVector<T>::NumericVector (const numeric_index_type /*n*/,
template <typename T>
inline
-NumericVector<T>::NumericVector (const numeric_index_type /*n*/,
+NumericVector<T>::NumericVector (const Parallel::Communicator &comm,
+ const numeric_index_type /*n*/,
const numeric_index_type /*n_local*/,
const std::vector<numeric_index_type>& /*ghost*/,
- const ParallelType ptype,
- const Parallel::Communicator &comm) :
+ const ParallelType ptype) :
ParallelObject(comm),
_is_closed(false),
_is_initialized(false),
View
8 include/numerics/petsc_matrix.h
@@ -92,7 +92,9 @@ class PetscMatrix : public SparseMatrix<T>
* the matrix before usage with
* \p init(...).
*/
- PetscMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ explicit
+ PetscMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Constructor. Creates a PetscMatrix assuming you already
@@ -101,8 +103,10 @@ class PetscMatrix : public SparseMatrix<T>
* This allows ownership of m to remain with the original creator,
* and to simply provide additional functionality with the PetscMatrix.
*/
+ explicit
PetscMatrix (Mat m,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor. Free all memory, but do not
View
3  include/numerics/petsc_preconditioner.h
@@ -64,7 +64,8 @@ class PetscPreconditioner : public Preconditioner<T>
/**
* Constructor. Initializes PetscPreconditioner data structures
*/
- PetscPreconditioner (const libMesh::Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ PetscPreconditioner (const libMesh::Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor.
View
65 include/numerics/petsc_vector.h
@@ -66,36 +66,36 @@ class PetscVector : public NumericVector<T>
* Dummy-Constructor. Dimension=0
*/
explicit
- PetscVector (const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ PetscVector (const Parallel::Communicator &comm,
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- PetscVector (const numeric_index_type n,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- PetscVector (const numeric_index_type n,
+ PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- PetscVector (const numeric_index_type N,
+ PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Creates a PetscVector assuming you already have a
@@ -104,7 +104,9 @@ class PetscVector : public NumericVector<T>
* This allows ownership of \p v to remain with the original creator,
* and to simply provide additional functionality with the PetscVector.
*/
- PetscVector(Vec v, const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ PetscVector(Vec v,
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor, deallocates memory. Made virtual to allow
@@ -602,8 +604,8 @@ class PetscVector : public NumericVector<T>
template <typename T>
inline
-PetscVector<T>::PetscVector (const ParallelType ptype, const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm),
+PetscVector<T>::PetscVector (const Parallel::Communicator &comm, const ParallelType ptype)
+ : NumericVector<T>(comm, ptype),
_array_is_present(false),
_local_form(NULL),
_values(NULL),
@@ -617,10 +619,10 @@ PetscVector<T>::PetscVector (const ParallelType ptype, const Parallel::Communica
template <typename T>
inline
-PetscVector<T>::PetscVector (const numeric_index_type n,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm),
+PetscVector<T>::PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype),
_array_is_present(false),
_local_form(NULL),
_values(NULL),
@@ -634,11 +636,11 @@ PetscVector<T>::PetscVector (const numeric_index_type n,
template <typename T>
inline
-PetscVector<T>::PetscVector (const numeric_index_type n,
+PetscVector<T>::PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm),
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype),
_array_is_present(false),
_local_form(NULL),
_values(NULL),
@@ -652,12 +654,12 @@ PetscVector<T>::PetscVector (const numeric_index_type n,
template <typename T>
inline
-PetscVector<T>::PetscVector (const numeric_index_type n,
+PetscVector<T>::PetscVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType ptype,
- const Parallel::Communicator &comm)
- : NumericVector<T>(ptype, comm),
+ const ParallelType ptype)
+ : NumericVector<T>(comm, ptype),
_array_is_present(false),
_local_form(NULL),
_values(NULL),
@@ -673,8 +675,9 @@ PetscVector<T>::PetscVector (const numeric_index_type n,
template <typename T>
inline
-PetscVector<T>::PetscVector (Vec v, const Parallel::Communicator &comm)
- : NumericVector<T>(AUTOMATIC, comm),
+PetscVector<T>::PetscVector (Vec v,
+ const Parallel::Communicator &comm)
+ : NumericVector<T>(comm, AUTOMATIC),
_array_is_present(false),
_local_form(NULL),
_values(NULL),
@@ -1037,7 +1040,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > PetscVector<T>::zero_clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new PetscVector<T>(this->type(), this->communicator()));
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new PetscVector<T>(this->communicator(), this->type()));
cloned_vector->init(*this);
@@ -1050,7 +1054,8 @@ template <typename T>
inline
AutoPtr<NumericVector<T> > PetscVector<T>::clone () const
{
- AutoPtr<NumericVector<T> > cloned_vector (new PetscVector<T>(this->type(), this->communicator()));
+ AutoPtr<NumericVector<T> > cloned_vector
+ (new PetscVector<T>(this->communicator(), this->type()));
cloned_vector->init(*this, true);
View
5 include/numerics/preconditioner.h
@@ -67,7 +67,7 @@ class Preconditioner : public ReferenceCountedObject<Preconditioner<T> >,
/**
* Constructor. Initializes Preconditioner data structures
*/
- Preconditioner (const libMesh::Parallel::Communicator &comm /*= libMesh::CommWorld*/);
+ Preconditioner (const libMesh::Parallel::Communicator &comm);
/**
* Destructor.
@@ -78,7 +78,8 @@ class Preconditioner : public ReferenceCountedObject<Preconditioner<T> >,
* Builds a \p Preconditioner using the linear solver package specified by
* \p solver_package
*/
- static Preconditioner<T> * build(const libMesh::Parallel::Communicator &comm /* = libMesh::CommWorld */,
+ static Preconditioner<T> * build(const libMesh::Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD,
const SolverPackage solver_package = libMesh::default_solver_package());
/**
View
3  include/numerics/shell_matrix.h
@@ -51,7 +51,8 @@ class ShellMatrix : public ReferenceCountedObject<ShellMatrix<T> >,
/**
* Constructor; does nothing.
*/
- ShellMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ ShellMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor.
View
4 include/numerics/sparse_matrix.h
@@ -81,7 +81,9 @@ class SparseMatrix : public ReferenceCountedObject<SparseMatrix<T> >,
* the matrix before usage with
* \p init(...).
*/
- SparseMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ explicit
+ SparseMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor. Free all memory, but do not
View
6 include/numerics/sum_shell_matrix.h
@@ -51,14 +51,16 @@ class SumShellMatrix : public ShellMatrix<T>
* in an error. However, an empty sum is allowed to be multiplied
* with a vector and will give the expected result.
*/
- SumShellMatrix (const Parallel::Communicator &comm = libMesh::CommWorld);
+ SumShellMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Constructor that passes a vector of shell matrices.
*/
explicit
SumShellMatrix (const std::vector<ShellMatrix<T>*>& mat,
- const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor.
View
6 include/numerics/trilinos_epetra_matrix.h
@@ -72,7 +72,8 @@ class EpetraMatrix : public SparseMatrix<T>
* the matrix before usage with
* \p init(...).
*/
- EpetraMatrix (const Parallel::Communicator &comm /* = libMesh::CommWorld*/);
+ EpetraMatrix (const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Constructor. Creates a EpetraMatrix assuming you already
@@ -82,7 +83,8 @@ class EpetraMatrix : public SparseMatrix<T>
* and to simply provide additional functionality with the EpetraMatrix.
*/
EpetraMatrix (Epetra_FECrsMatrix * m,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor. Free all memory, but do not
View
65 include/numerics/trilinos_epetra_vector.h
@@ -65,36 +65,36 @@ class EpetraVector : public NumericVector<T>
* Dummy-Constructor. Dimension=0
*/
explicit
- EpetraVector (const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ EpetraVector (const Parallel::Communicator &comm,
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set dimension to \p n and initialize all elements with zero.
*/
explicit
- EpetraVector (const numeric_index_type n,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ EpetraVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global dimension
* to \p n, and initialize all elements with zero.
*/
- EpetraVector (const numeric_index_type n,
+ EpetraVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
const numeric_index_type n_local,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Set local dimension to \p n_local, the global
* dimension to \p n, but additionally reserve memory for the
* indices specified by the \p ghost argument.
*/
- EpetraVector (const numeric_index_type N,
+ EpetraVector (const Parallel::Communicator &comm,
+ const numeric_index_type N,
const numeric_index_type n_local,
const std::vector<numeric_index_type>& ghost,
- const ParallelType type = AUTOMATIC,
- const Parallel::Communicator &comm = libMesh::CommWorld);
+ const ParallelType type = AUTOMATIC);
/**
* Constructor. Creates a EpetraVector assuming you already have a
@@ -104,7 +104,8 @@ class EpetraVector : public NumericVector<T>
* and to simply provide additional functionality with the EpetraVector.
*/
EpetraVector(Epetra_Vector & v,
- const Parallel::Communicator &comm /* = libMesh::CommWorld */);
+ const Parallel::Communicator &comm
+ LIBMESH_CAN_DEFAULT_TO_COMMWORLD);
/**
* Destructor, deallocates memory. Made virtual to allow
@@ -625,9 +626,9 @@ class EpetraVector : public NumericVector<T>
template <typename T>
inline
-EpetraVector<T>::EpetraVector (const ParallelType type,
- const Parallel::Communicator &comm)
-: NumericVector<T>(type, comm),
+EpetraVector<T>::EpetraVector (const Parallel::Communicator &comm,
+ const ParallelType type)
+: NumericVector<T>(comm, type),
_destroy_vec_on_exit(true),
myFirstID_(0),
myNumIDs_(0),
@@ -647,10 +648,10 @@ EpetraVector<T>::EpetraVector (const ParallelType type,
template <typename T>
inline
-EpetraVector<T>::EpetraVector (const numeric_index_type n,
- const ParallelType type,
- const Parallel::Communicator &comm)
-: NumericVector<T>(type, comm),
+EpetraVector<T>::EpetraVector (const Parallel::Communicator &comm,
+ const numeric_index_type n,
+ const ParallelType type)
+: NumericVector<T>(comm, type),
_destroy_vec_on_exit(true),
myFirstID_(0),
myNumIDs_(0),
@@ -671,11 +672,11 @@ EpetraVector<T>::EpetraVector (const numeric_index_type n,
template <typename T>
inline