From: kronbichler
Date: Tue, 2 Aug 2011 09:47:19 +0000 (+0000)
Subject: Extend classes Tensor, SymmetricTensor and Point to work with templates for the numbe...
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03d659809da981ef5bfa4ab981b230debb2574ef;p=dealii-svn.git
Extend classes Tensor, SymmetricTensor and Point to work with templates for the number type. Default template value is double, so all old code remains valid, except for forward declarations without the number type.
git-svn-id: https://svn.dealii.org/trunk@23989 0785d39b-7218-0410-832d-ea1e28bc413d
---
diff --git a/deal.II/doc/doxygen/headers/coding_conventions.h b/deal.II/doc/doxygen/headers/coding_conventions.h
index 7265d69103..9136b101b5 100644
--- a/deal.II/doc/doxygen/headers/coding_conventions.h
+++ b/deal.II/doc/doxygen/headers/coding_conventions.h
@@ -102,6 +102,10 @@ code is written, without having to look up the exact definition of something.
and DoFHandler (named cell_iterator, active_line_iterator, etc)
to make the connection to the STL classes clear.
+ For classes with multiple template arguments, the dimension is usually
+ put before the data type specifier, i.e., we use Point and not
+ Point.
+
Each class has to have at least 200 pages of documentation ;-)
diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index be4b64a31e..08d6c50b3e 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -21,6 +21,19 @@ inconvenience this causes.
+- Changed: The classes Tensor, SymmetricTensor and Point now have an
+additional template argument for the number type. While a default template
+value of double ensures that all old code is still valid, this
+change invalidates forward declarations of the form
template
+ class Point
that might be present in user-defined header
+files. Now forward declarations need to specify the type as well, i.e.,
+template class Point
. However,
+nothing changes if the full declarations in deal.II/base/tensor.h,
+deal.II/base/symmetric_tensor.h
and deal.II/base/point.h
+are included.
+
+(Martin Kronbichler, 2011/08/02)
+
- Removed: deal.II no longer supports Trilinos versions prior to 10.0.
(Wolfgang Bangerth, 2011/06/29)
@@ -50,7 +63,7 @@ corresponding elements of namespace std::placeholders into the global namespace
if your compiler supported this part of the C++ 1x standard, or otherwise using
the BOOST counterparts which are already in the global namespace. However,
this leads to a conflict if one has a C++ 1x enabled compiler (e.g. GCC 4.6)
-and #includes certain BOOST headers, since the importation of symbols
+and includes certain BOOST headers, since the importation of symbols
into the global namespace now leads to ambiguous names. The only solution to
the problem is to not import names into the global namespace, but rather
import the names from either BOOST or namespace std into the deal.II namespace
@@ -65,7 +78,18 @@ changed to use std_cxx1x::_1, std_cxx1x::_2, etc from now on.
General
-- Fixed: The function VectorTools::create_right_hand_side now also works for objects of type hp::DoFHandler with different finite elements.
+
- Extended: The classes Tensor, SymmetricTensor and Point now have an
+additional template argument for the number type. It is now possible to base
+these classes on any abstract data type that implements basic arithmetic
+operations, like
Tensor<1,dim,std::complex >
. deal.II
+uses a default template argument double
that ensures that all
+code using e.g. Tensor<1,dim>
remains valid.
+
+(Martin Kronbichler, 2011/08/02)
+
+
+ - Fixed: The function VectorTools::create_right_hand_side now also works
+for objects of type hp::DoFHandler with different finite elements.
(Daniel Gerecht, 2011/07/20)
@@ -383,12 +407,10 @@ more than rhs.size()
CG iterations if the number of degrees of free
is very small.
(Jichao Yin, WB, 2011/04/06)
-
- New: There is now a new function ConditionalOStream::get_stream().
(WB, 2011/03/09)
-
- Fixed: FESystem::get_unit_face_support_points would refuse to return
anything if one of the base elements did not have support points. This
@@ -397,7 +419,6 @@ base element has no support points and also has degrees of freedom on
the face.
(WB, 2011/03/07)
-
- Fixed: Objects of type FE_Nothing could be generated with multiple vector components
by passing an argument to the constructor. Yet, the FE_Nothing::get_name() function
@@ -405,18 +426,15 @@ always just returned the string
FE_Nothing@()
independently o
number of components. This is now fixed.
(WB, 2011/03/07)
-
- Fixed: PETScWrappers:MPI:SparseMatrix and apply_boundary_values() produced an error in debug mode about non-existant SparsityPattern entries. Reason: clear_rows() also eliminated the whole row in the PETSc-internal SparsityPattern, which resulted in an error in the next assembly process.
(Timo Heister, 2011/02/23)
-
- Fixed: It wasn't possible to use the FE_Nothing element inside an FESystem
object and hand the result over to an FEValues object. This is now fixed.
(Wolfgang Bangerth, 2011/02/18)
-
- New: There is now a function DataOutBase::write_visit_record that does
the equivalent for VisIt that DataOutBase::write_pvtu_record does for ParaView:
@@ -424,25 +442,21 @@ generate a file that contains a list of all other VTK or VTU files of which the
current parallel simulation consists.
(Wolfgang Bangerth, 2011/02/16)
-
- New: There is now a function TrilinosWrappers::VectorBase::minimal_value.
(Wolfgang Bangerth, 2011/02/16)
-
- Fixed: TableBase::operator= could not be compiled if the type of the
elements of the table was
bool
. This is now fixed.
(Wolfgang Bangerth, 2011/02/16)
-
- Improved: The GridGenerator::hyper_shell function generated meshes in 3d
that are valid but of poor quality upon refinement. There is now an additional
option to generate a coarse mesh of 96 cells that has a much better quality.
(Wolfgang Bangerth, 2011/02/12)
-
- Fixed: There are systems where the
libz
library is installed
but the zlib.h
header file is not available. Since the latter
@@ -450,7 +464,6 @@ condition was not tested, this would result in compiler errors. This is now
fixed.
(Wolfgang Bangerth, 2011/02/09)
-
- Fixed: Prolongation and restriction matrices were not computed at all
for elements of type FE_DGQ if
dim@. Consequently,
@@ -459,7 +472,6 @@ the DoFCellAccess::set_dof_values_by_interpolation function did not
work either and simply returned zero results. This is now fixed.
(M. Sebastian Pauletti, Wolfgang Bangerth, 2011/02/09)
-
- Fixed: When refining a mesh with codimension one, edges were refined using
the same manifold description as adjacent cells, but this ignored that a
@@ -467,63 +479,58 @@ boundary indicator might have been purposefully set for edges that are truly at
the boundary of the mesh. For such edges, the boundary indicator is now honored.
(M. Sebastian Pauletti, Wolfgang Bangerth, 2011/02/09)
-
- Fixed: The functions VectorTools::compute_mean_value and
VectorTools::integrate_difference now also work for distributed
triangulations of type parallel::distributed::Triangulation.
(Wolfgang Bangerth, 2011/02/07)
-
- Changed: If the
libz
library was detected during library
configuration, the function DataOutBase::write_vtu now writes data in compressed
format, saving a good fraction of disk space (80-90% for big output files).
(Wolfgang Bangerth, 2011/01/28)
-
- New: Trilinos and PETSc vectors now have a function has_ghost_elements().
(Timo Heister, 2011/01/26)
-
- Changed: The TrilinosWrappers::MPI::BlockVector::compress function now takes an
argument (with a default value) in exactly the same way as the
TrilinosWrappers::MPI::Vector::compress function already did.
(Wolfgang Bangerth, 2011/01/21)
-
- Fixed: When calling DataOut::build_patches with a mapping, requesting more
than one subdivision, and when
dim@, then some cells
were not properly mapped. This is now fixed.
(Wolfgang Bangerth, 2011/01/18)
-
- New: Restructured the internals of PETScWrappers::Precondition* to allow a
-PETSc PC object to exist without a solver. New: use Precondition*::vmult() to
+PETSc PC object to exist without a solver. New: use Precondition*::@vmult() to
apply the preconditioner once. Preconditioners now have a default constructor
and an initialize() function and are no longer initialized in the solver call,
but in the constructor or initialize().
(Timo Heister, 2011/01/17)
-
- Fixed: Boundary conditions in the step-23 tutorial program are now
applied correctly. Matrix columns get eliminated with the used method
and introduce some contribution to the right hand side coming from
inhomogeneous boundary values. The old implementation did not reset the
-matrix columns before applying new boundary values.
+matrix columns before applying new boundary values.
+
(Martin Stoll, Martin Kronbichler, 2011/01/14)
-
- Extended:
base/tensor.h
has an additional collection of
contractions between three tensors (ie. contract3
).
This can be useful for writing matrix/vector assembly in a more compact
-form than before.
+form than before.
+
(Toby D. Young, 2011/01/12)
+
diff --git a/deal.II/include/deal.II/base/function.h b/deal.II/include/deal.II/base/function.h
index bd2096a9c7..c9daa892be 100644
--- a/deal.II/include/deal.II/base/function.h
+++ b/deal.II/include/deal.II/base/function.h
@@ -17,12 +17,11 @@
#include
#include
#include
+#include
+#include
#include
DEAL_II_NAMESPACE_OPEN
-template class Point;
-template class Tensor;
-template class Tensor<1,dim>;
template class Vector;
/**
@@ -109,7 +108,7 @@ class Function : public FunctionTime,
* template programming.
*/
static const unsigned int dimension = dim;
-
+
/**
* Number of vector components.
*/
@@ -126,7 +125,7 @@ class Function : public FunctionTime,
*/
Function (const unsigned int n_components = 1,
const double initial_time = 0.0);
-
+
/**
* Virtual destructor; absolutely
* necessary in this case.
@@ -182,7 +181,7 @@ class Function : public FunctionTime,
* to.
*/
Function & operator= (const Function &f);
-
+
/**
* Return the value of the
* function at the given
@@ -208,7 +207,7 @@ class Function : public FunctionTime,
*/
virtual void vector_value (const Point &p,
Vector &values) const;
-
+
/**
* Set values to the point
* values of the specified
@@ -245,7 +244,7 @@ class Function : public FunctionTime,
*/
virtual void vector_value_list (const std::vector > &points,
std::vector > &values) const;
-
+
/**
* For each component of the
* function, fill a vector of
@@ -277,7 +276,7 @@ class Function : public FunctionTime,
*/
virtual void vector_gradient (const Point &p,
std::vector > &gradients) const;
-
+
/**
* Set gradients to the
* gradients of the specified
@@ -290,7 +289,7 @@ class Function : public FunctionTime,
virtual void gradient_list (const std::vector > &points,
std::vector > &gradients,
const unsigned int component = 0) const;
-
+
/**
* For each component of the
* function, fill a vector of
@@ -306,12 +305,12 @@ class Function : public FunctionTime,
*/
virtual void vector_gradients (const std::vector > &points,
std::vector > > &gradients) const;
-
+
/**
* Set gradients to the gradients of
* the function at the points,
* for all components.
- * It is assumed that gradients
+ * It is assumed that gradients
* already has the right size, i.e.
* the same size as the points array.
*
@@ -338,7 +337,7 @@ class Function : public FunctionTime,
*/
virtual void vector_laplacian (const Point &p,
Vector &values) const;
-
+
/**
* Compute the Laplacian of one
* component at a set of points.
@@ -396,13 +395,13 @@ class ZeroFunction : public Function
* components is preset to one.
*/
ZeroFunction (const unsigned int n_components = 1);
-
+
/**
* Virtual destructor; absolutely
* necessary in this case.
*/
virtual ~ZeroFunction ();
-
+
/**
* Return the value of the function
* at the given point for one
@@ -443,7 +442,7 @@ class ZeroFunction : public Function
*/
virtual void vector_value_list (const std::vector > &points,
std::vector > &values) const;
-
+
/**
* Return the gradient of the function
* at the given point, for the
@@ -460,7 +459,7 @@ class ZeroFunction : public Function
*/
virtual void vector_gradient (const Point &p,
std::vector > &gradients) const;
-
+
/**
* Set gradients to the gradients of
* the function at the points,
@@ -472,12 +471,12 @@ class ZeroFunction : public Function
virtual void gradient_list (const std::vector > &points,
std::vector > &gradients,
const unsigned int component = 0) const;
-
+
/**
* Set gradients to the gradients of
* the function at the points,
* for all components.
- * It is assumed that gradients
+ * It is assumed that gradients
* already has the right size, i.e.
* the same size as the points array.
*
@@ -527,7 +526,7 @@ class ConstantFunction : public ZeroFunction
*/
ConstantFunction (const double value,
const unsigned int n_components = 1);
-
+
/**
* Virtual destructor; absolutely
* necessary in this case.
@@ -656,8 +655,8 @@ class ComponentSelectFunction : public ConstantFunction
* number of vector components.
*/
ComponentSelectFunction (const std::pair &selected,
- const unsigned int n_components);
-
+ const unsigned int n_components);
+
/**
* Return the value of the function
* at the given point for all
diff --git a/deal.II/include/deal.II/base/function_parser.h b/deal.II/include/deal.II/base/function_parser.h
index 745f9b347f..40317b10f1 100644
--- a/deal.II/include/deal.II/base/function_parser.h
+++ b/deal.II/include/deal.II/base/function_parser.h
@@ -20,6 +20,8 @@
#include
#include
#include
+#include
+#include
#include
#include