From: Wolfgang Bangerth Date: Fri, 25 Aug 2017 19:34:35 +0000 (-0600) Subject: Don't make GrowingVectorMemory objects 'static'. X-Git-Tag: v9.0.0-rc1~1149^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6df8e1cf83c82e9a4b98fc0484d5d364d60c6429;p=dealii.git Don't make GrowingVectorMemory objects 'static'. --- diff --git a/include/deal.II/lac/block_linear_operator.h b/include/deal.II/lac/block_linear_operator.h index 2fcc737cf5..b3a67fee94 100644 --- a/include/deal.II/lac/block_linear_operator.h +++ b/include/deal.II/lac/block_linear_operator.h @@ -758,7 +758,7 @@ block_forward_substitution(const BlockLinearOperator vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer tmp (vector_memory); diagonal_inverse.block(0, 0).vmult_add(v.block(0), u.block(0)); @@ -865,7 +865,7 @@ block_back_substitution(const BlockLinearOperator & ExcDimensionMismatch(diagonal_inverse.n_block_cols(), m)); Assert(v.n_blocks() == m, ExcDimensionMismatch(v.n_blocks(), m)); Assert(u.n_blocks() == m, ExcDimensionMismatch(u.n_blocks(), m)); - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer tmp (vector_memory); if (m == 0) diff --git a/include/deal.II/lac/constrained_linear_operator.h b/include/deal.II/lac/constrained_linear_operator.h index 5d4c70ba12..0c4d38a883 100644 --- a/include/deal.II/lac/constrained_linear_operator.h +++ b/include/deal.II/lac/constrained_linear_operator.h @@ -317,7 +317,7 @@ constrained_right_hand_side(const ConstraintMatrix &constraint_matrix, distribute_constraints_linear_operator(constraint_matrix, linop); const auto Ct = transpose_operator(C); - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer k (vector_memory); linop.reinit_domain_vector(*k, /*bool fast=*/ false); constraint_matrix.distribute(*k); diff --git a/include/deal.II/lac/linear_operator.h b/include/deal.II/lac/linear_operator.h index afa1273802..a897d037dc 100644 --- a/include/deal.II/lac/linear_operator.h +++ b/include/deal.II/lac/linear_operator.h @@ -580,7 +580,7 @@ operator*(const LinearOperator &first_op, return_op.vmult = [first_op, second_op](Range &v, const Domain &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); second_op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -590,7 +590,7 @@ operator*(const LinearOperator &first_op, return_op.vmult_add = [first_op, second_op](Range &v, const Domain &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); second_op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -600,7 +600,7 @@ operator*(const LinearOperator &first_op, return_op.Tvmult = [first_op, second_op](Domain &v, const Range &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); first_op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -610,7 +610,7 @@ operator*(const LinearOperator &first_op, return_op.Tvmult_add = [first_op, second_op](Domain &v, const Range &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); first_op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -695,7 +695,7 @@ inverse_operator(const LinearOperator &op, return_op.vmult_add = [op, &solver, &preconditioner](Range &v, const Domain &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer v2 (vector_memory); op.reinit_range_vector(*v2, /*bool omit_zeroing_entries =*/ false); @@ -712,7 +712,7 @@ inverse_operator(const LinearOperator &op, return_op.Tvmult_add = [op, &solver, &preconditioner](Range &v, const Domain &u) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer v2 (vector_memory); op.reinit_range_vector(*v2, /*bool omit_zeroing_entries =*/ false); @@ -1033,7 +1033,7 @@ namespace void apply_with_intermediate_storage(Function function, Range &v, const Domain &u, bool add) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); i->reinit(v, /*bool omit_zeroing_entries =*/true); diff --git a/include/deal.II/lac/packaged_operation.h b/include/deal.II/lac/packaged_operation.h index e801def071..053a6c9da4 100644 --- a/include/deal.II/lac/packaged_operation.h +++ b/include/deal.II/lac/packaged_operation.h @@ -748,7 +748,7 @@ operator*(const LinearOperator &op, return_comp.apply = [op, comp](Domain &v) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); op.reinit_domain_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -759,7 +759,7 @@ operator*(const LinearOperator &op, return_comp.apply_add = [op, comp](Domain &v) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -794,7 +794,7 @@ operator*(const PackagedOperation &comp, return_comp.apply = [op, comp](Domain &v) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true); @@ -805,7 +805,7 @@ operator*(const PackagedOperation &comp, return_comp.apply_add = [op, comp](Domain &v) { - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; typename VectorMemory::Pointer i (vector_memory); op.reinit_range_vector(*i, /*bool omit_zeroing_entries =*/ true); diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index 1808b8b8f9..3a4e008675 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -2972,7 +2972,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // Initialize intermediate vector @@ -3006,7 +3006,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // These operators may themselves be transposed or not, so we let them @@ -3051,7 +3051,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // Initialize intermediate vector @@ -3085,7 +3085,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // These operators may themselves be transposed or not, so we let them @@ -3149,7 +3149,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // Initialize intermediate vector @@ -3181,7 +3181,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // These operators may themselves be transposed or not, so we let them @@ -3223,7 +3223,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // Initialize intermediate vector @@ -3255,7 +3255,7 @@ namespace TrilinosWrappers { // Duplicated from LinearOperator::operator* // TODO: Template the constructor on GrowingVectorMemory vector type? - static GrowingVectorMemory vector_memory; + GrowingVectorMemory vector_memory; GVMVectorType *i = vector_memory.alloc(); // These operators may themselves be transposed or not, so we let them