From 4ec46417532b590d4d66933dbe7ed4cfc4d46733 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 7 Apr 2003 15:42:17 +0000 Subject: [PATCH] Make the cell argument to transform_*_to_*_cell a reference, rather than a value. git-svn-id: https://svn.dealii.org/trunk@7366 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/mapping.h | 14 ++++++---- .../deal.II/include/fe/mapping_cartesian.h | 14 ++++++---- deal.II/deal.II/include/fe/mapping_q.h | 14 ++++++---- deal.II/deal.II/include/fe/mapping_q1.h | 16 ++++++----- .../deal.II/source/fe/mapping_cartesian.cc | 14 ++++++---- deal.II/deal.II/source/fe/mapping_q.cc | 14 ++++++---- deal.II/deal.II/source/fe/mapping_q1.cc | 28 +++++++++++-------- .../deal.II/source/fe/mapping_q1_eulerian.cc | 4 +-- 8 files changed, 67 insertions(+), 51 deletions(-) diff --git a/deal.II/deal.II/include/fe/mapping.h b/deal.II/deal.II/include/fe/mapping.h index 5f9806e579..db8e033abf 100644 --- a/deal.II/deal.II/include/fe/mapping.h +++ b/deal.II/deal.II/include/fe/mapping.h @@ -67,9 +67,10 @@ class Mapping : public Subscriptor * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const=0; + virtual Point + transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const = 0; /** * Transforms the point @p{p} on @@ -77,9 +78,10 @@ class Mapping : public Subscriptor * @p{p_unit} on the unit cell * @p{cell} and returns @p{p_unit}. */ - virtual Point transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const=0; + virtual Point + transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const = 0; /** * Base class for internal data diff --git a/deal.II/deal.II/include/fe/mapping_cartesian.h b/deal.II/deal.II/include/fe/mapping_cartesian.h index f46808eb9d..2161a1e25e 100644 --- a/deal.II/deal.II/include/fe/mapping_cartesian.h +++ b/deal.II/deal.II/include/fe/mapping_cartesian.h @@ -148,9 +148,10 @@ class MappingCartesian : public Mapping * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Transforms the point @p{p} on @@ -162,9 +163,10 @@ class MappingCartesian : public Mapping * @p{transform_unit_to_real_cell} * function. */ - virtual Point transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Implementation of the interface in diff --git a/deal.II/deal.II/include/fe/mapping_q.h b/deal.II/deal.II/include/fe/mapping_q.h index 2b1edbc99d..9071c0cab2 100644 --- a/deal.II/deal.II/include/fe/mapping_q.h +++ b/deal.II/deal.II/include/fe/mapping_q.h @@ -55,9 +55,10 @@ class MappingQ : public MappingQ1 * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Transforms the point @p{p} on @@ -69,9 +70,10 @@ class MappingQ : public MappingQ1 * @p{transform_unit_to_real_cell} * function. */ - virtual Point transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Implementation of the diff --git a/deal.II/deal.II/include/fe/mapping_q1.h b/deal.II/deal.II/include/fe/mapping_q1.h index f941af5cf1..e53e5a4195 100644 --- a/deal.II/deal.II/include/fe/mapping_q1.h +++ b/deal.II/deal.II/include/fe/mapping_q1.h @@ -52,9 +52,10 @@ class MappingQ1 : public Mapping * @p{p_real} on the real cell * @p{cell} and returns @p{p_real}. */ - virtual Point transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Transforms the point @p{p} on @@ -66,9 +67,10 @@ class MappingQ1 : public Mapping * @p{transform_unit_to_real_cell} * function. */ - virtual Point transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const; + virtual Point + transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const; /** * Implementation of the interface in @@ -527,7 +529,7 @@ class MappingQ1 : public Mapping * @p{mdata} will be changed by * this function. */ - void transform_real_to_unit_cell_internal (const typename Triangulation::cell_iterator cell, + void transform_real_to_unit_cell_internal (const typename Triangulation::cell_iterator &cell, const Point &p, InternalData &mdata, Point &p_unit) const; diff --git a/deal.II/deal.II/source/fe/mapping_cartesian.cc b/deal.II/deal.II/source/fe/mapping_cartesian.cc index c948e40534..5214b53ae3 100644 --- a/deal.II/deal.II/source/fe/mapping_cartesian.cc +++ b/deal.II/deal.II/source/fe/mapping_cartesian.cc @@ -545,9 +545,10 @@ MappingCartesian::transform_contravariant (Tensor<2,dim> *begin, template -Point MappingCartesian::transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingCartesian::transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { Tensor<1,dim> length; const Point start = cell->vertex(0); @@ -579,9 +580,10 @@ Point MappingCartesian::transform_unit_to_real_cell ( template -Point MappingCartesian::transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingCartesian::transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { const Point &start = cell->vertex(0); Point real = p; diff --git a/deal.II/deal.II/source/fe/mapping_q.cc b/deal.II/deal.II/source/fe/mapping_q.cc index 0524e035dd..47543ddd12 100644 --- a/deal.II/deal.II/source/fe/mapping_q.cc +++ b/deal.II/deal.II/source/fe/mapping_q.cc @@ -1063,9 +1063,10 @@ MappingQ::transform_contravariant (Tensor<2,dim> *begin, template -Point MappingQ::transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingQ::transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { // Use the get_data function to // create an InternalData with data @@ -1096,9 +1097,10 @@ Point MappingQ::transform_unit_to_real_cell ( template -Point MappingQ::transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingQ::transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { // first a Newton iteration based // on a Q1 mapping diff --git a/deal.II/deal.II/source/fe/mapping_q1.cc b/deal.II/deal.II/source/fe/mapping_q1.cc index b389455a2d..9c71143df1 100644 --- a/deal.II/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/deal.II/source/fe/mapping_q1.cc @@ -884,9 +884,10 @@ MappingQ1::transform_contravariant (Tensor<2,dim> *begin, template -Point MappingQ1::transform_unit_to_real_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingQ1::transform_unit_to_real_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { // Use the get_data function to // create an InternalData with data @@ -910,7 +911,8 @@ Point MappingQ1::transform_unit_to_real_cell ( template -Point MappingQ1::transform_unit_to_real_cell_internal ( +Point +MappingQ1::transform_unit_to_real_cell_internal ( const InternalData &data) const { const unsigned int n_mapping_points=data.mapping_support_points.size(); @@ -927,9 +929,10 @@ Point MappingQ1::transform_unit_to_real_cell_internal ( template -Point MappingQ1::transform_real_to_unit_cell ( - const typename Triangulation::cell_iterator cell, - const Point &p) const +Point +MappingQ1::transform_real_to_unit_cell ( + const typename Triangulation::cell_iterator &cell, + const Point &p) const { // Let the start value of the // newton iteration be the center @@ -965,11 +968,12 @@ Point MappingQ1::transform_real_to_unit_cell ( template -void MappingQ1::transform_real_to_unit_cell_internal ( - const typename Triangulation::cell_iterator cell, - const Point &p, - InternalData &mdata, - Point &p_unit) const +void +MappingQ1::transform_real_to_unit_cell_internal ( + const typename Triangulation::cell_iterator &cell, + const Point &p, + InternalData &mdata, + Point &p_unit) const { const unsigned int n_shapes=mdata.shape_values.size(); Assert(n_shapes!=0, ExcInternalError()); diff --git a/deal.II/deal.II/source/fe/mapping_q1_eulerian.cc b/deal.II/deal.II/source/fe/mapping_q1_eulerian.cc index c001b4d460..5d1e6527ae 100644 --- a/deal.II/deal.II/source/fe/mapping_q1_eulerian.cc +++ b/deal.II/deal.II/source/fe/mapping_q1_eulerian.cc @@ -22,8 +22,8 @@ template -MappingQ1Eulerian::MappingQ1Eulerian ( const Vector &euler_transform_vectors, - const DoFHandler &shiftmap_dof_handler) +MappingQ1Eulerian::MappingQ1Eulerian (const Vector &euler_transform_vectors, + const DoFHandler &shiftmap_dof_handler) : euler_transform_vectors(euler_transform_vectors), shiftmap_dof_handler(&shiftmap_dof_handler) -- 2.39.5