From: bangerth Date: Fri, 8 Oct 2010 12:41:43 +0000 (+0000) Subject: Also pass the locations of evaluation points through DataPostprocessor. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1e5b2187b5ab68f85eb4c6e10e0156cc1ea5bfd;p=dealii-svn.git Also pass the locations of evaluation points through DataPostprocessor. git-svn-id: https://svn.dealii.org/trunk@22292 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/numerics/data_out.h b/deal.II/deal.II/include/numerics/data_out.h index 2fe312fdbe..dffd98ea68 100644 --- a/deal.II/deal.II/include/numerics/data_out.h +++ b/deal.II/deal.II/include/numerics/data_out.h @@ -122,6 +122,8 @@ namespace internal const dealii::hp::QCollection q_collection; const dealii::hp::MappingCollection mapping_collection; dealii::hp::FEValues x_fe_values; + + std::vector > patch_evaluation_points; const std::vector > *cell_to_patch_index_map; }; diff --git a/deal.II/deal.II/include/numerics/data_out_faces.h b/deal.II/deal.II/include/numerics/data_out_faces.h index a4cdc00d91..c26f4da8ec 100644 --- a/deal.II/deal.II/include/numerics/data_out_faces.h +++ b/deal.II/deal.II/include/numerics/data_out_faces.h @@ -54,6 +54,7 @@ namespace internal dealii::hp::FEFaceValues x_fe_values; std::vector > patch_normals; + std::vector > patch_evaluation_points; }; } } diff --git a/deal.II/deal.II/include/numerics/data_out_rotation.h b/deal.II/deal.II/include/numerics/data_out_rotation.h index af8d501a9e..f293f9f73a 100644 --- a/deal.II/deal.II/include/numerics/data_out_rotation.h +++ b/deal.II/deal.II/include/numerics/data_out_rotation.h @@ -53,6 +53,8 @@ namespace internal const dealii::hp::QCollection q_collection; dealii::hp::FEValues x_fe_values; + + std::vector > patch_evaluation_points; }; } } diff --git a/deal.II/deal.II/include/numerics/data_postprocessor.h b/deal.II/deal.II/include/numerics/data_postprocessor.h index 8fd4567a9c..910eb4204e 100644 --- a/deal.II/deal.II/include/numerics/data_postprocessor.h +++ b/deal.II/deal.II/include/numerics/data_postprocessor.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2007, 2008 by the deal.II authors +// Copyright (C) 2007, 2008, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -80,6 +80,28 @@ class DataPostprocessor: public Subscriptor */ virtual ~DataPostprocessor (); + /** + * @deprecated + * + * This function only exists for backward + * compatibility as this is the interface + * provided by previous versions of the + * library. The default implementation of + * the other function of same name below + * calls this function by simply dropping + * the argument that denotes the + * evaluation points. Since this function + * might at one point go away, you should + * overload the other function instead. + */ + virtual + void + compute_derived_quantities_scalar (const std::vector &uh, + const std::vector > &duh, + const std::vector > &dduh, + const std::vector > &normals, + std::vector > &computed_quantities) const; + /** * This is the main function which actually * performs the postprocessing. The last @@ -113,16 +135,22 @@ class DataPostprocessor: public Subscriptor const std::vector > &duh, const std::vector > &dduh, const std::vector > &normals, - std::vector > &computed_quantities) const; + const std::vector > &evaluation_points, + std::vector > &computed_quantities) const; /** - * Same as above function, but - * this function is called when - * the original data vector - * represents vector data, - * i.e. the finite element in use - * has multiple vector - * components. + * @deprecated + * + * This function only exists for backward + * compatibility as this is the interface + * provided by previous versions of the + * library. The default implementation of + * the other function of same name below + * calls this function by simply dropping + * the argument that denotes the + * evaluation points. Since this function + * might at one point go away, you should + * overload the other function instead. */ virtual void @@ -131,6 +159,24 @@ class DataPostprocessor: public Subscriptor const std::vector > > &dduh, const std::vector > &normals, std::vector > &computed_quantities) const; + + /** + * Same as the + * compute_derived_quantities_scalar() + * function, but this function is called + * when the original data vector + * represents vector data, i.e. the + * finite element in use has multiple + * vector components. + */ + virtual + void + compute_derived_quantities_vector (const std::vector > &uh, + const std::vector > > &duh, + const std::vector > > &dduh, + const std::vector > &normals, + const std::vector > &evaluation_points, + std::vector > &computed_quantities) const; /** * Return the vector of strings describing diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index 845d23e2e3..0926a72d99 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -768,12 +768,18 @@ build_one_patch (const std::pair *cell_and_index, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + + std::vector > dummy_normals; postprocessor-> compute_derived_quantities_scalar(data.patch_values, data.patch_gradients, data.patch_hessians, dummy_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } else @@ -791,12 +797,18 @@ build_one_patch (const std::pair *cell_and_index, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians_system); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + std::vector > dummy_normals; + postprocessor-> compute_derived_quantities_vector(data.patch_values_system, data.patch_gradients_system, data.patch_hessians_system, dummy_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } diff --git a/deal.II/deal.II/source/numerics/data_out_faces.cc b/deal.II/deal.II/source/numerics/data_out_faces.cc index 22b0716203..3b4b62e340 100644 --- a/deal.II/deal.II/source/numerics/data_out_faces.cc +++ b/deal.II/deal.II/source/numerics/data_out_faces.cc @@ -170,11 +170,16 @@ build_one_patch (const FaceDescriptor *cell_and_face, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + postprocessor-> compute_derived_quantities_scalar(data.patch_values, data.patch_gradients, data.patch_hessians, data.patch_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } else @@ -192,11 +197,16 @@ build_one_patch (const FaceDescriptor *cell_and_face, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians_system); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + postprocessor-> compute_derived_quantities_vector(data.patch_values_system, data.patch_gradients_system, data.patch_hessians_system, data.patch_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } diff --git a/deal.II/deal.II/source/numerics/data_out_rotation.cc b/deal.II/deal.II/source/numerics/data_out_rotation.cc index d456b165d0..148c5b8627 100644 --- a/deal.II/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/deal.II/source/numerics/data_out_rotation.cc @@ -220,6 +220,9 @@ build_one_patch (const cell_iterator *cell, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); std::vector > dummy_normals; postprocessor-> @@ -227,6 +230,7 @@ build_one_patch (const cell_iterator *cell, data.patch_gradients, data.patch_hessians, dummy_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } else @@ -244,12 +248,17 @@ build_one_patch (const cell_iterator *cell, if (update_flags & update_hessians) this->dof_data[dataset]->get_function_hessians (fe_patch_values, data.patch_hessians_system); + + if (update_flags & update_quadrature_points) + data.patch_evaluation_points = fe_patch_values.get_quadrature_points(); + std::vector > dummy_normals; postprocessor-> compute_derived_quantities_vector(data.patch_values_system, data.patch_gradients_system, data.patch_hessians_system, dummy_normals, + data.patch_evaluation_points, data.postprocessed_values[dataset]); } diff --git a/deal.II/deal.II/source/numerics/data_postprocessor.cc b/deal.II/deal.II/source/numerics/data_postprocessor.cc index 217b201479..502b24452c 100644 --- a/deal.II/deal.II/source/numerics/data_postprocessor.cc +++ b/deal.II/deal.II/source/numerics/data_postprocessor.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2007 by the deal.II authors +// Copyright (C) 2007, 2010 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -35,11 +35,25 @@ compute_derived_quantities_scalar (const std::vector &/*uh*/, } +template +void +DataPostprocessor:: +compute_derived_quantities_scalar (const std::vector &uh, + const std::vector > &duh, + const std::vector > &dduh, + const std::vector > &normals, + const std::vector > &/*evaluation_points*/, + std::vector > &computed_quantities) const +{ + compute_derived_quantities_scalar(uh, duh, dduh, normals, computed_quantities); +} + + template void DataPostprocessor:: -compute_derived_quantities_vector (const std::vector > &/*uh*/, +compute_derived_quantities_vector (const std::vector > &/*uh*/, const std::vector > > &/*duh*/, const std::vector > > &/*dduh*/, const std::vector > &/*normals*/, @@ -51,6 +65,21 @@ compute_derived_quantities_vector (const std::vector > +template +void +DataPostprocessor:: +compute_derived_quantities_vector (const std::vector > &uh, + const std::vector > > &duh, + const std::vector > > &dduh, + const std::vector > &normals, + const std::vector > &/*evaluation_points*/, + std::vector > &computed_quantities) const +{ + compute_derived_quantities_vector(uh, duh, dduh, normals, computed_quantities); +} + + + template std::vector DataPostprocessor::get_data_component_interpretation () const diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index fdfca2971f..7f332bef92 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -280,6 +280,15 @@ through DoFHandler::get_tria() and DoFHandler::get_fe(), respectively.

deal.II

    +
  1. Changed: The DataPostprocessor functions now take an additional + argument that indicates the location of an evaluation point. For backward + compatibility, the old function signature still exists so that applications + that overload one of the existing functions continue to work. + The old signature has been deprecated, however, and will be removed in a + future version. +
    + (Scott Miller 2010/10/08) +

  2. Changed: FETools is now a namespace rather than a class with only static member functions. diff --git a/deal.II/examples/step-29/step-29.cc b/deal.II/examples/step-29/step-29.cc index 80e692366f..2ca1113d73 100644 --- a/deal.II/examples/step-29/step-29.cc +++ b/deal.II/examples/step-29/step-29.cc @@ -2,7 +2,7 @@ /* Author: Moritz Allmaras, Texas A&M University, 2007 */ /* */ -/* Copyright (C) 2007, 2008 by the deal.II authors and M. Allmaras */ +/* Copyright (C) 2007, 2008, 2010 by the deal.II authors and M. Allmaras */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -414,6 +414,7 @@ class ComputeIntensity : public DataPostprocessor const std::vector< std::vector< Tensor< 1, dim > > > &, const std::vector< std::vector< Tensor< 2, dim > > > &, const std::vector< Point< dim > > &, + const std::vector > &, std::vector< Vector< double > > & ) const; @@ -518,6 +519,7 @@ ComputeIntensity::compute_derived_quantities_vector ( const std::vector< std::vector< Tensor< 1, dim > > > & /*duh*/, const std::vector< std::vector< Tensor< 2, dim > > > & /*dduh*/, const std::vector< Point< dim > > & /*normals*/, + const std::vector > & /*evaluation_points*/, std::vector< Vector< double > > & computed_quantities ) const { diff --git a/deal.II/examples/step-33/step-33.cc b/deal.II/examples/step-33/step-33.cc index bd72e790f5..1d1d4cc3de 100644 --- a/deal.II/examples/step-33/step-33.cc +++ b/deal.II/examples/step-33/step-33.cc @@ -711,6 +711,7 @@ struct EulerEquations const std::vector > > &duh, const std::vector > > &dduh, const std::vector > &normals, + const std::vector > &evaluation_points, std::vector > &computed_quantities) const; virtual std::vector get_names () const; @@ -765,6 +766,7 @@ compute_derived_quantities_vector (const std::vector > const std::vector > > &duh, const std::vector > > &/*dduh*/, const std::vector > &/*normals*/, + const std::vector > &/*evaluation_points*/, std::vector > &computed_quantities) const { // At the beginning of the function, let us