*/
template <int dim>
static void
- approximate_gradient (const DoFHandler<dim> &dof,
+ approximate_gradient (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
const Vector<double> &solution,
Vector<float> &derivative_norm,
const unsigned int component = 0);
+ /**
+ * Calls the @p{interpolate}
+ * function, see above, with
+ * @p{mapping=MappingQ1<dim>()}.
+ */
+ template <int dim>
+ static void
+ approximate_gradient (const DoFHandler<dim> &dof,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component = 0);
+
/**
* This function is the analogue
* to the one above, computing
*/
template <int dim>
static void
- approximate_second_derivative (const DoFHandler<dim> &dof,
+ approximate_second_derivative (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
const Vector<double> &solution,
Vector<float> &derivative_norm,
const unsigned int component);
+ /**
+ * Calls the @p{interpolate}
+ * function, see above, with
+ * @p{mapping=MappingQ1<dim>()}.
+ */
+ template <int dim>
+ static void
+ approximate_second_derivative (const DoFHandler<dim> &dof,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component);
+
/**
* Exception
*/
*/
template <class DerivativeDescription, int dim>
static void
- approximate_derivative (const DoFHandler<dim> &dof,
+ approximate_derivative (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
const Vector<double> &solution,
const unsigned int component,
Vector<float> &derivative_norm);
*/
template <class DerivativeDescription, int dim>
static void
- approximate (const DoFHandler<dim> &dof,
+ approximate (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
const Vector<double> &solution,
const unsigned int component,
const IndexInterval &index_interval,
#include <cmath>
-//TODO:[RH,GK] Replace global by local object; better: have two functions, or by default arg
-static const MappingQ1<deal_II_dimension> mapping;
-
template <typename T>
static T sqr (const T t)
+template <int dim>
+void
+DerivativeApproximation::
+approximate_gradient (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component)
+{
+ approximate_derivative<Gradient<dim>,dim> (mapping,
+ dof_handler,
+ solution,
+ component,
+ derivative_norm);
+};
+
+
template <int dim>
void
DerivativeApproximation::
Vector<float> &derivative_norm,
const unsigned int component)
{
- approximate_derivative<Gradient<dim>,dim> (dof_handler,
+ static const MappingQ1<dim> mapping;
+ approximate_derivative<Gradient<dim>,dim> (mapping,
+ dof_handler,
solution,
component,
derivative_norm);
};
+template <int dim>
+void
+DerivativeApproximation::
+approximate_second_derivative (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component)
+{
+ approximate_derivative<SecondDerivative<dim>,dim> (mapping,
+ dof_handler,
+ solution,
+ component,
+ derivative_norm);
+};
+
template <int dim>
void
Vector<float> &derivative_norm,
const unsigned int component)
{
- approximate_derivative<SecondDerivative<dim>,dim> (dof_handler,
+ static const MappingQ1<dim> mapping;
+ approximate_derivative<SecondDerivative<dim>,dim> (mapping,
+ dof_handler,
solution,
component,
derivative_norm);
};
-
template <class DerivativeDescription, int dim>
void
DerivativeApproximation::
-approximate_derivative (const DoFHandler<dim> &dof_handler,
+approximate_derivative (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
const Vector<double> &solution,
const unsigned int component,
Vector<float> &derivative_norm)
Threads::encapsulate
(&DerivativeApproximation::
template approximate<DerivativeDescription,dim>)
- .collect_args (dof_handler, solution, component,
+ .collect_args (mapping, dof_handler, solution, component,
index_intervals[i],
derivative_norm));
thread_manager.wait ();
template <class DerivativeDescription, int dim>
void
-DerivativeApproximation::approximate (const DoFHandler<dim> &dof_handler,
+DerivativeApproximation::approximate (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof_handler,
const Vector<double> &solution,
const unsigned int component,
const IndexInterval &index_interval,
template
void
DerivativeApproximation::
+approximate_gradient (const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component);
+template
+void
+DerivativeApproximation::
approximate_gradient (const DoFHandler<deal_II_dimension> &dof_handler,
const Vector<double> &solution,
Vector<float> &derivative_norm,
template
void
DerivativeApproximation::
+approximate_second_derivative (const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<double> &solution,
+ Vector<float> &derivative_norm,
+ const unsigned int component);
+template
+void
+DerivativeApproximation::
approximate_second_derivative (const DoFHandler<deal_II_dimension> &dof_handler,
const Vector<double> &solution,
Vector<float> &derivative_norm,