From: David Wells Date: Sat, 24 Oct 2015 21:12:38 +0000 (-0400) Subject: VECTOR to VectorType, part 1 X-Git-Tag: v8.4.0-rc2~230^2~17 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d898e990a4e165fac34ac425329f0ca1f8a476f5;p=dealii.git VECTOR to VectorType, part 1 --- diff --git a/include/deal.II/algorithms/newton.h b/include/deal.II/algorithms/newton.h index 2e2fb3cd71..f85aa1d41c 100644 --- a/include/deal.II/algorithms/newton.h +++ b/include/deal.II/algorithms/newton.h @@ -63,15 +63,15 @@ namespace Algorithms * * @author Guido Kanschat, 2006, 2010 */ - template - class Newton : public Operator + template + class Newton : public Operator { public: /** * Constructor, receiving the applications computing the residual and * solving the linear problem, respectively. */ - Newton (Operator &residual, Operator &inverse_derivative); + Newton (Operator &residual, Operator &inverse_derivative); /** * Declare the parameters applicable to Newton's method. @@ -86,7 +86,7 @@ namespace Algorithms /** * Initialize the pointer data_out for debugging. */ - void initialize (OutputOperator &output); + void initialize (OutputOperator &output); /** * The actual Newton iteration. The initial value is in out(0), @@ -112,18 +112,18 @@ namespace Algorithms /** * The operator computing the residual. */ - SmartPointer, Newton > residual; + SmartPointer, Newton > residual; /** * The operator applying the inverse derivative to the residual. */ - SmartPointer, Newton > inverse_derivative; + SmartPointer, Newton > inverse_derivative; /** * The operator handling the output in case the debug_vectors is true. * Call the initialize function first. */ - SmartPointer, Newton > data_out; + SmartPointer, Newton > data_out; /** * This flag is set by the function assemble(), indicating that the matrix diff --git a/include/deal.II/algorithms/newton.templates.h b/include/deal.II/algorithms/newton.templates.h index 4d5b2ad232..aa2622e266 100644 --- a/include/deal.II/algorithms/newton.templates.h +++ b/include/deal.II/algorithms/newton.templates.h @@ -27,8 +27,8 @@ DEAL_II_NAMESPACE_OPEN namespace Algorithms { - template - Newton::Newton(Operator &residual, Operator &inverse_derivative) + template + Newton::Newton(Operator &residual, Operator &inverse_derivative) : residual(&residual), inverse_derivative(&inverse_derivative), assemble_now(false), @@ -39,9 +39,9 @@ namespace Algorithms {} - template + template void - Newton::declare_parameters(ParameterHandler ¶m) + Newton::declare_parameters(ParameterHandler ¶m) { param.enter_subsection("Newton"); ReductionControl::declare_parameters (param); @@ -52,9 +52,9 @@ namespace Algorithms param.leave_subsection(); } - template + template void - Newton::parse_parameters (ParameterHandler ¶m) + Newton::parse_parameters (ParameterHandler ¶m) { param.enter_subsection("Newton"); control.parse_parameters (param); @@ -64,25 +64,25 @@ namespace Algorithms param.leave_subsection (); } - template + template void - Newton::initialize (OutputOperator &output) + Newton::initialize (OutputOperator &output) { data_out = &output; } - template + template void - Newton::notify(const Event &e) + Newton::notify(const Event &e) { residual->notify(e); inverse_derivative->notify(e); } - template + template double - Newton::threshold(const double thr) + Newton::threshold(const double thr) { const double t = assemble_threshold; assemble_threshold = thr; @@ -90,33 +90,33 @@ namespace Algorithms } - template + template void - Newton::operator() (AnyData &out, const AnyData &in) + Newton::operator() (AnyData &out, const AnyData &in) { Assert (out.size() == 1, ExcNotImplemented()); deallog.push ("Newton"); - VECTOR &u = *out.entry(0); + VectorType &u = *out.entry(0); if (debug>2) deallog << "u: " << u.l2_norm() << std::endl; - GrowingVectorMemory mem; - typename VectorMemory::Pointer Du(mem); - typename VectorMemory::Pointer res(mem); + GrowingVectorMemory mem; + typename VectorMemory::Pointer Du(mem); + typename VectorMemory::Pointer res(mem); res->reinit(u); AnyData src1; AnyData src2; - src1.add(&u, "Newton iterate"); + src1.add(&u, "Newton iterate"); src1.merge(in); - src2.add(res, "Newton residual"); + src2.add(res, "Newton residual"); src2.merge(src1); AnyData out1; - out1.add(res, "Residual"); + out1.add(res, "Residual"); AnyData out2; - out2.add(Du, "Update"); + out2.add(Du, "Update"); unsigned int step = 0; // fill res with (f(u), v) @@ -127,12 +127,12 @@ namespace Algorithms if (debug_vectors) { AnyData out; - VECTOR *p = &u; - out.add(p, "solution"); + VectorType *p = &u; + out.add(p, "solution"); p = Du; - out.add(p, "update"); + out.add(p, "update"); p = res; - out.add(p, "residual"); + out.add(p, "residual"); *data_out << step; *data_out << out; } @@ -158,12 +158,12 @@ namespace Algorithms if (debug_vectors) { AnyData out; - VECTOR *p = &u; - out.add(p, "solution"); + VectorType *p = &u; + out.add(p, "solution"); p = Du; - out.add(p, "update"); + out.add(p, "update"); p = res; - out.add(p, "residual"); + out.add(p, "residual"); *data_out << step; *data_out << out; } diff --git a/include/deal.II/algorithms/operator.h b/include/deal.II/algorithms/operator.h index d9434abc4d..5602b4f743 100644 --- a/include/deal.II/algorithms/operator.h +++ b/include/deal.II/algorithms/operator.h @@ -125,7 +125,7 @@ namespace Algorithms * * @author Guido Kanschat, 2010 */ - template + template class Operator : public OperatorBase { public: @@ -138,10 +138,10 @@ namespace Algorithms * * @author Guido Kanschat, 2010 */ - template + template class OutputOperator : public Subscriptor { - OutputOperator(const OutputOperator &); + OutputOperator(const OutputOperator &); public: OutputOperator (); /** @@ -161,7 +161,7 @@ namespace Algorithms /** * Output all the vectors in AnyData. */ - virtual OutputOperator &operator<< (const AnyData &vectors); + virtual OutputOperator &operator<< (const AnyData &vectors); protected: unsigned int step; @@ -169,10 +169,10 @@ namespace Algorithms std::ostream *os; }; - template + template inline void - OutputOperator::set_step (const unsigned int s) + OutputOperator::set_step (const unsigned int s) { step = s; } @@ -183,10 +183,10 @@ namespace Algorithms * * @relates OutputOperator */ - template + template inline - OutputOperator & - operator<< (OutputOperator &out, unsigned int step) + OutputOperator & + operator<< (OutputOperator &out, unsigned int step) { out.set_step(step); return out; diff --git a/include/deal.II/algorithms/operator.templates.h b/include/deal.II/algorithms/operator.templates.h index 3ca22c1ac6..c0b65a778b 100644 --- a/include/deal.II/algorithms/operator.templates.h +++ b/include/deal.II/algorithms/operator.templates.h @@ -21,36 +21,36 @@ DEAL_II_NAMESPACE_OPEN namespace Algorithms { - template - Operator::Operator() + template + Operator::Operator() {} - template - OutputOperator::~OutputOperator() + template + OutputOperator::~OutputOperator() {} - template - OutputOperator::OutputOperator() + template + OutputOperator::OutputOperator() : os(0) {} - template - void OutputOperator::initialize_stream(std::ostream &stream) + template + void OutputOperator::initialize_stream(std::ostream &stream) { os =&stream; } - template - OutputOperator & - OutputOperator::operator<< (const AnyData &vectors) + template + OutputOperator & + OutputOperator::operator<< (const AnyData &vectors) { if (os == 0) { deallog << "Step " << step << std::endl; for (unsigned int i=0; i(i); + const VectorType *v = vectors.try_read_ptr(i); if (v == 0) continue; deallog << vectors.name(i); for (unsigned int j=0; jsize(); ++j) @@ -64,7 +64,7 @@ namespace Algorithms (*os) << ' ' << step; for (unsigned int i=0; i(i); + const VectorType *v = vectors.try_read_ptr(i); if (v == 0) continue; for (unsigned int j=0; jsize(); ++j) (*os) << ' ' << (*v)(j); diff --git a/include/deal.II/algorithms/theta_timestepping.h b/include/deal.II/algorithms/theta_timestepping.h index aaef17882d..423c078c78 100644 --- a/include/deal.II/algorithms/theta_timestepping.h +++ b/include/deal.II/algorithms/theta_timestepping.h @@ -186,8 +186,8 @@ namespace Algorithms * @author Guido Kanschat * @date 2010 */ - template - class ThetaTimestepping : public Operator + template + class ThetaTimestepping : public Operator { public: /** @@ -195,8 +195,8 @@ namespace Algorithms * #op_implicit. For their meaning, see the description of those * variables. */ - ThetaTimestepping (Operator &op_explicit, - Operator &op_implicit); + ThetaTimestepping (Operator &op_explicit, + Operator &op_implicit); /** * The timestepping scheme. @@ -205,9 +205,9 @@ namespace Algorithms * AnyData objects used as input for the operators #op_explicit and * #op_implicit. * - * @param out in its first argument must contain a pointer to a `VECTOR`, - * which contains the initial value when the operator is called. It - * contains the final value when the operator returns. + * @param out in its first argument must contain a pointer to a VectorType + * instance, which contains the initial value when the operator is + * called. It contains the final value when the operator returns. */ virtual void operator() (AnyData &out, const AnyData &in); @@ -220,7 +220,7 @@ namespace Algorithms * Define an operator which will output the result in each step. Note that * no output will be generated without this. */ - void set_output(OutputOperator &output); + void set_output(OutputOperator &output); /** * Declare parameters in a parameter handler. @@ -309,7 +309,7 @@ namespace Algorithms * vector, $M$ the mass matrix, $F$ the operator in space and $c$ is the * adjusted time step size $(1-\theta) \Delta t$. */ - SmartPointer, ThetaTimestepping > op_explicit; + SmartPointer, ThetaTimestepping > op_explicit; /** * The operator solving the implicit part of the scheme. It will receive @@ -321,60 +321,60 @@ namespace Algorithms * the input data, M the mass matrix, F the operator in * space and c is the adjusted time step size $ \theta \Delta t$ */ - SmartPointer, ThetaTimestepping > op_implicit; + SmartPointer, ThetaTimestepping > op_implicit; /** * The operator writing the output in each time step */ - SmartPointer, ThetaTimestepping > output; + SmartPointer, ThetaTimestepping > output; }; - template + template inline const TimestepData & - ThetaTimestepping::explicit_data () const + ThetaTimestepping::explicit_data () const { return d_explicit; } - template + template inline const TimestepData & - ThetaTimestepping::implicit_data () const + ThetaTimestepping::implicit_data () const { return d_implicit; } - template + template inline TimestepControl & - ThetaTimestepping::timestep_control () + ThetaTimestepping::timestep_control () { return control; } - template + template inline - void ThetaTimestepping::set_output (OutputOperator &out) + void ThetaTimestepping::set_output (OutputOperator &out) { output = &out; } - template + template inline - double ThetaTimestepping::theta () const + double ThetaTimestepping::theta () const { return vtheta; } - template + template inline - double ThetaTimestepping::theta (double new_theta) + double ThetaTimestepping::theta (double new_theta) { const double tmp = vtheta; vtheta = new_theta; @@ -382,9 +382,9 @@ namespace Algorithms } - template + template inline - double ThetaTimestepping::current_time () const + double ThetaTimestepping::current_time () const { return control.now(); } diff --git a/include/deal.II/algorithms/theta_timestepping.templates.h b/include/deal.II/algorithms/theta_timestepping.templates.h index 8f754f491f..71d048d4c8 100644 --- a/include/deal.II/algorithms/theta_timestepping.templates.h +++ b/include/deal.II/algorithms/theta_timestepping.templates.h @@ -23,23 +23,23 @@ DEAL_II_NAMESPACE_OPEN namespace Algorithms { - template - ThetaTimestepping::ThetaTimestepping (Operator &e, Operator &i) + template + ThetaTimestepping::ThetaTimestepping (Operator &e, Operator &i) : vtheta(0.5), adaptive(false), op_explicit(&e), op_implicit(&i) {} - template + template void - ThetaTimestepping::notify(const Event &e) + ThetaTimestepping::notify(const Event &e) { op_explicit->notify(e); op_implicit->notify(e); } - template + template void - ThetaTimestepping::declare_parameters(ParameterHandler ¶m) + ThetaTimestepping::declare_parameters(ParameterHandler ¶m) { param.enter_subsection("ThetaTimestepping"); TimestepControl::declare_parameters (param); @@ -48,9 +48,9 @@ namespace Algorithms param.leave_subsection(); } - template + template void - ThetaTimestepping::parse_parameters (ParameterHandler ¶m) + ThetaTimestepping::parse_parameters (ParameterHandler ¶m) { param.enter_subsection("ThetaTimestepping"); control.parse_parameters (param); @@ -60,17 +60,17 @@ namespace Algorithms } - template + template void - ThetaTimestepping::operator() (AnyData &out, const AnyData &in) + ThetaTimestepping::operator() (AnyData &out, const AnyData &in) { Assert(!adaptive, ExcNotImplemented()); deallog.push ("Theta"); - VECTOR &solution = *out.entry(0); - GrowingVectorMemory mem; - typename VectorMemory::Pointer aux(mem); + VectorType &solution = *out.entry(0); + GrowingVectorMemory mem; + typename VectorMemory::Pointer aux(mem); aux->reinit(solution); control.restart(); @@ -81,7 +81,7 @@ namespace Algorithms // vector associated with the old // timestep AnyData src1; - src1.add(&solution, "Previous iterate"); + src1.add(&solution, "Previous iterate"); src1.add(&d_explicit.time, "Time"); src1.add(&d_explicit.step, "Timestep"); src1.add(&vtheta, "Theta"); @@ -90,10 +90,10 @@ namespace Algorithms AnyData src2; AnyData out1; - out1.add(aux, "Solution"); + out1.add(aux, "Solution"); // The data provided to the inner solver - src2.add(aux, "Previous time"); - src2.add(&solution, "Previous iterate"); + src2.add(aux, "Previous time"); + src2.add(&solution, "Previous iterate"); src2.add(&d_implicit.time, "Time"); src2.add(&d_implicit.step, "Timestep"); src2.add(&vtheta, "Theta"); diff --git a/include/deal.II/base/time_stepping.h b/include/deal.II/base/time_stepping.h index d05db95b37..de353b7e1d 100644 --- a/include/deal.II/base/time_stepping.h +++ b/include/deal.II/base/time_stepping.h @@ -65,7 +65,7 @@ namespace TimeStepping * Abstract class for time stepping methods. These methods assume that the * equation has the form: $ \frac{\partial y}{\partial t} = f(t,y) $. */ - template + template class TimeStepping { public: @@ -84,12 +84,12 @@ namespace TimeStepping * and a vector. The output is the value of function at this point. This * function returns the time at the end of the time step. */ - virtual double evolve_one_time_step( - std::vector > &F, - std::vector > &J_inverse, - double t, - double delta_t, - VECTOR &y) = 0; + virtual double evolve_one_time_step + (std::vector > &F, + std::vector > &J_inverse, + double t, + double delta_t, + VectorType &y) = 0; /** * Empty structure used to store information. @@ -110,8 +110,8 @@ namespace TimeStepping * @author Damien Lebrun-Grandie, Bruno Turcksin * @date 2014 */ - template - class RungeKutta : public TimeStepping + template + class RungeKutta : public TimeStepping { public: /** @@ -134,12 +134,12 @@ namespace TimeStepping * returns the time at the end of the time step. When using Runge-Kutta * methods, @p F and @ J_inverse can only contain one element. */ - double evolve_one_time_step( - std::vector > &F, - std::vector > &J_inverse, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std::vector > &F, + std::vector > &J_inverse, + double t, + double delta_t, + VectorType &y); /** * Purely virtual function. This function is used to advance from time @p @@ -152,12 +152,12 @@ namespace TimeStepping * vector. The output is the value of function at this point. * evolve_one_time_step returns the time at the end of the time step. */ - virtual double evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y) = 0; + virtual double evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y) = 0; protected: /** @@ -187,11 +187,11 @@ namespace TimeStepping * ExplicitRungeKutta is derived from RungeKutta and implement the explicit * methods. */ - template - class ExplicitRungeKutta : public RungeKutta + template + class ExplicitRungeKutta : public RungeKutta { public: - using RungeKutta::evolve_one_time_step; + using RungeKutta::evolve_one_time_step; /** * Default constructor. initialize(runge_kutta_method) needs to be called @@ -220,12 +220,12 @@ namespace TimeStepping * of function at this point. evolve_one_time_step returns the time at the * end of the time step. */ - double evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y); /** * This function is used to advance from time @p t to t+ @p delta_t. This @@ -234,15 +234,16 @@ namespace TimeStepping * methods. evolve_one_time_step returns the time at the end of the time * step. */ - double evolve_one_time_step(std_cxx11::function f, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std_cxx11::function f, + double t, + double delta_t, + VectorType &y); /** * This structure stores the name of the method used. */ - struct Status : public TimeStepping::Status + struct Status : public TimeStepping::Status { runge_kutta_method method; }; @@ -256,11 +257,12 @@ namespace TimeStepping /** * Compute the different stages needed. */ - void compute_stages(std_cxx11::function f, - const double t, - const double delta_t, - const VECTOR &y, - std::vector &f_stages) const; + void compute_stages + (std_cxx11::function f, + const double t, + const double delta_t, + const VectorType &y, + std::vector &f_stages) const; /** * Status structure of the object. @@ -274,11 +276,11 @@ namespace TimeStepping * This class is derived from RungeKutta and implement the implicit methods. * This class works only for Diagonal Implicit Runge-Kutta (DIRK) methods. */ - template - class ImplicitRungeKutta : public RungeKutta + template + class ImplicitRungeKutta : public RungeKutta { public: - using RungeKutta::evolve_one_time_step; + using RungeKutta::evolve_one_time_step; /** * Default constructor. initialize(runge_kutta_method) and @@ -310,12 +312,12 @@ namespace TimeStepping * The output is the value of function at this point. evolve_one_time_step * returns the time at the end of the time step. */ - double evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y); /** * Set the maximum number of iterations and the tolerance used by the @@ -327,7 +329,7 @@ namespace TimeStepping * Structure that stores the name of the method, the number of Newton * iterations and the norm of the residual when exiting the Newton solver. */ - struct Status : public TimeStepping::Status + struct Status : public TimeStepping::Status { runge_kutta_method method; unsigned int n_iterations; @@ -343,31 +345,31 @@ namespace TimeStepping /** * Compute the different stages needed. */ - void compute_stages( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y, - std::vector &f_stages); + void compute_stages + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y, + std::vector &f_stages); /** * Newton solver used for the implicit stages. */ - void newton_solve(std_cxx11::function get_residual, - std_cxx11::function id_minus_tau_J_inverse, - VECTOR &y); + void newton_solve(std_cxx11::function get_residual, + std_cxx11::function id_minus_tau_J_inverse, + VectorType &y); /** * Compute the residual needed by the Newton solver. */ - void compute_residual(std_cxx11::function f, - double t, - double delta_t, - const VECTOR &old_y, - const VECTOR &y, - VECTOR &tendency, - VECTOR &residual) const; + void compute_residual(std_cxx11::function f, + double t, + double delta_t, + const VectorType &old_y, + const VectorType &y, + VectorType &tendency, + VectorType &residual) const; /** * When using SDIRK, there is no need to compute the linear combination of @@ -398,11 +400,11 @@ namespace TimeStepping * This is class is derived from RungeKutta and implement embedded explicit * methods. */ - template - class EmbeddedExplicitRungeKutta : public RungeKutta + template + class EmbeddedExplicitRungeKutta : public RungeKutta { public: - using RungeKutta::evolve_one_time_step; + using RungeKutta::evolve_one_time_step; /** * Default constructor. initialize(runge_kutta_method) and @@ -452,12 +454,12 @@ namespace TimeStepping * value of function at this point. evolve_one_time_step returns the time * at the end of the time step. */ - double evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y); /** * This function is used to advance from time @p t to t+ @p delta_t. This @@ -466,10 +468,11 @@ namespace TimeStepping * methods. evolve_one_time_step returns the time at the end of the time * step. */ - double evolve_one_time_step(std_cxx11::function f, - double t, - double delta_t, - VECTOR &y); + double evolve_one_time_step + (std_cxx11::function f, + double t, + double delta_t, + VectorType &y); /** * Set the parameters necessary for the time adaptation. @@ -487,7 +490,7 @@ namespace TimeStepping * guess of what the next time step should be, and an estimate of the norm * of the error. */ - struct Status : public TimeStepping::Status + struct Status : public TimeStepping::Status { runge_kutta_method method; embedded_runge_kutta_time_step exit_delta_t; @@ -505,11 +508,11 @@ namespace TimeStepping /** * Compute the different stages needed. */ - void compute_stages(std_cxx11::function f, - const double t, - const double delta_t, - const VECTOR &y, - std::vector &f_stages); + void compute_stages(std_cxx11::function f, + const double t, + const double delta_t, + const VectorType &y, + std::vector &f_stages); /** * This parameter is the factor (>1) by which the time step is multiplied @@ -565,7 +568,7 @@ namespace TimeStepping * If the last_same_as_first flag is set to true, the last stage is saved * and reused as the first stage of the next time step. */ - VECTOR *last_stage; + VectorType *last_stage; /** * Status structure of the object. diff --git a/include/deal.II/base/time_stepping.templates.h b/include/deal.II/base/time_stepping.templates.h index 2223d104a4..165bc94a08 100644 --- a/include/deal.II/base/time_stepping.templates.h +++ b/include/deal.II/base/time_stepping.templates.h @@ -28,14 +28,14 @@ namespace TimeStepping // RungeKutta // ---------------------------------------------------------------------- - template - double RungeKutta::evolve_one_time_step( - std::vector > &F, - std::vector > &J_inverse, + template + double RungeKutta::evolve_one_time_step( + std::vector > &F, + std::vector > &J_inverse, double t, double delta_t, - VECTOR &y) + VectorType &y) { AssertThrow(F.size()==0, ExcMessage("RungeKutta methods cannot handle more that one function to integate.")); @@ -51,16 +51,16 @@ namespace TimeStepping // ExplicitRungeKutta // ---------------------------------------------------------------------- - template - ExplicitRungeKutta::ExplicitRungeKutta(runge_kutta_method method) + template + ExplicitRungeKutta::ExplicitRungeKutta(runge_kutta_method method) { initialize(method); } - template - void ExplicitRungeKutta::initialize(runge_kutta_method method) + template + void ExplicitRungeKutta::initialize(runge_kutta_method method) { status.method = method; @@ -135,27 +135,27 @@ namespace TimeStepping - template - double ExplicitRungeKutta::evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function /*id_minus_tau_J_inverse*/, - double t, - double delta_t, - VECTOR &y) + template + double ExplicitRungeKutta::evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function /*id_minus_tau_J_inverse*/, + double t, + double delta_t, + VectorType &y) { return evolve_one_time_step(f,t,delta_t,y); } - template - double ExplicitRungeKutta::evolve_one_time_step( - std_cxx11::function f, - double t, - double delta_t, - VECTOR &y) + template + double ExplicitRungeKutta::evolve_one_time_step + (std_cxx11::function f, + double t, + double delta_t, + VectorType &y) { - std::vector f_stages(this->n_stages,y); + std::vector f_stages(this->n_stages,y); // Compute the different stages needed. compute_stages(f,t,delta_t,y,f_stages); @@ -168,25 +168,25 @@ namespace TimeStepping - template - const typename ExplicitRungeKutta::Status &ExplicitRungeKutta::get_status() const + template + const typename ExplicitRungeKutta::Status &ExplicitRungeKutta::get_status() const { return status; } - template - void ExplicitRungeKutta::compute_stages( - std_cxx11::function f, - const double t, - const double delta_t, - const VECTOR &y, - std::vector &f_stages) const + template + void ExplicitRungeKutta::compute_stages + (std_cxx11::function f, + const double t, + const double delta_t, + const VectorType &y, + std::vector &f_stages) const { for (unsigned int i=0; in_stages; ++i) { - VECTOR Y(y); + VectorType Y(y); for (unsigned int j=0; ja[i][j],f_stages[j]); // Evaluate the function f at the point (t+c[i]*delta_t,Y). @@ -200,12 +200,12 @@ namespace TimeStepping // ImplicitRungeKutta // ---------------------------------------------------------------------- - template - ImplicitRungeKutta::ImplicitRungeKutta(runge_kutta_method method, + template + ImplicitRungeKutta::ImplicitRungeKutta(runge_kutta_method method, unsigned int max_it, double tolerance) : - RungeKutta (), + RungeKutta (), skip_linear_combi(false), max_it(max_it), tolerance(tolerance) @@ -215,8 +215,8 @@ namespace TimeStepping - template - void ImplicitRungeKutta::initialize(runge_kutta_method method) + template + void ImplicitRungeKutta::initialize(runge_kutta_method method) { status.method = method; @@ -278,16 +278,16 @@ namespace TimeStepping - template - double ImplicitRungeKutta::evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, - double t, - double delta_t, - VECTOR &y) + template + double ImplicitRungeKutta::evolve_one_time_step + (std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, + double t, + double delta_t, + VectorType &y) { - VECTOR old_y(y); - std::vector f_stages(this->n_stages,y); + VectorType old_y(y); + std::vector f_stages(this->n_stages,y); // Compute the different stages needed. compute_stages(f,id_minus_tau_J_inverse,t,delta_t,y,f_stages); @@ -304,8 +304,8 @@ namespace TimeStepping - template - void ImplicitRungeKutta::set_newton_solver_parameters(unsigned int max_it_, double tolerance_) + template + void ImplicitRungeKutta::set_newton_solver_parameters(unsigned int max_it_, double tolerance_) { max_it = max_it_; tolerance = tolerance_; @@ -313,34 +313,34 @@ namespace TimeStepping - template - const typename ImplicitRungeKutta::Status &ImplicitRungeKutta::get_status() const + template + const typename ImplicitRungeKutta::Status &ImplicitRungeKutta::get_status() const { return status; } - template - void ImplicitRungeKutta::compute_stages( - std_cxx11::function f, - std_cxx11::function id_minus_tau_J_inverse, + template + void ImplicitRungeKutta::compute_stages( + std_cxx11::function f, + std_cxx11::function id_minus_tau_J_inverse, double t, double delta_t, - VECTOR &y, - std::vector &f_stages) + VectorType &y, + std::vector &f_stages) { - VECTOR z(y); + VectorType z(y); for (unsigned int i=0; in_stages; ++i) { - VECTOR old_y(z); + VectorType old_y(z); for (unsigned int j=0; ja[i][j],f_stages[j]); // Solve the nonlinear system using Newton's method const double new_t = t+this->c[i]*delta_t; const double new_delta_t = this->a[i][i]*delta_t; - newton_solve(std_cxx11::bind(&ImplicitRungeKutta::compute_residual,this,f,new_t,new_delta_t, + newton_solve(std_cxx11::bind(&ImplicitRungeKutta::compute_residual,this,f,new_t,new_delta_t, std_cxx11::cref(old_y),std_cxx11::_1,std_cxx11::ref(f_stages[i]),std_cxx11::_2), std_cxx11::bind(id_minus_tau_J_inverse,new_t,new_delta_t,std_cxx11::_1),y); } @@ -348,13 +348,13 @@ namespace TimeStepping - template - void ImplicitRungeKutta::newton_solve( - std_cxx11::function get_residual, - std_cxx11::function id_minus_tau_J_inverse, - VECTOR &y) + template + void ImplicitRungeKutta::newton_solve( + std_cxx11::function get_residual, + std_cxx11::function id_minus_tau_J_inverse, + VectorType &y) { - VECTOR residual(y); + VectorType residual(y); get_residual(y,residual); unsigned int i=0; const double initial_residual_norm = residual.l2_norm(); @@ -374,15 +374,15 @@ namespace TimeStepping - template - void ImplicitRungeKutta::compute_residual( - std_cxx11::function f, - double t, - double delta_t, - const VECTOR &old_y, - const VECTOR &y, - VECTOR &tendency, - VECTOR &residual) const + template + void ImplicitRungeKutta::compute_residual + (std_cxx11::function f, + double t, + double delta_t, + const VectorType &old_y, + const VectorType &y, + VectorType &tendency, + VectorType &residual) const { // The tendency is stored to save one evaluation of f. tendency = f(t,y); @@ -397,14 +397,15 @@ namespace TimeStepping // EmbeddedExplicitRungeKutta // ---------------------------------------------------------------------- - template - EmbeddedExplicitRungeKutta::EmbeddedExplicitRungeKutta(runge_kutta_method method, - double coarsen_param, - double refine_param, - double min_delta, - double max_delta, - double refine_tol, - double coarsen_tol) + template + EmbeddedExplicitRungeKutta::EmbeddedExplicitRungeKutta + (runge_kutta_method method, + double coarsen_param, + double refine_param, + double min_delta, + double max_delta, + double refine_tol, + double coarsen_tol) : coarsen_param(coarsen_param), refine_param(refine_param), @@ -420,8 +421,8 @@ namespace TimeStepping - template - void EmbeddedExplicitRungeKutta::initialize(runge_kutta_method method) + template + void EmbeddedExplicitRungeKutta::initialize(runge_kutta_method method) { status.method = method; @@ -660,8 +661,8 @@ namespace TimeStepping - template - void EmbeddedExplicitRungeKutta::free_memory() + template + void EmbeddedExplicitRungeKutta::free_memory() { if (last_stage!=NULL) delete last_stage; @@ -671,30 +672,30 @@ namespace TimeStepping - template - double EmbeddedExplicitRungeKutta::evolve_one_time_step( - std_cxx11::function f, - std_cxx11::function /*id_minus_tau_J_inverse*/, + template + double EmbeddedExplicitRungeKutta::evolve_one_time_step( + std_cxx11::function f, + std_cxx11::function /*id_minus_tau_J_inverse*/, double t, double delta_t, - VECTOR &y) + VectorType &y) { return evolve_one_time_step(f,t,delta_t,y); } - template - double EmbeddedExplicitRungeKutta::evolve_one_time_step( - std_cxx11::function f, - double t, double delta_t, VECTOR &y) + template + double EmbeddedExplicitRungeKutta::evolve_one_time_step( + std_cxx11::function f, + double t, double delta_t, VectorType &y) { bool done = false; unsigned int count = 0; double error_norm = 0.; - VECTOR old_y(y); - VECTOR error(y); - std::vector f_stages(this->n_stages,y); + VectorType old_y(y); + VectorType error(y); + std::vector f_stages(this->n_stages,y); while (!done) { @@ -761,7 +762,7 @@ namespace TimeStepping if (last_same_as_first==true) { if (last_stage==NULL) - last_stage = new VECTOR(f_stages.back()); + last_stage = new VectorType(f_stages.back()); else *last_stage = f_stages.back(); } @@ -774,8 +775,8 @@ namespace TimeStepping - template - void EmbeddedExplicitRungeKutta::set_time_adaptation_parameters(double coarsen_param_, + template + void EmbeddedExplicitRungeKutta::set_time_adaptation_parameters(double coarsen_param_, double refine_param_, double min_delta_, double max_delta_, @@ -792,22 +793,22 @@ namespace TimeStepping - template - const typename EmbeddedExplicitRungeKutta::Status &EmbeddedExplicitRungeKutta::get_status() const + template + const typename EmbeddedExplicitRungeKutta::Status &EmbeddedExplicitRungeKutta::get_status() const { return status; } - template - void EmbeddedExplicitRungeKutta::compute_stages( - std_cxx11::function f, + template + void EmbeddedExplicitRungeKutta::compute_stages( + std_cxx11::function f, const double t, const double delta_t, - const VECTOR &y, - std::vector &f_stages) + const VectorType &y, + std::vector &f_stages) { - VECTOR Y(y); + VectorType Y(y); unsigned int i = 0; // If the last stage is the same as the first, we can skip the evaluation diff --git a/include/deal.II/base/vector_slice.h b/include/deal.II/base/vector_slice.h index 919aa4726b..67f5bfd8fd 100644 --- a/include/deal.II/base/vector_slice.h +++ b/include/deal.II/base/vector_slice.h @@ -27,7 +27,7 @@ DEAL_II_NAMESPACE_OPEN * (unsigned int) and a function size() const. * * The use of this object is straightforward. It duplicates the random access - * operator of the VECTOR and adds an offset to every index. + * operator of the VectorType and adds an offset to every index. * * Some precautions have to be taken if it is used for a constant vector: the * VectorSlice object has to be constant, too. The appropriate initialization @@ -44,7 +44,7 @@ DEAL_II_NAMESPACE_OPEN * @ingroup data * @author Guido Kanschat, 2004 */ -template +template class VectorSlice { public: @@ -54,12 +54,12 @@ public: * just put in the vector itself as argument and let this constructor make a * slice for you. */ - VectorSlice(VECTOR &v); + VectorSlice(VectorType &v); /** * The real constructor for a vector slice, allowing you to specify the * start index and the length of the slice. */ - VectorSlice(VECTOR &v, + VectorSlice(VectorType &v, unsigned int start, unsigned int length); @@ -73,39 +73,39 @@ public: * Access an element of the slice using the same interface as * std::vector. */ - typename VECTOR::reference operator[] (unsigned int i); + typename VectorType::reference operator[] (unsigned int i); /** * Access an element of a constant slice using the same interface as * std::vector. */ - typename VECTOR::const_reference operator[] (unsigned int i) const; + typename VectorType::const_reference operator[] (unsigned int i) const; /** * Standard-conforming iterator function. */ - typename VECTOR::iterator begin(); + typename VectorType::iterator begin(); /** * Standard-conforming iterator function. */ - typename VECTOR::const_iterator begin() const; + typename VectorType::const_iterator begin() const; /** * Standard-conforming iterator function. */ - typename VECTOR::iterator end(); + typename VectorType::iterator end(); /** * Standard-conforming iterator function. */ - typename VECTOR::const_iterator end() const; + typename VectorType::const_iterator end() const; private: /** * The vector we extract from. */ - VECTOR &v; + VectorType &v; /** * The start index of the slice. */ @@ -124,12 +124,12 @@ private: * @relates VectorSlice * @author Guido Kanschat, 2004 */ -template +template inline -const VectorSlice -make_slice (VECTOR &v) +const VectorSlice +make_slice (VectorType &v) { - const VectorSlice r(v); + const VectorSlice r(v); return r; } @@ -142,14 +142,14 @@ make_slice (VECTOR &v) * @relates VectorSlice * @author Guido Kanschat, 2004 */ -template +template inline -const VectorSlice -make_slice (VECTOR &v, +const VectorSlice +make_slice (VectorType &v, const unsigned int start, const unsigned int length) { - const VectorSlice r(v, start, length); + const VectorSlice r(v, start, length); return r; } @@ -158,19 +158,19 @@ make_slice (VECTOR &v, //--------------------------------------------------------------------------- -template +template inline -VectorSlice::VectorSlice(VECTOR &v) +VectorSlice::VectorSlice(VectorType &v) : v(v), start(0), length(v.size()) {} -template +template inline -VectorSlice::VectorSlice(VECTOR &v, - unsigned int start, - unsigned int length) +VectorSlice::VectorSlice(VectorType &v, + unsigned int start, + unsigned int length) : v(v), start(start), length(length) { @@ -179,19 +179,19 @@ VectorSlice::VectorSlice(VECTOR &v, } -template +template inline unsigned int -VectorSlice::size() const +VectorSlice::size() const { return length; } -template +template inline -typename VECTOR::reference -VectorSlice::operator[](unsigned int i) +typename VectorType::reference +VectorSlice::operator[](unsigned int i) { Assert ((i::operator[](unsigned int i) } -template +template inline -typename VECTOR::const_reference -VectorSlice::operator[](unsigned int i) const +typename VectorType::const_reference +VectorSlice::operator[](unsigned int i) const { Assert ((i::operator[](unsigned int i) const } -template +template inline -typename VECTOR::const_iterator -VectorSlice::begin() const +typename VectorType::const_iterator +VectorSlice::begin() const { return v.begin()+start; } -template +template inline -typename VECTOR::iterator -VectorSlice::begin() +typename VectorType::iterator +VectorSlice::begin() { return v.begin()+start; } -template +template inline -typename VECTOR::const_iterator -VectorSlice::end() const +typename VectorType::const_iterator +VectorSlice::end() const { return v.begin()+start+length; } -template +template inline -typename VECTOR::iterator -VectorSlice::end() +typename VectorType::iterator +VectorSlice::end() { return v.begin()+start+length; } diff --git a/include/deal.II/distributed/solution_transfer.h b/include/deal.II/distributed/solution_transfer.h index ffcc3c2f45..407fab5483 100644 --- a/include/deal.II/distributed/solution_transfer.h +++ b/include/deal.II/distributed/solution_transfer.h @@ -48,11 +48,11 @@ namespace parallel * interpolate() or deserialize() you need to supply distributed vectors * without ghost elements. * - *

Transferring a solution

Here VECTOR is your favorite vector + *

Transferring a solution

Here VectorType is your favorite vector * type, e.g. PETScWrappers::MPI::Vector, TrilinosWrappers::MPI::Vector, * or corresponding blockvectors. * @code - * SolutionTransfer soltrans(dof_handler); + * SolutionTransfer soltrans(dof_handler); * // flag some cells for refinement * // and coarsening, e.g. * GridRefinement::refine_and_coarsen_fixed_fraction( @@ -69,8 +69,8 @@ namespace parallel * // redistribute dofs, * dof_handler.distribute_dofs (fe); * // and interpolate the solution - * VECTOR interpolated_solution; - * //create VECTOR in the right size here + * VectorType interpolated_solution; + * //create VectorType in the right size here * soltrans.interpolate(interpolated_solution); * @endcode * @@ -85,7 +85,7 @@ namespace parallel * follows: * *@code * - * parallel::distributed::SolutionTransfer sol_trans(dof_handler); + * parallel::distributed::SolutionTransfer sol_trans(dof_handler); * sol_trans.prepare_serialization (vector); * * triangulation.save(filename); @@ -96,7 +96,7 @@ namespace parallel * //[create coarse mesh...] * triangulation.load(filename); * - * parallel::distributed::SolutionTransfer sol_trans(dof_handler); + * parallel::distributed::SolutionTransfer sol_trans(dof_handler); * sol_trans.deserialize (distributed_vector); * @endcode * @@ -112,7 +112,7 @@ namespace parallel * @ingroup distributed * @author Timo Heister, 2009-2011 */ - template > + template > class SolutionTransfer { public: @@ -132,13 +132,13 @@ namespace parallel * includes all vectors that are to be interpolated onto the new * (refined and/or coarsened) grid. */ - void prepare_for_coarsening_and_refinement (const std::vector &all_in); + void prepare_for_coarsening_and_refinement (const std::vector &all_in); /** * Same as previous function but for only one discrete function to be * interpolated. */ - void prepare_for_coarsening_and_refinement (const VECTOR &in); + void prepare_for_coarsening_and_refinement (const VectorType &in); /** * Interpolate the data previously stored in this object before the mesh @@ -147,7 +147,7 @@ namespace parallel * prepare_for_coarsening_and_refinement() and write the result into the * given set of vectors. */ - void interpolate (std::vector &all_out); + void interpolate (std::vector &all_out); /** * Same as the previous function. It interpolates only one function. It @@ -158,7 +158,7 @@ namespace parallel * several functions can be performed in one step by using * interpolate (all_in, all_out) */ - void interpolate (VECTOR &out); + void interpolate (VectorType &out); /** @@ -173,13 +173,13 @@ namespace parallel * on the locally active DoFs (it must be ghosted). See documentation of * this class for more information. */ - void prepare_serialization(const VECTOR &in); + void prepare_serialization(const VectorType &in); /** * Same as the function above, only for a list of vectors. */ - void prepare_serialization(const std::vector &all_in); + void prepare_serialization(const std::vector &all_in); /** @@ -188,25 +188,25 @@ namespace parallel * fully distributed vector without ghost elements. See documentation of * this class for more information. */ - void deserialize(VECTOR &in); + void deserialize(VectorType &in); /** * Same as the function above, only for a list of vectors. */ - void deserialize(std::vector &all_in); + void deserialize(std::vector &all_in); private: /** * Pointer to the degree of freedom handler to work with. */ - SmartPointer > dof_handler; + SmartPointer > dof_handler; /** * A vector that stores pointers to all the vectors we are supposed to * copy over from the old to the new mesh. */ - std::vector input_vectors; + std::vector input_vectors; /** * The offset that the Triangulation has assigned to this object @@ -231,7 +231,7 @@ namespace parallel void unpack_callback(const typename Triangulation::cell_iterator &cell, const typename Triangulation::CellStatus status, const void *data, - std::vector &all_out); + std::vector &all_out); /** diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index b44ddeea70..1cda170a60 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -69,13 +69,13 @@ DEAL_II_NAMESPACE_OPEN * @author Luca Heltai, Marco Tezzele 2013, 2015 */ template , + typename VectorType=Vector, class DH=DoFHandler > class MappingFEField : public Mapping { public: /** - * Constructor. The first argument is a VECTOR that specifies the + * Constructor. The first argument is a VectorType that specifies the * transformation of the domain from the reference to the current * configuration. * @@ -106,14 +106,14 @@ public: * * If an incompatible mask is passed, an exception is thrown. */ - MappingFEField (const DH &euler_dof_handler, - const VECTOR &euler_vector, + MappingFEField (const DH &euler_dof_handler, + const VectorType &euler_vector, const ComponentMask mask=ComponentMask()); /** * Copy constructor. */ - MappingFEField (const MappingFEField &mapping); + MappingFEField (const MappingFEField &mapping); /** * Return a pointer to a copy of the present object. The caller of this copy @@ -489,7 +489,7 @@ private: /** * Reference to the vector of shifts. */ - SmartPointer > euler_vector; + SmartPointer > euler_vector; /** * A FiniteElement object which is only needed in 3D, since it knows how to @@ -498,13 +498,13 @@ private: * prevent construction in 1D and 2D, but since memory and time requirements * are not particularly high this seems unnecessary at the moment. */ - SmartPointer, MappingFEField > fe; + SmartPointer, MappingFEField > fe; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer > euler_dof_handler; + SmartPointer > euler_dof_handler; private: /** diff --git a/include/deal.II/fe/mapping_q1_eulerian.h b/include/deal.II/fe/mapping_q1_eulerian.h index 796a1bd85c..8bbf6421e1 100644 --- a/include/deal.II/fe/mapping_q1_eulerian.h +++ b/include/deal.II/fe/mapping_q1_eulerian.h @@ -82,7 +82,7 @@ DEAL_II_NAMESPACE_OPEN * * @author Michael Stadler, 2001 */ -template , int spacedim=dim > +template , int spacedim=dim > class MappingQ1Eulerian : public MappingQGeneric { public: @@ -97,7 +97,7 @@ public: * problem. Alternatively, the @p Vector can be initialized by * DoFAccessor::set_dof_values(). */ - MappingQ1Eulerian (const VECTOR &euler_transform_vectors, + MappingQ1Eulerian (const VectorType &euler_transform_vectors, const DoFHandler &shiftmap_dof_handler); /** @@ -115,7 +115,7 @@ public: * then assumes ownership of it. */ virtual - MappingQ1Eulerian *clone () const; + MappingQ1Eulerian *clone () const; /** * Always returns @p false because MappingQ1Eulerian does not in general @@ -161,12 +161,12 @@ protected: /** * Reference to the vector of shifts. */ - SmartPointer > euler_transform_vectors; + SmartPointer > euler_transform_vectors; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer,MappingQ1Eulerian > shiftmap_dof_handler; + SmartPointer,MappingQ1Eulerian > shiftmap_dof_handler; }; /*@}*/ @@ -175,10 +175,10 @@ protected: #ifndef DOXYGEN -template +template inline bool -MappingQ1Eulerian::preserves_vertex_locations () const +MappingQ1Eulerian::preserves_vertex_locations () const { return false; } diff --git a/include/deal.II/fe/mapping_q_eulerian.h b/include/deal.II/fe/mapping_q_eulerian.h index a2c57827f6..5295847b64 100644 --- a/include/deal.II/fe/mapping_q_eulerian.h +++ b/include/deal.II/fe/mapping_q_eulerian.h @@ -87,7 +87,7 @@ DEAL_II_NAMESPACE_OPEN * * @author Joshua White, 2008 */ -template , int spacedim=dim > +template , int spacedim=dim > class MappingQEulerian : public MappingQ { public: @@ -104,16 +104,16 @@ public: * interpreted as the displacement we use in defining the mapping, * relative to the location of cells of the underlying triangulation. */ - MappingQEulerian (const unsigned int degree, + MappingQEulerian (const unsigned int degree, const DoFHandler &euler_dof_handler, - const VECTOR &euler_vector); + const VectorType &euler_vector); /** * @deprecated Use the constructor with the reverse order of second and * third argument. */ - MappingQEulerian (const unsigned int degree, - const VECTOR &euler_vector, + MappingQEulerian (const unsigned int degree, + const VectorType &euler_vector, const DoFHandler &euler_dof_handler) DEAL_II_DEPRECATED; /** @@ -165,12 +165,12 @@ protected: /** * Reference to the vector of shifts. */ - SmartPointer > euler_vector; + SmartPointer > euler_vector; /** * Pointer to the DoFHandler to which the mapping vector is associated. */ - SmartPointer,MappingQEulerian > euler_dof_handler; + SmartPointer,MappingQEulerian > euler_dof_handler; private: @@ -261,10 +261,10 @@ private: #ifndef DOXYGEN -template +template inline bool -MappingQEulerian::preserves_vertex_locations () const +MappingQEulerian::preserves_vertex_locations () const { return false; } @@ -276,4 +276,3 @@ DEAL_II_NAMESPACE_CLOSE #endif // dealii__mapping_q_eulerian_h - diff --git a/include/deal.II/lac/arpack_solver.h b/include/deal.II/lac/arpack_solver.h index 42739b43d3..cef7851e2d 100644 --- a/include/deal.II/lac/arpack_solver.h +++ b/include/deal.II/lac/arpack_solver.h @@ -172,15 +172,14 @@ public: * Leave it at its default zero, which will be reset to the size of * eigenvalues internally. */ - template - void solve( - const MATRIX1 &A, - const MATRIX2 &B, - const INVERSE &inverse, - std::vector > &eigenvalues, - std::vector &eigenvectors, - const unsigned int n_eigenvalues = 0); + void solve (const MATRIX1 &A, + const MATRIX2 &B, + const INVERSE &inverse, + std::vector > &eigenvalues, + std::vector &eigenvectors, + const unsigned int n_eigenvalues = 0); protected: @@ -258,16 +257,15 @@ ArpackSolver::ArpackSolver (SolverControl &control, {} -template inline -void ArpackSolver::solve ( - const MATRIX1 &system_matrix, - const MATRIX2 &mass_matrix, - const INVERSE &inverse, - std::vector > &eigenvalues, - std::vector &eigenvectors, - const unsigned int n_eigenvalues) +void ArpackSolver::solve (const MATRIX1 &system_matrix, + const MATRIX2 &mass_matrix, + const INVERSE &inverse, + std::vector > &eigenvalues, + std::vector &eigenvectors, + const unsigned int n_eigenvalues) { //inside the routines of ARPACK the //values change magically, so store @@ -403,7 +401,7 @@ void ArpackSolver::solve ( case -1: { - VECTOR src,dst,tmp; + VectorType src,dst,tmp; src.reinit(eigenvectors[0]); dst.reinit(src); tmp.reinit(src); @@ -425,7 +423,7 @@ void ArpackSolver::solve ( case 1: { - VECTOR src,dst,tmp, tmp2; + VectorType src,dst,tmp, tmp2; src.reinit(eigenvectors[0]); dst.reinit(src); tmp.reinit(src); @@ -447,7 +445,7 @@ void ArpackSolver::solve ( case 2: { - VECTOR src,dst; + VectorType src,dst; src.reinit(eigenvectors[0]); dst.reinit(src); diff --git a/include/deal.II/lac/filtered_matrix.h b/include/deal.II/lac/filtered_matrix.h index f7bfea2a11..306607548b 100644 --- a/include/deal.II/lac/filtered_matrix.h +++ b/include/deal.II/lac/filtered_matrix.h @@ -30,7 +30,7 @@ DEAL_II_NAMESPACE_OPEN template class Vector; -template class FilteredMatrixBlock; +template class FilteredMatrixBlock; /*! @addtogroup Matrix2 @@ -190,7 +190,7 @@ template class FilteredMatrixBlock; * * @author Wolfgang Bangerth 2001, Luca Heltai 2006, Guido Kanschat 2007, 2008 */ -template +template class FilteredMatrix : public Subscriptor { public: @@ -210,8 +210,8 @@ public: * Constructor. Since we use accessors only for read access, a const * matrix pointer is sufficient. */ - Accessor (const FilteredMatrix *matrix, - const size_type index); + Accessor (const FilteredMatrix *matrix, + const size_type index); public: /** @@ -238,7 +238,7 @@ public: /** * The matrix accessed. */ - const FilteredMatrix *matrix; + const FilteredMatrix *matrix; /** * Current row number. @@ -260,8 +260,8 @@ public: /** * Constructor. */ - const_iterator(const FilteredMatrix *matrix, - const size_type index); + const_iterator(const FilteredMatrix *matrix, + const size_type index); /** * Prefix increment. @@ -412,28 +412,28 @@ public: * the second parameter to @p true to use a faster algorithm. Note: This * method is deprecated as matrix_is_symmetric parameter is no longer used. */ - void apply_constraints (VECTOR &v, - const bool matrix_is_symmetric) const DEAL_II_DEPRECATED; + void apply_constraints (VectorType &v, + const bool matrix_is_symmetric) const DEAL_II_DEPRECATED; /** * Apply the constraints to a right hand side vector. This needs to be done * before starting to solve with the filtered matrix. */ - void apply_constraints (VECTOR &v) const; + void apply_constraints (VectorType &v) const; /** * Matrix-vector multiplication: this operation performs pre_filter(), * multiplication with the stored matrix and post_filter() in that order. */ - void vmult (VECTOR &dst, - const VECTOR &src) const; + void vmult (VectorType &dst, + const VectorType &src) const; /** * Matrix-vector multiplication: this operation performs pre_filter(), * transposed multiplication with the stored matrix and post_filter() in * that order. */ - void Tvmult (VECTOR &dst, - const VECTOR &src) const; + void Tvmult (VectorType &dst, + const VectorType &src) const; /** * Adding matrix-vector multiplication. @@ -442,8 +442,8 @@ public: * entries set to zero, independent of the previous value of dst. * We excpect that in most cases this is the required behavior. */ - void vmult_add (VECTOR &dst, - const VECTOR &src) const; + void vmult_add (VectorType &dst, + const VectorType &src) const; /** * Adding transpose matrix-vector multiplication: @@ -452,8 +452,8 @@ public: * entries set to zero, independent of the previous value of dst. * We excpect that in most cases this is the required behavior. */ - void Tvmult_add (VECTOR &dst, - const VECTOR &src) const; + void Tvmult_add (VectorType &dst, + const VectorType &src) const; //@} /** @@ -514,7 +514,7 @@ private: /** * Pointer to the sparsity pattern used for this matrix. */ - std_cxx11::shared_ptr > matrix; + std_cxx11::shared_ptr > matrix; /** * Sorted list of pairs denoting the index of the variable and the value to @@ -526,21 +526,21 @@ private: * Do the pre-filtering step, i.e. zero out those components that belong to * constrained degrees of freedom. */ - void pre_filter (VECTOR &v) const; + void pre_filter (VectorType &v) const; /** * Do the postfiltering step, i.e. set constrained degrees of freedom to the * value of the input vector, as the matrix contains only ones on the * diagonal for these degrees of freedom. */ - void post_filter (const VECTOR &in, - VECTOR &out) const; + void post_filter (const VectorType &in, + VectorType &out) const; friend class Accessor; /** * FilteredMatrixBlock accesses pre_filter() and post_filter(). */ - friend class FilteredMatrixBlock; + friend class FilteredMatrixBlock; }; /*@}*/ @@ -549,11 +549,11 @@ private: //--------------------------------Iterators--------------------------------------// -template +template inline -FilteredMatrix::Accessor::Accessor( - const FilteredMatrix *matrix, - const size_type index) +FilteredMatrix::Accessor::Accessor +(const FilteredMatrix *matrix, + const size_type index) : matrix(matrix), index(index) @@ -564,40 +564,40 @@ FilteredMatrix::Accessor::Accessor( -template +template inline types::global_dof_index -FilteredMatrix::Accessor::row() const +FilteredMatrix::Accessor::row() const { return matrix->constraints[index].first; } -template +template inline types::global_dof_index -FilteredMatrix::Accessor::column() const +FilteredMatrix::Accessor::column() const { return matrix->constraints[index].first; } -template +template inline double -FilteredMatrix::Accessor::value() const +FilteredMatrix::Accessor::value() const { return matrix->constraints[index].second; } -template +template inline void -FilteredMatrix::Accessor::advance() +FilteredMatrix::Accessor::advance() { Assert (index < matrix->constraints.size(), ExcIteratorPastEnd()); ++index; @@ -606,21 +606,21 @@ FilteredMatrix::Accessor::advance() -template +template inline -FilteredMatrix::const_iterator::const_iterator( - const FilteredMatrix *matrix, - const size_type index) +FilteredMatrix::const_iterator::const_iterator +(const FilteredMatrix *matrix, + const size_type index) : accessor(matrix, index) {} -template +template inline -typename FilteredMatrix::const_iterator & -FilteredMatrix::const_iterator::operator++ () +typename FilteredMatrix::const_iterator & +FilteredMatrix::const_iterator::operator++ () { accessor.advance(); return *this; @@ -687,10 +687,10 @@ FilteredMatrix::end () const } -template +template inline bool -FilteredMatrix::PairComparison:: +FilteredMatrix::PairComparison:: operator () (const IndexValuePair &i1, const IndexValuePair &i2) const { @@ -699,29 +699,29 @@ operator () (const IndexValuePair &i1, -template +template template inline void -FilteredMatrix::initialize (const MATRIX &m, bool ecs) +FilteredMatrix::initialize (const MATRIX &m, bool ecs) { - matrix.reset (new_pointer_matrix_base(m, VECTOR())); + matrix.reset (new_pointer_matrix_base(m, VectorType())); expect_constrained_source = ecs; } -template +template inline -FilteredMatrix::FilteredMatrix () +FilteredMatrix::FilteredMatrix () {} -template +template inline -FilteredMatrix::FilteredMatrix (const FilteredMatrix &fm) +FilteredMatrix::FilteredMatrix (const FilteredMatrix &fm) : Subscriptor(), expect_constrained_source(fm.expect_constrained_source), @@ -731,10 +731,10 @@ FilteredMatrix::FilteredMatrix (const FilteredMatrix &fm) -template +template template inline -FilteredMatrix:: +FilteredMatrix:: FilteredMatrix (const MATRIX &m, bool ecs) { initialize (m, ecs); @@ -742,10 +742,10 @@ FilteredMatrix (const MATRIX &m, bool ecs) -template +template inline -FilteredMatrix & -FilteredMatrix::operator = (const FilteredMatrix &fm) +FilteredMatrix & +FilteredMatrix::operator = (const FilteredMatrix &fm) { matrix = fm.matrix; expect_constrained_source = fm.expect_constrained_source; @@ -755,10 +755,10 @@ FilteredMatrix::operator = (const FilteredMatrix &fm) -template +template inline void -FilteredMatrix::add_constraint (const size_type index, const double value) +FilteredMatrix::add_constraint (const size_type index, const double value) { // add new constraint to end constraints.push_back(IndexValuePair(index, value)); @@ -766,11 +766,11 @@ FilteredMatrix::add_constraint (const size_type index, const double valu -template +template template inline void -FilteredMatrix::add_constraints (const ConstraintList &new_constraints) +FilteredMatrix::add_constraints (const ConstraintList &new_constraints) { // add new constraints to end const size_type old_size = constraints.size(); @@ -788,10 +788,10 @@ FilteredMatrix::add_constraints (const ConstraintList &new_constraints) -template +template inline void -FilteredMatrix::clear_constraints () +FilteredMatrix::clear_constraints () { // swap vectors to release memory std::vector empty; @@ -800,10 +800,10 @@ FilteredMatrix::clear_constraints () -template +template inline void -FilteredMatrix::clear () +FilteredMatrix::clear () { clear_constraints(); matrix.reset(); @@ -811,25 +811,24 @@ FilteredMatrix::clear () -template +template inline void -FilteredMatrix::apply_constraints ( - VECTOR &v, - const bool /* matrix_is_symmetric */) const +FilteredMatrix::apply_constraints +(VectorType &v, + const bool /* matrix_is_symmetric */) const { apply_constraints(v); } -template +template inline void -FilteredMatrix::apply_constraints ( - VECTOR &v) const +FilteredMatrix::apply_constraints (VectorType &v) const { - GrowingVectorMemory mem; - typename VectorMemory::Pointer tmp_vector(mem); + GrowingVectorMemory mem; + typename VectorMemory::Pointer tmp_vector(mem); tmp_vector->reinit(v); const_index_value_iterator i = constraints.begin(); const const_index_value_iterator e = constraints.end(); @@ -853,10 +852,10 @@ FilteredMatrix::apply_constraints ( } -template +template inline void -FilteredMatrix::pre_filter (VECTOR &v) const +FilteredMatrix::pre_filter (VectorType &v) const { // iterate over all constraints and // zero out value @@ -868,11 +867,11 @@ FilteredMatrix::pre_filter (VECTOR &v) const -template +template inline void -FilteredMatrix::post_filter (const VECTOR &in, - VECTOR &out) const +FilteredMatrix::post_filter (const VectorType &in, + VectorType &out) const { // iterate over all constraints and // set value correctly @@ -887,15 +886,15 @@ FilteredMatrix::post_filter (const VECTOR &in, -template +template inline void -FilteredMatrix::vmult (VECTOR &dst, const VECTOR &src) const +FilteredMatrix::vmult (VectorType &dst, const VectorType &src) const { if (!expect_constrained_source) { - GrowingVectorMemory mem; - VECTOR *tmp_vector = mem.alloc(); + GrowingVectorMemory mem; + VectorType *tmp_vector = mem.alloc(); // first copy over src vector and // pre-filter tmp_vector->reinit(src, true); @@ -916,15 +915,15 @@ FilteredMatrix::vmult (VECTOR &dst, const VECTOR &src) const -template +template inline void -FilteredMatrix::Tvmult (VECTOR &dst, const VECTOR &src) const +FilteredMatrix::Tvmult (VectorType &dst, const VectorType &src) const { if (!expect_constrained_source) { - GrowingVectorMemory mem; - VECTOR *tmp_vector = mem.alloc(); + GrowingVectorMemory mem; + VectorType *tmp_vector = mem.alloc(); // first copy over src vector and // pre-filter tmp_vector->reinit(src, true); @@ -945,15 +944,15 @@ FilteredMatrix::Tvmult (VECTOR &dst, const VECTOR &src) const -template +template inline void -FilteredMatrix::vmult_add (VECTOR &dst, const VECTOR &src) const +FilteredMatrix::vmult_add (VectorType &dst, const VectorType &src) const { if (!expect_constrained_source) { - GrowingVectorMemory mem; - VECTOR *tmp_vector = mem.alloc(); + GrowingVectorMemory mem; + VectorType *tmp_vector = mem.alloc(); // first copy over src vector and // pre-filter tmp_vector->reinit(src, true); @@ -974,15 +973,15 @@ FilteredMatrix::vmult_add (VECTOR &dst, const VECTOR &src) const -template +template inline void -FilteredMatrix::Tvmult_add (VECTOR &dst, const VECTOR &src) const +FilteredMatrix::Tvmult_add (VectorType &dst, const VectorType &src) const { if (!expect_constrained_source) { - GrowingVectorMemory mem; - VECTOR *tmp_vector = mem.alloc(); + GrowingVectorMemory mem; + VectorType *tmp_vector = mem.alloc(); // first copy over src vector and // pre-filter tmp_vector->reinit(src, true); @@ -1003,10 +1002,10 @@ FilteredMatrix::Tvmult_add (VECTOR &dst, const VECTOR &src) const -template +template inline std::size_t -FilteredMatrix::memory_consumption () const +FilteredMatrix::memory_consumption () const { return (MemoryConsumption::memory_consumption (matrix) + MemoryConsumption::memory_consumption (constraints)); diff --git a/include/deal.II/lac/householder.h b/include/deal.II/lac/householder.h index b306e4946d..da3045a128 100644 --- a/include/deal.II/lac/householder.h +++ b/include/deal.II/lac/householder.h @@ -103,11 +103,11 @@ public: /** * A wrapper to least_squares(), implementing the standard MATRIX interface. */ - template - void vmult (VECTOR &dst, const VECTOR &src) const; + template + void vmult (VectorType &dst, const VectorType &src) const; - template - void Tvmult (VECTOR &dst, const VECTOR &src) const; + template + void Tvmult (VectorType &dst, const VectorType &src) const; private: @@ -295,18 +295,18 @@ Householder::least_squares (BlockVector &dst, template -template +template void -Householder::vmult (VECTOR &dst, const VECTOR &src) const +Householder::vmult (VectorType &dst, const VectorType &src) const { least_squares (dst, src); } template -template +template void -Householder::Tvmult (VECTOR &, const VECTOR &) const +Householder::Tvmult (VectorType &, const VectorType &) const { Assert(false, ExcNotImplemented()); } @@ -318,4 +318,3 @@ Householder::Tvmult (VECTOR &, const VECTOR &) const DEAL_II_NAMESPACE_CLOSE #endif - diff --git a/include/deal.II/lac/iterative_inverse.h b/include/deal.II/lac/iterative_inverse.h index dbbf17ccfc..0fb7db5b74 100644 --- a/include/deal.II/lac/iterative_inverse.h +++ b/include/deal.II/lac/iterative_inverse.h @@ -75,7 +75,7 @@ DEAL_II_NAMESPACE_OPEN * @author Guido Kanschat * @date 2010 */ -template +template class IterativeInverse : public Subscriptor { public: @@ -94,7 +94,7 @@ public: /** * Solve for right hand side src. */ - void vmult (VECTOR &dst, const VECTOR &src) const; + void vmult (VectorType &dst, const VectorType &src) const; /** * Solve for right hand side src, but allow for the fact that the @@ -108,47 +108,47 @@ public: * The solver, which allows selection of the actual solver as well as * adjustment of parameters. */ - SolverSelector solver; + SolverSelector solver; private: /** * The matrix in use. */ - std_cxx11::shared_ptr > matrix; + std_cxx11::shared_ptr > matrix; /** * The preconditioner to use. */ - std_cxx11::shared_ptr > preconditioner; + std_cxx11::shared_ptr > preconditioner; }; -template +template template inline void -IterativeInverse::initialize(const MATRIX &m, const PRECONDITION &p) +IterativeInverse::initialize(const MATRIX &m, const PRECONDITION &p) { // dummy variable - VECTOR *v = 0; - matrix = std_cxx11::shared_ptr > (new_pointer_matrix_base(m, *v)); - preconditioner = std_cxx11::shared_ptr > (new_pointer_matrix_base(p, *v)); + VectorType *v = 0; + matrix = std_cxx11::shared_ptr > (new_pointer_matrix_base(m, *v)); + preconditioner = std_cxx11::shared_ptr > (new_pointer_matrix_base(p, *v)); } -template +template inline void -IterativeInverse::clear() +IterativeInverse::clear() { matrix = 0; preconditioner = 0; } -template +template inline void -IterativeInverse::vmult (VECTOR &dst, const VECTOR &src) const +IterativeInverse::vmult (VectorType &dst, const VectorType &src) const { Assert(matrix.get() != 0, ExcNotInitialized()); Assert(preconditioner.get() != 0, ExcNotInitialized()); @@ -157,16 +157,16 @@ IterativeInverse::vmult (VECTOR &dst, const VECTOR &src) const } -template +template template inline void -IterativeInverse::vmult (VECTOR2 &dst, const VECTOR2 &src) const +IterativeInverse::vmult (VECTOR2 &dst, const VECTOR2 &src) const { Assert(matrix.get() != 0, ExcNotInitialized()); Assert(preconditioner.get() != 0, ExcNotInitialized()); - GrowingVectorMemory mem; - typename VectorMemory::Pointer sol(mem); - typename VectorMemory::Pointer rhs(mem); + GrowingVectorMemory mem; + typename VectorMemory::Pointer sol(mem); + typename VectorMemory::Pointer rhs(mem); sol->reinit(dst); *rhs = src; solver.solve(*matrix, *sol, *rhs, *preconditioner); @@ -178,5 +178,3 @@ IterativeInverse::vmult (VECTOR2 &dst, const VECTOR2 &src) const DEAL_II_NAMESPACE_CLOSE #endif - - diff --git a/include/deal.II/lac/matrix_block.h b/include/deal.II/lac/matrix_block.h index 79d170296b..59a51810b3 100644 --- a/include/deal.II/lac/matrix_block.h +++ b/include/deal.II/lac/matrix_block.h @@ -235,32 +235,32 @@ public: * No index computations are done, thus, the vectors need to have sizes * matching #matrix. */ - template - void vmult (VECTOR &w, const VECTOR &v) const; + template + void vmult (VectorType &w, const VectorType &v) const; /** * Matrix-vector-multiplication, forwarding to the same function in MATRIX. * No index computations are done, thus, the vectors need to have sizes * matching #matrix. */ - template - void vmult_add (VECTOR &w, const VECTOR &v) const; + template + void vmult_add (VectorType &w, const VectorType &v) const; /** * Matrix-vector-multiplication, forwarding to the same function in MATRIX. * No index computations are done, thus, the vectors need to have sizes * matching #matrix. */ - template - void Tvmult (VECTOR &w, const VECTOR &v) const; + template + void Tvmult (VectorType &w, const VectorType &v) const; /** * Matrix-vector-multiplication, forwarding to the same function in MATRIX. * No index computations are done, thus, the vectors need to have sizes * matching #matrix. */ - template - void Tvmult_add (VECTOR &w, const VECTOR &v) const; + template + void Tvmult_add (VectorType &w, const VectorType &v) const; /** * The memory used by this object. @@ -767,40 +767,40 @@ MatrixBlock::add (const size_type row, template -template +template inline void -MatrixBlock::vmult (VECTOR &w, const VECTOR &v) const +MatrixBlock::vmult (VectorType &w, const VectorType &v) const { matrix.vmult(w,v); } template -template +template inline void -MatrixBlock::vmult_add (VECTOR &w, const VECTOR &v) const +MatrixBlock::vmult_add (VectorType &w, const VectorType &v) const { matrix.vmult_add(w,v); } template -template +template inline void -MatrixBlock::Tvmult (VECTOR &w, const VECTOR &v) const +MatrixBlock::Tvmult (VectorType &w, const VectorType &v) const { matrix.Tvmult(w,v); } template -template +template inline void -MatrixBlock::Tvmult_add (VECTOR &w, const VECTOR &v) const +MatrixBlock::Tvmult_add (VectorType &w, const VectorType &v) const { matrix.Tvmult_add(w,v); } diff --git a/include/deal.II/lac/parpack_solver.h b/include/deal.II/lac/parpack_solver.h index aa64d78d4f..5da03105c2 100644 --- a/include/deal.II/lac/parpack_solver.h +++ b/include/deal.II/lac/parpack_solver.h @@ -127,7 +127,7 @@ extern "C" { * * @author Denis Davydov, 2015. */ -template +template class PArpackSolver : public Subscriptor { public: @@ -179,7 +179,7 @@ public: /** * Apply A-sigma * B */ - void vmult (VECTOR &dst, const VECTOR &src) const + void vmult (VectorType &dst, const VectorType &src) const { B.vmult(dst,src); dst *= (-sigma); @@ -189,7 +189,7 @@ public: /** * Apply A^T-sigma * B^T */ - void Tvmult (VECTOR &dst, const VECTOR &src) const + void Tvmult (VectorType &dst, const VectorType &src) const { B.Tvmult(dst,src); dst *= (-sigma); @@ -246,13 +246,13 @@ public: */ template - void solve( - const MATRIX1 &A, - const MATRIX2 &B, - const INVERSE &inverse, - std::vector > &eigenvalues, - std::vector &eigenvectors, - const unsigned int n_eigenvalues); + void solve + (const MATRIX1 &A, + const MATRIX2 &B, + const INVERSE &inverse, + std::vector > &eigenvalues, + std::vector &eigenvectors, + const unsigned int n_eigenvalues); std::size_t memory_consumption() const; @@ -356,7 +356,7 @@ protected: /** * Temporary vectors used between Arpack and deal.II */ - VECTOR src,dst,tmp; + VectorType src,dst,tmp; /** * Indices of local degrees of freedom. @@ -422,9 +422,9 @@ private: << " Arnoldi vectors."); }; -template +template std::size_t -PArpackSolver::memory_consumption() const +PArpackSolver::memory_consumption() const { return MemoryConsumption::memory_consumption (double()) * (workl.size() + @@ -439,21 +439,21 @@ PArpackSolver::memory_consumption() const MemoryConsumption::memory_consumption (types::global_dof_index()) * local_indices.size(); } -template -PArpackSolver::AdditionalData:: -AdditionalData (const unsigned int number_of_arnoldi_vectors, +template +PArpackSolver::AdditionalData:: +AdditionalData (const unsigned int number_of_arnoldi_vectors, const WhichEigenvalues eigenvalue_of_interest, - const bool symmetric) + const bool symmetric) : number_of_arnoldi_vectors(number_of_arnoldi_vectors), eigenvalue_of_interest(eigenvalue_of_interest), symmetric(symmetric) {} -template -PArpackSolver::PArpackSolver (SolverControl &control, - const MPI_Comm &mpi_communicator, - const AdditionalData &data) +template +PArpackSolver::PArpackSolver (SolverControl &control, + const MPI_Comm &mpi_communicator, + const AdditionalData &data) : solver_control (control), additional_data (data), @@ -463,14 +463,14 @@ PArpackSolver::PArpackSolver (SolverControl &control, {} -template -void PArpackSolver::set_shift(const double s ) +template +void PArpackSolver::set_shift(const double s ) { shift_value = s; } -template -void PArpackSolver::reinit(const dealii::IndexSet &locally_owned_dofs) +template +void PArpackSolver::reinit(const dealii::IndexSet &locally_owned_dofs) { // store local indices to write to vectors locally_owned_dofs.fill_index_vector(local_indices); @@ -516,15 +516,15 @@ void PArpackSolver::reinit(const dealii::IndexSet &locally_owned_dofs) } -template +template template -void PArpackSolver::solve ( - const MATRIX1 &/*system_matrix*/, - const MATRIX2 &mass_matrix, - const INVERSE &inverse, - std::vector > &eigenvalues, - std::vector &eigenvectors, - const unsigned int n_eigenvalues) +void PArpackSolver::solve +(const MATRIX1 &/*system_matrix*/, + const MATRIX2 &mass_matrix, + const INVERSE &inverse, + std::vector > &eigenvalues, + std::vector &eigenvectors, + const unsigned int n_eigenvalues) { Assert (n_eigenvalues <= eigenvectors.size(), @@ -863,8 +863,8 @@ void PArpackSolver::solve ( } -template -SolverControl &PArpackSolver::control () const +template +SolverControl &PArpackSolver::control () const { return solver_control; } diff --git a/include/deal.II/lac/pointer_matrix.h b/include/deal.II/lac/pointer_matrix.h index 708f595e1c..ed0088c0ee 100644 --- a/include/deal.II/lac/pointer_matrix.h +++ b/include/deal.II/lac/pointer_matrix.h @@ -23,7 +23,7 @@ DEAL_II_NAMESPACE_OPEN -template class VectorMemory; +template class VectorMemory; class IdentityMatrix; template class FullMatrix; @@ -47,7 +47,7 @@ template class BlockMatrixArray; * * @author Guido Kanschat, 2000, 2001, 2002 */ -template +template class PointerMatrixBase : public Subscriptor { public: @@ -59,7 +59,7 @@ public: * This was defined to make this matrix a possible template argument to * BlockMatrixArray. */ - typedef typename VECTOR::value_type value_type; + typedef typename VectorType::value_type value_type; /** * Virtual destructor. Does nothing except making sure that the destructor @@ -76,26 +76,26 @@ public: /** * Matrix-vector product. */ - virtual void vmult (VECTOR &dst, - const VECTOR &src) const = 0; + virtual void vmult (VectorType &dst, + const VectorType &src) const = 0; /** * Transposed matrix-vector product. */ - virtual void Tvmult (VECTOR &dst, - const VECTOR &src) const = 0; + virtual void Tvmult (VectorType &dst, + const VectorType &src) const = 0; /** * Matrix-vector product, adding to dst. */ - virtual void vmult_add (VECTOR &dst, - const VECTOR &src) const = 0; + virtual void vmult_add (VectorType &dst, + const VectorType &src) const = 0; /** * Transposed matrix-vector product, adding to dst. */ - virtual void Tvmult_add (VECTOR &dst, - const VECTOR &src) const = 0; + virtual void Tvmult_add (VectorType &dst, + const VectorType &src) const = 0; }; @@ -109,8 +109,8 @@ public: * * @author Guido Kanschat 2000, 2001, 2002 */ -template -class PointerMatrix : public PointerMatrixBase +template +class PointerMatrix : public PointerMatrixBase { public: /** @@ -166,32 +166,32 @@ public: /** * Matrix-vector product. */ - virtual void vmult (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product. */ - virtual void Tvmult (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult (VectorType &dst, + const VectorType &src) const; /** * Matrix-vector product, adding to dst. */ - virtual void vmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult_add (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product, adding to dst. */ - virtual void Tvmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult_add (VectorType &dst, + const VectorType &src) const; private: /** * The pointer to the actual matrix. */ - SmartPointer > m; + SmartPointer > m; }; @@ -209,8 +209,8 @@ private: * * @author Guido Kanschat 2006 */ -template -class PointerMatrixAux : public PointerMatrixBase +template +class PointerMatrixAux : public PointerMatrixBase { public: /** @@ -222,8 +222,8 @@ public: * * If mem is zero, then GrowingVectorMemory is used. */ - PointerMatrixAux (VectorMemory *mem = 0, - const MATRIX *M=0); + PointerMatrixAux (VectorMemory *mem = 0, + const MATRIX *M=0); /** * Constructor not using a matrix. @@ -235,8 +235,8 @@ public: * argument to this function is used to this end, i.e., you can in essence * assign a name to the current PointerMatrix object. */ - PointerMatrixAux(VectorMemory *mem, - const char *name); + PointerMatrixAux(VectorMemory *mem, + const char *name); /** * Constructor. M points to a matrix which must live longer than @@ -249,9 +249,9 @@ public: * argument to this function is used to this end, i.e., you can in essence * assign a name to the current PointerMatrix object. */ - PointerMatrixAux(VectorMemory *mem, - const MATRIX *M, - const char *name); + PointerMatrixAux(VectorMemory *mem, + const MATRIX *M, + const char *name); // Use doc from base class virtual void clear(); @@ -264,7 +264,7 @@ public: /** * Assign a new VectorMemory object for getting auxiliary vectors. */ - void set_memory(VectorMemory *mem); + void set_memory(VectorMemory *mem); /** * Assign a new matrix pointer. Deletes the old pointer and releases its @@ -276,42 +276,42 @@ public: /** * Matrix-vector product. */ - virtual void vmult (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product. */ - virtual void Tvmult (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult (VectorType &dst, + const VectorType &src) const; /** * Matrix-vector product, adding to dst. */ - virtual void vmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult_add (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product, adding to dst. */ - virtual void Tvmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult_add (VectorType &dst, + const VectorType &src) const; private: /** * The backup memory if none was provided. */ - mutable GrowingVectorMemory my_memory; + mutable GrowingVectorMemory my_memory; /** * Object for getting the auxiliary vector. */ - mutable SmartPointer,PointerMatrixAux > mem; + mutable SmartPointer,PointerMatrixAux > mem; /** * The pointer to the actual matrix. */ - SmartPointer > m; + SmartPointer > m; }; @@ -439,17 +439,17 @@ private: * should overload the function in order to save memory and time. * * The result is a PointerMatrixBase* pointing to matrix. The - * VECTOR argument is a dummy just used to determine the template + * VectorType argument is a dummy just used to determine the template * arguments. * * @relates PointerMatrixBase @relates PointerMatrixAux */ -template +template inline -PointerMatrixBase * -new_pointer_matrix_base(MATRIX &matrix, const VECTOR &, const char *name = "PointerMatrixAux") +PointerMatrixBase * +new_pointer_matrix_base(MATRIX &matrix, const VectorType &, const char *name = "PointerMatrixAux") { - return new PointerMatrixAux(0, &matrix, name); + return new PointerMatrixAux(0, &matrix, name); } /** @@ -509,11 +509,11 @@ new_pointer_matrix_base(const SparseMatrix &matrix, const Vector -PointerMatrixBase * -new_pointer_matrix_base(const BlockSparseMatrix &matrix, const VECTOR &, const char *name = "PointerMatrix") +template +PointerMatrixBase * +new_pointer_matrix_base(const BlockSparseMatrix &matrix, const VectorType &, const char *name = "PointerMatrix") { - return new PointerMatrix, VECTOR>(&matrix, name); + return new PointerMatrix, VectorType>(&matrix, name); } @@ -535,11 +535,11 @@ new_pointer_matrix_base(const SparseMatrixEZ &matrix, const Vector -PointerMatrixBase * -new_pointer_matrix_base(const BlockSparseMatrixEZ &matrix, const VECTOR &, const char *name = "PointerMatrix") +template +PointerMatrixBase * +new_pointer_matrix_base(const BlockSparseMatrixEZ &matrix, const VectorType &, const char *name = "PointerMatrix") { - return new PointerMatrix, VECTOR>(&matrix, name); + return new PointerMatrix, VectorType>(&matrix, name); } @@ -548,11 +548,11 @@ new_pointer_matrix_base(const BlockSparseMatrixEZ &matrix, const VECTOR * * @relates PointerMatrixBase @relates PointerMatrix */ -template -PointerMatrixBase * -new_pointer_matrix_base(const BlockMatrixArray &matrix, const BLOCK_VECTOR &, const char *name = "PointerMatrix") +template +PointerMatrixBase * +new_pointer_matrix_base(const BlockMatrixArray &matrix, const BLOCK_VectorType &, const char *name = "PointerMatrix") { - return new PointerMatrix, BlockVector >(&matrix, name); + return new PointerMatrix, BlockVector >(&matrix, name); } @@ -573,9 +573,9 @@ new_pointer_matrix_base(const TridiagonalMatrix &matrix, const Vector +template inline -PointerMatrixBase::~PointerMatrixBase () +PointerMatrixBase::~PointerMatrixBase () {} @@ -583,86 +583,85 @@ PointerMatrixBase::~PointerMatrixBase () //----------------------------------------------------------------------// -template -PointerMatrix::PointerMatrix (const MATRIX *M) +template +PointerMatrix::PointerMatrix (const MATRIX *M) : m(M, typeid(*this).name()) {} -template -PointerMatrix::PointerMatrix (const char *name) +template +PointerMatrix::PointerMatrix (const char *name) : m(0, name) {} -template -PointerMatrix::PointerMatrix ( - const MATRIX *M, - const char *name) +template +PointerMatrix::PointerMatrix (const MATRIX *M, + const char *name) : m(M, name) {} -template +template inline void -PointerMatrix::clear () +PointerMatrix::clear () { m = 0; } -template -inline const PointerMatrix & -PointerMatrix::operator= (const MATRIX *M) +template +inline const PointerMatrix & +PointerMatrix::operator= (const MATRIX *M) { m = M; return *this; } -template +template inline bool -PointerMatrix::empty () const +PointerMatrix::empty () const { if (m == 0) return true; return m->empty(); } -template +template inline void -PointerMatrix::vmult (VECTOR &dst, - const VECTOR &src) const +PointerMatrix::vmult (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->vmult (dst, src); } -template +template inline void -PointerMatrix::Tvmult (VECTOR &dst, - const VECTOR &src) const +PointerMatrix::Tvmult (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->Tvmult (dst, src); } -template +template inline void -PointerMatrix::vmult_add (VECTOR &dst, - const VECTOR &src) const +PointerMatrix::vmult_add (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->vmult_add (dst, src); } -template +template inline void -PointerMatrix::Tvmult_add (VECTOR &dst, - const VECTOR &src) const +PointerMatrix::Tvmult_add (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->Tvmult_add (dst, src); @@ -673,9 +672,9 @@ PointerMatrix::Tvmult_add (VECTOR &dst, //----------------------------------------------------------------------// -template -PointerMatrixAux::PointerMatrixAux ( - VectorMemory *mem, +template +PointerMatrixAux::PointerMatrixAux ( + VectorMemory *mem, const MATRIX *M) : mem(mem, typeid(*this).name()), m(M, typeid(*this).name()) @@ -684,9 +683,9 @@ PointerMatrixAux::PointerMatrixAux ( } -template -PointerMatrixAux::PointerMatrixAux ( - VectorMemory *mem, +template +PointerMatrixAux::PointerMatrixAux ( + VectorMemory *mem, const char *name) : mem(mem, name), m(0, name) @@ -695,9 +694,9 @@ PointerMatrixAux::PointerMatrixAux ( } -template -PointerMatrixAux::PointerMatrixAux ( - VectorMemory *mem, +template +PointerMatrixAux::PointerMatrixAux ( + VectorMemory *mem, const MATRIX *M, const char *name) : mem(mem, name), @@ -707,26 +706,26 @@ PointerMatrixAux::PointerMatrixAux ( } -template +template inline void -PointerMatrixAux::clear () +PointerMatrixAux::clear () { m = 0; } -template -inline const PointerMatrixAux & -PointerMatrixAux::operator= (const MATRIX *M) +template +inline const PointerMatrixAux & +PointerMatrixAux::operator= (const MATRIX *M) { m = M; return *this; } -template +template inline void -PointerMatrixAux::set_memory(VectorMemory *M) +PointerMatrixAux::set_memory(VectorMemory *M) { mem = M; if (mem == 0) @@ -734,19 +733,19 @@ PointerMatrixAux::set_memory(VectorMemory *M) } -template +template inline bool -PointerMatrixAux::empty () const +PointerMatrixAux::empty () const { if (m == 0) return true; return m->empty(); } -template +template inline void -PointerMatrixAux::vmult (VECTOR &dst, - const VECTOR &src) const +PointerMatrixAux::vmult (VectorType &dst, + const VectorType &src) const { if (mem == 0) mem = &my_memory; @@ -756,10 +755,10 @@ PointerMatrixAux::vmult (VECTOR &dst, } -template +template inline void -PointerMatrixAux::Tvmult (VECTOR &dst, - const VECTOR &src) const +PointerMatrixAux::Tvmult (VectorType &dst, + const VectorType &src) const { if (mem == 0) mem = &my_memory; @@ -769,16 +768,16 @@ PointerMatrixAux::Tvmult (VECTOR &dst, } -template +template inline void -PointerMatrixAux::vmult_add (VECTOR &dst, - const VECTOR &src) const +PointerMatrixAux::vmult_add (VectorType &dst, + const VectorType &src) const { if (mem == 0) mem = &my_memory; Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); - VECTOR *v = mem->alloc(); + VectorType *v = mem->alloc(); v->reinit(dst); m->vmult (*v, src); dst += *v; @@ -786,16 +785,16 @@ PointerMatrixAux::vmult_add (VECTOR &dst, } -template +template inline void -PointerMatrixAux::Tvmult_add (VECTOR &dst, - const VECTOR &src) const +PointerMatrixAux::Tvmult_add (VectorType &dst, + const VectorType &src) const { if (mem == 0) mem = &my_memory; Assert (mem != 0, ExcNotInitialized()); Assert (m != 0, ExcNotInitialized()); - VECTOR *v = mem->alloc(); + VectorType *v = mem->alloc(); v->reinit(dst); m->Tvmult (*v, src); dst += *v; diff --git a/include/deal.II/lac/precondition_selector.h b/include/deal.II/lac/precondition_selector.h index 3cdcfe857b..f6bbe079fb 100644 --- a/include/deal.II/lac/precondition_selector.h +++ b/include/deal.II/lac/precondition_selector.h @@ -91,7 +91,7 @@ template class SparseMatrix; * LinearOperator class: Jean-Paul Pelteret, 2015 */ template , - class VECTOR = dealii::Vector > + typename VectorType = dealii::Vector > class PreconditionSelector : public Subscriptor { public: @@ -104,8 +104,8 @@ public: * Constructor. @p omega denotes the damping parameter of the * preconditioning. */ - PreconditionSelector(const std::string &preconditioning, - const typename VECTOR::value_type &omega=1.); + PreconditionSelector (const std::string &preconditioning, + const typename VectorType::value_type &omega=1.); /** * Destructor. @@ -134,13 +134,13 @@ public: * Precondition procedure. Calls the preconditioning that was specified in * the constructor. */ - virtual void vmult (VECTOR &dst, const VECTOR &src) const; + virtual void vmult (VectorType &dst, const VectorType &src) const; /** * Transpose precondition procedure. Calls the preconditioning that was * specified in the constructor. */ - virtual void Tvmult (VECTOR &dst, const VECTOR &src) const; + virtual void Tvmult (VectorType &dst, const VectorType &src) const; /** * Get the names of all implemented preconditionings. @@ -171,62 +171,64 @@ private: * Matrix that is used for the matrix-builtin preconditioning function. cf. * also @p PreconditionUseMatrix. */ - SmartPointer > A; + SmartPointer > A; /** * Stores the damping parameter of the preconditioner. */ - const typename VECTOR::value_type omega; + const typename VectorType::value_type omega; }; /*@}*/ /* --------------------- Inline and template functions ------------------- */ -template -PreconditionSelector -::PreconditionSelector(const std::string &preconditioning, - const typename VECTOR::value_type &omega) : +template +PreconditionSelector +::PreconditionSelector(const std::string &preconditioning, + const typename VectorType::value_type &omega) : preconditioning(preconditioning), omega(omega) {} -template -PreconditionSelector::~PreconditionSelector() +template +PreconditionSelector::~PreconditionSelector() { // release the matrix A A=0; } -template -void PreconditionSelector::use_matrix(const MATRIX &M) +template +void PreconditionSelector::use_matrix(const MATRIX &M) { A=&M; } +<<<<<<< fc87b7c22812a5fc7751b36c66b20e6fa54df72c -template -inline typename PreconditionSelector::size_type -PreconditionSelector::m () const +template +inline typename PreconditionSelector::size_type +PreconditionSelector::m () const { Assert(A!=0, ExcNoMatrixGivenToUse()); return A->m(); } -template -inline typename PreconditionSelector::size_type -PreconditionSelector::n () const +template +inline typename PreconditionSelector::size_type +PreconditionSelector::n () const { Assert(A!=0, ExcNoMatrixGivenToUse()); return A->n(); } -template -void PreconditionSelector::vmult (VECTOR &dst, - const VECTOR &src) const + +template +void PreconditionSelector::vmult (VectorType &dst, + const VectorType &src) const { if (preconditioning=="none") { @@ -254,9 +256,9 @@ void PreconditionSelector::vmult (VECTOR &dst, } -template -void PreconditionSelector::Tvmult (VECTOR &dst, - const VECTOR &src) const +template +void PreconditionSelector::Tvmult (VectorType &dst, + const VectorType &src) const { if (preconditioning=="none") { @@ -284,8 +286,8 @@ void PreconditionSelector::Tvmult (VECTOR &dst, } -template -std::string PreconditionSelector::get_precondition_names() +template +std::string PreconditionSelector::get_precondition_names() { return "none|jacobi|sor|ssor"; } diff --git a/include/deal.II/lac/shifted_matrix.h b/include/deal.II/lac/shifted_matrix.h index 54de67a637..d754edb124 100644 --- a/include/deal.II/lac/shifted_matrix.h +++ b/include/deal.II/lac/shifted_matrix.h @@ -61,14 +61,14 @@ public: /** * Matrix-vector-product. */ - template - void vmult (VECTOR &dst, const VECTOR &src) const; + template + void vmult (VectorType &dst, const VectorType &src) const; /** * Residual. */ - template - double residual (VECTOR &dst, const VECTOR &src, const VECTOR &rhs) const; + template + double residual (VectorType &dst, const VectorType &src, const VectorType &rhs) const; private: /** @@ -79,7 +79,7 @@ private: /** * Auxiliary vector. */ - // VECTOR aux; + // VectorType aux; /** * Shift parameter. */ @@ -103,7 +103,7 @@ private: * * @author Guido Kanschat, 2001 */ -template +template class ShiftedMatrixGeneralized { public: @@ -127,27 +127,27 @@ public: /** * Matrix-vector-product. */ - void vmult (VECTOR &dst, const VECTOR &src) const; + void vmult (VectorType &dst, const VectorType &src) const; /** * Residual. */ - double residual (VECTOR &dst, const VECTOR &src, const VECTOR &rhs) const; + double residual (VectorType &dst, const VectorType &src, const VectorType &rhs) const; private: /** * Storage for base matrix. */ - SmartPointer > A; + SmartPointer > A; /** * Storage for mass matrix. */ - SmartPointer > M; + SmartPointer > M; /** * Auxiliary vector. */ - VECTOR aux; + VectorType aux; /** * Shift parameter. @@ -186,9 +186,9 @@ ShiftedMatrix::shift () const template -template +template inline void -ShiftedMatrix::vmult (VECTOR &dst, const VECTOR &src) const +ShiftedMatrix::vmult (VectorType &dst, const VectorType &src) const { A->vmult(dst, src); if (sigma != 0.) @@ -197,11 +197,11 @@ ShiftedMatrix::vmult (VECTOR &dst, const VECTOR &src) const template -template +template inline double -ShiftedMatrix::residual (VECTOR &dst, - const VECTOR &src, - const VECTOR &rhs) const +ShiftedMatrix::residual (VectorType &dst, + const VectorType &src, + const VectorType &rhs) const { A->vmult(dst, src); if (sigma != 0.) @@ -212,36 +212,36 @@ ShiftedMatrix::residual (VECTOR &dst, //--------------------------------------------------------------------------- -template +template inline -ShiftedMatrixGeneralized -::ShiftedMatrixGeneralized (const MATRIX &A, +ShiftedMatrixGeneralized +::ShiftedMatrixGeneralized (const MATRIX &A, const MASSMATRIX &M, - const double sigma) + const double sigma) : A(&A), M(&M), sigma(sigma) {} -template +template inline void -ShiftedMatrixGeneralized::shift (const double s) +ShiftedMatrixGeneralized::shift (const double s) { sigma = s; } -template +template inline double -ShiftedMatrixGeneralized::shift () const +ShiftedMatrixGeneralized::shift () const { return sigma; } -template +template inline void -ShiftedMatrixGeneralized::vmult (VECTOR &dst, - const VECTOR &src) const +ShiftedMatrixGeneralized::vmult (VectorType &dst, + const VectorType &src) const { A->vmult(dst, src); if (sigma != 0.) @@ -253,11 +253,11 @@ ShiftedMatrixGeneralized::vmult (VECTOR &dst, } -template +template inline double -ShiftedMatrixGeneralized::residual (VECTOR &dst, - const VECTOR &src, - const VECTOR &rhs) const +ShiftedMatrixGeneralized::residual (VectorType &dst, + const VectorType &src, + const VectorType &rhs) const { A->vmult(dst, src); if (sigma != 0.) diff --git a/include/deal.II/lac/solver.h b/include/deal.II/lac/solver.h index f62ef974d2..cdca1a8194 100644 --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@ -60,13 +60,13 @@ template class Vector; * public: * // Application of matrix to vector src. * // Write result into dst - * void vmult (VECTOR &dst, - * const VECTOR &src) const; + * void vmult (VectorType &dst, + * const VectorType &src) const; * * // Application of transpose to a vector. * // Only used by some iterative methods. - * void Tvmult (VECTOR &dst, - * const VECTOR &src) const; + * void Tvmult (VectorType &dst, + * const VectorType &src) const; * }; * * @@ -120,11 +120,11 @@ template class Vector; * @endcode * * In addition, for some solvers there has to be a global function - * swap(VECTOR &a, VECTOR &b) that exchanges the values of the two - * vectors. + * swap(VectorType &a, VectorType &b) that exchanges the values of + * the two vectors. * * Finally, the solvers also expect an instantiation of - * GrowingVectorMemory@. These instantiations are provided by the + * GrowingVectorMemory@. These instantiations are provided by the * deal.II library for the built-in vector types, but must be explicitly added * for user-provided vector classes. Otherwise, the linker will complain that * it cannot find the constructors and destructors of GrowingVectorMemory that @@ -321,14 +321,14 @@ template class Vector; * @author Wolfgang Bangerth, Guido Kanschat, Ralf Hartmann, 1997-2001, 2005, * 2014 */ -template > +template > class Solver : public Subscriptor { public: /** * A typedef for the underlying vector type */ - typedef VECTOR vector_type; + typedef VectorType vector_type; /** * Constructor. Takes a control object which evaluates the conditions for @@ -339,8 +339,8 @@ public: * responsibility to guarantee that the lifetime of the two arguments is at * least as long as that of the solver object. */ - Solver (SolverControl &solver_control, - VectorMemory &vector_memory); + Solver (SolverControl &solver_control, + VectorMemory &vector_memory); /** * Constructor. Takes a control object which evaluates the conditions for @@ -384,8 +384,8 @@ public: */ boost::signals2::connection connect (const std_cxx11::function &slot); + const double check_value, + const VectorType ¤t_iterate)> &slot); @@ -394,12 +394,12 @@ protected: * A static vector memory object to be used whenever no such object has been * given to the constructor. */ - mutable GrowingVectorMemory static_vector_memory; + mutable GrowingVectorMemory static_vector_memory; /** * A reference to an object that provides memory for auxiliary vectors. */ - VectorMemory &memory; + VectorMemory &memory; private: /** @@ -443,8 +443,8 @@ protected: * signal's return value indicates that the iteration should be terminated. */ boost::signals2::signal iteration_status; }; @@ -452,10 +452,10 @@ protected: /*-------------------------------- Inline functions ------------------------*/ -template +template inline SolverControl::State -Solver::StateCombiner::operator ()(const SolverControl::State state1, +Solver::StateCombiner::operator ()(const SolverControl::State state1, const SolverControl::State state2) const { if ((state1 == SolverControl::failure) @@ -471,11 +471,11 @@ Solver::StateCombiner::operator ()(const SolverControl::State state1, } -template +template template inline SolverControl::State -Solver::StateCombiner::operator ()(const Iterator begin, +Solver::StateCombiner::operator ()(const Iterator begin, const Iterator end) const { Assert (begin != end, ExcMessage ("You can't combine iterator states if no state is given.")); @@ -491,10 +491,10 @@ Solver::StateCombiner::operator ()(const Iterator begin, } -template +template inline -Solver::Solver (SolverControl &solver_control, - VectorMemory &vector_memory) +Solver::Solver (SolverControl &solver_control, + VectorMemory &vector_memory) : memory(vector_memory) { @@ -510,9 +510,9 @@ Solver::Solver (SolverControl &solver_control, -template +template inline -Solver::Solver (SolverControl &solver_control) +Solver::Solver (SolverControl &solver_control) : // use the static memory object this class owns memory(static_vector_memory) @@ -529,13 +529,13 @@ Solver::Solver (SolverControl &solver_control) -template +template inline boost::signals2::connection -Solver:: +Solver:: connect (const std_cxx11::function &slot) + const double check_value, + const VectorType ¤t_iterate)> &slot) { return iteration_status.connect (slot); } diff --git a/include/deal.II/lac/solver_bicgstab.h b/include/deal.II/lac/solver_bicgstab.h index 325a81331c..40f6852931 100644 --- a/include/deal.II/lac/solver_bicgstab.h +++ b/include/deal.II/lac/solver_bicgstab.h @@ -68,8 +68,8 @@ DEAL_II_NAMESPACE_OPEN * to observe the progress of the iteration. * */ -template > -class SolverBicgstab : public Solver +template > +class SolverBicgstab : public Solver { public: /** @@ -109,9 +109,9 @@ public: /** * Constructor. */ - SolverBicgstab (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data=AdditionalData()); + SolverBicgstab (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data=AdditionalData()); /** * Constructor. Use an object of type GrowingVectorMemory as a default to @@ -130,9 +130,9 @@ public: */ template void - solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + solve (const MATRIX &A, + VectorType &x, + const VectorType &b, const PRECONDITIONER &precondition); protected: @@ -140,7 +140,7 @@ protected: * Computation of the stopping criterion. */ template - double criterion (const MATRIX &A, const VECTOR &x, const VECTOR &b); + double criterion (const MATRIX &A, const VectorType &x, const VectorType &b); /** * Interface for derived class. This function gets the current iteration @@ -148,46 +148,46 @@ protected: * for a graphical output of the convergence history. */ virtual void print_vectors(const unsigned int step, - const VECTOR &x, - const VECTOR &r, - const VECTOR &d) const; + const VectorType &x, + const VectorType &r, + const VectorType &d) const; /** * Auxiliary vector. */ - VECTOR *Vx; + VectorType *Vx; /** * Auxiliary vector. */ - VECTOR *Vr; + VectorType *Vr; /** * Auxiliary vector. */ - VECTOR *Vrbar; + VectorType *Vrbar; /** * Auxiliary vector. */ - VECTOR *Vp; + VectorType *Vp; /** * Auxiliary vector. */ - VECTOR *Vy; + VectorType *Vy; /** * Auxiliary vector. */ - VECTOR *Vz; + VectorType *Vz; /** * Auxiliary vector. */ - VECTOR *Vt; + VectorType *Vt; /** * Auxiliary vector. */ - VECTOR *Vv; + VectorType *Vv; /** * Right hand side vector. */ - const VECTOR *Vb; + const VectorType *Vb; /** * Auxiliary value. @@ -265,11 +265,12 @@ private: #ifndef DOXYGEN -template -SolverBicgstab::IterationResult::IterationResult(const bool breakdown, - const SolverControl::State state, - const unsigned int last_step, - const double last_residual) +template +SolverBicgstab::IterationResult::IterationResult +(const bool breakdown, + const SolverControl::State state, + const unsigned int last_step, + const double last_residual) : breakdown (breakdown), state (state), @@ -278,37 +279,37 @@ SolverBicgstab::IterationResult::IterationResult(const bool breakdown, {} -template -SolverBicgstab::SolverBicgstab (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data) +template +SolverBicgstab::SolverBicgstab (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data) : - Solver(cn,mem), + Solver(cn,mem), additional_data(data) {} -template -SolverBicgstab::SolverBicgstab (SolverControl &cn, - const AdditionalData &data) +template +SolverBicgstab::SolverBicgstab (SolverControl &cn, + const AdditionalData &data) : - Solver(cn), + Solver(cn), additional_data(data) {} -template -SolverBicgstab::~SolverBicgstab () +template +SolverBicgstab::~SolverBicgstab () {} -template +template template double -SolverBicgstab::criterion (const MATRIX &A, const VECTOR &x, const VECTOR &b) +SolverBicgstab::criterion (const MATRIX &A, const VectorType &x, const VectorType &b) { A.vmult(*Vt, x); Vt->add(-1.,b); @@ -319,10 +320,10 @@ SolverBicgstab::criterion (const MATRIX &A, const VECTOR &x, const VECTO -template +template template SolverControl::State -SolverBicgstab::start(const MATRIX &A) +SolverBicgstab::start(const MATRIX &A) { A.vmult(*Vr, *Vx); Vr->sadd(-1.,1.,*Vb); @@ -333,33 +334,33 @@ SolverBicgstab::start(const MATRIX &A) -template +template void -SolverBicgstab::print_vectors(const unsigned int, - const VECTOR &, - const VECTOR &, - const VECTOR &) const +SolverBicgstab::print_vectors(const unsigned int, + const VectorType &, + const VectorType &, + const VectorType &) const {} -template +template template -typename SolverBicgstab::IterationResult -SolverBicgstab::iterate(const MATRIX &A, - const PRECONDITIONER &precondition) +typename SolverBicgstab::IterationResult +SolverBicgstab::iterate(const MATRIX &A, + const PRECONDITIONER &precondition) { //TODO:[GK] Implement "use the length of the computed orthogonal residual" in the BiCGStab method. SolverControl::State state = SolverControl::iterate; alpha = omega = rho = 1.; - VECTOR &r = *Vr; - VECTOR &rbar = *Vrbar; - VECTOR &p = *Vp; - VECTOR &y = *Vy; - VECTOR &z = *Vz; - VECTOR &t = *Vt; - VECTOR &v = *Vv; + VectorType &r = *Vr; + VectorType &rbar = *Vrbar; + VectorType &p = *Vp; + VectorType &y = *Vy; + VectorType &z = *Vz; + VectorType &t = *Vt; + VectorType &v = *Vv; rbar = r; bool startup = true; @@ -430,13 +431,13 @@ SolverBicgstab::iterate(const MATRIX &A, } -template +template template void -SolverBicgstab::solve(const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const PRECONDITIONER &precondition) +SolverBicgstab::solve(const MATRIX &A, + VectorType &x, + const VectorType &b, + const PRECONDITIONER &precondition) { deallog.push("Bicgstab"); Vr = this->memory.alloc(); diff --git a/include/deal.II/lac/solver_gmres.h b/include/deal.II/lac/solver_gmres.h index c149c95612..650b7411b1 100644 --- a/include/deal.II/lac/solver_gmres.h +++ b/include/deal.II/lac/solver_gmres.h @@ -52,15 +52,15 @@ namespace internal * automatically, avoiding restart. */ - template + template class TmpVectors { public: /** - * Constructor. Prepares an array of @p VECTOR of length @p max_size. + * Constructor. Prepares an array of @p VectorType of length @p max_size. */ - TmpVectors(const unsigned int max_size, - VectorMemory &vmem); + TmpVectors(const unsigned int max_size, + VectorMemory &vmem); /** * Delete all allocated vectors. @@ -71,7 +71,7 @@ namespace internal * Get vector number @p i. If this vector was unused before, an error * occurs. */ - VECTOR &operator[] (const unsigned int i) const; + VectorType &operator[] (const unsigned int i) const; /** * Get vector number @p i. Allocate it if necessary. @@ -79,19 +79,19 @@ namespace internal * If a vector must be allocated, @p temp is used to reinit it to the * proper dimensions. */ - VECTOR &operator() (const unsigned int i, - const VECTOR &temp); + VectorType &operator() (const unsigned int i, + const VectorType &temp); private: /** * Pool were vectors are obtained from. */ - VectorMemory &mem; + VectorMemory &mem; /** * Field for storing the vectors. */ - std::vector data; + std::vector data; /** * Offset of the first vector. This is for later when vector rotation @@ -169,8 +169,8 @@ namespace internal * * @author Wolfgang Bangerth, Guido Kanschat, Ralf Hartmann. */ -template > -class SolverGMRES : public Solver +template > +class SolverGMRES : public Solver { public: /** @@ -245,9 +245,9 @@ public: /** * Constructor. */ - SolverGMRES (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data=AdditionalData()); + SolverGMRES (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data=AdditionalData()); /** * Constructor. Use an object of type GrowingVectorMemory as a default to @@ -262,8 +262,8 @@ public: template void solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + VectorType &x, + const VectorType &b, const PRECONDITIONER &precondition); /** @@ -349,12 +349,12 @@ protected: * All subsequent iterations use re-orthogonalization. */ static double - modified_gram_schmidt (const internal::SolverGMRES::TmpVectors &orthogonal_vectors, - const unsigned int dim, - const unsigned int accumulated_iterations, - VECTOR &vv, - Vector &h, - bool &re_orthogonalize); + modified_gram_schmidt (const internal::SolverGMRES::TmpVectors &orthogonal_vectors, + const unsigned int dim, + const unsigned int accumulated_iterations, + VectorType &vv, + Vector &h, + bool &re_orthogonalize); /** * Estimates the eigenvalues from the Hessenberg matrix, H_orig, generated @@ -386,7 +386,7 @@ private: /** * No copy constructor. */ - SolverGMRES (const SolverGMRES &); + SolverGMRES (const SolverGMRES &); }; /** @@ -410,8 +410,8 @@ private: * * @author Guido Kanschat, 2003 */ -template > -class SolverFGMRES : public Solver +template > +class SolverFGMRES : public Solver { public: /** @@ -438,9 +438,9 @@ public: /** * Constructor. */ - SolverFGMRES (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data=AdditionalData()); + SolverFGMRES (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data=AdditionalData()); /** * Constructor. Use an object of type GrowingVectorMemory as a default to @@ -455,8 +455,8 @@ public: template void solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + VectorType &x, + const VectorType &b, const PRECONDITIONER &precondition); private: @@ -486,11 +486,11 @@ namespace internal { namespace SolverGMRES { - template + template inline - TmpVectors:: - TmpVectors (const unsigned int max_size, - VectorMemory &vmem) + TmpVectors:: + TmpVectors (const unsigned int max_size, + VectorMemory &vmem) : mem(vmem), data (max_size, 0), @@ -498,20 +498,20 @@ namespace internal {} - template + template inline - TmpVectors::~TmpVectors () + TmpVectors::~TmpVectors () { - for (typename std::vector::iterator v = data.begin(); + for (typename std::vector::iterator v = data.begin(); v != data.end(); ++v) if (*v != 0) mem.free(*v); } - template - inline VECTOR & - TmpVectors::operator[] (const unsigned int i) const + template + inline VectorType & + TmpVectors::operator[] (const unsigned int i) const { Assert (i+offset - inline VECTOR & - TmpVectors::operator() (const unsigned int i, - const VECTOR &temp) + template + inline VectorType & + TmpVectors::operator() (const unsigned int i, + const VectorType &temp) { Assert (i+offset +template inline -SolverGMRES::AdditionalData:: +SolverGMRES::AdditionalData:: AdditionalData (const unsigned int max_n_tmp_vectors, const bool right_preconditioning, const bool use_default_residual, @@ -565,9 +565,9 @@ AdditionalData (const unsigned int max_n_tmp_vectors, -template +template inline -SolverGMRES::AdditionalData:: +SolverGMRES::AdditionalData:: AdditionalData (const unsigned int max_n_tmp_vectors, const bool right_preconditioning, const bool use_default_residual, @@ -583,34 +583,34 @@ AdditionalData (const unsigned int max_n_tmp_vectors, -template -SolverGMRES::SolverGMRES (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data) +template +SolverGMRES::SolverGMRES (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data) : - Solver (cn,mem), + Solver (cn,mem), additional_data(data) {} -template -SolverGMRES::SolverGMRES (SolverControl &cn, - const AdditionalData &data) : - Solver (cn), +template +SolverGMRES::SolverGMRES (SolverControl &cn, + const AdditionalData &data) : + Solver (cn), additional_data(data) {} -template +template inline void -SolverGMRES::givens_rotation (Vector &h, - Vector &b, - Vector &ci, - Vector &si, - int col) const +SolverGMRES::givens_rotation (Vector &h, + Vector &b, + Vector &ci, + Vector &si, + int col) const { for (int i=0 ; i::givens_rotation (Vector &h, -template +template inline double -SolverGMRES::modified_gram_schmidt (const internal::SolverGMRES::TmpVectors &orthogonal_vectors, - const unsigned int dim, - const unsigned int accumulated_iterations, - VECTOR &vv, - Vector &h, - bool &re_orthogonalize) +SolverGMRES::modified_gram_schmidt +(const internal::SolverGMRES::TmpVectors &orthogonal_vectors, + const unsigned int dim, + const unsigned int accumulated_iterations, + VectorType &vv, + Vector &h, + bool &re_orthogonalize) { Assert(dim > 0, ExcInternalError()); const unsigned int inner_iteration = dim - 1; @@ -665,7 +666,7 @@ SolverGMRES::modified_gram_schmidt (const internal::SolverGMRES::TmpVect if (re_orthogonalize == false && inner_iteration % 5 == 4) { if (norm_vv > 10. * norm_vv_start * - std::sqrt(std::numeric_limits::epsilon())) + std::sqrt(std::numeric_limits::epsilon())) return norm_vv; else @@ -693,14 +694,14 @@ SolverGMRES::modified_gram_schmidt (const internal::SolverGMRES::TmpVect -template +template inline void -SolverGMRES::compute_eigs_and_cond( - const FullMatrix &H_orig, - const unsigned int dim, - const boost::signals2::signal > &)> &eigenvalues_signal, - const boost::signals2::signal &cond_signal, - const bool log_eigenvalues) +SolverGMRES::compute_eigs_and_cond +(const FullMatrix &H_orig, + const unsigned int dim, + const boost::signals2::signal > &)> &eigenvalues_signal, + const boost::signals2::signal &cond_signal, + const bool log_eigenvalues) { //Avoid copying the Hessenberg matrix if it isn't needed. if (!eigenvalues_signal.empty() || !cond_signal.empty() || log_eigenvalues ) @@ -744,13 +745,13 @@ SolverGMRES::compute_eigs_and_cond( -template +template template void -SolverGMRES::solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const PRECONDITIONER &precondition) +SolverGMRES::solve (const MATRIX &A, + VectorType &x, + const VectorType &b, + const PRECONDITIONER &precondition) { // this code was written a very long time ago by people not associated with // deal.II. we don't make any guarantees to its optimality or that it even @@ -763,7 +764,7 @@ SolverGMRES::solve (const MATRIX &A, const unsigned int n_tmp_vectors = additional_data.max_n_tmp_vectors; // Generate an object where basis vectors are stored. - internal::SolverGMRES::TmpVectors tmp_vectors (n_tmp_vectors, this->memory); + internal::SolverGMRES::TmpVectors tmp_vectors (n_tmp_vectors, this->memory); // number of the present iteration; this // number is not reset to zero upon a @@ -808,14 +809,14 @@ SolverGMRES::solve (const MATRIX &A, const bool use_default_residual = additional_data.use_default_residual; // define two aliases - VECTOR &v = tmp_vectors(0, x); - VECTOR &p = tmp_vectors(n_tmp_vectors-1, x); + VectorType &v = tmp_vectors(0, x); + VectorType &p = tmp_vectors(n_tmp_vectors-1, x); // Following vectors are needed // when not the default residuals // are used as stopping criterion - VECTOR *r=0; - VECTOR *x_=0; + VectorType *r=0; + VectorType *x_=0; dealii::Vector *gamma_=0; if (!use_default_residual) { @@ -898,7 +899,7 @@ SolverGMRES::solve (const MATRIX &A, { ++accumulated_iterations; // yet another alias - VECTOR &vv = tmp_vectors(inner_iteration+1, x); + VectorType &vv = tmp_vectors(inner_iteration+1, x); if (left_precondition) { @@ -1042,11 +1043,11 @@ SolverGMRES::solve (const MATRIX &A, -template +template boost::signals2::connection -SolverGMRES::connect_condition_number_slot( - const std_cxx11::function &slot, - const bool every_iteration) +SolverGMRES::connect_condition_number_slot +(const std_cxx11::function &slot, + const bool every_iteration) { if (every_iteration) { @@ -1060,11 +1061,11 @@ SolverGMRES::connect_condition_number_slot( -template +template boost::signals2::connection -SolverGMRES::connect_eigenvalues_slot( - const std_cxx11::function > &)> &slot, - const bool every_iteration) +SolverGMRES::connect_eigenvalues_slot +(const std_cxx11::function > &)> &slot, + const bool every_iteration) { if (every_iteration) { @@ -1078,9 +1079,9 @@ SolverGMRES::connect_eigenvalues_slot( -template +template double -SolverGMRES::criterion () +SolverGMRES::criterion () { // dummy implementation. this function is not needed for the present // implementation of gmres @@ -1091,35 +1092,34 @@ SolverGMRES::criterion () //----------------------------------------------------------------------// -template -SolverFGMRES::SolverFGMRES (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data) +template +SolverFGMRES::SolverFGMRES (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data) : - Solver (cn, mem), + Solver (cn, mem), additional_data(data) {} -template -SolverFGMRES::SolverFGMRES (SolverControl &cn, - const AdditionalData &data) +template +SolverFGMRES::SolverFGMRES (SolverControl &cn, + const AdditionalData &data) : - Solver (cn), + Solver (cn), additional_data(data) {} -template +template template void -SolverFGMRES::solve ( - const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const PRECONDITIONER &precondition) +SolverFGMRES::solve (const MATRIX &A, + VectorType &x, + const VectorType &b, + const PRECONDITIONER &precondition) { deallog.push("FGMRES"); @@ -1128,8 +1128,8 @@ SolverFGMRES::solve ( const unsigned int basis_size = additional_data.max_basis_size; // Generate an object where basis vectors are stored. - typename internal::SolverGMRES::TmpVectors v (basis_size, this->memory); - typename internal::SolverGMRES::TmpVectors z (basis_size, this->memory); + typename internal::SolverGMRES::TmpVectors v (basis_size, this->memory); + typename internal::SolverGMRES::TmpVectors z (basis_size, this->memory); // number of the present iteration; this number is not reset to zero upon a // restart @@ -1145,7 +1145,7 @@ SolverFGMRES::solve ( // Iteration starts here double res = -std::numeric_limits::max(); - VECTOR *aux = this->memory.alloc(); + VectorType *aux = this->memory.alloc(); aux->reinit(x); do { diff --git a/include/deal.II/lac/solver_minres.h b/include/deal.II/lac/solver_minres.h index aec100c5ea..05d14847a1 100644 --- a/include/deal.II/lac/solver_minres.h +++ b/include/deal.II/lac/solver_minres.h @@ -64,8 +64,8 @@ DEAL_II_NAMESPACE_OPEN * * @author Thomas Richter, 2000, Luca Heltai, 2006 */ -template > -class SolverMinRes : public Solver +template > +class SolverMinRes : public Solver { public: /** @@ -79,9 +79,9 @@ public: /** * Constructor. */ - SolverMinRes (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data=AdditionalData()); + SolverMinRes (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data=AdditionalData()); /** * Constructor. Use an object of type GrowingVectorMemory as a default to @@ -101,8 +101,8 @@ public: template void solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + VectorType &x, + const VectorType &b, const PRECONDITIONER &precondition); /** @@ -127,17 +127,17 @@ protected: * for a graphical output of the convergence history. */ virtual void print_vectors(const unsigned int step, - const VECTOR &x, - const VECTOR &r, - const VECTOR &d) const; + const VectorType &x, + const VectorType &r, + const VectorType &d) const; /** * Temporary vectors, allocated through the @p VectorMemory object at the * start of the actual solution process and deallocated at the end. */ - VECTOR *Vu0, *Vu1, *Vu2; - VECTOR *Vm0, *Vm1, *Vm2; - VECTOR *Vv; + VectorType *Vu0, *Vu1, *Vu2; + VectorType *Vm0, *Vm1, *Vm2; + VectorType *Vv; /** * Within the iteration loop, the square of the residual vector is stored in @@ -153,55 +153,55 @@ protected: #ifndef DOXYGEN -template -SolverMinRes::SolverMinRes (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &) +template +SolverMinRes::SolverMinRes (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &) : - Solver(cn,mem) + Solver(cn,mem) {} -template -SolverMinRes::SolverMinRes (SolverControl &cn, - const AdditionalData &) +template +SolverMinRes::SolverMinRes (SolverControl &cn, + const AdditionalData &) : - Solver(cn) + Solver(cn) {} -template -SolverMinRes::~SolverMinRes () +template +SolverMinRes::~SolverMinRes () {} -template +template double -SolverMinRes::criterion() +SolverMinRes::criterion() { return res2; } -template +template void -SolverMinRes::print_vectors(const unsigned int, - const VECTOR &, - const VECTOR &, - const VECTOR &) const +SolverMinRes::print_vectors(const unsigned int, + const VectorType &, + const VectorType &, + const VectorType &) const {} -template +template template void -SolverMinRes::solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const PRECONDITIONER &precondition) +SolverMinRes::solve (const MATRIX &A, + VectorType &x, + const VectorType &b, + const PRECONDITIONER &precondition) { SolverControl::State conv=SolverControl::iterate; @@ -216,10 +216,10 @@ SolverMinRes::solve (const MATRIX &A, Vm1 = this->memory.alloc(); Vm2 = this->memory.alloc(); // define some aliases for simpler access - typedef VECTOR *vecptr; + typedef VectorType *vecptr; vecptr u[3] = {Vu0, Vu1, Vu2}; vecptr m[3] = {Vm0, Vm1, Vm2}; - VECTOR &v = *Vv; + VectorType &v = *Vv; // resize the vectors, but do not set // the values since they'd be overwritten // soon anyway. diff --git a/include/deal.II/lac/solver_qmrs.h b/include/deal.II/lac/solver_qmrs.h index 0f41712aec..5f20184ae9 100644 --- a/include/deal.II/lac/solver_qmrs.h +++ b/include/deal.II/lac/solver_qmrs.h @@ -67,8 +67,8 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat, 1999 */ -template > -class SolverQMRS : public Solver +template > +class SolverQMRS : public Solver { public: /** @@ -111,9 +111,9 @@ public: /** * Constructor. */ - SolverQMRS (SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data=AdditionalData()); + SolverQMRS (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data=AdditionalData()); /** * Constructor. Use an object of type GrowingVectorMemory as a default to @@ -128,8 +128,8 @@ public: template void solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + VectorType &x, + const VectorType &b, const PRECONDITIONER &precondition); /** @@ -137,10 +137,10 @@ public: * vector, the residual and the update vector in each step. It can be used * for a graphical output of the convergence history. */ - virtual void print_vectors(const unsigned int step, - const VECTOR &x, - const VECTOR &r, - const VECTOR &d) const; + virtual void print_vectors (const unsigned int step, + const VectorType &x, + const VectorType &r, + const VectorType &d) const; protected: /** * Implementation of the computation of the norm of the residual. @@ -151,19 +151,19 @@ protected: * Temporary vectors, allocated through the @p VectorMemory object at the * start of the actual solution process and deallocated at the end. */ - VECTOR *Vv; - VECTOR *Vp; - VECTOR *Vq; - VECTOR *Vt; - VECTOR *Vd; + VectorType *Vv; + VectorType *Vp; + VectorType *Vq; + VectorType *Vt; + VectorType *Vd; /** * Iteration vector. */ - VECTOR *Vx; + VectorType *Vx; /** * RHS vector. */ - const VECTOR *Vb; + const VectorType *Vb; /** * Within the iteration loop, the square of the residual vector is stored in @@ -214,62 +214,62 @@ private: #ifndef DOXYGEN -template -SolverQMRS::IterationResult::IterationResult(const SolverControl::State state, - const double last_residual) +template +SolverQMRS::IterationResult::IterationResult (const SolverControl::State state, + const double last_residual) : state (state), last_residual (last_residual) {} -template -SolverQMRS::SolverQMRS(SolverControl &cn, - VectorMemory &mem, - const AdditionalData &data) +template +SolverQMRS::SolverQMRS (SolverControl &cn, + VectorMemory &mem, + const AdditionalData &data) : - Solver(cn,mem), + Solver(cn,mem), additional_data(data) {} -template -SolverQMRS::SolverQMRS(SolverControl &cn, - const AdditionalData &data) +template +SolverQMRS::SolverQMRS(SolverControl &cn, + const AdditionalData &data) : - Solver(cn), + Solver(cn), additional_data(data) {} -template +template double -SolverQMRS::criterion() +SolverQMRS::criterion() { return std::sqrt(res2); } -template +template void -SolverQMRS::print_vectors(const unsigned int, - const VECTOR &, - const VECTOR &, - const VECTOR &) const +SolverQMRS::print_vectors(const unsigned int, + const VectorType &, + const VectorType &, + const VectorType &) const {} -template +template template void -SolverQMRS::solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const PRECONDITIONER &precondition) +SolverQMRS::solve (const MATRIX &A, + VectorType &x, + const VectorType &b, + const PRECONDITIONER &precondition) { deallog.push("QMRS"); @@ -321,11 +321,11 @@ SolverQMRS::solve (const MATRIX &A, -template +template template -typename SolverQMRS::IterationResult -SolverQMRS::iterate(const MATRIX &A, - const PRECONDITIONER &precondition) +typename SolverQMRS::IterationResult +SolverQMRS::iterate(const MATRIX &A, + const PRECONDITIONER &precondition) { /* Remark: the matrix A in the article is the preconditioned matrix. * Therefore, we have to precondition x before we compute the first residual. @@ -336,13 +336,13 @@ SolverQMRS::iterate(const MATRIX &A, SolverControl::State state = SolverControl::iterate; // define some aliases for simpler access - VECTOR &v = *Vv; - VECTOR &p = *Vp; - VECTOR &q = *Vq; - VECTOR &t = *Vt; - VECTOR &d = *Vd; - VECTOR &x = *Vx; - const VECTOR &b = *Vb; + VectorType &v = *Vv; + VectorType &p = *Vp; + VectorType &q = *Vq; + VectorType &t = *Vt; + VectorType &d = *Vd; + VectorType &x = *Vx; + const VectorType &b = *Vb; int it=0; diff --git a/include/deal.II/lac/solver_relaxation.h b/include/deal.II/lac/solver_relaxation.h index 59e74cd819..b371f63df8 100644 --- a/include/deal.II/lac/solver_relaxation.h +++ b/include/deal.II/lac/solver_relaxation.h @@ -53,8 +53,8 @@ DEAL_II_NAMESPACE_OPEN * @author Guido Kanschat * @date 2010 */ -template > -class SolverRelaxation : public Solver +template > +class SolverRelaxation : public Solver { public: /** @@ -81,46 +81,45 @@ public: */ template void - solve (const MATRIX &A, - VECTOR &x, - const VECTOR &b, + solve (const MATRIX &A, + VectorType &x, + const VectorType &b, const RELAXATION &R); }; //----------------------------------------------------------------------// -template -SolverRelaxation::SolverRelaxation(SolverControl &cn, - const AdditionalData &) +template +SolverRelaxation::SolverRelaxation (SolverControl &cn, + const AdditionalData &) : - Solver (cn) + Solver (cn) {} -template -SolverRelaxation::~SolverRelaxation() +template +SolverRelaxation::~SolverRelaxation() {} -template +template template void -SolverRelaxation::solve ( - const MATRIX &A, - VECTOR &x, - const VECTOR &b, - const RELAXATION &R) +SolverRelaxation::solve (const MATRIX &A, + VectorType &x, + const VectorType &b, + const RELAXATION &R) { - GrowingVectorMemory mem; + GrowingVectorMemory mem; SolverControl::State conv=SolverControl::iterate; // Memory allocation - typename VectorMemory::Pointer Vr(mem); - VECTOR &r = *Vr; + typename VectorMemory::Pointer Vr(mem); + VectorType &r = *Vr; r.reinit(x); - typename VectorMemory::Pointer Vd(mem); - VECTOR &d = *Vd; + typename VectorMemory::Pointer Vd(mem); + VectorType &d = *Vd; d.reinit(x); deallog.push("Relaxation"); diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 9b7a4647de..e27f6c1f1e 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -34,7 +34,7 @@ template class FullMatrix; template class SparseMatrix; template class SparseLUDecomposition; template class SparseILU; -template class VectorSlice; +template class VectorSlice; namespace ChunkSparsityPatternIterators { diff --git a/include/deal.II/lac/transpose_matrix.h b/include/deal.II/lac/transpose_matrix.h index 571fff646c..34ccd08d7d 100644 --- a/include/deal.II/lac/transpose_matrix.h +++ b/include/deal.II/lac/transpose_matrix.h @@ -40,9 +40,9 @@ DEAL_II_NAMESPACE_OPEN * @ingroup Matrix2 * @author Guido Kanschat, 2006 */ -template +template class - TransposeMatrix : public PointerMatrixBase + TransposeMatrix : public PointerMatrixBase { public: /** @@ -86,118 +86,118 @@ public: /** * Matrix-vector product. */ - virtual void vmult (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product. */ - virtual void Tvmult (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult (VectorType &dst, + const VectorType &src) const; /** * Matrix-vector product, adding to dst. */ - virtual void vmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void vmult_add (VectorType &dst, + const VectorType &src) const; /** * Transposed matrix-vector product, adding to dst. */ - virtual void Tvmult_add (VECTOR &dst, - const VECTOR &src) const; + virtual void Tvmult_add (VectorType &dst, + const VectorType &src) const; private: /** * The pointer to the actual matrix. */ - SmartPointer > m; + SmartPointer > m; }; //----------------------------------------------------------------------// -template -TransposeMatrix::TransposeMatrix (const MATRIX *M) +template +TransposeMatrix::TransposeMatrix (const MATRIX *M) : m(M) {} -template -TransposeMatrix::TransposeMatrix (const char *name) +template +TransposeMatrix::TransposeMatrix (const char *name) : m(0, name) {} -template -TransposeMatrix::TransposeMatrix ( +template +TransposeMatrix::TransposeMatrix ( const MATRIX *M, const char *name) : m(M, name) {} -template +template inline void -TransposeMatrix::clear () +TransposeMatrix::clear () { m = 0; } -template -inline const TransposeMatrix & -TransposeMatrix::operator= (const MATRIX *M) +template +inline const TransposeMatrix & +TransposeMatrix::operator= (const MATRIX *M) { m = M; return *this; } -template +template inline bool -TransposeMatrix::empty () const +TransposeMatrix::empty () const { if (m == 0) return true; return m->empty(); } -template +template inline void -TransposeMatrix::vmult (VECTOR &dst, - const VECTOR &src) const +TransposeMatrix::vmult (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->Tvmult (dst, src); } -template +template inline void -TransposeMatrix::Tvmult (VECTOR &dst, - const VECTOR &src) const +TransposeMatrix::Tvmult (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->vmult (dst, src); } -template +template inline void -TransposeMatrix::vmult_add (VECTOR &dst, - const VECTOR &src) const +TransposeMatrix::vmult_add (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->Tvmult_add (dst, src); } -template +template inline void -TransposeMatrix::Tvmult_add (VECTOR &dst, - const VECTOR &src) const +TransposeMatrix::Tvmult_add (VectorType &dst, + const VectorType &src) const { Assert (m != 0, ExcNotInitialized()); m->vmult_add (dst, src); diff --git a/include/deal.II/lac/vector_memory.templates.h b/include/deal.II/lac/vector_memory.templates.h index e8d2934e55..85d433a132 100644 --- a/include/deal.II/lac/vector_memory.templates.h +++ b/include/deal.II/lac/vector_memory.templates.h @@ -22,24 +22,24 @@ DEAL_II_NAMESPACE_OPEN -template -typename GrowingVectorMemory::Pool GrowingVectorMemory::pool; +template +typename GrowingVectorMemory::Pool GrowingVectorMemory::pool; -template -Threads::Mutex GrowingVectorMemory::mutex; +template +Threads::Mutex GrowingVectorMemory::mutex; -template +template inline -GrowingVectorMemory::Pool::Pool() +GrowingVectorMemory::Pool::Pool() : data(0) {} -template +template inline -GrowingVectorMemory::Pool::~Pool() +GrowingVectorMemory::Pool::~Pool() { // Nothing to do if memory was unused. if (data == 0) return; @@ -58,10 +58,10 @@ GrowingVectorMemory::Pool::~Pool() } -template +template inline void -GrowingVectorMemory::Pool::initialize(const size_type size) +GrowingVectorMemory::Pool::initialize(const size_type size) { if (data == 0) { @@ -72,16 +72,16 @@ GrowingVectorMemory::Pool::initialize(const size_type size) ++i) { i->first = false; - i->second = new VECTOR; + i->second = new VectorType; } } } -template +template inline -GrowingVectorMemory::GrowingVectorMemory (const size_type initial_size, - const bool log_statistics) +GrowingVectorMemory::GrowingVectorMemory (const size_type initial_size, + const bool log_statistics) : total_alloc(0), @@ -93,9 +93,9 @@ GrowingVectorMemory::GrowingVectorMemory (const size_type initial_size, } -template +template inline -GrowingVectorMemory::~GrowingVectorMemory() +GrowingVectorMemory::~GrowingVectorMemory() { AssertNothrow(current_alloc == 0, StandardExceptions::ExcMemoryLeak(current_alloc)); @@ -110,10 +110,10 @@ GrowingVectorMemory::~GrowingVectorMemory() -template +template inline -VECTOR * -GrowingVectorMemory::alloc () +VectorType * +GrowingVectorMemory::alloc () { Threads::Mutex::ScopedLock lock(mutex); ++total_alloc; @@ -132,7 +132,7 @@ GrowingVectorMemory::alloc () // no free vector found, so let's // just allocate a new one - const entry_type t (true, new VECTOR); + const entry_type t (true, new VectorType); pool.data->push_back(t); return t.second; @@ -140,10 +140,10 @@ GrowingVectorMemory::alloc () -template +template inline void -GrowingVectorMemory::free(const VECTOR *const v) +GrowingVectorMemory::free(const VectorType *const v) { Threads::Mutex::ScopedLock lock(mutex); for (typename std::vector::iterator i=pool.data->begin(); @@ -156,15 +156,15 @@ GrowingVectorMemory::free(const VECTOR *const v) return; } } - Assert(false, typename VectorMemory::ExcNotAllocatedHere()); + Assert(false, typename VectorMemory::ExcNotAllocatedHere()); } -template +template inline void -GrowingVectorMemory::release_unused_memory () +GrowingVectorMemory::release_unused_memory () { Threads::Mutex::ScopedLock lock(mutex); @@ -187,10 +187,10 @@ GrowingVectorMemory::release_unused_memory () -template +template inline std::size_t -GrowingVectorMemory::memory_consumption () const +GrowingVectorMemory::memory_consumption () const { Threads::Mutex::ScopedLock lock(mutex); diff --git a/include/deal.II/multigrid/mg_base.h b/include/deal.II/multigrid/mg_base.h index 923d9b0b82..1b3384e81b 100644 --- a/include/deal.II/multigrid/mg_base.h +++ b/include/deal.II/multigrid/mg_base.h @@ -45,7 +45,7 @@ template class MGLevelObject; * * @author Guido Kanschat, 2002 */ -template +template class MGMatrixBase : public Subscriptor { public: @@ -58,29 +58,29 @@ public: * Matrix-vector-multiplication on a certain level. */ virtual void vmult (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; /** * Adding matrix-vector-multiplication on a certain level. */ virtual void vmult_add (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; /** * Transpose matrix-vector-multiplication on a certain level. */ virtual void Tvmult (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; /** * Adding transpose matrix-vector-multiplication on a certain level. */ virtual void Tvmult_add (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; }; @@ -91,7 +91,7 @@ public: * * @author Guido Kanschat, 2002 */ -template +template class MGCoarseGridBase : public Subscriptor { public: @@ -103,9 +103,9 @@ public: /** * Solution operator. */ - virtual void operator() (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const = 0; + virtual void operator() (const unsigned int level, + VectorType &dst, + const VectorType &src) const = 0; }; @@ -156,7 +156,7 @@ public: * * @author Wolfgang Bangerth, Guido Kanschat, 1999, 2002, 2007 */ -template +template class MGTransferBase : public Subscriptor { public: @@ -176,8 +176,8 @@ public: * finer level. */ virtual void prolongate (const unsigned int to_level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; /** * Restrict a vector from level from_level to level @@ -195,8 +195,8 @@ public: * */ virtual void restrict_and_add (const unsigned int from_level, - VECTOR &dst, - const VECTOR &src) const = 0; + VectorType &dst, + const VectorType &src) const = 0; }; @@ -207,7 +207,7 @@ public: * * @author Guido Kanschat, 2002 */ -template +template class MGSmootherBase : public Subscriptor { public: @@ -224,8 +224,8 @@ public: * Smoothing function. This is the function used in multigrid methods. */ virtual void smooth (const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const = 0; + VectorType &u, + const VectorType &rhs) const = 0; }; /*@}*/ diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index 13a4810966..74a2a679c3 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -37,8 +37,8 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat, 1999, Ralf Hartmann, 2002. */ -template > -class MGCoarseGridLACIteration : public MGCoarseGridBase +template > +class MGCoarseGridLACIteration : public MGCoarseGridBase { public: /** @@ -77,9 +77,9 @@ public: * Implementation of the abstract function. Calls the solver method with * matrix, vectors and preconditioner. */ - void operator() (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const; + void operator() (const unsigned int level, + VectorType &dst, + const VectorType &src) const; /** * Sets the matrix. This gives the possibility to replace the matrix that @@ -92,17 +92,17 @@ private: /** * Reference to the solver. */ - SmartPointer > solver; + SmartPointer > solver; /** * Reference to the matrix. */ - PointerMatrixBase *matrix; + PointerMatrixBase *matrix; /** * Reference to the preconditioner. */ - PointerMatrixBase *precondition; + PointerMatrixBase *precondition; }; @@ -117,8 +117,8 @@ private: * * @author Guido Kanschat, 2003, 2012 */ -template > -class MGCoarseGridHouseholder : public MGCoarseGridBase +template > +class MGCoarseGridHouseholder : public MGCoarseGridBase { public: /** @@ -131,9 +131,9 @@ public: */ void initialize (const FullMatrix &A); - void operator() (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const; + void operator() (const unsigned int level, + VectorType &dst, + const VectorType &src) const; private: /** @@ -150,8 +150,8 @@ private: * * @author Guido Kanschat, 2003, 2012 */ -template > -class MGCoarseGridSVD : public MGCoarseGridBase +template > +class MGCoarseGridSVD : public MGCoarseGridBase { public: /** @@ -164,9 +164,9 @@ public: */ void initialize (const FullMatrix &A, const double threshold = 0); - void operator() (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const; + void operator() (const unsigned int level, + VectorType &dst, + const VectorType &src) const; /** * Write the singular values to @p deallog. @@ -187,8 +187,8 @@ private: /* ------------------ Functions for MGCoarseGridLACIteration ------------ */ -template -MGCoarseGridLACIteration +template +MGCoarseGridLACIteration ::MGCoarseGridLACIteration() : solver(0, typeid(*this).name()), @@ -197,32 +197,32 @@ MGCoarseGridLACIteration {} -template +template template -MGCoarseGridLACIteration +MGCoarseGridLACIteration ::MGCoarseGridLACIteration(SOLVER &s, const MATRIX &m, const PRECOND &p) : solver(&s, typeid(*this).name()) { - matrix = new PointerMatrix(&m); - precondition = new PointerMatrix(&p); + matrix = new PointerMatrix(&m); + precondition = new PointerMatrix(&p); } -template -MGCoarseGridLACIteration +template +MGCoarseGridLACIteration ::~MGCoarseGridLACIteration() { clear(); } -template +template template void -MGCoarseGridLACIteration +MGCoarseGridLACIteration ::initialize(SOLVER &s, const MATRIX &m, const PRECOND &p) @@ -230,16 +230,16 @@ MGCoarseGridLACIteration solver = &s; if (matrix) delete matrix; - matrix = new PointerMatrix(&m); + matrix = new PointerMatrix(&m); if (precondition) delete precondition; - precondition = new PointerMatrix(&p); + precondition = new PointerMatrix(&p); } -template +template void -MGCoarseGridLACIteration +MGCoarseGridLACIteration ::clear() { solver = 0; @@ -252,12 +252,12 @@ MGCoarseGridLACIteration } -template +template void -MGCoarseGridLACIteration -::operator() (const unsigned int /* level */, - VECTOR &dst, - const VECTOR &src) const +MGCoarseGridLACIteration +::operator() (const unsigned int /* level */, + VectorType &dst, + const VectorType &src) const { Assert(solver!=0, ExcNotInitialized()); Assert(matrix!=0, ExcNotInitialized()); @@ -266,21 +266,21 @@ MGCoarseGridLACIteration } -template +template template void -MGCoarseGridLACIteration +MGCoarseGridLACIteration ::set_matrix(const MATRIX &m) { if (matrix) delete matrix; - matrix = new PointerMatrix(&m); + matrix = new PointerMatrix(&m); } //--------------------------------------------------------------------------- -template -MGCoarseGridHouseholder::MGCoarseGridHouseholder( +template +MGCoarseGridHouseholder::MGCoarseGridHouseholder( const FullMatrix *A) { if (A != 0) householder.initialize(*A); @@ -288,9 +288,9 @@ MGCoarseGridHouseholder::MGCoarseGridHouseholder( -template +template void -MGCoarseGridHouseholder::initialize( +MGCoarseGridHouseholder::initialize( const FullMatrix &A) { householder.initialize(A); @@ -298,28 +298,28 @@ MGCoarseGridHouseholder::initialize( -template +template void -MGCoarseGridHouseholder::operator() ( +MGCoarseGridHouseholder::operator() ( const unsigned int /*level*/, - VECTOR &dst, - const VECTOR &src) const + VectorType &dst, + const VectorType &src) const { householder.least_squares(dst, src); } //--------------------------------------------------------------------------- -template +template inline -MGCoarseGridSVD::MGCoarseGridSVD() +MGCoarseGridSVD::MGCoarseGridSVD() {} -template +template void -MGCoarseGridSVD::initialize( +MGCoarseGridSVD::initialize( const FullMatrix &A, double threshold) { @@ -329,20 +329,20 @@ MGCoarseGridSVD::initialize( } -template +template void -MGCoarseGridSVD::operator() ( +MGCoarseGridSVD::operator() ( const unsigned int /*level*/, - VECTOR &dst, - const VECTOR &src) const + VectorType &dst, + const VectorType &src) const { matrix.vmult(dst, src); } -template +template void -MGCoarseGridSVD::log() const +MGCoarseGridSVD::log() const { const unsigned int n = std::min(matrix.n_rows(), matrix.n_cols()); diff --git a/include/deal.II/multigrid/mg_matrix.h b/include/deal.II/multigrid/mg_matrix.h index 78dd2b1dbb..51887c87d7 100644 --- a/include/deal.II/multigrid/mg_matrix.h +++ b/include/deal.II/multigrid/mg_matrix.h @@ -38,9 +38,9 @@ namespace mg * @author Guido Kanschat * @date 2002, 2010 */ - template > + template > class Matrix - : public MGMatrixBase + : public MGMatrixBase { public: /** @@ -66,19 +66,19 @@ namespace mg /** * Access matrix on a level. */ - const PointerMatrixBase &operator[] (unsigned int level) const; + const PointerMatrixBase &operator[] (unsigned int level) const; - virtual void vmult (const unsigned int level, VECTOR &dst, const VECTOR &src) const; - virtual void vmult_add (const unsigned int level, VECTOR &dst, const VECTOR &src) const; - virtual void Tvmult (const unsigned int level, VECTOR &dst, const VECTOR &src) const; - virtual void Tvmult_add (const unsigned int level, VECTOR &dst, const VECTOR &src) const; + virtual void vmult (const unsigned int level, VectorType &dst, const VectorType &src) const; + virtual void vmult_add (const unsigned int level, VectorType &dst, const VectorType &src) const; + virtual void Tvmult (const unsigned int level, VectorType &dst, const VectorType &src) const; + virtual void Tvmult_add (const unsigned int level, VectorType &dst, const VectorType &src) const; /** * Memory used by this object. */ std::size_t memory_consumption () const; private: - MGLevelObject > > matrices; + MGLevelObject > > matrices; }; } @@ -168,88 +168,87 @@ private: namespace mg { - template + template template inline void - Matrix::initialize (const MGLevelObject &p) + Matrix::initialize (const MGLevelObject &p) { matrices.resize(p.min_level(), p.max_level()); for (unsigned int level=p.min_level(); level <= p.max_level(); ++level) - matrices[level] = std_cxx11::shared_ptr > (new_pointer_matrix_base(p[level], VECTOR())); + matrices[level] = std_cxx11::shared_ptr > + (new_pointer_matrix_base(p[level], VectorType())); } - template + template template inline - Matrix::Matrix (const MGLevelObject &p) + Matrix::Matrix (const MGLevelObject &p) { initialize(p); } - template + template inline - Matrix::Matrix () + Matrix::Matrix () {} - template + template inline - const PointerMatrixBase & - Matrix::operator[] (unsigned int level) const + const PointerMatrixBase & + Matrix::operator[] (unsigned int level) const { return *matrices[level]; } - template + template void - Matrix::vmult ( - const unsigned int level, - VECTOR &dst, - const VECTOR &src) const + Matrix::vmult (const unsigned int level, + VectorType &dst, + const VectorType &src) const { matrices[level]->vmult(dst, src); } - template + template void - Matrix::vmult_add ( - const unsigned int level, - VECTOR &dst, - const VECTOR &src) const + Matrix::vmult_add (const unsigned int level, + VectorType &dst, + const VectorType &src) const { matrices[level]->vmult_add(dst, src); } - template + template void - Matrix::Tvmult (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const + Matrix::Tvmult (const unsigned int level, + VectorType &dst, + const VectorType &src) const { matrices[level]->Tvmult(dst, src); } - template + template void - Matrix::Tvmult_add (const unsigned int level, - VECTOR &dst, - const VECTOR &src) const + Matrix::Tvmult_add (const unsigned int level, + VectorType &dst, + const VectorType &src) const { matrices[level]->Tvmult_add(dst, src); } - template + template inline std::size_t - Matrix::memory_consumption () const + Matrix::memory_consumption () const { return sizeof(*this) + matrices->memory_consumption(); } diff --git a/include/deal.II/multigrid/mg_smoother.h b/include/deal.II/multigrid/mg_smoother.h index da058062ea..96dcd81dc1 100644 --- a/include/deal.II/multigrid/mg_smoother.h +++ b/include/deal.II/multigrid/mg_smoother.h @@ -42,8 +42,8 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat 2009 */ -template -class MGSmoother : public MGSmootherBase +template +class MGSmoother : public MGSmootherBase { public: /** @@ -88,7 +88,7 @@ protected: * The object is marked as mutable since we will need to use it to allocate * temporary vectors also in functions that are const. */ - mutable GrowingVectorMemory vector_memory; + mutable GrowingVectorMemory vector_memory; /** * Number of smoothing steps on the finest level. If no #variable smoothing @@ -129,8 +129,8 @@ protected: * * @author Guido Kanschat, 1999, 2002 */ -template -class MGSmootherIdentity : public MGSmootherBase +template +class MGSmootherIdentity : public MGSmootherBase { public: /** @@ -139,8 +139,8 @@ public: * that the the smoothing operator equals the null operator. */ virtual void smooth (const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const; + VectorType &u, + const VectorType &rhs) const; virtual void clear (); }; @@ -152,8 +152,8 @@ namespace mg * * A relaxation class is an object that has two member functions, * @code - * void step(VECTOR& x, const VECTOR& d) const; - * void Tstep(VECTOR& x, const VECTOR& d) const; + * void step(VectorType& x, const VectorType& d) const; + * void Tstep(VectorType& x, const VectorType& d) const; * @endcode * performing one step of the smoothing scheme. * @@ -180,8 +180,8 @@ namespace mg * @author Guido Kanschat, * @date 2003, 2009, 2010 */ - template - class SmootherRelaxation : public MGLevelObject, public MGSmoother + template + class SmootherRelaxation : public MGLevelObject, public MGSmoother { public: /** @@ -223,8 +223,8 @@ namespace mg * The actual smoothing method. */ virtual void smooth (const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const; + VectorType &u, + const VectorType &rhs) const; /** * Memory used by this object. @@ -238,8 +238,8 @@ namespace mg * * A relaxation class is an object that has two member functions, * @code - * void step(VECTOR& x, const VECTOR& d) const; - * void Tstep(VECTOR& x, const VECTOR& d) const; + * void step(VectorType& x, const VectorType& d) const; + * void Tstep(VectorType& x, const VectorType& d) const; * @endcode * performing one step of the smoothing scheme. * @@ -270,8 +270,8 @@ namespace mg * * @author Guido Kanschat, 2003 */ -template -class MGSmootherRelaxation : public MGSmoother +template +class MGSmootherRelaxation : public MGSmoother { public: /** @@ -345,8 +345,8 @@ public: * The actual smoothing method. */ virtual void smooth (const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const; + VectorType &u, + const VectorType &rhs) const; /** * Object containing relaxation methods. @@ -363,7 +363,7 @@ private: /** * Pointer to the matrices. */ - MGLevelObject > matrices; + MGLevelObject > matrices; }; @@ -399,8 +399,8 @@ private: * * @author Guido Kanschat, 2009 */ -template -class MGSmootherPrecondition : public MGSmoother +template +class MGSmootherPrecondition : public MGSmoother { public: /** @@ -474,8 +474,8 @@ public: * The actual smoothing method. */ virtual void smooth (const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const; + VectorType &u, + const VectorType &rhs) const; /** * Object containing relaxation methods. @@ -492,7 +492,7 @@ private: /** * Pointer to the matrices. */ - MGLevelObject > matrices; + MGLevelObject > matrices; }; @@ -502,23 +502,23 @@ private: #ifndef DOXYGEN -template +template inline void -MGSmootherIdentity::smooth ( - const unsigned int, VECTOR &, - const VECTOR &) const +MGSmootherIdentity::smooth (const unsigned int, + VectorType &, + const VectorType &) const {} -template +template inline void -MGSmootherIdentity::clear () +MGSmootherIdentity::clear () {} //--------------------------------------------------------------------------- -template +template inline -MGSmoother::MGSmoother( +MGSmoother::MGSmoother( const unsigned int steps, const bool variable, const bool symmetric, @@ -532,41 +532,41 @@ MGSmoother::MGSmoother( {} -template +template inline void -MGSmoother::set_steps (const unsigned int s) +MGSmoother::set_steps (const unsigned int s) { steps = s; } -template +template inline void -MGSmoother::set_debug (const unsigned int s) +MGSmoother::set_debug (const unsigned int s) { debug = s; } -template +template inline void -MGSmoother::set_variable (const bool flag) +MGSmoother::set_variable (const bool flag) { variable = flag; } -template +template inline void -MGSmoother::set_symmetric (const bool flag) +MGSmoother::set_symmetric (const bool flag) { symmetric = flag; } -template +template inline void -MGSmoother::set_transpose (const bool flag) +MGSmoother::set_transpose (const bool flag) { transpose = flag; } @@ -575,29 +575,29 @@ MGSmoother::set_transpose (const bool flag) namespace mg { - template + template inline - SmootherRelaxation::SmootherRelaxation( + SmootherRelaxation::SmootherRelaxation( const unsigned int steps, const bool variable, const bool symmetric, const bool transpose) - : MGSmoother(steps, variable, symmetric, transpose) + : MGSmoother(steps, variable, symmetric, transpose) {} - template + template inline void - SmootherRelaxation::clear () + SmootherRelaxation::clear () { MGLevelObject::clear(); } - template + template template inline void - SmootherRelaxation::initialize ( + SmootherRelaxation::initialize ( const MGLevelObject &m, const typename RELAX::AdditionalData &data) { @@ -611,10 +611,10 @@ namespace mg } - template + template template inline void - SmootherRelaxation::initialize ( + SmootherRelaxation::initialize ( const MGLevelObject &m, const MGLevelObject &data) { @@ -628,12 +628,11 @@ namespace mg } - template + template inline void - SmootherRelaxation::smooth( - const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const + SmootherRelaxation::smooth (const unsigned int level, + VectorType &u, + const VectorType &rhs) const { unsigned int maxlevel = this->max_level(); unsigned int steps2 = this->steps; @@ -659,10 +658,10 @@ namespace mg } - template + template inline std::size_t - SmootherRelaxation:: + SmootherRelaxation:: memory_consumption () const { return sizeof(*this) @@ -675,22 +674,22 @@ namespace mg //----------------------------------------------------------------------// -template +template inline -MGSmootherRelaxation::MGSmootherRelaxation( +MGSmootherRelaxation::MGSmootherRelaxation( const unsigned int steps, const bool variable, const bool symmetric, const bool transpose) : - MGSmoother(steps, variable, symmetric, transpose) + MGSmoother(steps, variable, symmetric, transpose) {} -template +template inline void -MGSmootherRelaxation::clear () +MGSmootherRelaxation::clear () { smoothers.clear(); @@ -701,10 +700,10 @@ MGSmootherRelaxation::clear () } -template +template template inline void -MGSmootherRelaxation::initialize ( +MGSmootherRelaxation::initialize ( const MGLevelObject &m, const typename RELAX::AdditionalData &data) { @@ -721,10 +720,10 @@ MGSmootherRelaxation::initialize ( } } -template +template template inline void -MGSmootherRelaxation::initialize ( +MGSmootherRelaxation::initialize ( const MGLevelObject &m, const MGLevelObject &data) { @@ -746,10 +745,10 @@ MGSmootherRelaxation::initialize ( } } -template +template template inline void -MGSmootherRelaxation::initialize ( +MGSmootherRelaxation::initialize ( const MGLevelObject &m, const DATA &data, const unsigned int row, @@ -768,10 +767,10 @@ MGSmootherRelaxation::initialize ( } } -template +template template inline void -MGSmootherRelaxation::initialize ( +MGSmootherRelaxation::initialize ( const MGLevelObject &m, const MGLevelObject &data, const unsigned int row, @@ -796,12 +795,11 @@ MGSmootherRelaxation::initialize ( } -template +template inline void -MGSmootherRelaxation::smooth( - const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const +MGSmootherRelaxation::smooth (const unsigned int level, + VectorType &u, + const VectorType &rhs) const { unsigned int maxlevel = smoothers.max_level(); unsigned int steps2 = this->steps; @@ -828,10 +826,10 @@ MGSmootherRelaxation::smooth( -template +template inline std::size_t -MGSmootherRelaxation:: +MGSmootherRelaxation:: memory_consumption () const { return sizeof(*this) @@ -843,22 +841,22 @@ memory_consumption () const //----------------------------------------------------------------------// -template +template inline -MGSmootherPrecondition::MGSmootherPrecondition( +MGSmootherPrecondition::MGSmootherPrecondition( const unsigned int steps, const bool variable, const bool symmetric, const bool transpose) : - MGSmoother(steps, variable, symmetric, transpose) + MGSmoother(steps, variable, symmetric, transpose) {} -template +template inline void -MGSmootherPrecondition::clear () +MGSmootherPrecondition::clear () { smoothers.clear(); @@ -870,10 +868,10 @@ MGSmootherPrecondition::clear () -template +template template inline void -MGSmootherPrecondition::initialize ( +MGSmootherPrecondition::initialize ( const MGLevelObject &m, const typename PRECONDITIONER::AdditionalData &data) { @@ -892,10 +890,10 @@ MGSmootherPrecondition::initialize ( -template +template template inline void -MGSmootherPrecondition::initialize ( +MGSmootherPrecondition::initialize ( const MGLevelObject &m, const MGLevelObject &data) { @@ -919,10 +917,10 @@ MGSmootherPrecondition::initialize ( -template +template template inline void -MGSmootherPrecondition::initialize ( +MGSmootherPrecondition::initialize ( const MGLevelObject &m, const DATA &data, const unsigned int row, @@ -943,10 +941,10 @@ MGSmootherPrecondition::initialize ( -template +template template inline void -MGSmootherPrecondition::initialize ( +MGSmootherPrecondition::initialize ( const MGLevelObject &m, const MGLevelObject &data, const unsigned int row, @@ -972,12 +970,12 @@ MGSmootherPrecondition::initialize ( -template +template inline void -MGSmootherPrecondition::smooth( - const unsigned int level, - VECTOR &u, - const VECTOR &rhs) const +MGSmootherPrecondition::smooth +(const unsigned int level, + VectorType &u, + const VectorType &rhs) const { unsigned int maxlevel = matrices.max_level(); unsigned int steps2 = this->steps; @@ -985,8 +983,8 @@ MGSmootherPrecondition::smooth( if (this->variable) steps2 *= (1<<(maxlevel-level)); - typename VectorMemory::Pointer r(this->vector_memory); - typename VectorMemory::Pointer d(this->vector_memory); + typename VectorMemory::Pointer r(this->vector_memory); + typename VectorMemory::Pointer d(this->vector_memory); r->reinit(u,true); d->reinit(u,true); @@ -1043,10 +1041,10 @@ MGSmootherPrecondition::smooth( -template +template inline std::size_t -MGSmootherPrecondition:: +MGSmootherPrecondition:: memory_consumption () const { return sizeof(*this) diff --git a/include/deal.II/multigrid/mg_transfer.h b/include/deal.II/multigrid/mg_transfer.h index 514a263b86..ae936df4b4 100644 --- a/include/deal.II/multigrid/mg_transfer.h +++ b/include/deal.II/multigrid/mg_transfer.h @@ -43,11 +43,11 @@ template class DoFHandler; namespace internal { - template + template struct MatrixSelector { typedef ::dealii::SparsityPattern Sparsity; - typedef ::dealii::SparseMatrix Matrix; + typedef ::dealii::SparseMatrix Matrix; template static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const DSP &dsp, const DH &) @@ -124,8 +124,8 @@ namespace internal * @author Wolfgang Bangerth, Guido Kanschat * @date 1999, 2000, 2001, 2002, 2003, 2004, 2012 */ -template -class MGTransferPrebuilt : public MGTransferBase +template +class MGTransferPrebuilt : public MGTransferBase { public: /** @@ -161,13 +161,13 @@ public: template void build_matrices (const DoFHandler &mg_dof); - virtual void prolongate (const unsigned int to_level, - VECTOR &dst, - const VECTOR &src) const; + virtual void prolongate (const unsigned int to_level, + VectorType &dst, + const VectorType &src) const; - virtual void restrict_and_add (const unsigned int from_level, - VECTOR &dst, - const VECTOR &src) const; + virtual void restrict_and_add (const unsigned int from_level, + VectorType &dst, + const VectorType &src) const; /** * Transfer from a vector on the global grid to vectors defined on each of @@ -176,8 +176,8 @@ public: template void copy_to_mg (const DoFHandler &mg_dof, - MGLevelObject &dst, - const InVector &src) const; + MGLevelObject &dst, + const InVector &src) const; /** * Transfer from multi-level vector to normal vector. @@ -188,9 +188,9 @@ public: */ template void - copy_from_mg (const DoFHandler &mg_dof, - OutVector &dst, - const MGLevelObject &src) const; + copy_from_mg (const DoFHandler &mg_dof, + OutVector &dst, + const MGLevelObject &src) const; /** * Add a multi-level vector to a normal vector. @@ -199,9 +199,9 @@ public: */ template void - copy_from_mg_add (const DoFHandler &mg_dof, - OutVector &dst, - const MGLevelObject &src) const; + copy_from_mg_add (const DoFHandler &mg_dof, + OutVector &dst, + const MGLevelObject &src) const; /** * If this object operates on BlockVector objects, we need to describe how @@ -262,14 +262,14 @@ private: /** * Sparsity patterns for transfer matrices. */ - std::vector::Sparsity> > prolongation_sparsities; + std::vector::Sparsity> > prolongation_sparsities; /** * The actual prolongation matrix. column indices belong to the dof indices * of the mother cell, i.e. the coarse level. while row indices belong to * the child cell, i.e. the fine level. */ - std::vector::Matrix> > prolongation_matrices; + std::vector::Matrix> > prolongation_matrices; /** * Mapping for the copy_to_mg() and copy_from_mg() functions. Here only @@ -316,12 +316,12 @@ private: /** * The constraints of the global system. */ - SmartPointer > constraints; + SmartPointer > constraints; /** * The mg_constrained_dofs of the level systems. */ - SmartPointer > mg_constrained_dofs; + SmartPointer > mg_constrained_dofs; }; diff --git a/include/deal.II/multigrid/mg_transfer.templates.h b/include/deal.II/multigrid/mg_transfer.templates.h index 4a776673eb..6f634159d5 100644 --- a/include/deal.II/multigrid/mg_transfer.templates.h +++ b/include/deal.II/multigrid/mg_transfer.templates.h @@ -165,13 +165,13 @@ namespace -template +template template void -MGTransferPrebuilt::copy_to_mg ( - const DoFHandler &mg_dof_handler, - MGLevelObject &dst, - const InVector &src) const +MGTransferPrebuilt::copy_to_mg +(const DoFHandler &mg_dof_handler, + MGLevelObject &dst, + const InVector &src) const { reinit_vector(mg_dof_handler, component_to_block_map, dst); bool first = true; @@ -182,7 +182,7 @@ MGTransferPrebuilt::copy_to_mg ( for (unsigned int level=mg_dof_handler.get_tria().n_global_levels(); level != 0;) { --level; - VECTOR &dst_level = dst[level]; + VectorType &dst_level = dst[level]; #ifdef DEBUG_OUTPUT MPI_Barrier(MPI_COMM_WORLD); @@ -222,13 +222,13 @@ MGTransferPrebuilt::copy_to_mg ( -template +template template void -MGTransferPrebuilt::copy_from_mg( - const DoFHandler &mg_dof_handler, - OutVector &dst, - const MGLevelObject &src) const +MGTransferPrebuilt::copy_from_mg +(const DoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject &src) const { // For non-DG: degrees of // freedom in the refinement @@ -276,13 +276,13 @@ MGTransferPrebuilt::copy_from_mg( -template +template template void -MGTransferPrebuilt::copy_from_mg_add ( - const DoFHandler &mg_dof_handler, - OutVector &dst, - const MGLevelObject &src) const +MGTransferPrebuilt::copy_from_mg_add +(const DoFHandler &mg_dof_handler, + OutVector &dst, + const MGLevelObject &src) const { // For non-DG: degrees of // freedom in the refinement @@ -311,17 +311,17 @@ MGTransferPrebuilt::copy_from_mg_add ( -template +template void -MGTransferPrebuilt:: +MGTransferPrebuilt:: set_component_to_block_map (const std::vector &map) { component_to_block_map = map; } -template +template std::size_t -MGTransferPrebuilt::memory_consumption () const +MGTransferPrebuilt::memory_consumption () const { std::size_t result = sizeof(*this); result += sizeof(unsigned int) * sizes.size(); diff --git a/include/deal.II/multigrid/multigrid.h b/include/deal.II/multigrid/multigrid.h index 1fa5a5cc21..8d20f15ac4 100644 --- a/include/deal.II/multigrid/multigrid.h +++ b/include/deal.II/multigrid/multigrid.h @@ -60,7 +60,7 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat, 1999 - 2005 */ -template +template class Multigrid : public Subscriptor { public: @@ -77,8 +77,8 @@ public: f_cycle }; - typedef VECTOR vector_type; - typedef const VECTOR const_vector_type; + typedef VectorType vector_type; + typedef const VectorType const_vector_type; /** * Constructor. The DoFHandler is used to determine the highest possible @@ -90,27 +90,27 @@ public: * this type as late as possible. */ template - Multigrid(const DoFHandler &mg_dof_handler, - const MGMatrixBase &matrix, - const MGCoarseGridBase &coarse, - const MGTransferBase &transfer, - const MGSmootherBase &pre_smooth, - const MGSmootherBase &post_smooth, - Cycle cycle = v_cycle); + Multigrid(const DoFHandler &mg_dof_handler, + const MGMatrixBase &matrix, + const MGCoarseGridBase &coarse, + const MGTransferBase &transfer, + const MGSmootherBase &pre_smooth, + const MGSmootherBase &post_smooth, + Cycle cycle = v_cycle); /** * Experimental constructor for cases in which no DoFHandler is available. * * @warning Not intended for general use. */ - Multigrid(const unsigned int minlevel, - const unsigned int maxlevel, - const MGMatrixBase &matrix, - const MGCoarseGridBase &coarse, - const MGTransferBase &transfer, - const MGSmootherBase &pre_smooth, - const MGSmootherBase &post_smooth, - Cycle cycle = v_cycle); + Multigrid(const unsigned int minlevel, + const unsigned int maxlevel, + const MGMatrixBase &matrix, + const MGCoarseGridBase &coarse, + const MGTransferBase &transfer, + const MGSmootherBase &pre_smooth, + const MGSmootherBase &post_smooth, + Cycle cycle = v_cycle); /** * Reinit this class according to #minlevel and #maxlevel. @@ -148,8 +148,8 @@ public: * edge_in. In particular, for symmetric operators, both arguments * can refer to the same matrix, saving assembling of one of them. */ - void set_edge_matrices (const MGMatrixBase &edge_out, - const MGMatrixBase &edge_in); + void set_edge_matrices (const MGMatrixBase &edge_out, + const MGMatrixBase &edge_in); /** * Set additional matrices to correct residual computation at refinement @@ -163,8 +163,8 @@ public: * edge_up. In particular, for symmetric operators, both arguments * can refer to the same matrix, saving assembling of one of them. */ - void set_edge_flux_matrices (const MGMatrixBase &edge_down, - const MGMatrixBase &edge_up); + void set_edge_flux_matrices (const MGMatrixBase &edge_down, + const MGMatrixBase &edge_up); /** * Return the finest level for multigrid. @@ -252,56 +252,56 @@ public: * Input vector for the cycle. Contains the defect of the outer method * projected to the multilevel vectors. */ - MGLevelObject defect; + MGLevelObject defect; /** * The solution update after the multigrid step. */ - MGLevelObject solution; + MGLevelObject solution; private: /** * Auxiliary vector. */ - MGLevelObject t; + MGLevelObject t; /** * Auxiliary vector for W- and F-cycles. Left uninitialized in V-cycle. */ - MGLevelObject defect2; + MGLevelObject defect2; /** * The matrix for each level. */ - SmartPointer,Multigrid > matrix; + SmartPointer,Multigrid > matrix; /** * The matrix for each level. */ - SmartPointer,Multigrid > coarse; + SmartPointer,Multigrid > coarse; /** * Object for grid tranfer. */ - SmartPointer,Multigrid > transfer; + SmartPointer,Multigrid > transfer; /** * The pre-smoothing object. */ - SmartPointer,Multigrid > pre_smooth; + SmartPointer,Multigrid > pre_smooth; /** * The post-smoothing object. */ - SmartPointer,Multigrid > post_smooth; + SmartPointer,Multigrid > post_smooth; /** * Edge matrix from the interior of the refined part to the refinement edge. * * @note Only vmult is used for these matrices. */ - SmartPointer > edge_out; + SmartPointer > edge_out; /** * Transpose edge matrix from the refinement edge to the interior of the @@ -309,21 +309,21 @@ private: * * @note Only Tvmult is used for these matrices. */ - SmartPointer > edge_in; + SmartPointer > edge_in; /** * Edge matrix from fine to coarse. * * @note Only vmult is used for these matrices. */ - SmartPointer,Multigrid > edge_down; + SmartPointer,Multigrid > edge_down; /** * Transpose edge matrix from coarse to fine. * * @note Only Tvmult is used for these matrices. */ - SmartPointer,Multigrid > edge_up; + SmartPointer,Multigrid > edge_up; /** * Level for debug output. Defaults to zero and can be set by set_debug(). @@ -339,13 +339,13 @@ private: * multi-level preconditioning and provide the standard interface for LAC * iterative methods. * - * Furthermore, it needs functions void copy_to_mg(const VECTOR&) to + * Furthermore, it needs functions void copy_to_mg(const VectorType&) to * store @p src in the right hand side of the multi-level method and void - * copy_from_mg(VECTOR&) to store the result of the v-cycle in @p dst. + * copy_from_mg(VectorType&) to store the result of the v-cycle in @p dst. * * @author Guido Kanschat, 1999, 2000, 2001, 2002 */ -template +template class PreconditionMG : public Subscriptor { public: @@ -353,9 +353,9 @@ public: * Constructor. Arguments are the multigrid object, pre-smoother, post- * smoother and coarse grid solver. */ - PreconditionMG(const DoFHandler &dof_handler, - Multigrid &mg, - const TRANSFER &transfer); + PreconditionMG(const DoFHandler &dof_handler, + Multigrid &mg, + const TRANSFER &transfer); /** * Dummy function needed by other classes. @@ -402,17 +402,17 @@ private: /** * Associated @p DoFHandler. */ - SmartPointer,PreconditionMG > dof_handler; + SmartPointer,PreconditionMG > dof_handler; /** * The multigrid object. */ - SmartPointer,PreconditionMG > multigrid; + SmartPointer,PreconditionMG > multigrid; /** * Object for grid tranfer. */ - SmartPointer > transfer; + SmartPointer > transfer; }; /*@}*/ @@ -421,15 +421,15 @@ private: /* --------------------------- inline functions --------------------- */ -template +template template -Multigrid::Multigrid (const DoFHandler &mg_dof_handler, - const MGMatrixBase &matrix, - const MGCoarseGridBase &coarse, - const MGTransferBase &transfer, - const MGSmootherBase &pre_smooth, - const MGSmootherBase &post_smooth, - Cycle cycle) +Multigrid::Multigrid (const DoFHandler &mg_dof_handler, + const MGMatrixBase &matrix, + const MGCoarseGridBase &coarse, + const MGTransferBase &transfer, + const MGSmootherBase &pre_smooth, + const MGSmootherBase &post_smooth, + Cycle cycle) : cycle_type(cycle), minlevel(0), @@ -450,20 +450,20 @@ Multigrid::Multigrid (const DoFHandler &mg_dof_handler, -template +template inline unsigned int -Multigrid::get_maxlevel () const +Multigrid::get_maxlevel () const { return maxlevel; } -template +template inline unsigned int -Multigrid::get_minlevel () const +Multigrid::get_minlevel () const { return minlevel; } @@ -472,28 +472,28 @@ Multigrid::get_minlevel () const /* --------------------------- inline functions --------------------- */ -template -PreconditionMG -::PreconditionMG(const DoFHandler &dof_handler, - Multigrid &mg, - const TRANSFER &transfer) +template +PreconditionMG +::PreconditionMG(const DoFHandler &dof_handler, + Multigrid &mg, + const TRANSFER &transfer) : dof_handler(&dof_handler), multigrid(&mg), transfer(&transfer) {} -template +template inline bool -PreconditionMG::empty () const +PreconditionMG::empty () const { return false; } -template +template template void -PreconditionMG::vmult ( +PreconditionMG::vmult ( VECTOR2 &dst, const VECTOR2 &src) const { @@ -508,10 +508,10 @@ PreconditionMG::vmult ( } -template +template template void -PreconditionMG::vmult_add ( +PreconditionMG::vmult_add ( VECTOR2 &dst, const VECTOR2 &src) const { @@ -525,10 +525,10 @@ PreconditionMG::vmult_add ( } -template +template template void -PreconditionMG::Tvmult ( +PreconditionMG::Tvmult ( VECTOR2 &, const VECTOR2 &) const { @@ -536,10 +536,10 @@ PreconditionMG::Tvmult ( } -template +template template void -PreconditionMG::Tvmult_add ( +PreconditionMG::Tvmult_add ( VECTOR2 &, const VECTOR2 &) const { diff --git a/include/deal.II/multigrid/multigrid.templates.h b/include/deal.II/multigrid/multigrid.templates.h index 968eacaba9..e4f3befa50 100644 --- a/include/deal.II/multigrid/multigrid.templates.h +++ b/include/deal.II/multigrid/multigrid.templates.h @@ -24,15 +24,15 @@ DEAL_II_NAMESPACE_OPEN -template -Multigrid::Multigrid (const unsigned int minlevel, - const unsigned int maxlevel, - const MGMatrixBase &matrix, - const MGCoarseGridBase &coarse, - const MGTransferBase &transfer, - const MGSmootherBase &pre_smooth, - const MGSmootherBase &post_smooth, - typename Multigrid::Cycle cycle) +template +Multigrid::Multigrid (const unsigned int minlevel, + const unsigned int maxlevel, + const MGMatrixBase &matrix, + const MGCoarseGridBase &coarse, + const MGTransferBase &transfer, + const MGSmootherBase &pre_smooth, + const MGSmootherBase &post_smooth, + typename Multigrid::Cycle cycle) : cycle_type(cycle), minlevel(minlevel), @@ -54,10 +54,10 @@ Multigrid::Multigrid (const unsigned int minlevel, -template +template void -Multigrid::reinit(const unsigned int min_level, - const unsigned int max_level) +Multigrid::reinit (const unsigned int min_level, + const unsigned int max_level) { minlevel=min_level; maxlevel=max_level; @@ -65,9 +65,9 @@ Multigrid::reinit(const unsigned int min_level, } -template +template void -Multigrid::set_maxlevel (const unsigned int l) +Multigrid::set_maxlevel (const unsigned int l) { Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1)); Assert (l >= minlevel, ExcIndexRange(l,minlevel,maxlevel+1)); @@ -75,10 +75,10 @@ Multigrid::set_maxlevel (const unsigned int l) } -template +template void -Multigrid::set_minlevel (const unsigned int l, - const bool relative) +Multigrid::set_minlevel (const unsigned int l, + const bool relative) { Assert (l <= maxlevel, ExcIndexRange(l,minlevel,maxlevel+1)); minlevel = (relative) @@ -87,45 +87,45 @@ Multigrid::set_minlevel (const unsigned int l, } -template +template void -Multigrid::set_cycle(typename Multigrid::Cycle c) +Multigrid::set_cycle(typename Multigrid::Cycle c) { cycle_type = c; } -template +template void -Multigrid::set_debug (const unsigned int d) +Multigrid::set_debug (const unsigned int d) { debug = d; } -template +template void -Multigrid::set_edge_matrices (const MGMatrixBase &down, - const MGMatrixBase &up) +Multigrid::set_edge_matrices (const MGMatrixBase &down, + const MGMatrixBase &up) { edge_out = &down; edge_in = &up; } -template +template void -Multigrid::set_edge_flux_matrices (const MGMatrixBase &down, - const MGMatrixBase &up) +Multigrid::set_edge_flux_matrices (const MGMatrixBase &down, + const MGMatrixBase &up) { edge_down = &down; edge_up = &up; } -template +template void -Multigrid::level_v_step(const unsigned int level) +Multigrid::level_v_step (const unsigned int level) { if (debug>0) deallog << "V-cycle entering level " << level << std::endl; @@ -243,10 +243,10 @@ Multigrid::level_v_step(const unsigned int level) -template +template void -Multigrid::level_step(const unsigned int level, - Cycle cycle) +Multigrid::level_step(const unsigned int level, + Cycle cycle) { char cychar = '?'; switch (cycle) @@ -373,9 +373,9 @@ Multigrid::level_step(const unsigned int level, } -template +template void -Multigrid::cycle() +Multigrid::cycle() { // The defect vector has been // initialized by copy_to_mg. Now @@ -400,9 +400,9 @@ Multigrid::cycle() } -template +template void -Multigrid::vcycle() +Multigrid::vcycle() { // The defect vector has been // initialized by copy_to_mg. Now diff --git a/include/deal.II/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index 08bf6caa45..0db667e817 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -638,10 +638,10 @@ public: * includes all of the usual vector types, but also IndexSet (see step-41 * for a use of this). */ - template - void add_data_vector (const VECTOR &data, + template + void add_data_vector (const VectorType &data, const std::vector &names, - const DataVectorType type = type_automatic, + const DataVectorType type = type_automatic, const std::vector &data_component_interpretation = std::vector()); @@ -661,10 +661,10 @@ public: * which FEValues can extract values on a cell using the * FEValuesBase::get_function_values() function. */ - template - void add_data_vector (const VECTOR &data, + template + void add_data_vector (const VectorType &data, const std::string &name, - const DataVectorType type = type_automatic, + const DataVectorType type = type_automatic, const std::vector &data_component_interpretation = std::vector()); @@ -682,9 +682,9 @@ public: * represents dof data, the data vector type argument present in the other * methods above is skipped. */ - template + template void add_data_vector (const DH &dof_handler, - const VECTOR &data, + const VectorType &data, const std::vector &names, const std::vector &data_component_interpretation = std::vector()); @@ -694,10 +694,10 @@ public: * This function is an abbreviation of the function above with only a scalar * @p dof_handler given and a single data name. */ - template - void add_data_vector (const DH &dof_handler, - const VECTOR &data, - const std::string &name, + template + void add_data_vector (const DH &dof_handler, + const VectorType &data, + const std::string &name, const std::vector &data_component_interpretation = std::vector()); @@ -729,8 +729,8 @@ public: * error by declaring the data postprocessor variable before the DataOut * variable as objects are destroyed in reverse order of declaration. */ - template - void add_data_vector (const VECTOR &data, + template + void add_data_vector (const VectorType &data, const DataPostprocessor &data_postprocessor); /** @@ -739,9 +739,9 @@ public: * postprocessor can only read data from the given DoFHandler and solution * vector, not other solution vectors or DoFHandlers. */ - template - void add_data_vector (const DH &dof_handler, - const VECTOR &data, + template + void add_data_vector (const DH &dof_handler, + const VectorType &data, const DataPostprocessor &data_postprocessor); /** diff --git a/include/deal.II/numerics/dof_output_operator.h b/include/deal.II/numerics/dof_output_operator.h index 727c9752de..c10475d1c2 100644 --- a/include/deal.II/numerics/dof_output_operator.h +++ b/include/deal.II/numerics/dof_output_operator.h @@ -35,8 +35,8 @@ namespace Algorithms * An output operator writing a separate file in each step and writing the * vectors as finite element functions with respect to a given DoFHandler. */ - template - class DoFOutputOperator : public OutputOperator + template + class DoFOutputOperator : public OutputOperator { public: /* @@ -53,12 +53,12 @@ namespace Algorithms void parse_parameters(ParameterHandler ¶m); void initialize (const DoFHandler &dof_handler); - virtual OutputOperator & + virtual OutputOperator & operator << (const AnyData &vectors); private: SmartPointer, - DoFOutputOperator > dof; + DoFOutputOperator > dof; const std::string filename_base; const unsigned int digits; @@ -66,9 +66,9 @@ namespace Algorithms DataOut out; }; - template + template inline void - DoFOutputOperator::initialize(const DoFHandler &dof_handler) + DoFOutputOperator::initialize(const DoFHandler &dof_handler) { dof = &dof_handler; } diff --git a/include/deal.II/numerics/dof_output_operator.templates.h b/include/deal.II/numerics/dof_output_operator.templates.h index 9712863159..8882f109a1 100644 --- a/include/deal.II/numerics/dof_output_operator.templates.h +++ b/include/deal.II/numerics/dof_output_operator.templates.h @@ -20,8 +20,8 @@ DEAL_II_NAMESPACE_OPEN namespace Algorithms { - template - DoFOutputOperator::DoFOutputOperator ( + template + DoFOutputOperator::DoFOutputOperator ( const std::string filename_base, const unsigned int digits) : @@ -32,23 +32,23 @@ namespace Algorithms } - template + template void - DoFOutputOperator::parse_parameters(ParameterHandler ¶m) + DoFOutputOperator::parse_parameters(ParameterHandler ¶m) { out.parse_parameters(param); } - template - OutputOperator & - DoFOutputOperator::operator<<( + template + OutputOperator & + DoFOutputOperator::operator<<( const AnyData &data) { Assert ((dof!=0), ExcNotInitialized()); out.attach_dof_handler (*dof); for (unsigned int i=0; i(i); + const VectorType *p = data.try_read_ptr(i); if (p!=0) { out.add_data_vector (*p, data.name(i)); diff --git a/include/deal.II/numerics/dof_print_solver_step.h b/include/deal.II/numerics/dof_print_solver_step.h index 2f65a1cab7..09f1001249 100644 --- a/include/deal.II/numerics/dof_print_solver_step.h +++ b/include/deal.II/numerics/dof_print_solver_step.h @@ -49,7 +49,7 @@ DEAL_II_NAMESPACE_OPEN * @ingroup output * @author Guido Kanschat, 2000 */ -template > +template > class DoFPrintSolverStep : public SOLVER { public: @@ -61,17 +61,17 @@ public: * produced for each iteration step. */ DoFPrintSolverStep (SolverControl &control, - VectorMemory &mem, - DataOut &data_out, - const std::string &basename); + VectorMemory &mem, + DataOut &data_out, + const std::string &basename); /** * Call-back function for the iterative method. */ virtual void print_vectors (const unsigned int step, - const VECTOR &x, - const VECTOR &r, - const VECTOR &d) const; + const VectorType &x, + const VectorType &r, + const VectorType &d) const; private: /** * Output object. @@ -87,23 +87,24 @@ private: /* ----------------------- template functions --------------- */ -template -DoFPrintSolverStep::DoFPrintSolverStep (SolverControl &control, - VectorMemory &mem, - DataOut &data_out, - const std::string &basename) +template +DoFPrintSolverStep::DoFPrintSolverStep +(SolverControl &control, + VectorMemory &mem, + DataOut &data_out, + const std::string &basename) : SOLVER (control, mem), out (data_out), basename (basename) {} -template +template void -DoFPrintSolverStep::print_vectors (const unsigned int step, - const VECTOR &x, - const VECTOR &r, - const VECTOR &d) const +DoFPrintSolverStep::print_vectors (const unsigned int step, + const VectorType &x, + const VectorType &r, + const VectorType &d) const { out.clear_data_vectors(); out.add_data_vector(x, "solution"); diff --git a/include/deal.II/numerics/fe_field_function.h b/include/deal.II/numerics/fe_field_function.h index db6bc6fdd2..658125c538 100644 --- a/include/deal.II/numerics/fe_field_function.h +++ b/include/deal.II/numerics/fe_field_function.h @@ -161,7 +161,7 @@ namespace Functions */ template , - typename VECTOR=Vector > + typename VectorType=Vector > class FEFieldFunction : public Function { public: @@ -174,7 +174,7 @@ namespace Functions * lay. Otherwise the standard Q1 mapping is used. */ FEFieldFunction (const DH &dh, - const VECTOR &data_vector, + const VectorType &data_vector, const Mapping &mapping = StaticMappingQ1::mapping); /** @@ -429,12 +429,12 @@ namespace Functions /** * Pointer to the dof handler. */ - SmartPointer > dh; + SmartPointer > dh; /** * A reference to the actual data vector. */ - const VECTOR &data_vector; + const VectorType &data_vector; /** * A reference to the mapping being used. diff --git a/include/deal.II/numerics/fe_field_function.templates.h b/include/deal.II/numerics/fe_field_function.templates.h index a905771c09..adfe897ad9 100644 --- a/include/deal.II/numerics/fe_field_function.templates.h +++ b/include/deal.II/numerics/fe_field_function.templates.h @@ -31,10 +31,10 @@ DEAL_II_NAMESPACE_OPEN namespace Functions { - template - FEFieldFunction::FEFieldFunction (const DH &mydh, - const VECTOR &myv, - const Mapping &mymapping) + template + FEFieldFunction::FEFieldFunction (const DH &mydh, + const VectorType &myv, + const Mapping &mymapping) : Function(mydh.get_fe().n_components()), dh(&mydh, "FEFieldFunction"), @@ -47,9 +47,9 @@ namespace Functions - template + template void - FEFieldFunction:: + FEFieldFunction:: set_active_cell(const typename DH::active_cell_iterator &newcell) { cell_hint.get() = newcell; @@ -57,9 +57,9 @@ namespace Functions - template - void FEFieldFunction::vector_value (const Point &p, - Vector &values) const + template + void FEFieldFunction::vector_value (const Point &p, + Vector &values) const { Assert (values.size() == n_components, ExcDimensionMismatch(values.size(), n_components)); @@ -87,18 +87,18 @@ namespace Functions FEValues fe_v(mapping, cell->get_fe(), quad, update_values); fe_v.reinit(cell); - std::vector< Vector > - vvalues (1, Vector(values.size())); + std::vector< Vector > + vvalues (1, Vector(values.size())); fe_v.get_function_values(data_vector, vvalues); values = vvalues[0]; } - template + template double - FEFieldFunction::value (const Point &p, - const unsigned int comp) const + FEFieldFunction::value (const Point &p, + const unsigned int comp) const { Vector values(n_components); vector_value(p, values); @@ -107,9 +107,9 @@ namespace Functions - template + template void - FEFieldFunction:: + FEFieldFunction:: vector_gradient (const Point &p, std::vector > &gradients) const { @@ -143,17 +143,17 @@ namespace Functions // FIXME: we need a temp argument because get_function_values wants to put // its data into an object storing the correct scalar type, but this // function wants to return everything in a vector - std::vector< std::vector > > vgrads - (1, std::vector >(n_components) ); + std::vector< std::vector > > vgrads + (1, std::vector >(n_components) ); fe_v.get_function_gradients(data_vector, vgrads); gradients = std::vector >(vgrads[0].begin(), vgrads[0].end()); } - template + template Tensor<1,dim> - FEFieldFunction:: + FEFieldFunction:: gradient (const Point &p, const unsigned int comp) const { @@ -164,9 +164,9 @@ namespace Functions - template + template void - FEFieldFunction:: + FEFieldFunction:: vector_laplacian (const Point &p, Vector &values) const { @@ -196,16 +196,16 @@ namespace Functions FEValues fe_v(mapping, cell->get_fe(), quad, update_hessians); fe_v.reinit(cell); - std::vector< Vector > - vvalues (1, Vector(values.size())); + std::vector< Vector > + vvalues (1, Vector(values.size())); fe_v.get_function_laplacians(data_vector, vvalues); values = vvalues[0]; } - template - double FEFieldFunction::laplacian + template + double FEFieldFunction::laplacian (const Point &p, const unsigned int comp) const { Vector lap(n_components); @@ -217,9 +217,9 @@ namespace Functions // Now the list versions // ============================== - template + template void - FEFieldFunction:: + FEFieldFunction:: vector_value_list (const std::vector > &points, std::vector< Vector > &values) const { @@ -252,7 +252,7 @@ namespace Functions { fe_v.reinit(cells[i], i, 0); const unsigned int nq = qpoints[i].size(); - std::vector< Vector > vvalues (nq, Vector(n_components)); + std::vector< Vector > vvalues (nq, Vector(n_components)); fe_v.get_present_fe_values ().get_function_values(data_vector, vvalues); for (unsigned int q=0; q + template void - FEFieldFunction:: + FEFieldFunction:: value_list (const std::vector > &points, - std::vector< double > &values, - const unsigned int component) const + std::vector< double > &values, + const unsigned int component) const { Assert(points.size() == values.size(), ExcDimensionMismatch(points.size(), values.size())); @@ -278,9 +278,9 @@ namespace Functions - template + template void - FEFieldFunction:: + FEFieldFunction:: vector_gradient_list (const std::vector > &points, std::vector< std::vector< Tensor<1,dim> > > &values) const @@ -314,8 +314,8 @@ namespace Functions { fe_v.reinit(cells[i], i, 0); const unsigned int nq = qpoints[i].size(); - std::vector< std::vector > > - vgrads (nq, std::vector >(n_components)); + std::vector< std::vector > > + vgrads (nq, std::vector >(n_components)); fe_v.get_present_fe_values ().get_function_gradients(data_vector, vgrads); for (unsigned int q=0; q + template void - FEFieldFunction:: + FEFieldFunction:: gradient_list (const std::vector > &points, std::vector< Tensor<1,dim> > &values, const unsigned int component) const @@ -344,9 +344,9 @@ namespace Functions } - template + template void - FEFieldFunction:: + FEFieldFunction:: vector_laplacian_list (const std::vector > &points, std::vector< Vector > &values) const { @@ -379,16 +379,16 @@ namespace Functions { fe_v.reinit(cells[i], i, 0); const unsigned int nq = qpoints[i].size(); - std::vector< Vector > vvalues (nq, Vector(n_components)); + std::vector< Vector > vvalues (nq, Vector(n_components)); fe_v.get_present_fe_values ().get_function_laplacians(data_vector, vvalues); for (unsigned int q=0; q + template void - FEFieldFunction:: + FEFieldFunction:: laplacian_list (const std::vector > &points, std::vector< double > &values, const unsigned int component) const @@ -403,8 +403,8 @@ namespace Functions - template - unsigned int FEFieldFunction:: + template + unsigned int FEFieldFunction:: compute_point_locations(const std::vector > &points, std::vector &cells, std::vector > > &qpoints, @@ -565,9 +565,9 @@ namespace Functions } - template + template boost::optional > - FEFieldFunction:: + FEFieldFunction:: get_reference_coordinates (const typename DH::active_cell_iterator &cell, const Point &point) const { diff --git a/include/deal.II/numerics/point_value_history.h b/include/deal.II/numerics/point_value_history.h index a37243a24b..7ef06fe51d 100644 --- a/include/deal.II/numerics/point_value_history.h +++ b/include/deal.II/numerics/point_value_history.h @@ -282,7 +282,7 @@ public: /** - * Put another mnemonic string (and hence @p VECTOR) into the class. This + * Put another mnemonic string (and hence @p VectorType) into the class. This * method adds storage space for variables equal to the number of true * values in component_mask. This also adds extra entries for points that * are already in the class, so @p add_field_name and @p add_points can be @@ -292,7 +292,7 @@ public: const ComponentMask &component_mask = ComponentMask()); /** - * Put another mnemonic string (and hence @p VECTOR) into the class. This + * Put another mnemonic string (and hence @p VectorType) into the class. This * method adds storage space for n_components variables. This also adds * extra entries for points that are already in the class, so @p * add_field_name and @p add_points can be called in any order. This method @@ -318,20 +318,20 @@ public: /** - * Extract values at the stored points from the VECTOR supplied and add them - * to the new dataset in vector_name. The component mask supplied when the - * field was added is used to select components to extract. If a @p + * Extract values at the stored points from the VectorType supplied and add + * them to the new dataset in vector_name. The component mask supplied when + * the field was added is used to select components to extract. If a @p * DoFHandler is used, one (and only one) evaluate_field method must be * called for each dataset (time step, iteration, etc) for each vector_name, * otherwise a @p ExcDataLostSync error can occur. */ - template + template void evaluate_field(const std::string &name, - const VECTOR &solution); + const VectorType &solution); /** - * Compute values using a @p DataPostprocessor object with the @p VECTOR + * Compute values using a @p DataPostprocessor object with the @p VectorType * supplied and add them to the new dataset in vector_name. The * component_mask supplied when the field was added is used to select * components to extract from the @p DataPostprocessor return vector. This @@ -347,26 +347,26 @@ public: * method must be called for each dataset (time step, iteration, etc) for * each vector_name, otherwise a @p ExcDataLostSync error can occur. */ - template + template void evaluate_field(const std::vector &names, - const VECTOR &solution, - const DataPostprocessor &data_postprocessor, - const Quadrature &quadrature); + const VectorType &solution, + const DataPostprocessor &data_postprocessor, + const Quadrature &quadrature); /** * Construct a std::vector containing only vector_name and * call the above function. The above function is more efficient if multiple * fields use the same @p DataPostprocessor object. */ - template - void evaluate_field(const std::string &name, - const VECTOR &solution, + template + void evaluate_field(const std::string &name, + const VectorType &solution, const DataPostprocessor &data_postprocessor, - const Quadrature &quadrature); + const Quadrature &quadrature); /** - * Extract values at the points actually requested from the VECTOR supplied + * Extract values at the points actually requested from the VectorType supplied * and add them to the new dataset in vector_name. Unlike the other * evaluate_field methods this method does not care if the dof_handler has * been modified because it uses calls to @p VectorTools::point_value to @@ -377,9 +377,9 @@ public: * called for each dataset (time step, iteration, etc) for each vector_name, * otherwise a @p ExcDataLostSync error can occur. */ - template + template void evaluate_field_at_requested_location(const std::string &name, - const VECTOR &solution); + const VectorType &solution); /** diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index e1b5278cad..738c09e3a9 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -288,7 +288,7 @@ DEAL_II_NAMESPACE_OPEN * @author Ralf Hartmann, 1999, Oliver Kayser-Herold and Wolfgang Bangerth, * 2006, Wolfgang Bangerth 2014 */ -template, class DH=DoFHandler > +template, class DH=DoFHandler > class SolutionTransfer { public: @@ -323,13 +323,13 @@ public: * vectors that are to be interpolated onto the new (refined and/or * coarsenend) grid. */ - void prepare_for_coarsening_and_refinement (const std::vector &all_in); + void prepare_for_coarsening_and_refinement (const std::vector &all_in); /** * Same as previous function but for only one discrete function to be * interpolated. */ - void prepare_for_coarsening_and_refinement (const VECTOR &in); + void prepare_for_coarsening_and_refinement (const VectorType &in); /** * This function interpolates the discrete function @p in, which is a vector @@ -342,8 +342,8 @@ public: * is called and the refinement is executed before. Multiple calling of this * function is allowed. e.g. for interpolating several functions. */ - void refine_interpolate (const VECTOR &in, - VECTOR &out) const; + void refine_interpolate (const VectorType &in, + VectorType &out) const; /** * This function interpolates the discrete functions that are stored in @p @@ -364,8 +364,8 @@ public: * the right size (@p n_dofs_refined). Otherwise an assertion will be * thrown. */ - void interpolate (const std::vector &all_in, - std::vector &all_out) const; + void interpolate (const std::vector &all_in, + std::vector &all_out) const; /** * Same as the previous function. It interpolates only one function. It @@ -376,8 +376,8 @@ public: * functions can be performed in one step by using interpolate (all_in, * all_out) */ - void interpolate (const VECTOR &in, - VECTOR &out) const; + void interpolate (const VectorType &in, + VectorType &out) const; /** * Determine an estimate for the memory consumption (in bytes) of this @@ -418,7 +418,7 @@ private: /** * Pointer to the degree of freedom handler to work with. */ - SmartPointer > dof_handler; + SmartPointer > dof_handler; /** * Stores the number of DoFs before the refinement and/or coarsening. @@ -468,7 +468,7 @@ private: indices_ptr(indices_ptr_in), dof_values_ptr (0), active_fe_index(active_fe_index_in) {}; - Pointerstruct(std::vector > *dof_values_ptr_in, + Pointerstruct(std::vector > *dof_values_ptr_in, const unsigned int active_fe_index_in = 0) : indices_ptr (0), dof_values_ptr(dof_values_ptr_in), @@ -476,7 +476,7 @@ private: std::size_t memory_consumption () const; std::vector *indices_ptr; - std::vector > *dof_values_ptr; + std::vector > *dof_values_ptr; unsigned int active_fe_index; }; @@ -492,7 +492,7 @@ private: * Is used for @p prepare_for_refining_and_coarsening The interpolated dof * values of all cells that'll be coarsened will be stored in this vector. */ - std::vector > > dof_values_on_cell; + std::vector > > dof_values_on_cell; }; diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index 1e02f20c98..82b37ba285 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -400,20 +400,20 @@ namespace VectorTools * @todo The @p mapping argument should be replaced by a * hp::MappingCollection in case of a hp::DoFHandler. */ - template class DH> - void interpolate (const Mapping &mapping, - const DH &dof, - const Function &function, - VECTOR &vec); + template class DH> + void interpolate (const Mapping &mapping, + const DH &dof, + const Function &function, + VectorType &vec); /** * Calls the @p interpolate() function above with * mapping=MappingQGeneric1@@(). */ - template - void interpolate (const DH &dof, - const Function &function, - VECTOR &vec); + template + void interpolate (const DH &dof, + const Function &function, + VectorType &vec); /** * Interpolate different finite element spaces. The interpolation of vector @@ -484,13 +484,14 @@ namespace VectorTools * * @author Valentin Zingan, 2013 */ - template + template void - interpolate_based_on_material_id(const Mapping &mapping, - const DH &dof_handler, - const std::map< types::material_id, const Function* > &function_map, - VECTOR &dst, - const ComponentMask &component_mask = ComponentMask()); + interpolate_based_on_material_id + (const Mapping &mapping, + const DH &dof_handler, + const std::map< types::material_id, const Function* > &function_map, + VectorType &dst, + const ComponentMask &component_mask = ComponentMask()); /** * Gives the interpolation of a @p dof1-function @p u1 to a @p dof2-function @@ -518,12 +519,12 @@ namespace VectorTools */ template class DH, - class VECTOR> + typename VectorType> void interpolate_to_different_mesh (const DH &dof1, - const VECTOR &u1, + const VectorType &u1, const DH &dof2, - VECTOR &u2); + VectorType &u2); /** * Gives the interpolation of a @p dof1-function @p u1 to a @p dof2-function @@ -540,13 +541,13 @@ namespace VectorTools */ template class DH, - class VECTOR> + typename VectorType> void interpolate_to_different_mesh (const DH &dof1, - const VECTOR &u1, + const VectorType &u1, const DH &dof2, const ConstraintMatrix &constraints, - VECTOR &u2); + VectorType &u2); /** @@ -558,12 +559,12 @@ namespace VectorTools */ template class DH, - class VECTOR> + typename VectorType> void interpolate_to_different_mesh (const InterGridMap > &intergridmap, - const VECTOR &u1, + const VectorType &u1, const ConstraintMatrix &constraints, - VECTOR &u2); + VectorType &u2); /** * Compute the projection of @p function to the finite element space. @@ -585,67 +586,67 @@ namespace VectorTools * In 1d, the default value of the boundary quadrature formula is an invalid * object since integration on the boundary doesn't happen in 1d. */ - template - void project (const Mapping &mapping, - const DoFHandler &dof, - const ConstraintMatrix &constraints, - const Quadrature &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary = false, - const Quadrature &q_boundary = (dim > 1 ? - QGauss(2) : - Quadrature(0)), - const bool project_to_boundary_first = false); + template + void project (const Mapping &mapping, + const DoFHandler &dof, + const ConstraintMatrix &constraints, + const Quadrature &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary = false, + const Quadrature &q_boundary = (dim > 1 ? + QGauss(2) : + Quadrature(0)), + const bool project_to_boundary_first = false); /** * Calls the project() function above, with * mapping=MappingQGeneric@(1). */ - template - void project (const DoFHandler &dof, - const ConstraintMatrix &constraints, - const Quadrature &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary = false, - const Quadrature &q_boundary = (dim > 1 ? + template + void project (const DoFHandler &dof, + const ConstraintMatrix &constraints, + const Quadrature &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary = false, + const Quadrature &q_boundary = (dim > 1 ? QGauss(2) : Quadrature(0)), - const bool project_to_boundary_first = false); + const bool project_to_boundary_first = false); /** * Same as above, but for arguments of type hp::DoFHandler, * hp::QuadratureCollection, hp::MappingCollection */ - template - void project (const hp::MappingCollection &mapping, - const hp::DoFHandler &dof, - const ConstraintMatrix &constraints, - const hp::QCollection &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary = false, - const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? - QGauss(2) : - Quadrature(0)), - const bool project_to_boundary_first = false); + template + void project (const hp::MappingCollection &mapping, + const hp::DoFHandler &dof, + const ConstraintMatrix &constraints, + const hp::QCollection &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary = false, + const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? + QGauss(2) : + Quadrature(0)), + const bool project_to_boundary_first = false); /** * Calls the project() function above, with a collection of * $Q_1$ mapping objects, i.e., with hp::StaticMappingQ1::mapping_collection. */ - template - void project (const hp::DoFHandler &dof, - const ConstraintMatrix &constraints, - const hp::QCollection &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary = false, - const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? - QGauss(2) : - Quadrature(0)), - const bool project_to_boundary_first = false); + template + void project (const hp::DoFHandler &dof, + const ConstraintMatrix &constraints, + const hp::QCollection &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary = false, + const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? + QGauss(2) : + Quadrature(0)), + const bool project_to_boundary_first = false); /** * Compute Dirichlet boundary conditions. This function makes up a map of @@ -1963,7 +1964,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_difference (const DoFHandler &dof, const VectorType &fe_function, const Function &exact_solution, @@ -1982,7 +1983,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_difference (const Mapping &mapping, const DoFHandler &dof, const VectorType &fe_function, @@ -2001,7 +2002,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_value (const DoFHandler &dof, const VectorType &fe_function, @@ -2014,7 +2015,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_value (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -2036,7 +2037,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template double point_value (const DoFHandler &dof, const VectorType &fe_function, @@ -2048,7 +2049,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template double point_value (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -2065,7 +2066,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_value (const Mapping &mapping, const DoFHandler &dof, @@ -2079,7 +2080,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_value (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -2098,7 +2099,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template double point_value (const Mapping &mapping, const DoFHandler &dof, @@ -2111,7 +2112,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template double point_value (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -2129,7 +2130,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_gradient (const DoFHandler &dof, const VectorType &fe_function, @@ -2142,7 +2143,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_gradient (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -2160,7 +2161,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const DoFHandler &dof, const VectorType &fe_function, @@ -2172,7 +2173,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -2189,7 +2190,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_gradient (const Mapping &mapping, const DoFHandler &dof, @@ -2203,7 +2204,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template void point_gradient (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -2222,7 +2223,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const Mapping &mapping, const DoFHandler &dof, @@ -2235,7 +2236,7 @@ namespace VectorTools * @note If the cell in which the point is found is not locally owned, an * exception of type VectorTools::ExcPointNotAvailableHere is thrown. */ - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -2294,8 +2295,8 @@ namespace VectorTools * not equal to $(1,1,\ldots,1)^T$. For such elements, a different procedure * has to be used when subtracting the mean value. */ - template - void subtract_mean_value(VECTOR &v, + template + void subtract_mean_value(VectorType &v, const std::vector &p_select = std::vector()); @@ -2321,7 +2322,7 @@ namespace VectorTools * Lagrangian elements. For all other elements, you will need to compute the * mean value and subtract it right inside the evaluation routine. */ - template + template double compute_mean_value (const Mapping &mapping, const DoFHandler &dof, const Quadrature &quadrature, @@ -2332,7 +2333,7 @@ namespace VectorTools * Calls the other compute_mean_value() function, see above, with * mapping=MappingQGeneric@(1). */ - template + template double compute_mean_value (const DoFHandler &dof, const Quadrature &quadrature, const VectorType &v, @@ -2348,14 +2349,14 @@ namespace VectorTools * points of a FE_Q() finite element of the same degree as the * degree of the required components. * - * Curved manifold are respected, and the resulting VECTOR will be + * Curved manifold are respected, and the resulting VectorType will be * geometrically consistent. The resulting map is guaranteed to be * interpolatory at the support points of a FE_Q() finite element of * the same degree as the degree of the required components. * * If the underlying finite element is an FE_Q(1)^spacedim, then the - * resulting VECTOR is a finite element field representation of the vertices - * of the Triangulation. + * resulting @p VectorType is a finite element field representation of the + * vertices of the Triangulation. * * The optional ComponentMask argument can be used to specify what * components of the FiniteElement to use to describe the geometry. If no @@ -2368,9 +2369,9 @@ namespace VectorTools * * @author Luca Heltai, 2015 */ - template + template void get_position_vector(const DH &dh, - VECTOR &vector, + VectorType &vector, const ComponentMask &mask=ComponentMask()); //@} diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 2a0a2d6643..03fde39e59 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -73,11 +73,11 @@ DEAL_II_NAMESPACE_OPEN namespace VectorTools { - template class DH> - void interpolate (const Mapping &mapping, - const DH &dof, - const Function &function, - VECTOR &vec) + template class DH> + void interpolate (const Mapping &mapping, + const DH &dof, + const Function &function, + VectorType &vec) { Assert (vec.size() == dof.n_dofs(), ExcDimensionMismatch (vec.size(), dof.n_dofs())); @@ -269,10 +269,10 @@ namespace VectorTools } - template - void interpolate (const DH &dof, - const Function &function, - VECTOR &vec) + template + void interpolate (const DH &dof, + const Function &function, + VectorType &vec) { interpolate(StaticMappingQ1::mapping, dof, function, vec); @@ -332,12 +332,12 @@ namespace VectorTools } - template + template void interpolate_based_on_material_id(const Mapping &mapping, const DH &dof, const std::map< types::material_id, const Function* > &function_map, - VECTOR &dst, + VectorType &dst, const ComponentMask &component_mask) { const unsigned int dim = DH::dimension; @@ -541,9 +541,7 @@ namespace VectorTools - template class DH, - class VectorType> + template class DH, typename VectorType> void interpolate_to_different_mesh (const DH &dof1, const VectorType &u1, @@ -565,9 +563,7 @@ namespace VectorTools - template class DH, - class VectorType> + template class DH, typename VectorType> void interpolate_to_different_mesh (const DH &dof1, const VectorType &u1, @@ -605,9 +601,7 @@ namespace VectorTools } - template class DH, - class VectorType> + template class DH, typename VectorType> void interpolate_to_different_mesh (const InterGridMap > &intergridmap, const VectorType &u1, @@ -682,10 +676,8 @@ namespace VectorTools /** * Compute the boundary values to be used in the project() functions. */ - template class DH, - template class M_or_MC, - template class Q_or_QC> + template class DH, + template class M_or_MC, template class Q_or_QC> void project_compute_b_v (const M_or_MC &mapping, const DH &dof, const Function &function, @@ -749,20 +741,17 @@ namespace VectorTools /** * Generic implementation of the project() function */ - template class DH, - template class M_or_MC, - template class Q_or_QC> - void do_project (const M_or_MC &mapping, - const DH &dof, - const ConstraintMatrix &constraints, - const Q_or_QC &quadrature, - const Function &function, - VectorType &vec_result, - const bool enforce_zero_boundary, - const Q_or_QC &q_boundary, - const bool project_to_boundary_first) + template class DH, + template class M_or_MC, template class Q_or_QC> + void do_project (const M_or_MC &mapping, + const DH &dof, + const ConstraintMatrix &constraints, + const Q_or_QC &quadrature, + const Function &function, + VectorType &vec_result, + const bool enforce_zero_boundary, + const Q_or_QC &q_boundary, + const bool project_to_boundary_first) { Assert (dof.get_fe().n_components() == function.n_components, ExcDimensionMismatch(dof.get_fe().n_components(), @@ -842,16 +831,16 @@ namespace VectorTools } - template + template void project (const Mapping &mapping, const DoFHandler &dof, - const ConstraintMatrix &constraints, - const Quadrature &quadrature, - const Function &function, - VECTOR &vec_result, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + const ConstraintMatrix &constraints, + const Quadrature &quadrature, + const Function &function, + VectorType &vec_result, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { do_project (mapping, dof, constraints, quadrature, function, vec_result, @@ -860,15 +849,15 @@ namespace VectorTools } - template + template void project (const DoFHandler &dof, - const ConstraintMatrix &constraints, - const Quadrature &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary, - const Quadrature &q_boundary, - const bool project_to_boundary_first) + const ConstraintMatrix &constraints, + const Quadrature &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary, + const Quadrature &q_boundary, + const bool project_to_boundary_first) { project(StaticMappingQ1::mapping, dof, constraints, quadrature, function, vec, enforce_zero_boundary, q_boundary, project_to_boundary_first); @@ -876,16 +865,16 @@ namespace VectorTools - template - void project (const hp::MappingCollection &mapping, - const hp::DoFHandler &dof, - const ConstraintMatrix &constraints, - const hp::QCollection &quadrature, - const Function &function, - VECTOR &vec_result, - const bool enforce_zero_boundary, - const hp::QCollection &q_boundary, - const bool project_to_boundary_first) + template + void project (const hp::MappingCollection &mapping, + const hp::DoFHandler &dof, + const ConstraintMatrix &constraints, + const hp::QCollection &quadrature, + const Function &function, + VectorType &vec_result, + const bool enforce_zero_boundary, + const hp::QCollection &q_boundary, + const bool project_to_boundary_first) { do_project (mapping, dof, constraints, quadrature, function, vec_result, @@ -894,15 +883,15 @@ namespace VectorTools } - template + template void project (const hp::DoFHandler &dof, - const ConstraintMatrix &constraints, - const hp::QCollection &quadrature, - const Function &function, - VECTOR &vec, - const bool enforce_zero_boundary, - const hp::QCollection &q_boundary, - const bool project_to_boundary_first) + const ConstraintMatrix &constraints, + const hp::QCollection &quadrature, + const Function &function, + VectorType &vec, + const bool enforce_zero_boundary, + const hp::QCollection &q_boundary, + const bool project_to_boundary_first) { project(hp::StaticMappingQ1::mapping_collection, dof, constraints, quadrature, function, vec, @@ -1661,8 +1650,7 @@ namespace VectorTools // faces are points and it is far // easier to simply work on // individual vertices - template class M_or_MC> + template class M_or_MC> static inline void do_interpolate_boundary_values (const M_or_MC &, const DH &dof, @@ -1744,9 +1732,7 @@ namespace VectorTools // dim_, it is clearly less specialized than the 1d function above and // whenever possible (i.e., if dim==1), the function template above // will be used - template class M_or_MC, - int dim_> + template class M_or_MC, int dim_> static inline void do_interpolate_boundary_values (const M_or_MC &mapping, @@ -2153,10 +2139,8 @@ namespace VectorTools namespace { - template class DH, - template class M_or_MC, - template class Q_or_QC> + template class DH, + template class M_or_MC, template class Q_or_QC> void do_project_boundary_values (const M_or_MC &mapping, const DH &dof, @@ -6541,7 +6525,7 @@ namespace VectorTools - template + template void point_difference (const DoFHandler &dof, const VectorType &fe_function, @@ -6558,7 +6542,7 @@ namespace VectorTools } - template + template void point_difference (const Mapping &mapping, const DoFHandler &dof, @@ -6604,7 +6588,7 @@ namespace VectorTools } - template + template void point_value (const DoFHandler &dof, const VectorType &fe_function, @@ -6620,7 +6604,7 @@ namespace VectorTools } - template + template void point_value (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -6635,7 +6619,7 @@ namespace VectorTools } - template + template double point_value (const DoFHandler &dof, const VectorType &fe_function, @@ -6648,7 +6632,7 @@ namespace VectorTools } - template + template double point_value (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -6661,7 +6645,7 @@ namespace VectorTools } - template + template void point_value (const Mapping &mapping, const DoFHandler &dof, @@ -6702,7 +6686,7 @@ namespace VectorTools } - template + template void point_value (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -6742,7 +6726,7 @@ namespace VectorTools } - template + template double point_value (const Mapping &mapping, const DoFHandler &dof, @@ -6759,7 +6743,7 @@ namespace VectorTools } - template + template double point_value (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -6777,7 +6761,7 @@ namespace VectorTools - template + template void point_gradient (const DoFHandler &dof, const VectorType &fe_function, @@ -6793,7 +6777,7 @@ namespace VectorTools } - template + template void point_gradient (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -6808,7 +6792,7 @@ namespace VectorTools } - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const DoFHandler &dof, const VectorType &fe_function, @@ -6821,7 +6805,7 @@ namespace VectorTools } - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const hp::DoFHandler &dof, const VectorType &fe_function, @@ -6834,7 +6818,7 @@ namespace VectorTools } - template + template void point_gradient (const Mapping &mapping, const DoFHandler &dof, @@ -6876,7 +6860,7 @@ namespace VectorTools } - template + template void point_gradient (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -6915,7 +6899,7 @@ namespace VectorTools } - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const Mapping &mapping, const DoFHandler &dof, @@ -6933,7 +6917,7 @@ namespace VectorTools - template + template Tensor<1, spacedim, typename VectorType::value_type> point_gradient (const hp::MappingCollection &mapping, const hp::DoFHandler &dof, @@ -6951,9 +6935,9 @@ namespace VectorTools - template + template void - subtract_mean_value(VECTOR &v, + subtract_mean_value(VectorType &v, const std::vector &p_select) { if (p_select.size() == 0) @@ -6978,7 +6962,7 @@ namespace VectorTools Assert(p_select.size() == n, ExcDimensionMismatch(p_select.size(), n)); - typename VECTOR::value_type s = 0.; + typename VectorType::value_type s = 0.; unsigned int counter = 0; for (unsigned int i=0; i + template double compute_mean_value (const Mapping &mapping, const DoFHandler &dof, @@ -7087,7 +7071,7 @@ namespace VectorTools } - template + template double compute_mean_value (const DoFHandler &dof, const Quadrature &quadrature, @@ -7098,9 +7082,9 @@ namespace VectorTools } - template + template void get_position_vector(const DH &dh, - VECTOR &vector, + VectorType &vector, const ComponentMask &mask) { AssertDimension(vector.size(), dh.n_dofs());