From: wolf Date: Fri, 11 Apr 2003 20:03:57 +0000 (+0000) Subject: DerivativeApproximation can also work on BlockVector arguments. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66f810092d47aade45b0983c8a77c50fd8518864;p=dealii-svn.git DerivativeApproximation can also work on BlockVector arguments. git-svn-id: https://svn.dealii.org/trunk@7391 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/derivative_approximation.h b/deal.II/deal.II/include/numerics/derivative_approximation.h index 3ece87276e..208d95155a 100644 --- a/deal.II/deal.II/include/numerics/derivative_approximation.h +++ b/deal.II/deal.II/include/numerics/derivative_approximation.h @@ -180,11 +180,11 @@ class DerivativeApproximation * computed. It defaults to the * first component. */ - template + template static void approximate_gradient (const Mapping &mapping, const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component = 0); @@ -193,10 +193,10 @@ class DerivativeApproximation * function, see above, with * @p{mapping=MappingQ1()}. */ - template + template static void approximate_gradient (const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component = 0); @@ -222,11 +222,11 @@ class DerivativeApproximation * computed. It defaults to the * first component. */ - template + template static void approximate_second_derivative (const Mapping &mapping, const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component = 0); @@ -235,10 +235,10 @@ class DerivativeApproximation * function, see above, with * @p{mapping=MappingQ1()}. */ - template + template static void approximate_second_derivative (const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component = 0); @@ -306,9 +306,10 @@ class DerivativeApproximation * field at the center of each * cell). */ + template static ProjectedDerivative get_projected_derivative (const FEValues &fe_values, - const Vector &solution, + const InputVector &solution, const unsigned int component); /** @@ -386,9 +387,10 @@ class DerivativeApproximation * field at the center of each * cell). */ + template static ProjectedDerivative get_projected_derivative (const FEValues &fe_values, - const Vector &solution, + const InputVector &solution, const unsigned int component); /** @@ -452,11 +454,11 @@ class DerivativeApproximation * solution vector we are to work * on. */ - template + template static void approximate_derivative (const Mapping &mapping, const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, const unsigned int component, Vector &derivative_norm); @@ -466,11 +468,11 @@ class DerivativeApproximation * the range given by the third * parameter. */ - template + template static void approximate (const Mapping &mapping, const DoFHandler &dof, - const Vector &solution, + const InputVector &solution, const unsigned int component, const IndexInterval &index_interval, Vector &derivative_norm); diff --git a/deal.II/deal.II/source/numerics/derivative_approximation.cc b/deal.II/deal.II/source/numerics/derivative_approximation.cc index 7549c9b079..09dcd4deb6 100644 --- a/deal.II/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/deal.II/source/numerics/derivative_approximation.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -46,11 +47,12 @@ const UpdateFlags DerivativeApproximation::SecondDerivative::update_flags = template +template inline typename DerivativeApproximation::Gradient::ProjectedDerivative DerivativeApproximation::Gradient:: get_projected_derivative (const FEValues &fe_values, - const Vector &solution, + const InputVector &solution, const unsigned int component) { if (fe_values.get_fe().n_components() == 1) @@ -94,11 +96,12 @@ DerivativeApproximation::Gradient::symmetrize (Derivative &) template +template inline typename DerivativeApproximation::SecondDerivative::ProjectedDerivative DerivativeApproximation::SecondDerivative:: get_projected_derivative (const FEValues &fe_values, - const Vector &solution, + const InputVector &solution, const unsigned int component) { if (fe_values.get_fe().n_components() == 1) @@ -381,12 +384,12 @@ DerivativeApproximation::SecondDerivative::symmetrize (Derivative &d) -template +template void DerivativeApproximation:: approximate_gradient (const Mapping &mapping, const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component) { @@ -398,11 +401,11 @@ approximate_gradient (const Mapping &mapping, } -template +template void DerivativeApproximation:: approximate_gradient (const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component) { @@ -416,12 +419,12 @@ approximate_gradient (const DoFHandler &dof_handler, } -template +template void DerivativeApproximation:: approximate_second_derivative (const Mapping &mapping, const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component) { @@ -433,11 +436,11 @@ approximate_second_derivative (const Mapping &mapping, } -template +template void DerivativeApproximation:: approximate_second_derivative (const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, Vector &derivative_norm, const unsigned int component) { @@ -451,12 +454,12 @@ approximate_second_derivative (const DoFHandler &dof_handler, } -template +template void DerivativeApproximation:: approximate_derivative (const Mapping &mapping, const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, const unsigned int component, Vector &derivative_norm) { @@ -471,11 +474,11 @@ approximate_derivative (const Mapping &mapping, Threads::ThreadGroup<> threads; void (*fun_ptr) (const Mapping &, const DoFHandler &, - const Vector &, + const InputVector &, const unsigned int , const IndexInterval &, Vector &) - = &DerivativeApproximation::template approximate; + = &DerivativeApproximation::template approximate; for (unsigned int i=0; i &mapping, -template +template void DerivativeApproximation::approximate (const Mapping &mapping, const DoFHandler &dof_handler, - const Vector &solution, + const InputVector &solution, const unsigned int component, const IndexInterval &index_interval, Vector &derivative_norm) @@ -719,11 +722,30 @@ template void DerivativeApproximation:: approximate_gradient +(const Mapping &mapping, + const DoFHandler &dof_handler, + const BlockVector &solution, + Vector &derivative_norm, + const unsigned int component); + +template +void +DerivativeApproximation:: +approximate_gradient (const DoFHandler &dof_handler, const Vector &solution, Vector &derivative_norm, const unsigned int component); +template +void +DerivativeApproximation:: +approximate_gradient +(const DoFHandler &dof_handler, + const BlockVector &solution, + Vector &derivative_norm, + const unsigned int component); + template void DerivativeApproximation:: @@ -733,6 +755,17 @@ approximate_second_derivative const Vector &solution, Vector &derivative_norm, const unsigned int component); + +template +void +DerivativeApproximation:: +approximate_second_derivative +(const Mapping &mapping, + const DoFHandler &dof_handler, + const BlockVector &solution, + Vector &derivative_norm, + const unsigned int component); + template void DerivativeApproximation:: @@ -742,6 +775,16 @@ approximate_second_derivative Vector &derivative_norm, const unsigned int component); +template +void +DerivativeApproximation:: +approximate_second_derivative +(const DoFHandler &dof_handler, + const BlockVector &solution, + Vector &derivative_norm, + const unsigned int component); + + // static variables // // on AIX, the linker is unhappy about some missing symbols. they diff --git a/deal.II/doc/news/2002/c-3-4.html b/deal.II/doc/news/2002/c-3-4.html index 1cda9498fa..3c53bdc8b0 100644 --- a/deal.II/doc/news/2002/c-3-4.html +++ b/deal.II/doc/news/2002/c-3-4.html @@ -747,6 +747,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

deal.II

    +
  1. + New: The functions in the DerivativeApproximation class can now also + work on BlockVectors/ +
    + (WB 2003/04/11) +

    +
  2. Changed: The cell argument to Mapping::transform_unit_to_real_cell (and its