-/* ------------------------- explicit specializations -------------- */
-
-#ifndef DOXYGEN
-
-template <>
-void
-DoFTools::map_dof_to_boundary_indices (const DoFHandler<1,1> &dof_handler,
- std::vector<unsigned int> &mapping);
-
-#endif
-
/* ------------------------- inline functions -------------- */
const unsigned int FE_DGP<3>::Matrices::n_projection_matrices;
//codimension 1
-#if deal_II_dimension != 3
template <>
const double * const FE_DGP<1,2>::Matrices::projection_matrices[][GeometryInfo<1>::max_children_per_cell];
template <>
const unsigned int FE_DGP<2,3>::Matrices::n_projection_matrices;
-#endif
-
-
#endif
#endif // DOXYGEN
FE_Q<1>::face_lexicographic_to_hierarchic_numbering (const unsigned int);
-#if deal_II_dimension != 3
-
template <>
void FE_Q<1,2>::initialize_unit_face_support_points ();
std::vector<unsigned int>
FE_Q<1,2>::face_lexicographic_to_hierarchic_numbering (const unsigned int);
-#endif
DEAL_II_NAMESPACE_CLOSE
-#if deal_II_dimension == 1
-
template <class Container>
void
GridTools::get_active_neighbors(const typename Container::active_cell_iterator &cell,
std::vector<typename Container::active_cell_iterator> &active_neighbors)
{
active_neighbors.clear ();
- for (unsigned int n=0; n<GeometryInfo<1>::faces_per_cell; ++n)
+ for (unsigned int n=0; n<GeometryInfo<Container::dimension>::faces_per_cell; ++n)
if (! cell->at_boundary(n))
{
+ if (Container::dimension == 1)
+ {
// check children of neighbor. note
// that in 1d children of the neighbor
// may be further refined. In 1d the
// case is simple since we know what
// children bound to the present cell
- typename Container::cell_iterator
- neighbor_child = cell->neighbor(n);
- if (!neighbor_child->active())
- {
- while (neighbor_child->has_children())
- neighbor_child = neighbor_child->child (n==0 ? 1 : 0);
-
- Assert (neighbor_child->neighbor(n==0 ? 1 : 0)==cell,
- ExcInternalError());
+ typename Container::cell_iterator
+ neighbor_child = cell->neighbor(n);
+ if (!neighbor_child->active())
+ {
+ while (neighbor_child->has_children())
+ neighbor_child = neighbor_child->child (n==0 ? 1 : 0);
+
+ Assert (neighbor_child->neighbor(n==0 ? 1 : 0)==cell,
+ ExcInternalError());
+ }
+ active_neighbors.push_back (neighbor_child);
}
- active_neighbors.push_back (neighbor_child);
- }
-}
-
-#else
-
-template <class Container>
-void
-GridTools::get_active_neighbors(const typename Container::active_cell_iterator &cell,
- std::vector<typename Container::active_cell_iterator> &active_neighbors)
-{
- active_neighbors.clear ();
- for (unsigned int n=0; n<GeometryInfo<Container::dimension>::faces_per_cell; ++n)
- if (! cell->at_boundary(n))
- {
- if (cell->face(n)->has_children())
+ else
+ {
+ if (cell->face(n)->has_children())
// this neighbor has children. find
// out which border to the present
// cell
- for (unsigned int c=0; c<cell->face(n)->number_of_children(); ++c)
- active_neighbors.push_back (cell->neighbor_child_on_subface(n,c));
- else
- {
+ for (unsigned int c=0; c<cell->face(n)->number_of_children(); ++c)
+ active_neighbors.push_back (cell->neighbor_child_on_subface(n,c));
+ else
+ {
// the neighbor must be active
// himself
- Assert(cell->neighbor(n)->active(), ExcInternalError());
- active_neighbors.push_back(cell->neighbor(n));
+ Assert(cell->neighbor(n)->active(), ExcInternalError());
+ active_neighbors.push_back(cell->neighbor(n));
+ }
}
}
}
-#endif
-
-
// declaration of explicit specializations
-
-/* -------------- declaration of explicit specializations ------------- */
-
#ifndef DOXYGEN
- template <> unsigned int DoFHandler<1>::n_boundary_dofs () const;
- template <> unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const;
- template <> unsigned int DoFHandler<1>::n_boundary_dofs (const std::set<unsigned char> &) const;
-
/* ----------------------- Inline functions ---------------------------------- */
#include <lac/filtered_matrix.h>
#include <lac/constraint_matrix.h>
#include <grid/tria_iterator.h>
+#include <grid/tria_accessor.h>
#include <grid/grid_tools.h>
-#include <dofs/dof_handler.h>
-#include <hp/dof_handler.h>
#include <dofs/dof_accessor.h>
+#include <dofs/dof_handler.h>
#include <dofs/dof_tools.h>
#include <fe/fe.h>
#include <fe/fe_nedelec.h>
#include <fe/fe_tools.h>
#include <fe/fe_values.h>
#include <fe/fe_nedelec.h>
-#include <hp/fe_values.h>
#include <fe/mapping_q1.h>
+#include <hp/dof_handler.h>
+#include <hp/fe_values.h>
#include <hp/mapping_collection.h>
#include <hp/q_collection.h>
#include <numerics/vectors.h>
{
namespace VectorTools
{
-#if deal_II_dimension == 1
-
- template <int dim>
void
- interpolate_zero_boundary_values (const dealii::DoFHandler<dim> &dof_handler,
- std::map<unsigned int,double> &boundary_values)
+ interpolate_zero_boundary_values (const dealii::DoFHandler<1> &dof_handler,
+ std::map<unsigned int,double> &boundary_values)
{
// we only need to find the
// left-most and right-most
// dof indices. that's easy :-)
for (unsigned direction=0; direction<2; ++direction)
{
- typename dealii::DoFHandler<dim>::cell_iterator
+ typename dealii::DoFHandler<1>::cell_iterator
cell = dof_handler.begin(0);
while (!cell->at_boundary(direction))
cell = cell->neighbor(direction);
}
-//codimension 1
+
+ // codimension 1
void
- interpolate_zero_boundary_values (const dealii::DoFHandler<1,2> &dof_handler,
- std::map<unsigned int,double> &boundary_values)
+ interpolate_zero_boundary_values (const dealii::DoFHandler<1,2> &dof_handler,
+ std::map<unsigned int,double> &boundary_values)
{
// we only need to find the
// left-most and right-most
}
-#else
template <int dim, int spacedim>
void
boundary_values[face_dof_indices[i]] = 0.;
}
}
-
-#endif
}
}
}
-#if deal_II_dimension != 1
template <int dim, int spacedim>
void
Vector<double> &rhs_vector,
const std::set<unsigned char> &boundary_indicators)
{
+ if (dim == 1)
+ {
+ Assert (false, ExcImpossibleInDim(dim));
+ return;
+ }
+
const FiniteElement<dim> &fe = dof_handler.get_fe();
Assert (fe.n_components() == rhs_function.n_components,
ExcDimensionMismatch(fe.n_components(), rhs_function.n_components));
}
}
-#else
-
-// Implementation for 1D
-template <int dim, int spacedim>
-void
-VectorTools::create_boundary_right_hand_side (const Mapping<dim, spacedim> &,
- const DoFHandler<dim,spacedim> &,
- const Quadrature<dim-1> &,
- const Function<spacedim> &,
- Vector<double> &,
- const std::set<unsigned char> &)
-{
- Assert (false, ExcImpossibleInDim(dim));
-}
-#endif
template <int dim, int spacedim>
void
-#if deal_II_dimension != 1
+template <>
+void
+VectorTools::create_boundary_right_hand_side (const hp::MappingCollection<1,1> &mapping,
+ const hp::DoFHandler<1,1> &dof_handler,
+ const hp::QCollection<0> &quadrature,
+ const Function<1> &rhs_function,
+ Vector<double> &rhs_vector,
+ const std::set<unsigned char> &boundary_indicators)
+{
+ Assert (false, ExcImpossibleInDim(1));
+}
+
+
+
+template <>
+void
+VectorTools::create_boundary_right_hand_side (const hp::MappingCollection<1,2> &mapping,
+ const hp::DoFHandler<1,2> &dof_handler,
+ const hp::QCollection<0> &quadrature,
+ const Function<2> &rhs_function,
+ Vector<double> &rhs_vector,
+ const std::set<unsigned char> &boundary_indicators)
+{
+ Assert (false, ExcImpossibleInDim(1));
+}
+
+
template <int dim, int spacedim>
void
}
}
-#else
-
-// Implementation for 1D
-template <int dim, int spacedim>
-void
-VectorTools::create_boundary_right_hand_side (const hp::MappingCollection<dim,spacedim> &,
- const hp::DoFHandler<dim,spacedim> &,
- const hp::QCollection<dim-1> &,
- const Function<spacedim> &,
- Vector<double> &,
- const std::set<unsigned char> &)
-{
- Assert (false, ExcImpossibleInDim(1));
-}
-#endif
template <int dim, int spacedim>
void
// ----------- interpolate_boundary_values for std::map --------------------
-#if deal_II_dimension == 1
-
-//TODO[?] Actually the Mapping object should be a MappingCollection object for the
-// hp::DoFHandler.
-
-//template <int dim, template <int, int> class DH, int spacedim>
-
-template <class DH>
-void
-VectorTools::interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &,
- const DH &dof,
- const unsigned char boundary_component,
- const Function<DH::space_dimension> &boundary_function,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask_)
+// TODO: it might be possible to avoid the specialization for 1D if we could
+// have hp::FEFaceValues<1>...
+namespace internal
{
- //ConstraintMatrix boundary_constraints();
- // interpolate_boundary_values (dof, boundary_component, boundary_function,
- // boundary_constraints, component_mask);
+ namespace VectorTools
+ {
+ template <class DH>
+ static inline
+ void interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
+ const DH &dof,
+ const typename FunctionMap<DH::space_dimension>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask_,
+ const internal::int2type<1>)
+ {
+ const unsigned int dim = DH::dimension;
+ const unsigned int spacedim=DH::space_dimension;
- const unsigned int dim=DH::dimension;
- const unsigned int spacedim=DH::space_dimension;
+ Assert ((component_mask_.size() == 0) ||
+ (component_mask_.size() == dof.get_fe().n_components()),
+ ExcMessage ("The number of components in the mask has to be either "
+ "zero or equal to the number of components in the finite "
+ "element."));
- Assert (boundary_component != 255,
- ExcInvalidBoundaryIndicator());
- Assert ((component_mask_.size() == 0) ||
- (component_mask_.size() == dof.get_fe().n_components()),
- ExcMessage ("The number of components in the mask has to be either "
- "zero or equal to the number of components in the finite "
- "element."));
+ // if for whatever reason we were
+ // passed an empty map, return
+ // immediately
+ if (function_map.size() == 0)
+ return;
+ Assert (function_map.find(255) == function_map.end(),
+ dealii::VectorTools::ExcInvalidBoundaryIndicator());
+
+ for (typename FunctionMap<spacedim>::type::const_iterator i=function_map.begin();
+ i!=function_map.end(); ++i)
+ {
// check whether boundary values at
// the left or right boundary of
// the line are
// which we seek the boundary,
// i.e. 0 is left boundary and 1 is
// right.
- const unsigned int direction = boundary_component;
- Assert (direction < 2, ExcInvalidBoundaryIndicator());
+ const unsigned int direction = i->first;
+ Assert (direction < 2,
+ dealii::VectorTools::ExcInvalidBoundaryIndicator());
+
+ const Function<DH::space_dimension> & boundary_function = *(i->second);
// first find the outermost active
// cell by first traversing the coarse
// grid to its end and then going
// to the children
- typename DH::cell_iterator outermost_cell = dof.begin(0);
- while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
- outermost_cell = outermost_cell->neighbor(direction);
+ typename DH::cell_iterator outermost_cell = dof.begin(0);
+ while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
+ outermost_cell = outermost_cell->neighbor(direction);
- while (outermost_cell->has_children())
- outermost_cell = outermost_cell->child(direction);
+ while (outermost_cell->has_children())
+ outermost_cell = outermost_cell->child(direction);
// get the FE corresponding to this
// cell
- const FiniteElement<dim,spacedim> &fe = outermost_cell->get_fe();
- Assert (fe.n_components() == boundary_function.n_components,
- ExcDimensionMismatch(fe.n_components(), boundary_function.n_components));
+ const FiniteElement<dim,spacedim> &fe = outermost_cell->get_fe();
+ Assert (fe.n_components() == boundary_function.n_components,
+ ExcDimensionMismatch(fe.n_components(), boundary_function.n_components));
// set the component mask to either
// the original value or a vector
// of trues
- const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
- std::vector<bool> (fe.n_components(), true) :
- component_mask_);
- Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
- ExcNoComponentSelected());
+ const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
+ std::vector<bool> (fe.n_components(), true) :
+ component_mask_);
+ Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
+ dealii::VectorTools::ExcNoComponentSelected());
// now set the value of the
// outermost degree of
// values only once for each point,
// irrespective of the number of
// components of the function
- Vector<double> function_values (fe.n_components());
- if (fe.n_components() == 1)
- function_values(0)
- = boundary_function.value (outermost_cell->vertex(direction));
- else
- boundary_function.vector_value (outermost_cell->vertex(direction),
- function_values);
-
- for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
- if (component_mask[fe.face_system_to_component_index(i).first])
- boundary_values[outermost_cell->
- vertex_dof_index(direction,i,
- outermost_cell->active_fe_index())]
- = function_values(fe.face_system_to_component_index(i).first);
-}
-
-
-//TODO[?] Actually the Mapping object should be a MappingCollection object for the
-// hp::DoFHandler.
-
-// Implementation for 1D
-template <class DH>
-void
-VectorTools::interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
- const DH &dof,
- const typename FunctionMap<DH::space_dimension>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask)
-{
- for (typename FunctionMap<DH::space_dimension>::type::const_iterator i=function_map.begin();
- i!=function_map.end(); ++i)
- interpolate_boundary_values (mapping, dof, i->first, *i->second,
- boundary_values, component_mask);
-}
-
-
-//TODO[?] Actually the Mapping object should be a MappingCollection object for the
-// hp::DoFHandler.
-
+ dealii::Vector<double> function_values (fe.n_components());
+ if (fe.n_components() == 1)
+ function_values(0)
+ = boundary_function.value (outermost_cell->vertex(direction));
+ else
+ boundary_function.vector_value (outermost_cell->vertex(direction),
+ function_values);
+
+ for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
+ if (component_mask[fe.face_system_to_component_index(i).first])
+ boundary_values[outermost_cell->
+ vertex_dof_index(direction,i,
+ outermost_cell->active_fe_index())]
+ = function_values(fe.face_system_to_component_index(i).first);
+ }
+ }
-#else
-template <class DH>
-void
-VectorTools::
-interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
- const DH &dof,
- const typename FunctionMap<DH::space_dimension>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask_)
-{
- const unsigned int dim=DH::dimension;
- const unsigned int spacedim=DH::space_dimension;
+ template <class DH>
+ static inline
+ void
+ interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
+ const DH &dof,
+ const typename FunctionMap<DH::space_dimension>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask_,
+ const internal::int2type<DH::dimension>)
+ {
+ const unsigned int dim = DH::dimension;
+ const unsigned int spacedim=DH::space_dimension;
- Assert ((component_mask_.size() == 0) ||
- (component_mask_.size() == dof.get_fe().n_components()),
- ExcMessage ("The number of components in the mask has to be either "
- "zero or equal to the number of components in the finite "
- "element."));
+ Assert ((component_mask_.size() == 0) ||
+ (component_mask_.size() == dof.get_fe().n_components()),
+ ExcMessage ("The number of components in the mask has to be either "
+ "zero or equal to the number of components in the finite "
+ "element."));
// if for whatever reason we were
// passed an empty map, return
// immediately
- if (function_map.size() == 0)
- return;
+ if (function_map.size() == 0)
+ return;
- Assert (function_map.find(255) == function_map.end(),
- ExcInvalidBoundaryIndicator());
+ Assert (function_map.find(255) == function_map.end(),
+ dealii::VectorTools::ExcInvalidBoundaryIndicator());
- const unsigned int n_components = DoFTools::n_components(dof);
- const bool fe_is_system = (n_components != 1);
+ const unsigned int n_components = DoFTools::n_components(dof);
+ const bool fe_is_system = (n_components != 1);
- for (typename FunctionMap<spacedim>::type::const_iterator i=function_map.begin();
- i!=function_map.end(); ++i)
- Assert (n_components == i->second->n_components,
- ExcDimensionMismatch(n_components, i->second->n_components));
+ for (typename FunctionMap<spacedim>::type::const_iterator i=function_map.begin();
+ i!=function_map.end(); ++i)
+ Assert (n_components == i->second->n_components,
+ ExcDimensionMismatch(n_components, i->second->n_components));
// set the component mask to either
// the original value or a vector
// of trues
- const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
- std::vector<bool> (n_components, true) :
- component_mask_);
- Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
- ExcNoComponentSelected());
+ const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
+ std::vector<bool> (n_components, true) :
+ component_mask_);
+ Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
+ dealii::VectorTools::ExcNoComponentSelected());
// field to store the indices
- std::vector<unsigned int> face_dofs;
- face_dofs.reserve (DoFTools::max_dofs_per_face(dof));
+ std::vector<unsigned int> face_dofs;
+ face_dofs.reserve (DoFTools::max_dofs_per_face(dof));
- std::vector<Point<spacedim> > dof_locations;
- dof_locations.reserve (DoFTools::max_dofs_per_face(dof));
+ std::vector<Point<spacedim> > dof_locations;
+ dof_locations.reserve (DoFTools::max_dofs_per_face(dof));
// array to store the values of
// the boundary function at the
// for scalar and vector functions
// to use the more efficient one
// respectively
- std::vector<double> dof_values_scalar;
- std::vector<Vector<double> > dof_values_system;
- dof_values_scalar.reserve (DoFTools::max_dofs_per_face (dof));
- dof_values_system.reserve (DoFTools::max_dofs_per_face (dof));
+ std::vector<double> dof_values_scalar;
+ std::vector<dealii::Vector<double> > dof_values_system;
+ dof_values_scalar.reserve (DoFTools::max_dofs_per_face (dof));
+ dof_values_system.reserve (DoFTools::max_dofs_per_face (dof));
// before we start with the loop
// over all cells create an
// the interpolation points of all
// finite elements that may ever be
// in use
- hp::FECollection<dim,spacedim> finite_elements (dof.get_fe());
- hp::QCollection<dim-1> q_collection;
- for (unsigned int f=0; f<finite_elements.size(); ++f)
- {
- const FiniteElement<dim,spacedim> &fe = finite_elements[f];
+ dealii::hp::FECollection<dim,spacedim> finite_elements (dof.get_fe());
+ dealii::hp::QCollection<dim-1> q_collection;
+ for (unsigned int f=0; f<finite_elements.size(); ++f)
+ {
+ const FiniteElement<dim,spacedim> &fe = finite_elements[f];
// generate a quadrature rule
// on the face from the unit
// to do this, we check whether
// the FE has support points on
// the face at all:
- if (fe.has_face_support_points())
- q_collection.push_back (Quadrature<dim-1>(fe.get_unit_face_support_points()));
- else
+ if (fe.has_face_support_points())
+ q_collection.push_back (Quadrature<dim-1>(fe.get_unit_face_support_points()));
+ else
{
// if not, then we should
// try a more clever
q_collection.push_back (Quadrature<dim-1>(unit_support_points));
}
- }
+ }
// now that we have a q_collection
// object with all the right
// quadrature points, create an
// hp::FEFaceValues object that we
// can use to evaluate the boundary
// values at
- hp::MappingCollection<dim,spacedim> mapping_collection (mapping);
- hp::FEFaceValues<dim,spacedim> x_fe_values (mapping_collection, finite_elements, q_collection,
- update_quadrature_points);
+ dealii::hp::MappingCollection<dim,spacedim> mapping_collection (mapping);
+ dealii::hp::FEFaceValues<dim,spacedim> x_fe_values (mapping_collection, finite_elements, q_collection,
+ update_quadrature_points);
- typename DH::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
- for (; cell!=endc; ++cell)
- if (!cell->is_artificial())
- for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
- ++face_no)
+ typename DH::active_cell_iterator cell = dof.begin_active(),
+ endc = dof.end();
+ for (; cell!=endc; ++cell)
+ if (!cell->is_artificial())
+ for (unsigned int face_no = 0; face_no < GeometryInfo<dim>::faces_per_cell;
+ ++face_no)
{
const FiniteElement<dim,spacedim> &fe = cell->get_fe();
}
typename DH::face_iterator face = cell->face(face_no);
+
+ // cast the face iterator to a DoFHandler
+ // iterator so that we can access the boundary
+ // indicators
const unsigned char boundary_component = face->boundary_indicator();
if (function_map.find(boundary_component) != function_map.end())
{
// face is of the right component
x_fe_values.reinit(cell, face_no);
- const FEFaceValues<dim,spacedim> &fe_values = x_fe_values.get_present_fe_values();
+ const dealii::FEFaceValues<dim,spacedim> &fe_values =
+ x_fe_values.get_present_fe_values();
// get indices, physical location and
// boundary values of dofs on this
// possible
if (dof_values_system.size() < fe.dofs_per_face)
dof_values_system.resize (fe.dofs_per_face,
- Vector<double>(fe.n_components()));
+ dealii::Vector<double>(fe.n_components()));
else
dof_values_system.resize (fe.dofs_per_face);
}
}
}
+ } // end of interpolate_boundary_values
+ } // end of namespace VectorTools
+} // end of namespace internal
+
+
+
+template <class DH>
+void
+VectorTools::
+interpolate_boundary_values (const Mapping<DH::dimension, DH::space_dimension> &mapping,
+ const DH &dof,
+ const typename FunctionMap<DH::space_dimension>::type &function_map,
+ std::map<unsigned int,double> &boundary_values,
+ const std::vector<bool> &component_mask_)
+{
+ dealii::internal::VectorTools::
+ interpolate_boundary_values (mapping, dof, function_map, boundary_values,
+ component_mask_,
+ dealii::internal::int2type<DH::dimension>());
}
component_mask);
}
-#endif
template <class DH>
// -------- implementation for project_boundary_values with std::map --------
-#if deal_II_dimension == 1
-
-// Implementation for 1D
template <int dim, int spacedim>
void
VectorTools::project_boundary_values (const Mapping<dim, spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const typename FunctionMap<spacedim>::type &boundary_functions,
- const Quadrature<dim-1> &,
+ const Quadrature<dim-1> &q,
std::map<unsigned int,double> &boundary_values,
std::vector<unsigned int> component_mapping)
{
- Assert (component_mapping.size() == 0, ExcNotImplemented());
+ if (dim == 1)
+ {
+ Assert (component_mapping.size() == 0, ExcNotImplemented());
// projection in 1d is equivalent
// to interpolation
- interpolate_boundary_values (mapping, dof, boundary_functions,
- boundary_values, std::vector<bool>());
-}
-
-#else
-
+ interpolate_boundary_values (mapping, dof, boundary_functions,
+ boundary_values, std::vector<bool>());
+ return;
+ }
-template <int dim, int spacedim>
-void
-VectorTools::project_boundary_values (const Mapping<dim, spacedim> &mapping,
- const DoFHandler<dim,spacedim> &dof,
- const typename FunctionMap<spacedim>::type &boundary_functions,
- const Quadrature<dim-1> &q,
- std::map<unsigned int,double> &boundary_values,
- std::vector<unsigned int> component_mapping)
-{
//TODO:[?] In VectorTools::project_boundary_values, no condensation of sparsity
// structures, matrices and right hand sides or distribution of
// solution vectors is performed. This is ok for dim<3 because then
}
}
-#endif
+
template <int dim, int spacedim>
void
# list the dimension dependent and dimension independent directories
-dim-dep-dirs := dofs hp multigrid numerics
-dim-indep-dirs := base lac fe grid distributed
+dim-dep-dirs :=
+dim-indep-dirs := base lac dofs fe grid hp numerics multigrid distributed
all-dirs := $(dim-dep-dirs) $(dim-indep-dirs)
# create lists of file names.
Assert (false, ExcNotImplemented());
#else
-
+
//calculate new IndexSet. First try
//to find out if the new indices are
//contiguous blocks. This avoids
/*-------------- Explicit Instantiations -------------------------------*/
-
-namespace internal
-{
- namespace DoFHandler
- {
- namespace Policy
- {
- template class PolicyBase<deal_II_dimension,deal_II_dimension>;
- template class Sequential<deal_II_dimension,deal_II_dimension>;
- template class ParallelDistributed<deal_II_dimension,deal_II_dimension>;
-
-#if deal_II_dimension==1 || deal_II_dimension==2
- template class PolicyBase<deal_II_dimension,deal_II_dimension+1>;
- template class Sequential<deal_II_dimension,deal_II_dimension+1>;
- template class ParallelDistributed<deal_II_dimension,deal_II_dimension+1>;
-#endif
- }
- }
-}
+#include "dof_handler_policy.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+namespace internal
+\{
+ namespace DoFHandler
+ \{
+ namespace Policy
+ \{
+ template class PolicyBase<deal_II_dimension,deal_II_dimension>;
+ template class Sequential<deal_II_dimension,deal_II_dimension>;
+ template class ParallelDistributed<deal_II_dimension,deal_II_dimension>;
+
+#if deal_II_dimension==1 || deal_II_dimension==2
+ template class PolicyBase<deal_II_dimension,deal_II_dimension+1>;
+ template class Sequential<deal_II_dimension,deal_II_dimension+1>;
+ template class ParallelDistributed<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ \}
+ \}
+\}
+
+}
ExcInternalError());
}
+} // namespace DoFRenumbering
-// explicit instantiations
- namespace boost
- {
-//TODO[WB]: also implement the following boost for hp DoFHandlers etc.
- template
- void
- Cuthill_McKee (DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_Cuthill_McKee (std::vector<unsigned int> &,
- const DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- king_ordering (DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_king_ordering (std::vector<unsigned int> &,
- const DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- minimum_degree (DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_minimum_degree (std::vector<unsigned int> &,
- const DoFHandler<deal_II_dimension> &, bool, bool);
-
-
- template
- void
- Cuthill_McKee (hp::DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_Cuthill_McKee (std::vector<unsigned int> &,
- const hp::DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- king_ordering (hp::DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_king_ordering (std::vector<unsigned int> &,
- const hp::DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- minimum_degree (hp::DoFHandler<deal_II_dimension> &, bool, bool);
-
- template
- void
- compute_minimum_degree (std::vector<unsigned int> &,
- const hp::DoFHandler<deal_II_dimension> &, bool, bool);
- }
-
-
-// non-boost functions:
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "dof_renumbering.inst"
- template
- void Cuthill_McKee<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void
- compute_Cuthill_McKee<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
-
- template
- void Cuthill_McKee<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void
- compute_Cuthill_McKee<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void Cuthill_McKee<MGDoFHandler<deal_II_dimension> >
- (MGDoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void
- compute_Cuthill_McKee<MGDoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const MGDoFHandler<deal_II_dimension>&,
- const bool,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void component_wise<deal_II_dimension>
- (DoFHandler<deal_II_dimension>&,
- const std::vector<unsigned int>&);
-
- template
- void component_wise<deal_II_dimension>
- (hp::DoFHandler<deal_II_dimension>&,
- const std::vector<unsigned int>&);
-
-// template
-// void
-// compute_component_wise<deal_II_dimension>
-// (std::vector<unsigned int>&,
-// const DoFHandler<deal_II_dimension>&,
-// const std::vector<unsigned int>&);
-
- template
- void component_wise<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&,
- unsigned int,
- const std::vector<unsigned int>&);
-
- template
- void component_wise<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&,
- const std::vector<unsigned int>&);
-
-// DG renumbering for DoFHandler
-
- template
- void
- cell_wise_dg<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&,
- const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template
- void
- compute_cell_wise_dg<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&,
- const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template
- void
- downstream_dg<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
-
- template
- void
- compute_downstream_dg<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
- template
- void
- compute_downstream_dg<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
-
- template void
- cell_wise<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&,
- const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- compute_cell_wise<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&,
- const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- downstream<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
- const bool);
-
- template void
- compute_downstream<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
- const bool);
-
- template
- void
- clockwise_dg<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&, bool);
-
- template
- void
- compute_clockwise_dg<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&, const DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&, const bool);
-
-// Renumbering for hp::DoFHandler
-
- template void
- cell_wise_dg<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- compute_cell_wise_dg<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- cell_wise<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- compute_cell_wise<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
-
- template void
- downstream_dg<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
-
- template void
- compute_downstream_dg<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
- template
- void
- compute_downstream_dg<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&);
-
- template void
- downstream<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&,
- const bool);
-
- template void
- compute_downstream<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&,
- const bool);
-
- template
- void
- clockwise_dg<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&, bool);
-
- template
- void
- compute_clockwise_dg<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const Point<deal_II_dimension>&,
- const bool);
-
-// MG
-
- template
- void downstream_dg<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&, const unsigned int,
- const Point<deal_II_dimension>&);
-
- template
- void downstream<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&, const unsigned int,
- const Point<deal_II_dimension>&,
- const bool);
-
- template
- void clockwise_dg<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&,
- const unsigned int,
- const Point<deal_II_dimension>&, bool);
-
-// Generic numbering schemes
-
- template
- void random<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension> &);
-
- template
- void
- compute_random<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension> &);
-
- template
- void sort_selected_dofs_back<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &);
-
- template
- void
- compute_sort_selected_dofs_back<DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &);
-
- template
- void random<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension> &);
-
- template
- void
- compute_random<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension> &);
-
- template
- void sort_selected_dofs_back<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &);
-
- template
- void
- compute_sort_selected_dofs_back<hp::DoFHandler<deal_II_dimension> >
- (std::vector<unsigned int>&,
- const hp::DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &);
-
- template
- void subdomain_wise<DoFHandler<deal_II_dimension> >
- (DoFHandler<deal_II_dimension> &);
-
- template
- void subdomain_wise<hp::DoFHandler<deal_II_dimension> >
- (hp::DoFHandler<deal_II_dimension> &);
-
- template
- void Cuthill_McKee<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&,
- const unsigned int,
- const bool,
- const std::vector<unsigned int>&);
-
- template
- void cell_wise_dg<deal_II_dimension>
- (MGDoFHandler<deal_II_dimension>&,
- const unsigned int,
- const std::vector<MGDoFHandler<deal_II_dimension>::cell_iterator>&);
- template
- void compute_cell_wise_dg<deal_II_dimension>
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const MGDoFHandler<deal_II_dimension>&, const unsigned int,
- const std::vector<MGDoFHandler<deal_II_dimension>::cell_iterator>&);
- template
- void compute_downstream_dg<deal_II_dimension>
- (std::vector<unsigned int>&, std::vector<unsigned int>&,
- const MGDoFHandler<deal_II_dimension>&, const unsigned int,
- const Point<deal_II_dimension>&);
-
-} // namespace DoFRenumbering
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+ namespace DoFRenumbering
+ \{
+ namespace boost
+ \{
+//TODO[WB]: also implement the following boost for hp DoFHandlers etc.
+ template
+ void
+ Cuthill_McKee (DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_Cuthill_McKee (std::vector<unsigned int> &,
+ const DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ king_ordering (DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_king_ordering (std::vector<unsigned int> &,
+ const DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ minimum_degree (DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_minimum_degree (std::vector<unsigned int> &,
+ const DoFHandler<deal_II_dimension> &, bool, bool);
+
+
+ template
+ void
+ Cuthill_McKee (hp::DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_Cuthill_McKee (std::vector<unsigned int> &,
+ const hp::DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ king_ordering (hp::DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_king_ordering (std::vector<unsigned int> &,
+ const hp::DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ minimum_degree (hp::DoFHandler<deal_II_dimension> &, bool, bool);
+
+ template
+ void
+ compute_minimum_degree (std::vector<unsigned int> &,
+ const hp::DoFHandler<deal_II_dimension> &, bool, bool);
+ \}
+
+
+// non-boost functions:
+
+ template
+ void Cuthill_McKee<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void
+ compute_Cuthill_McKee<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+
+ template
+ void Cuthill_McKee<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void
+ compute_Cuthill_McKee<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void Cuthill_McKee<MGDoFHandler<deal_II_dimension> >
+ (MGDoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void
+ compute_Cuthill_McKee<MGDoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const MGDoFHandler<deal_II_dimension>&,
+ const bool,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void component_wise<deal_II_dimension>
+ (DoFHandler<deal_II_dimension>&,
+ const std::vector<unsigned int>&);
+
+ template
+ void component_wise<deal_II_dimension>
+ (hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<unsigned int>&);
+
+// template
+// void
+// compute_component_wise<deal_II_dimension>
+// (std::vector<unsigned int>&,
+// const DoFHandler<deal_II_dimension>&,
+// const std::vector<unsigned int>&);
+
+ template
+ void component_wise<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&,
+ unsigned int,
+ const std::vector<unsigned int>&);
+
+ template
+ void component_wise<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&,
+ const std::vector<unsigned int>&);
+
+// DG renumbering for DoFHandler
+
+ template
+ void
+ cell_wise_dg<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&,
+ const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template
+ void
+ compute_cell_wise_dg<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&,
+ const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template
+ void
+ downstream_dg<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+
+ template
+ void
+ compute_downstream_dg<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+ template
+ void
+ compute_downstream_dg<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+
+ template void
+ cell_wise<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&,
+ const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ compute_cell_wise<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&,
+ const std::vector<DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ downstream<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
+ const bool);
+
+ template void
+ compute_downstream<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&,
+ const bool);
+
+ template
+ void
+ clockwise_dg<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension>&, const Point<deal_II_dimension>&, bool);
+
+ template
+ void
+ compute_clockwise_dg<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&, const DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&, const bool);
+
+// Renumbering for hp::DoFHandler
+
+ template void
+ cell_wise_dg<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ compute_cell_wise_dg<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ cell_wise<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ compute_cell_wise<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<hp::DoFHandler<deal_II_dimension>::cell_iterator>&);
+
+ template void
+ downstream_dg<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+
+ template void
+ compute_downstream_dg<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+ template
+ void
+ compute_downstream_dg<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&);
+
+ template void
+ downstream<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&,
+ const bool);
+
+ template void
+ compute_downstream<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&,
+ const bool);
+
+ template
+ void
+ clockwise_dg<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&, bool);
+
+ template
+ void
+ compute_clockwise_dg<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const Point<deal_II_dimension>&,
+ const bool);
+
+// MG
+
+ template
+ void downstream_dg<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&, const unsigned int,
+ const Point<deal_II_dimension>&);
+
+ template
+ void downstream<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&, const unsigned int,
+ const Point<deal_II_dimension>&,
+ const bool);
+
+ template
+ void clockwise_dg<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&,
+ const unsigned int,
+ const Point<deal_II_dimension>&, bool);
+
+// Generic numbering schemes
+
+ template
+ void random<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension> &);
+
+ template
+ void
+ compute_random<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension> &);
+
+ template
+ void sort_selected_dofs_back<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &);
+
+ template
+ void
+ compute_sort_selected_dofs_back<DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &);
+
+ template
+ void random<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension> &);
+
+ template
+ void
+ compute_random<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension> &);
+
+ template
+ void sort_selected_dofs_back<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &);
+
+ template
+ void
+ compute_sort_selected_dofs_back<hp::DoFHandler<deal_II_dimension> >
+ (std::vector<unsigned int>&,
+ const hp::DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &);
+
+ template
+ void subdomain_wise<DoFHandler<deal_II_dimension> >
+ (DoFHandler<deal_II_dimension> &);
+
+ template
+ void subdomain_wise<hp::DoFHandler<deal_II_dimension> >
+ (hp::DoFHandler<deal_II_dimension> &);
+
+ template
+ void Cuthill_McKee<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&,
+ const unsigned int,
+ const bool,
+ const std::vector<unsigned int>&);
+
+ template
+ void cell_wise_dg<deal_II_dimension>
+ (MGDoFHandler<deal_II_dimension>&,
+ const unsigned int,
+ const std::vector<MGDoFHandler<deal_II_dimension>::cell_iterator>&);
+ template
+ void compute_cell_wise_dg<deal_II_dimension>
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const MGDoFHandler<deal_II_dimension>&, const unsigned int,
+ const std::vector<MGDoFHandler<deal_II_dimension>::cell_iterator>&);
+ template
+ void compute_downstream_dg<deal_II_dimension>
+ (std::vector<unsigned int>&, std::vector<unsigned int>&,
+ const MGDoFHandler<deal_II_dimension>&, const unsigned int,
+ const Point<deal_II_dimension>&);
+
+ \} // namespace DoFRenumbering
+ }
+
DEAL_II_NAMESPACE_OPEN
-//TODO: convert many more of the instantiations at the bottom of this file to the .inst.in mechanism
//#define WOLFGANG
-#if deal_II_dimension == 1
-
template <class DH, class SparsityPattern>
void
DoFTools::make_boundary_sparsity_pattern (
- const DH &dof_handler,
- const typename FunctionMap<DH::space_dimension>::type &function_map,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity)
-{
- // first check left, the right
- // boundary point
- for (unsigned int direction=0; direction<2; ++direction)
- {
- // if this boundary is not
- // requested, then go on with next one
- if (function_map.find(direction) ==
- function_map.end())
- continue;
-
- // find active cell at that
- // boundary: first go to
- // left/right, then to children
- typename DH::cell_iterator cell = dof_handler.begin(0);
- while (!cell->at_boundary(direction))
- cell = cell->neighbor(direction);
- while (!cell->active())
- cell = cell->child(direction);
-
- const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex;
- std::vector<unsigned int> boundary_dof_boundary_indices (dofs_per_vertex);
-
- // next get boundary mapped dof
- // indices of boundary dofs
- for (unsigned int i=0; i<dofs_per_vertex; ++i)
- boundary_dof_boundary_indices[i]
- = dof_to_boundary_mapping[cell->vertex_dof_index(direction,i)];
-
- for (unsigned int i=0; i<dofs_per_vertex; ++i)
- sparsity.add_entries (boundary_dof_boundary_indices[i],
- boundary_dof_boundary_indices.begin(),
- boundary_dof_boundary_indices.end());
- };
-}
-
-
-
-template <class DH, class SparsityPattern>
-void DoFTools::make_boundary_sparsity_pattern (
- const DH &dof_handler,
+ const DH &dof,
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
+ if (DH::dimension == 1)
+ {
// there are only 2 boundary
// indicators in 1d, so it is no
// performance problem to call the
// other function
- typename DH::FunctionMap boundary_indicators;
- boundary_indicators[0] = 0;
- boundary_indicators[1] = 0;
- make_boundary_sparsity_pattern<DH, SparsityPattern> (dof_handler,
- boundary_indicators,
- dof_to_boundary_mapping,
- sparsity);
-}
-
-
-#else
-
+ typename DH::FunctionMap boundary_indicators;
+ boundary_indicators[0] = 0;
+ boundary_indicators[1] = 0;
+ make_boundary_sparsity_pattern<DH, SparsityPattern> (dof,
+ boundary_indicators,
+ dof_to_boundary_mapping,
+ sparsity);
+ return;
+ }
-template <class DH, class SparsityPattern>
-void
-DoFTools::make_boundary_sparsity_pattern (
- const DH &dof,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity)
-{
const unsigned int n_dofs = dof.n_dofs();
AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
const std::vector<unsigned int> &dof_to_boundary_mapping,
SparsityPattern &sparsity)
{
+ if (DH::dimension == 1)
+ {
+ // first check left, then right
+ // boundary point
+ for (unsigned int direction=0; direction<2; ++direction)
+ {
+ // if this boundary is not
+ // requested, then go on with next one
+ if (boundary_indicators.find(direction) ==
+ boundary_indicators.end())
+ continue;
+
+ // find active cell at that
+ // boundary: first go to
+ // left/right, then to children
+ typename DH::cell_iterator cell = dof.begin(0);
+ while (!cell->at_boundary(direction))
+ cell = cell->neighbor(direction);
+ while (!cell->active())
+ cell = cell->child(direction);
+
+ const unsigned int dofs_per_vertex = cell->get_fe().dofs_per_vertex;
+ std::vector<unsigned int> boundary_dof_boundary_indices (dofs_per_vertex);
+
+ // next get boundary mapped dof
+ // indices of boundary dofs
+ for (unsigned int i=0; i<dofs_per_vertex; ++i)
+ boundary_dof_boundary_indices[i]
+ = dof_to_boundary_mapping[cell->vertex_dof_index(direction,i)];
+
+ for (unsigned int i=0; i<dofs_per_vertex; ++i)
+ sparsity.add_entries (boundary_dof_boundary_indices[i],
+ boundary_dof_boundary_indices.begin(),
+ boundary_dof_boundary_indices.end());
+ };
+ return;
+ }
+
const unsigned int n_dofs = dof.n_dofs();
AssertDimension (dof_to_boundary_mapping.size(), n_dofs);
}
}
-#endif
-#if deal_II_dimension != 1
template <class DH, class SparsityPattern>
void
DoFTools::make_flux_sparsity_pattern (const DH &dof,
typename DH::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
- // Clear user flags because we will
- // need them. But first we save them
- // and make sure that we restore them
- // later such that at the end of this
- // function the Triangulation will be
- // in the same state as it was at the
- // beginning of this function.
- std::vector<bool> user_flags;
- dof.get_tria().save_user_flags(user_flags);
- const_cast<Triangulation<DH::dimension> &>(dof.get_tria()).clear_user_flags ();
+ // TODO: in an old implementation, we used
+ // user flags before to tag faces that were
+ // already touched. this way, we could reduce
+ // the work a little bit. now, we instead add
+ // only data from one side. this should be OK,
+ // but we need to actually verify it.
// In case we work with a distributed
// sparsity pattern of Trilinos type, we
dofs_on_this_cell.resize (n_dofs_on_this_cell);
cell->get_dof_indices (dofs_on_this_cell);
- // make sparsity pattern for this cell
- // for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- // for (unsigned int j=0; j<n_dofs_on_this_cell; ++j)
- // sparsity.add (dofs_on_this_cell[i],
- // dofs_on_this_cell[j]);
-
// make sparsity pattern for this
// cell. if no constraints pattern was
// given, then the following call acts
sparsity,
keep_constrained_dofs);
- // Loop over all interior neighbors
for (unsigned int face = 0;
face < GeometryInfo<DH::dimension>::faces_per_cell;
++face)
{
typename DH::face_iterator cell_face = cell->face(face);
- if (cell_face->user_flag_set ())
- continue;
- if (! cell_face->at_boundary() )
+ if (! cell->at_boundary(face) )
{
typename DH::cell_iterator neighbor = cell->neighbor(face);
- const unsigned int neighbor_face
- = cell->neighbor_face_no(face);
-
if (cell_face->has_children())
{
for (unsigned int sub_nr = 0;
constraints.add_entries_local_to_global
(dofs_on_other_cell, dofs_on_this_cell,
sparsity, keep_constrained_dofs);
- sub_neighbor->face(neighbor_face)->set_user_flag ();
}
}
else
{
// Refinement edges are taken care of
// by coarser cells
+
+ // TODO: in the distributed case, we miss out
+ // the constraints when the neighbor cell is
+ // coarser, but only the current cell is owned
+ // locally!
if (cell->neighbor_is_coarser(face))
continue;
constraints.add_entries_local_to_global
(dofs_on_this_cell, dofs_on_other_cell,
sparsity, keep_constrained_dofs);
- constraints.add_entries_local_to_global
- (dofs_on_other_cell, dofs_on_this_cell,
- sparsity, keep_constrained_dofs);
- neighbor->face(neighbor_face)->set_user_flag ();
- }
- }
- }
- }
-
- // finally restore the user flags
- const_cast<Triangulation<DH::dimension> &>(dof.get_tria()).load_user_flags(user_flags);
-}
-
-
-template <class DH, class SparsityPattern>
-void
-DoFTools::make_flux_sparsity_pattern (
- const DH &dof,
- SparsityPattern &sparsity)
-{
- const unsigned int n_dofs = dof.n_dofs();
-
- Assert (sparsity.n_rows() == n_dofs,
- ExcDimensionMismatch (sparsity.n_rows(), n_dofs));
- Assert (sparsity.n_cols() == n_dofs,
- ExcDimensionMismatch (sparsity.n_cols(), n_dofs));
-
- std::vector<unsigned int> dofs_on_this_cell;
- std::vector<unsigned int> dofs_on_other_cell;
- dofs_on_this_cell.reserve (max_dofs_per_cell(dof));
- dofs_on_other_cell.reserve (max_dofs_per_cell(dof));
- typename DH::active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
-
- // Clear user flags because we will
- // need them. But first we save
- // them and make sure that we
- // restore them later such that at
- // the end of this function the
- // Triangulation will be in the
- // same state as it was at the
- // beginning of this function.
- std::vector<bool> user_flags;
- dof.get_tria().save_user_flags(user_flags);
- const_cast<Triangulation<DH::dimension> &>(dof.get_tria()).clear_user_flags ();
-
- for (; cell!=endc; ++cell)
- {
- const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
- dofs_on_this_cell.resize (n_dofs_on_this_cell);
- cell->get_dof_indices (dofs_on_this_cell);
- // make sparsity pattern for this cell
- for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- for (unsigned int j=0; j<n_dofs_on_this_cell; ++j)
- sparsity.add (dofs_on_this_cell[i],
- dofs_on_this_cell[j]);
-
- // Loop over all interior neighbors
- for (unsigned int face = 0;
- face < GeometryInfo<DH::dimension>::faces_per_cell;
- ++face)
- {
- typename DH::face_iterator cell_face = cell->face(face);
- if (cell_face->user_flag_set ())
- continue;
-
- if (! cell_face->at_boundary() )
- {
- typename DH::cell_iterator neighbor = cell->neighbor(face);
-
- const unsigned int neighbor_face
- = cell->neighbor_face_no(face);
-
- if (cell_face->has_children())
- {
- for (unsigned int sub_nr = 0;
- sub_nr != cell_face->number_of_children();
- ++sub_nr)
- {
- const typename DH::cell_iterator
- sub_neighbor
- = cell->neighbor_child_on_subface (face, sub_nr);
-
- const unsigned int n_dofs_on_neighbor
- = sub_neighbor->get_fe().dofs_per_cell;
- dofs_on_other_cell.resize (n_dofs_on_neighbor);
- sub_neighbor->get_dof_indices (dofs_on_other_cell);
-
- for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- sparsity.add_entries (dofs_on_this_cell[i],
- dofs_on_other_cell.begin(),
- dofs_on_other_cell.end());
- for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
- sparsity.add_entries (dofs_on_other_cell[j],
- dofs_on_this_cell.begin(),
- dofs_on_this_cell.end());
- sub_neighbor->face(neighbor_face)->set_user_flag ();
- }
- }
- else
- {
- // Refinement edges are
- // taken care of by
- // coarser cells
- if (cell->neighbor_is_coarser(face))
- continue;
-
- const unsigned int n_dofs_on_neighbor
- = neighbor->get_fe().dofs_per_cell;
- dofs_on_other_cell.resize (n_dofs_on_neighbor);
-
- neighbor->get_dof_indices (dofs_on_other_cell);
-
- for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- sparsity.add_entries (dofs_on_this_cell[i],
- dofs_on_other_cell.begin(),
- dofs_on_other_cell.end());
- for (unsigned int j=0; j<n_dofs_on_neighbor; ++j)
- sparsity.add_entries (dofs_on_other_cell[j],
- dofs_on_this_cell.begin(),
- dofs_on_this_cell.end());
- neighbor->face(neighbor_face)->set_user_flag ();
+ // only need to add these in case the neighbor
+ // cell is not locally owned - otherwise, we
+ // touch each face twice and hence put the
+ // indices the other way around
+ if (cell->neighbor(face)->subdomain_id() !=
+ cell->subdomain_id())
+ constraints.add_entries_local_to_global
+ (dofs_on_other_cell, dofs_on_this_cell,
+ sparsity, keep_constrained_dofs);
}
}
}
}
-
- // finally restore the user flags
- const_cast<Triangulation<DH::dimension> &>(dof.get_tria()).load_user_flags(user_flags);
}
-#else // deal_II_dimension == 1
-
template <class DH, class SparsityPattern>
void
const DH &dof,
SparsityPattern &sparsity)
{
- typedef typename DH::cell_iterator cell_iterator;
- typedef typename DH::active_cell_iterator active_cell_iterator;
-
- std::vector<unsigned int> local_dof_indices;
- std::vector<unsigned int> neighbor_dof_indices;
- local_dof_indices.reserve (max_dofs_per_cell(dof));
- neighbor_dof_indices.reserve (max_dofs_per_cell(dof));
-
- active_cell_iterator cell = dof.begin_active(),
- endc = dof.end();
- for (; cell!=endc; ++cell)
- {
- // first do couplings of dofs
- // locally on this cell
- const unsigned int n_dofs_on_this_cell = cell->get_fe().dofs_per_cell;
- local_dof_indices.resize (n_dofs_on_this_cell);
- cell->get_dof_indices (local_dof_indices);
- for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- sparsity.add_entries (local_dof_indices[i],
- local_dof_indices.begin(),
- local_dof_indices.end());
-
- // then do the same for the up
- // to 2 neighbors
- for (unsigned int nb=0; nb<2; ++nb)
- if (! cell->at_boundary(nb))
- {
- // find active neighbor
- cell_iterator neighbor = cell->neighbor(nb);
- while (neighbor->has_children())
- neighbor = neighbor->child(nb==0 ? 1 : 0);
-
- // get dofs on it
- const unsigned int n_dofs_on_neighbor
- = neighbor->get_fe().dofs_per_cell;
- neighbor_dof_indices.resize (n_dofs_on_neighbor);
- neighbor->get_dof_indices (neighbor_dof_indices);
-
- // compute couplings
- for (unsigned int i=0; i<n_dofs_on_this_cell; ++i)
- sparsity.add_entries (local_dof_indices[i],
- neighbor_dof_indices.begin(),
- neighbor_dof_indices.end());
- };
- };
+ ConstraintMatrix constraints;
+ make_flux_sparsity_pattern (dof, sparsity, constraints);
}
-#endif
template <int dim, int spacedim>
}
-#if deal_II_dimension == 1
+
static
void
make_hp_hanging_node_constraints (const dealii::DoFHandler<1> &,
// // that a bit more
// //TODO[WB]: think about what to do here...
// }
-#endif
+//#endif
-#if deal_II_dimension == 2
template <class DH>
static
void
}
}
}
-#endif
-#if deal_II_dimension == 3
+
template <class DH>
static
void
12*fe.dofs_per_line+
4*fe.dofs_per_quad);
//TODO[TL]: think about this and the following in case of anisotropic refinement
-
+
dofs_on_mother.resize (n_dofs_on_mother);
dofs_on_children.resize (n_dofs_on_children);
}
}
}
-#endif
template <class DH>
}
-#if deal_II_dimension != 1
template <class DH>
void
-
-#else // 1d
-
-
-template <class DH>
-void
-DoFTools::extract_boundary_dofs (const DH &dof_handler,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators)
-{
- Assert (component_select.size() == n_components(dof_handler),
- ExcWrongSize (component_select.size(),
- n_components(dof_handler)));
-
- // clear and reset array by default
- // values
- selected_dofs.clear ();
- selected_dofs.resize (dof_handler.n_dofs(), false);
-
- // let's see whether we have to
- // check for certain boundary
- // indicators or whether we can
- // accept all
- const bool check_left_vertex = ((boundary_indicators.size() == 0) ||
- (boundary_indicators.find(0) !=
- boundary_indicators.end()));
- const bool check_right_vertex = ((boundary_indicators.size() == 0) ||
- (boundary_indicators.find(1) !=
- boundary_indicators.end()));
-
- // see whether we have to check
- // whether a certain vector
- // component is selected, or all
- const bool check_vector_component
- = (component_select != std::vector<bool>(component_select.size(),
- true));
-
- // loop over coarse grid cells
- for (typename DH::cell_iterator cell=dof_handler.begin(0);
- cell!=dof_handler.end(0); ++cell)
- {
- const FiniteElement<1> &fe = cell->get_fe();
-
- // check left-most vertex
- if (check_left_vertex)
- if (cell->neighbor(0) == dof_handler.end())
- {
- // In 1D the number of DoFs
- // on the faces should be
- // equal to the number of DoFs
- // on the vertices.
- AssertDimension (fe.dofs_per_face, fe.dofs_per_vertex);
-
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (!check_vector_component)
- selected_dofs[cell->vertex_dof_index(0,i)] = true;
- else
- // check
- // component. make sure
- // we don't ask the
- // wrong question
- // (leading to an
- // exception) in case
- // the shape function
- // is non-primitive. note
- // that the face dof
- // index i is also the
- // cell dof index of a
- // corresponding dof in 1d
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.face_system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[cell->vertex_dof_index(0,i)] = true;
- }
- }
-
- // check right-most
- // vertex. same procedure here
- // as above
- if (check_right_vertex)
- if (cell->neighbor(1) == dof_handler.end())
- {
- AssertDimension (fe.dofs_per_face, fe.dofs_per_vertex);
-
- for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (!check_vector_component)
- selected_dofs[cell->vertex_dof_index(1,i)] = true;
- else
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.face_system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[cell->vertex_dof_index(1,i)] = true;
- }
- }
- }
-}
-
-
-
-template <class DH>
-void
-DoFTools::extract_dofs_with_support_on_boundary (const DH &dof_handler,
- const std::vector<bool> &component_select,
- std::vector<bool> &selected_dofs,
- const std::set<unsigned char> &boundary_indicators)
-{
- Assert (component_select.size() == n_components(dof_handler),
- ExcWrongSize (component_select.size(),
- n_components(dof_handler)));
-
- // clear and reset array by default
- // values
- selected_dofs.clear ();
- selected_dofs.resize (dof_handler.n_dofs(), false);
-
- // let's see whether we have to
- // check for certain boundary
- // indicators or whether we can
- // accept all
- const bool check_left_vertex = ((boundary_indicators.size() == 0) ||
- (boundary_indicators.find(0) !=
- boundary_indicators.end()));
- const bool check_right_vertex = ((boundary_indicators.size() == 0) ||
- (boundary_indicators.find(1) !=
- boundary_indicators.end()));
-
- // see whether we have to check
- // whether a certain vector
- // component is selected, or all
- const bool check_vector_component
- = (component_select != std::vector<bool>(component_select.size(),
- true));
-
- std::vector<unsigned int> dof_indices;
-
- // loop over cells
- for (typename DH::active_cell_iterator cell=dof_handler.begin_active();
- cell!=dof_handler.end(); ++cell)
- {
- const FiniteElement<1> &fe = cell->get_fe();
-
- // check left-most vertex
- if (check_left_vertex)
- if (cell->neighbor(0) == dof_handler.end())
- {
- dof_indices.resize (fe.dofs_per_cell);
- cell->get_dof_indices(dof_indices);
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- if (cell->get_fe().has_support_on_face (i,0) == true)
- {
- if (!check_vector_component)
- selected_dofs[dof_indices[i]] = true;
- else
- // check
- // component. make sure
- // we don't ask the
- // wrong question
- // (leading to an
- // exception) in case
- // the shape function
- // is non-primitive. note
- // that the face dof
- // index i is also the
- // cell dof index of a
- // corresponding dof in 1d
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[dof_indices[i]] = true;
- }
- }
- }
-
- // check right-most
- // vertex. same procedure here
- // as above
- if (check_right_vertex)
- if (cell->neighbor(1) == dof_handler.end())
- {
- dof_indices.resize (fe.dofs_per_cell);
- cell->get_dof_indices (dof_indices);
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- if (cell->get_fe().has_support_on_face (i,1) == true)
- {
- if (!check_vector_component)
- selected_dofs[dof_indices[i]] = true;
- else
- {
- const unsigned int component =
- (fe.is_primitive(i) ?
- fe.system_to_component_index(i).first :
- (std::find (fe.get_nonzero_components(i).begin(),
- fe.get_nonzero_components(i).end(),
- true)
- -
- fe.get_nonzero_components(i).begin()));
- Assert (component < fe.n_components(),
- ExcInternalError());
-
- if (component_select[component] == true)
- selected_dofs[dof_indices[i]] = true;
- }
- }
- }
- }
-}
-
-
-#endif
-
-
-
namespace internal
{
namespace DoFTools
"associated DoF handler objects, asking for any subdomain other "
"than the locally owned one does not make sense."));
#endif
-
+
IndexSet index_set (dof_handler.n_dofs());
std::vector<unsigned int> local_dof_indices;
-
-
-
template <class DH>
void
DoFTools::count_dofs_with_subdomain_association (const DH &dof_handler,
}
+
template <int dim, int spacedim>
void
DoFTools::compute_intergrid_constraints (
-#if deal_II_dimension == 1
-
-
-template <class DH>
-void DoFTools::map_dof_to_boundary_indices (
- const DH &dof_handler,
- const std::set<unsigned char> &boundary_indicators,
- std::vector<unsigned int> &mapping)
-{
- Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
-
- mapping.clear ();
- mapping.insert (mapping.end(), dof_handler.n_dofs(),
- DH::invalid_dof_index);
-
- unsigned int next_free_index = 0;
-
- // first check left, the right
- // boundary point
- for (unsigned int direction=0; direction<2; ++direction)
- {
- // if this boundary is not
- // requested, then go on with next one
- if (boundary_indicators.find(direction) ==
- boundary_indicators.end())
- continue;
-
- // find active cell at that
- // boundary: first go to
- // left/right, then to children
- typename DH::cell_iterator cell = dof_handler.begin(0);
- while (!cell->at_boundary(direction))
- cell = cell->neighbor(direction);
- while (!cell->active())
- cell = cell->child(direction);
-
- // next enumerate these degrees
- // of freedom
- for (unsigned int i=0; i<cell->get_fe().dofs_per_vertex; ++i)
- mapping[cell->vertex_dof_index(direction,i)] = next_free_index++;
- };
-}
-
-
-
-template <>
-void
-DoFTools::map_dof_to_boundary_indices (const DoFHandler<1> &dof_handler,
- std::vector<unsigned int> &mapping)
-{
- Assert (&dof_handler.get_fe() != 0, ExcNoFESelected());
-
- // in 1d, there are only 2 boundary
- // indicators, so enumerate them
- // and pass on to the other
- // function
- std::set<unsigned char> boundary_indicators;
- boundary_indicators.insert (0U);
- boundary_indicators.insert (1U);
-
- map_dof_to_boundary_indices<DoFHandler<1> > (dof_handler, boundary_indicators, mapping);
-}
-
-#else
-
-
template <class DH>
void
DoFTools::map_dof_to_boundary_indices (const DH &dof_handler,
AssertDimension (next_boundary_index, dof_handler.n_boundary_dofs (boundary_indicators));
}
-#endif
-
template <int dim, int spacedim>
}
}
-#if deal_II_dimension == 1
-template <int dim, int spacedim, template <int,int> class DH>
-void
-DoFTools::make_zero_boundary_constraints (const DH<dim, spacedim> &dof,
- ConstraintMatrix &zero_boundary_constraints,
- const std::vector<bool> &component_mask_)
-{
- Assert ((component_mask_.size() == 0) ||
- (component_mask_.size() == dof.get_fe().n_components()),
- ExcMessage ("The number of components in the mask has to be either "
- "zero or equal to the number of components in the finite "
- "element."));
-
- // check for boundary cells in both
- // directions to secure indicators
- // for the entire boundary, i.e. 0
- // is left boundary and 1 is right
- // boundary
- for (unsigned int direction = 0; direction < 2; ++direction)
- {
-
- // first find the outermost active
- // cell by traversing the coarse
- // grid to its end and then looking
- // for the children
- typename DH<dim,spacedim>::cell_iterator outermost_cell = dof.begin(0);
- while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
- outermost_cell = outermost_cell->neighbor(direction);
-
- while (outermost_cell->has_children())
- outermost_cell = outermost_cell->child(direction);
-
- // then get the FE corresponding to
- // this cell
- const FiniteElement<dim,spacedim> &fe = outermost_cell->get_fe();
-
- // set the component mask to either
- // the original value or a vector
- // of trues
- const std::vector<bool> component_mask ((component_mask_.size() == 0) ?
- std::vector<bool> (fe.n_components(), true) :
- component_mask_);
- Assert (std::count(component_mask.begin(), component_mask.end(), true) > 0,
- VectorTools::ExcNoComponentSelected());
-
- // cast zero boundary constraints
- // onto a matrix if component_mask
- // == true
- for (unsigned int i=0; i<fe.dofs_per_vertex; ++i)
- if (component_mask[fe.face_system_to_component_index(i).first])
- zero_boundary_constraints.add_line (outermost_cell->vertex_dof_index (direction, i));
-
- }
-}
-
-#else
template <int dim, int spacedim, template <int,int> class DH>
void
}
}
-#endif
// explicit instantiations
#include "dof_tools.inst"
-// #if deal_II_dimension > 1
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- SparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSetSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSimpleSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSimpleSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSetSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSimpleSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSimpleSparsityPattern &);
-
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- SparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSetSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSimpleSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- CompressedSimpleSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSetSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSimpleSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSimpleSparsityPattern &);
-
-
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSetSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,CompressedSimpleSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSimpleSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSetSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,BlockCompressedSimpleSparsityPattern>
-(const DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSimpleSparsityPattern &sparsity);
-
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSetSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSetSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,CompressedSimpleSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSimpleSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSetSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSetSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,BlockCompressedSimpleSparsityPattern>
-(const hp::DoFHandler<deal_II_dimension>& dof,
- const FunctionMap<deal_II_dimension>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSimpleSparsityPattern &sparsity);
-
-
-
-template
-void
-DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- const Vector<float> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component);
-template
-void
-DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- const Vector<double> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component);
-
-template
-void
-DoFTools::distribute_cell_to_dof_vector<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &dof_handler,
- const Vector<float> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component);
-template
-void
-DoFTools::distribute_cell_to_dof_vector<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &dof_handler,
- const Vector<double> &cell_data,
- Vector<double> &dof_data,
- const unsigned int component);
-
-
-template void DoFTools::extract_dofs<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&,
- const std::vector<bool>&, std::vector<bool>&, bool);
-
-template void DoFTools::extract_dofs<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension>&,
- const std::vector<bool>&, std::vector<bool>&, bool);
-
-template void DoFTools::extract_level_dofs<deal_II_dimension>
-(const unsigned int level, const MGDoFHandler<deal_II_dimension>&,
- const std::vector<bool>&, std::vector<bool>&, bool);
-
-template
-void
-DoFTools::extract_boundary_dofs<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &,
- std::vector<bool> &,
- const std::set<unsigned char> &);
-template
-void
-DoFTools::extract_boundary_dofs<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &,
- std::vector<bool> &,
- const std::set<unsigned char> &);
-
-template
-void
-DoFTools::extract_dofs_with_support_on_boundary<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &,
- std::vector<bool> &,
- const std::set<unsigned char> &);
-template
-void
-DoFTools::extract_dofs_with_support_on_boundary<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const std::vector<bool> &,
- std::vector<bool> &,
- const std::set<unsigned char> &);
-
-template
-void
-DoFTools::extract_hanging_node_dofs
-(const DoFHandler<deal_II_dimension> &dof_handler,
- std::vector<bool> &selected_dofs);
-
-template
-void
-DoFTools::extract_subdomain_dofs<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- const types::subdomain_id_t subdomain_id,
- std::vector<bool> &selected_dofs);
-template
-void
-DoFTools::extract_subdomain_dofs<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &dof_handler,
- const types::subdomain_id_t subdomain_id,
- std::vector<bool> &selected_dofs);
-
-template
-void
-DoFTools::extract_locally_owned_dofs<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> & dof_handler,
- IndexSet & dof_set);
-
-template
-void
-DoFTools::extract_locally_active_dofs<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> & dof_handler,
- IndexSet & dof_set);
-
-
-template
-void
-DoFTools::extract_locally_relevant_dofs<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> & dof_handler,
- IndexSet & dof_set);
-
-template
-void
-DoFTools::extract_constant_modes<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- const std::vector<bool> &selected_components,
- std::vector<std::vector<bool> > &constant_modes);
-
-template
-void
-DoFTools::get_active_fe_indices<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- std::vector<unsigned int> &active_fe_indices);
-
-template
-void
-DoFTools::get_active_fe_indices<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &dof_handler,
- std::vector<unsigned int> &active_fe_indices);
-
-template
-void
-DoFTools::get_subdomain_association<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &dof_handler,
- std::vector<types::subdomain_id_t> &subdomain_association);
-template
-void
-DoFTools::get_subdomain_association<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &dof_handler,
- std::vector<types::subdomain_id_t> &subdomain_association);
-
-
-template
-unsigned int
-DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-IndexSet
-DoFTools::dof_indices_with_subdomain_association<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-void
-DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t,
- std::vector<unsigned int> &);
-
-template
-unsigned int
-DoFTools::count_dofs_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-IndexSet
-DoFTools::dof_indices_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-void
-DoFTools::count_dofs_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t,
- std::vector<unsigned int> &);
-
-template
-unsigned int
-DoFTools::count_dofs_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
-(const MGDoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-IndexSet
-DoFTools::dof_indices_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
-(const MGDoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t);
-template
-void
-DoFTools::count_dofs_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
-(const MGDoFHandler<deal_II_dimension> &,
- const types::subdomain_id_t,
- std::vector<unsigned int> &);
-
-
-template
-void
-DoFTools::count_dofs_per_component<deal_II_dimension> (
- const DoFHandler<deal_II_dimension>&,
- std::vector<unsigned int>&, bool, std::vector<unsigned int>);
-
-#if deal_II_dimension < 3
-template void DoFTools::extract_level_dofs<deal_II_dimension, deal_II_dimension+1>
-(const unsigned int level, const MGDoFHandler<deal_II_dimension, deal_II_dimension+1>&,
- const std::vector<bool>&, std::vector<bool>&, bool);
-
-template
-void
-DoFTools::count_dofs_per_component<deal_II_dimension, deal_II_dimension+1> (
- const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
- std::vector<unsigned int>&, bool, std::vector<unsigned int>);
-#endif
-
-template
-void
-DoFTools::count_dofs_per_block<deal_II_dimension> (
- const DoFHandler<deal_II_dimension>&,
- std::vector<unsigned int>&, std::vector<unsigned int>);
-
-
-template
-void
-DoFTools::count_dofs_per_component<deal_II_dimension> (
- const DoFHandler<deal_II_dimension>&,
- std::vector<unsigned int>&, std::vector<unsigned int>);
-
-template
-void
-DoFTools::compute_intergrid_constraints<deal_II_dimension> (
- const DoFHandler<deal_II_dimension> &, const unsigned int,
- const DoFHandler<deal_II_dimension> &, const unsigned int,
- const InterGridMap<DoFHandler<deal_II_dimension> > &,
- ConstraintMatrix&);
-
-template
-void
-DoFTools::compute_intergrid_transfer_representation<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &, const unsigned int,
- const DoFHandler<deal_II_dimension> &, const unsigned int,
- const InterGridMap<DoFHandler<deal_II_dimension> > &,
- std::vector<std::map<unsigned int, float> > &);
-
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
- std::vector<unsigned int> &);
-
-#if deal_II_dimension != 1
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
-(const DoFHandler<deal_II_dimension> &,
- std::vector<unsigned int> &);
-
-#endif
-
-
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- const std::set<unsigned char> &,
- std::vector<unsigned int> &);
-
-#if deal_II_dimension != 1
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
-(const hp::DoFHandler<deal_II_dimension> &,
- std::vector<unsigned int> &);
-
-#endif
-
-
-
-
-template
-void
-DoFTools::map_dofs_to_support_points<deal_II_dimension>
-(const Mapping<deal_II_dimension,deal_II_dimension>&,
- const DoFHandler<deal_II_dimension>&,
- std::vector<Point<deal_II_dimension> >&);
-
-#if deal_II_dimension != 3
-
-template
-void
-DoFTools::map_dofs_to_support_points<deal_II_dimension,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1>&,
- const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
- std::vector<Point<deal_II_dimension+1> >&);
-
-template
-void
-DoFTools::count_dofs_per_block<deal_II_dimension,deal_II_dimension+1> (
- const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
- std::vector<unsigned int>&, std::vector<unsigned int>);
-
-#endif
-
-template
-void
-DoFTools::convert_couplings_to_blocks (
- const DoFHandler<deal_II_dimension>&, const Table<2, Coupling>&,
- std::vector<Table<2,Coupling> >&);
-
-template
-void
-DoFTools::convert_couplings_to_blocks (
- const hp::DoFHandler<deal_II_dimension>&, const Table<2, Coupling>&,
- std::vector<Table<2,Coupling> >&);
-
-template
-void
-DoFTools::make_zero_boundary_constraints
-(const DoFHandler<deal_II_dimension> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void
-DoFTools::make_zero_boundary_constraints
-(const hp::DoFHandler<deal_II_dimension> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-
-#if deal_II_dimension < 3
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- SparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- CompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- CompressedSetSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- BlockSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSparsityPattern &);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const std::vector<unsigned int> &,
- BlockCompressedSetSparsityPattern &);
-
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// SparsityPattern &);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// CompressedSparsityPattern &);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSetSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// CompressedSetSparsityPattern &);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// BlockSparsityPattern &);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// BlockCompressedSparsityPattern &);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSetSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const std::vector<unsigned int> &,
-// BlockCompressedSetSparsityPattern &);
-
-
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- SparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- CompressedSetSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSparsityPattern &sparsity);
-template void
-DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSetSparsityPattern>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
- const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
- const std::vector<unsigned int> &dof_to_boundary_mapping,
- BlockCompressedSetSparsityPattern &sparsity);
-
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// SparsityPattern &sparsity);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// CompressedSparsityPattern &sparsity);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,CompressedSetSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// CompressedSetSparsityPattern &sparsity);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// BlockSparsityPattern &sparsity);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// BlockCompressedSparsityPattern &sparsity);
-// template void
-// DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,BlockCompressedSetSparsityPattern>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
-// const std::vector<unsigned int> &dof_to_boundary_mapping,
-// BlockCompressedSetSparsityPattern &sparsity);
-
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const std::set<unsigned char> &,
- std::vector<unsigned int> &);
-
-#if deal_II_dimension != 1
-
-template
-void
-DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- std::vector<unsigned int> &);
-
-#endif
-
-
-template
-void
-DoFTools::extract_hanging_node_dofs
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
- std::vector<bool> &selected_dofs);
-
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// const std::set<unsigned char> &,
-// std::vector<unsigned int> &);
-
-// #if deal_II_dimension != 1
-
-// template
-// void
-// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// std::vector<unsigned int> &);
-
-// #endif
-
-
-
-#endif
-
-
-#if deal_II_dimension < 3
-template
-void
-DoFTools::
-make_hanging_node_constraints (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
- ConstraintMatrix &constraints);
-#endif
-
DEAL_II_NAMESPACE_CLOSE
//---------------------------------------------------------------------------
-for (SP : SPARSITY_PATTERNS)
+for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
{
template void
DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
const hp::DoFHandler<deal_II_dimension,deal_II_dimension> &dof_col,
SP &sparsity);
+ // #if deal_II_dimension > 1
+ template void
+ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
+ (const DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ SP &);
+
+ template void
+ DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
+ (const hp::DoFHandler<deal_II_dimension>& dof,
+ const std::vector<unsigned int> &,
+ SP &);
+
+ template void
+ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
+ (const DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ SP &sparsity);
+
+ template void
+ DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
+ (const hp::DoFHandler<deal_II_dimension>& dof,
+ const FunctionMap<deal_II_dimension>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ SP &sparsity);
+
template void
DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
(const DoFHandler<deal_II_dimension> &dof,
const bool, const unsigned int);
#endif
- }
-for (SP : SPARSITY_PATTERNS)
- {
#if deal_II_dimension < 3
template void
(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_row,
const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_col,
SP &sparsity);
+
+ template void
+ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+ const std::vector<unsigned int> &,
+ SP &);
+
+ //template void
+ //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+ //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+ // const std::vector<unsigned int> &,
+ // SP &);
+
+ template void
+ DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+ const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
+ const std::vector<unsigned int> &dof_to_boundary_mapping,
+ SP &sparsity);
+
+ //template void
+ //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
+ //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
+ // const FunctionMap<deal_II_dimension+1>::type &boundary_indicators,
+ // const std::vector<unsigned int> &dof_to_boundary_mapping,
+ // SP &sparsity);
+
#endif
}
-for (DH : DOFHANDLERS)
+for (DH : DOFHANDLERS; deal_II_dimension : DIMENSIONS)
{
template
void
DoFTools::make_hanging_node_constraints (const DH &dof_handler,
ConstraintMatrix &constraints);
}
+
+
+for (deal_II_dimension : DIMENSIONS)
+{
+
+#if deal_II_dimension < 3
+template
+void
+DoFTools::
+make_hanging_node_constraints (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
+ ConstraintMatrix &constraints);
+#endif
+
+
+// TODO: can cleanup a bit more to fit into the scheme used above
+
+template
+void
+DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<float> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component);
+template
+void
+DoFTools::distribute_cell_to_dof_vector<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<double> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component);
+
+template
+void
+DoFTools::distribute_cell_to_dof_vector<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<float> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component);
+template
+void
+DoFTools::distribute_cell_to_dof_vector<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const Vector<double> &cell_data,
+ Vector<double> &dof_data,
+ const unsigned int component);
+
+
+template void DoFTools::extract_dofs<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&,
+ const std::vector<bool>&, std::vector<bool>&, bool);
+
+template void DoFTools::extract_dofs<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension>&,
+ const std::vector<bool>&, std::vector<bool>&, bool);
+
+template void DoFTools::extract_level_dofs<deal_II_dimension>
+(const unsigned int level, const MGDoFHandler<deal_II_dimension>&,
+ const std::vector<bool>&, std::vector<bool>&, bool);
+
+template
+void
+DoFTools::extract_boundary_dofs<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &,
+ std::vector<bool> &,
+ const std::set<unsigned char> &);
+template
+void
+DoFTools::extract_boundary_dofs<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &,
+ std::vector<bool> &,
+ const std::set<unsigned char> &);
+
+template
+void
+DoFTools::extract_dofs_with_support_on_boundary<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &,
+ std::vector<bool> &,
+ const std::set<unsigned char> &);
+template
+void
+DoFTools::extract_dofs_with_support_on_boundary<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const std::vector<bool> &,
+ std::vector<bool> &,
+ const std::set<unsigned char> &);
+
+template
+void
+DoFTools::extract_hanging_node_dofs
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ std::vector<bool> &selected_dofs);
+
+template
+void
+DoFTools::extract_subdomain_dofs<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ const types::subdomain_id_t subdomain_id,
+ std::vector<bool> &selected_dofs);
+template
+void
+DoFTools::extract_subdomain_dofs<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &dof_handler,
+ const types::subdomain_id_t subdomain_id,
+ std::vector<bool> &selected_dofs);
+
+template
+void
+DoFTools::extract_locally_owned_dofs<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> & dof_handler,
+ IndexSet & dof_set);
+
+template
+void
+DoFTools::extract_locally_active_dofs<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> & dof_handler,
+ IndexSet & dof_set);
+
+
+template
+void
+DoFTools::extract_locally_relevant_dofs<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> & dof_handler,
+ IndexSet & dof_set);
+
+template
+void
+DoFTools::extract_constant_modes<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ const std::vector<bool> &selected_components,
+ std::vector<std::vector<bool> > &constant_modes);
+
+template
+void
+DoFTools::get_active_fe_indices<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ std::vector<unsigned int> &active_fe_indices);
+
+template
+void
+DoFTools::get_active_fe_indices<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &dof_handler,
+ std::vector<unsigned int> &active_fe_indices);
+
+template
+void
+DoFTools::get_subdomain_association<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &dof_handler,
+ std::vector<types::subdomain_id_t> &subdomain_association);
+template
+void
+DoFTools::get_subdomain_association<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &dof_handler,
+ std::vector<types::subdomain_id_t> &subdomain_association);
+
+
+template
+unsigned int
+DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+IndexSet
+DoFTools::dof_indices_with_subdomain_association<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+void
+DoFTools::count_dofs_with_subdomain_association<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t,
+ std::vector<unsigned int> &);
+
+template
+unsigned int
+DoFTools::count_dofs_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+IndexSet
+DoFTools::dof_indices_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+void
+DoFTools::count_dofs_with_subdomain_association<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t,
+ std::vector<unsigned int> &);
+
+template
+unsigned int
+DoFTools::count_dofs_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
+(const MGDoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+IndexSet
+DoFTools::dof_indices_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
+(const MGDoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t);
+template
+void
+DoFTools::count_dofs_with_subdomain_association<MGDoFHandler<deal_II_dimension> >
+(const MGDoFHandler<deal_II_dimension> &,
+ const types::subdomain_id_t,
+ std::vector<unsigned int> &);
+
+
+template
+void
+DoFTools::count_dofs_per_component<deal_II_dimension> (
+ const DoFHandler<deal_II_dimension>&,
+ std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+
+#if deal_II_dimension < 3
+template void DoFTools::extract_level_dofs<deal_II_dimension, deal_II_dimension+1>
+(const unsigned int level, const MGDoFHandler<deal_II_dimension, deal_II_dimension+1>&,
+ const std::vector<bool>&, std::vector<bool>&, bool);
+
+template
+void
+DoFTools::count_dofs_per_component<deal_II_dimension, deal_II_dimension+1> (
+ const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
+ std::vector<unsigned int>&, bool, std::vector<unsigned int>);
+#endif
+
+template
+void
+DoFTools::count_dofs_per_block<deal_II_dimension> (
+ const DoFHandler<deal_II_dimension>&,
+ std::vector<unsigned int>&, std::vector<unsigned int>);
+
+
+template
+void
+DoFTools::count_dofs_per_component<deal_II_dimension> (
+ const DoFHandler<deal_II_dimension>&,
+ std::vector<unsigned int>&, std::vector<unsigned int>);
+
+template
+void
+DoFTools::compute_intergrid_constraints<deal_II_dimension> (
+ const DoFHandler<deal_II_dimension> &, const unsigned int,
+ const DoFHandler<deal_II_dimension> &, const unsigned int,
+ const InterGridMap<DoFHandler<deal_II_dimension> > &,
+ ConstraintMatrix&);
+
+template
+void
+DoFTools::compute_intergrid_transfer_representation<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &, const unsigned int,
+ const DoFHandler<deal_II_dimension> &, const unsigned int,
+ const InterGridMap<DoFHandler<deal_II_dimension> > &,
+ std::vector<std::map<unsigned int, float> > &);
+
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ const std::set<unsigned char> &,
+ std::vector<unsigned int> &);
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension> >
+(const DoFHandler<deal_II_dimension> &,
+ std::vector<unsigned int> &);
+
+
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ const std::set<unsigned char> &,
+ std::vector<unsigned int> &);
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension> >
+(const hp::DoFHandler<deal_II_dimension> &,
+ std::vector<unsigned int> &);
+
+
+
+template
+void
+DoFTools::map_dofs_to_support_points<deal_II_dimension>
+(const Mapping<deal_II_dimension,deal_II_dimension>&,
+ const DoFHandler<deal_II_dimension>&,
+ std::vector<Point<deal_II_dimension> >&);
+
+#if deal_II_dimension < 3
+
+template
+void
+DoFTools::map_dofs_to_support_points<deal_II_dimension,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1>&,
+ const DoFHandler<deal_II_dimension, deal_II_dimension+1>&,
+ std::vector<Point<deal_II_dimension+1> >&);
+
+template
+void
+DoFTools::count_dofs_per_block<deal_II_dimension,deal_II_dimension+1> (
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
+ std::vector<unsigned int>&, std::vector<unsigned int>);
+
+#endif
+
+template
+void
+DoFTools::convert_couplings_to_blocks (
+ const DoFHandler<deal_II_dimension>&, const Table<2, Coupling>&,
+ std::vector<Table<2,Coupling> >&);
+
+template
+void
+DoFTools::convert_couplings_to_blocks (
+ const hp::DoFHandler<deal_II_dimension>&, const Table<2, Coupling>&,
+ std::vector<Table<2,Coupling> >&);
+
+template
+void
+DoFTools::make_zero_boundary_constraints
+(const DoFHandler<deal_II_dimension> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void
+DoFTools::make_zero_boundary_constraints
+(const hp::DoFHandler<deal_II_dimension> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+#if deal_II_dimension < 3
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const std::set<unsigned char> &,
+ std::vector<unsigned int> &);
+
+template
+void
+DoFTools::map_dof_to_boundary_indices<DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ std::vector<unsigned int> &);
+
+
+template
+void
+DoFTools::extract_hanging_node_dofs
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_handler,
+ std::vector<bool> &selected_dofs);
+
+// template
+// void
+// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+// const std::set<unsigned char> &,
+// std::vector<unsigned int> &);
+
+// template
+// void
+// DoFTools::map_dof_to_boundary_indices<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> >
+// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+// std::vector<unsigned int> &);
+
+#endif
+
+}
\ No newline at end of file
namespace hp
{
-#if deal_II_dimension == 1
-
unsigned int
DoFFaces<1>::memory_consumption () const
{
return 0;
}
-#endif
-#if deal_II_dimension == 2
-
+
unsigned int
DoFFaces<2>::memory_consumption () const
{
return MemoryConsumption::memory_consumption (lines);
}
-#endif
-#if deal_II_dimension == 3
-
+
unsigned int
DoFFaces<3>::memory_consumption () const
{
MemoryConsumption::memory_consumption (quads) );
}
-#endif
-
}
}
== 0),
ExcMessage ("The given triangulation is parallel distributed but "
"this class does not currently support this."));
-
+
create_active_fe_table ();
tria.add_refinement_listener (*this);
}
//------------------------------------------------------------------
-#if deal_II_dimension == 1
-
template <>
unsigned int DoFHandler<1>::n_boundary_dofs () const
{
-#endif
-
-
template<int dim, int spacedim>
unsigned int DoFHandler<dim,spacedim>::n_boundary_dofs () const
{
}
-#if deal_II_dimension == 2
template <>
unsigned int DoFHandler<2,3>::n_boundary_dofs () const
return 0;
}
+
+
template <>
unsigned int DoFHandler<2,3>::n_boundary_dofs (const FunctionMap &) const
{
return 0;
}
+
+
template <>
unsigned int DoFHandler<2,3>::n_boundary_dofs (const std::set<unsigned char> &) const
{
return 0;
}
-#endif
-
template<int dim, int spacedim>
}
-#if deal_II_dimension == 1
template <>
void
compute_line_dof_identities (std::vector<unsigned int> &) const
{}
+
+
template <>
void
DoFHandler<1,2>::
compute_line_dof_identities (std::vector<unsigned int> &) const
{}
-#endif
+
template<int dim, int spacedim>
void
}
}
-#if deal_II_dimension == 1
+
template <>
void
compute_quad_dof_identities (std::vector<unsigned int> &) const
{}
-#endif
-
-#if deal_II_dimension == 2
template <>
void
{}
+
template <>
void
DoFHandler<2,3>::
{}
-#endif
-
template<int dim, int spacedim>
void
}
-#if deal_II_dimension >= 2
- template<int dim, int spacedim>
+ // TODO: should be simplified a bit
+ template<>
void
- DoFHandler<dim,spacedim>::
+ DoFHandler<2,2>::
renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
internal::int2type<2>)
{
}
}
-#endif
-#if deal_II_dimension >= 3
- template<int dim, int spacedim>
+ template<>
void
- DoFHandler<dim,spacedim>::
+ DoFHandler<2,3>::
+ renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+ internal::int2type<2>)
+ {
+ Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
+
+ renumber_dofs_internal (new_numbers, internal::int2type<1>());
+
+ for (quad_iterator quad=begin_quad(); quad!=end_quad(); ++quad)
+ {
+ const unsigned int n_active_fe_indices
+ = quad->n_active_fe_indices ();
+
+ for (unsigned int f=0; f<n_active_fe_indices; ++f)
+ {
+ const unsigned int fe_index
+ = quad->nth_active_fe_index (f);
+
+ for (unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_quad; ++d)
+ quad->set_dof_index (d,
+ new_numbers[quad->dof_index(d,fe_index)],
+ fe_index);
+ }
+ }
+ }
+
+
+ template<>
+ void
+ DoFHandler<3,3>::
+ renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
+ internal::int2type<2>)
+ {
+ Assert (new_numbers.size() == n_dofs(), ExcRenumberingIncomplete());
+
+ renumber_dofs_internal (new_numbers, internal::int2type<1>());
+
+ for (quad_iterator quad=begin_quad(); quad!=end_quad(); ++quad)
+ {
+ const unsigned int n_active_fe_indices
+ = quad->n_active_fe_indices ();
+
+ for (unsigned int f=0; f<n_active_fe_indices; ++f)
+ {
+ const unsigned int fe_index
+ = quad->nth_active_fe_index (f);
+
+ for (unsigned int d=0; d<(*finite_elements)[fe_index].dofs_per_quad; ++d)
+ quad->set_dof_index (d,
+ new_numbers[quad->dof_index(d,fe_index)],
+ fe_index);
+ }
+ }
+ }
+
+
+ template<>
+ void
+ DoFHandler<3,3>::
renumber_dofs_internal (const std::vector<unsigned int> &new_numbers,
internal::int2type<3>)
{
}
}
-#endif
template <int dim, int spacedim>
-#if deal_II_dimension == 1
template <>
void DoFHandler<1>::pre_refinement_notification (const Triangulation<1> &tria)
{
has_children.push_back (has_children_level);
}
}
-#endif
+
template<int dim, int spacedim>
std::swap (vertex_dofs_offsets, tmp);
}
}
+}
-/*-------------- Explicit Instantiations -------------------------------*/
- template class DoFHandler<deal_II_dimension>;
-
-#if deal_II_dimension != 3
- template class DoFHandler<deal_II_dimension, deal_II_dimension+1>;
-#endif
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "dof_handler.inst"
-}
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ namespace hp
+ \{
+ template class DoFHandler<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class DoFHandler<deal_II_dimension, deal_II_dimension+1>;
+#endif
+ \}
+}
+++ /dev/null
-//---------------------------- hp_dof_levels.cc ---------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2003, 2006 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------- hp_dof_levels.cc ------------------------
-
-
-#include <base/memory_consumption.h>
-#include <hp/dof_levels.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-namespace internal
-{
- namespace hp
- {
-
- unsigned int
- DoFLevel<0>::memory_consumption () const
- {
- return MemoryConsumption::memory_consumption (active_fe_indices);
- }
-
- }
-}
-
-DEAL_II_NAMESPACE_CLOSE
namespace hp
{
-#if deal_II_dimension == 1
-
unsigned int
DoFLevel<1>::memory_consumption () const
{
MemoryConsumption::memory_consumption (lines));
}
-#endif
-
-#if deal_II_dimension == 2
unsigned int
DoFLevel<2>::memory_consumption () const
MemoryConsumption::memory_consumption (quads));
}
-#endif
-#if deal_II_dimension == 3
-
unsigned int
DoFLevel<3>::memory_consumption () const
{
MemoryConsumption::memory_consumption (hexes));
}
-#endif
+
+ unsigned int
+ DoFLevel<0>::memory_consumption () const
+ {
+ return MemoryConsumption::memory_consumption (active_fe_indices);
+ }
+
}
}
template <int dim, int spacedim>
FECollection<dim,spacedim>::FECollection ()
{}
-
-
+
+
template <int dim, int spacedim>
FECollection<dim,spacedim>::FECollection (const FiniteElement<dim,spacedim> &fe)
{
push_back (fe);
}
-
-
+
+
template <int dim, int spacedim>
FECollection<dim,spacedim>::
FECollection (const FECollection<dim,spacedim> &fe_collection)
Assert (new_fe.n_components() == finite_elements[0]->n_components(),
ExcMessage ("All elements inside a collection need to have the "
"same number of vector components!"));
-
+
finite_elements
.push_back (std_cxx1x::shared_ptr<const FiniteElement<dim,spacedim> >(new_fe.clone()));
}
- template <int dim, int spacedim>
+ template <int dim, int spacedim>
unsigned int
FECollection<dim,spacedim>::memory_consumption () const
{
return mem;
}
+}
+
// explicit instantiations
- template class FECollection<deal_II_dimension>;
+#include "fe_collection.inst"
-#if deal_II_dimension != 3
- template class FECollection<deal_II_dimension, deal_II_dimension+1>;
-#endif
-
-}
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ namespace hp
+ \{
+ template class FECollection<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class FECollection<deal_II_dimension, deal_II_dimension+1>;
+#endif
+ \}
+}
template <int dim, int spacedim>
void
FEValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FEValues<dim,spacedim>::reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FEFaceValues<dim,spacedim>::reinit (const typename hp::DoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FEFaceValues<dim,spacedim>::reinit (const typename dealii::DoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FEFaceValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FEFaceValues<dim,spacedim>::reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FESubfaceValues<dim,spacedim>::reinit (const typename hp::DoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FESubfaceValues<dim,spacedim>::reinit (const typename dealii::DoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FESubfaceValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
template <int dim, int spacedim>
void
FESubfaceValues<dim,spacedim>::reinit (const typename Triangulation<dim,spacedim>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int subface_no,
- const unsigned int q_index,
- const unsigned int mapping_index,
- const unsigned int fe_index)
+ const unsigned int face_no,
+ const unsigned int subface_no,
+ const unsigned int q_index,
+ const unsigned int mapping_index,
+ const unsigned int fe_index)
{
// determine which indices we
// should actually use
// explicit instantiations
-namespace internal
-{
- namespace hp
- {
- template class FEValuesBase<deal_II_dimension,deal_II_dimension,
- dealii::FEValues<deal_II_dimension> >;
-#if deal_II_dimension >= 2
- template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
- dealii::FEFaceValues<deal_II_dimension> >;
- template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
- dealii::FESubfaceValues<deal_II_dimension> >;
-#endif
- }
-}
-
-namespace hp
-{
- template class FEValues<deal_II_dimension>;
-#if deal_II_dimension >= 2
- template class FEFaceValues<deal_II_dimension>;
- template class FESubfaceValues<deal_II_dimension>;
-#endif
-}
-
-
-
-#if deal_II_dimension != 3
-
-namespace internal
-{
- namespace hp
- {
- template class FEValuesBase<deal_II_dimension,deal_II_dimension,
- dealii::FEValues<deal_II_dimension,deal_II_dimension+1> >;
-#if deal_II_dimension == 2
- template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
- dealii::FEFaceValues<deal_II_dimension,deal_II_dimension+1> >;
- template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
- dealii::FESubfaceValues<deal_II_dimension,deal_II_dimension+1> >;
-#endif
- }
-}
-
-namespace hp
-{
- template class FEValues<deal_II_dimension, deal_II_dimension+1>;
-
-#if deal_II_dimension == 2
- template class FEFaceValues<deal_II_dimension, deal_II_dimension+1>;
- template class FESubfaceValues<deal_II_dimension, deal_II_dimension+1>;
-#endif
-}
-#endif
-
+#include "fe_values.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+namespace internal
+\{
+ namespace hp
+ \{
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension,
+ dealii::FEValues<deal_II_dimension> >;
+#if deal_II_dimension >= 2
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
+ dealii::FEFaceValues<deal_II_dimension> >;
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
+ dealii::FESubfaceValues<deal_II_dimension> >;
+#endif
+ \}
+\}
+
+namespace hp
+\{
+ template class FEValues<deal_II_dimension>;
+#if deal_II_dimension >= 2
+ template class FEFaceValues<deal_II_dimension, deal_II_dimension>;
+ template class FESubfaceValues<deal_II_dimension, deal_II_dimension>;
+#endif
+\}
+
+
+
+#if deal_II_dimension != 3
+
+namespace internal
+\{
+ namespace hp
+ \{
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension,
+ dealii::FEValues<deal_II_dimension,deal_II_dimension+1> >;
+#if deal_II_dimension >= 2
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
+ dealii::FEFaceValues<deal_II_dimension,deal_II_dimension+1> >;
+ template class FEValuesBase<deal_II_dimension,deal_II_dimension-1,
+ dealii::FESubfaceValues<deal_II_dimension,deal_II_dimension+1> >;
+#endif
+ \}
+\}
+
+namespace hp
+\{
+ template class FEValues<deal_II_dimension, deal_II_dimension+1>;
+#if deal_II_dimension >= 2
+ template class FEFaceValues<deal_II_dimension, deal_II_dimension+1>;
+ template class FESubfaceValues<deal_II_dimension, deal_II_dimension+1>;
+#endif
+\}
+#endif
+}
{}
-
+
template<int dim, int spacedim>
MappingCollection<dim,spacedim>::
MappingCollection (const Mapping<dim,spacedim> &mapping)
// mappings
mappings (mapping_collection.mappings)
{}
-
-
+
+
template<int dim, int spacedim>
unsigned int
MemoryConsumption::memory_consumption (mappings));
}
-
+
template<int dim, int spacedim>
void
template<int dim, int spacedim>
MappingQ1<dim,spacedim>
StaticMappingQ1<dim,spacedim>::mapping_q1;
-
+
template<int dim, int spacedim>
MappingCollection<dim,spacedim>
StaticMappingQ1<dim,spacedim>::mapping_collection
= MappingCollection<dim,spacedim>(mapping_q1);
-// explicit instantiations
- template class MappingCollection<deal_II_dimension>;
- template struct StaticMappingQ1<deal_II_dimension>;
+}
-#if deal_II_dimension != 3
- template class MappingCollection<deal_II_dimension,deal_II_dimension+1>;
- template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
-#endif
-
-}
+
+// explicit instantiations
+#include "mapping_collection.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ namespace hp
+ \{
+ template class MappingCollection<deal_II_dimension>;
+ template struct StaticMappingQ1<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class MappingCollection<deal_II_dimension,deal_II_dimension+1>;
+ template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ \}
+}
-
// explicit instantiations
+#include "mg_dof_accessor.inst"
-template
-void
-MGDoFAccessor<1,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-template
-void
-MGDoFAccessor<1,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<float> &values,
- Vector<float> &dof_values) const;
-
-
-#if deal_II_dimension >= 2
-
-template
-void
-MGDoFAccessor<2,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-template
-void
-MGDoFAccessor<2,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<float> &values,
- Vector<float> &dof_values) const;
-
-#endif
-
-
-#if deal_II_dimension >= 3
-
-template
-void
-MGDoFAccessor<3,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-template
-void
-MGDoFAccessor<3,deal_II_dimension>::
-get_mg_dof_values (const int level,
- const Vector<float> &values,
- Vector<float> &dof_values) const;
-
-#endif
-template
-void
-MGDoFCellAccessor<deal_II_dimension>::
-get_mg_dof_values (const Vector<double> &values,
- Vector<double> &dof_values) const;
-
-template
-void
-MGDoFCellAccessor<deal_II_dimension>::
-get_mg_dof_values (const Vector<float> &values,
- Vector<float> &dof_values) const;
-
-
-
-
-#if deal_II_dimension == 1
-template class MGDoFAccessor<1, 1, 1>;
-template class MGDoFAccessor<1, 1, 2>;
-
-template class MGDoFCellAccessor<1>;
-template class MGDoFCellAccessor<1,2>;
-
-template class TriaRawIterator<MGDoFCellAccessor<1> >;
-template class TriaIterator<MGDoFCellAccessor<1> >;
-template class TriaActiveIterator<MGDoFCellAccessor<1> >;
-#endif
-
-#if deal_II_dimension == 2
-template class MGDoFAccessor<1, 2, 2>;
-template class MGDoFAccessor<2, 2, 2>;
-
-template class MGDoFAccessor<1, 2, 3>;
-template class MGDoFAccessor<2, 2, 3>;
-
-template class MGDoFCellAccessor<2>;
-template class MGDoFCellAccessor<2,3>;
-
-template class TriaRawIterator <MGDoFAccessor<1, 2, 2> >;
-template class TriaIterator <MGDoFAccessor<1, 2, 2> >;
-template class TriaActiveIterator<MGDoFAccessor<1, 2, 2> >;
-
-template class TriaRawIterator <MGDoFAccessor<1, 2, 3> >;
-template class TriaIterator <MGDoFAccessor<1, 2, 3> >;
-template class TriaActiveIterator<MGDoFAccessor<1, 2, 3> >;
-
-template class TriaRawIterator <MGDoFCellAccessor<2> >;
-template class TriaIterator <MGDoFCellAccessor<2> >;
-template class TriaActiveIterator<MGDoFCellAccessor<2> >;
-#endif
-
-
-#if deal_II_dimension == 3
-template class MGDoFAccessor<1, 3, 3>;
-template class MGDoFAccessor<2, 3, 3>;
-template class MGDoFAccessor<3, 3, 3>;
-
-template class MGDoFCellAccessor<3>;
-
-template class TriaRawIterator <MGDoFAccessor<1, 3, 3> >;
-template class TriaIterator <MGDoFAccessor<1, 3, 3> >;
-template class TriaActiveIterator<MGDoFAccessor<1, 3, 3> >;
-
-template class TriaRawIterator <MGDoFAccessor<2, 3, 3> >;
-template class TriaIterator <MGDoFAccessor<2, 3, 3> >;
-template class TriaActiveIterator<MGDoFAccessor<2, 3, 3> >;
-
-template class TriaRawIterator <MGDoFCellAccessor<3> >;
-template class TriaIterator <MGDoFCellAccessor<3> >;
-template class TriaActiveIterator<MGDoFCellAccessor<3> >;
-#endif
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+ template
+ void
+ MGDoFAccessor<1,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+ template
+ void
+ MGDoFAccessor<1,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+
+#if deal_II_dimension >= 2
+
+ template
+ void
+ MGDoFAccessor<2,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+ template
+ void
+ MGDoFAccessor<2,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+#endif
+
+
+#if deal_II_dimension >= 3
+
+ template
+ void
+ MGDoFAccessor<3,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+ template
+ void
+ MGDoFAccessor<3,deal_II_dimension>::
+ get_mg_dof_values (const int level,
+ const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+#endif
+
+ template
+ void
+ MGDoFCellAccessor<deal_II_dimension>::
+ get_mg_dof_values (const Vector<double> &values,
+ Vector<double> &dof_values) const;
+
+ template
+ void
+ MGDoFCellAccessor<deal_II_dimension>::
+ get_mg_dof_values (const Vector<float> &values,
+ Vector<float> &dof_values) const;
+
+
+
+
+#if deal_II_dimension == 1
+ template class MGDoFAccessor<1, 1, 1>;
+ template class MGDoFAccessor<1, 1, 2>;
+
+ template class MGDoFCellAccessor<1>;
+ template class MGDoFCellAccessor<1,2>;
+
+ template class TriaRawIterator<MGDoFCellAccessor<1> >;
+ template class TriaIterator<MGDoFCellAccessor<1> >;
+ template class TriaActiveIterator<MGDoFCellAccessor<1> >;
+#endif
+
+#if deal_II_dimension == 2
+ template class MGDoFAccessor<1, 2, 2>;
+ template class MGDoFAccessor<2, 2, 2>;
+
+ template class MGDoFAccessor<1, 2, 3>;
+ template class MGDoFAccessor<2, 2, 3>;
+
+ template class MGDoFCellAccessor<2>;
+ template class MGDoFCellAccessor<2,3>;
+
+ template class TriaRawIterator <MGDoFAccessor<1, 2, 2> >;
+ template class TriaIterator <MGDoFAccessor<1, 2, 2> >;
+ template class TriaActiveIterator<MGDoFAccessor<1, 2, 2> >;
+
+ template class TriaRawIterator <MGDoFAccessor<1, 2, 3> >;
+ template class TriaIterator <MGDoFAccessor<1, 2, 3> >;
+ template class TriaActiveIterator<MGDoFAccessor<1, 2, 3> >;
+
+ template class TriaRawIterator <MGDoFCellAccessor<2> >;
+ template class TriaIterator <MGDoFCellAccessor<2> >;
+ template class TriaActiveIterator<MGDoFCellAccessor<2> >;
+#endif
+
+
+#if deal_II_dimension == 3
+ template class MGDoFAccessor<1, 3, 3>;
+ template class MGDoFAccessor<2, 3, 3>;
+ template class MGDoFAccessor<3, 3, 3>;
+
+ template class MGDoFCellAccessor<3>;
+
+ template class TriaRawIterator <MGDoFAccessor<1, 3, 3> >;
+ template class TriaIterator <MGDoFAccessor<1, 3, 3> >;
+ template class TriaActiveIterator<MGDoFAccessor<1, 3, 3> >;
+
+ template class TriaRawIterator <MGDoFAccessor<2, 3, 3> >;
+ template class TriaIterator <MGDoFAccessor<2, 3, 3> >;
+ template class TriaActiveIterator<MGDoFAccessor<2, 3, 3> >;
+
+ template class TriaRawIterator <MGDoFCellAccessor<3> >;
+ template class TriaIterator <MGDoFCellAccessor<3> >;
+ template class TriaActiveIterator<MGDoFCellAccessor<3> >;
+#endif
+ }
+
-#if deal_II_dimension == 1
-
template <>
void MGDoFHandler<1>::renumber_dofs (const unsigned int level,
const std::vector<unsigned int> &new_numbers) {
}
}
-#endif
-
-
-#if deal_II_dimension == 2
template <>
void MGDoFHandler<2>::renumber_dofs (const unsigned int level,
}
}
-#endif
-
-
-#if deal_II_dimension == 3
template <>
void MGDoFHandler<3>::renumber_dofs (const unsigned int level,
}
}
-#endif
-
template <int dim, int spacedim>
// explicit instantiations
-template class MGDoFHandler<deal_II_dimension>;
-
-#if deal_II_dimension==1 || deal_II_dimension==2
-template class MGDoFHandler<deal_II_dimension,deal_II_dimension+1>;
-#endif
+#include "mg_dof_handler.inst"
-template
-unsigned int
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-get_dof_index<1> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index) const;
-
-#if deal_II_dimension < 3
-template
-unsigned int
-MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
-get_dof_index<1> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index) const;
-#endif
-
-#if deal_II_dimension >= 2
-template
-unsigned int
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-get_dof_index<2> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index) const;
-
-#if deal_II_dimension < 3
-template
-unsigned int
-MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
-get_dof_index<2> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index) const;
-#endif
-
-#if deal_II_dimension >= 3
-template
-unsigned int
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-get_dof_index<3> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index) const;
-#endif
-#endif
-
-template
-void
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-set_dof_index<1> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index) const;
-
-#if deal_II_dimension < 3
-template
-void
-MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
-set_dof_index<1> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index) const;
-#endif
-
-#if deal_II_dimension >= 2
-template
-void
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-set_dof_index<2> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index) const;
-
-#if deal_II_dimension < 3
-template
-void
-MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
-set_dof_index<2> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index) const;
-#endif
-
-#if deal_II_dimension >= 3
-template
-void
-MGDoFHandler<deal_II_dimension,deal_II_dimension>::
-set_dof_index<3> (const unsigned int obj_level,
- const unsigned int obj_index,
- const unsigned int fe_index,
- const unsigned int local_index,
- const unsigned int global_index) const;
-#endif
-#endif
-
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+template class MGDoFHandler<deal_II_dimension>;
+
+#if deal_II_dimension==1 || deal_II_dimension==2
+template class MGDoFHandler<deal_II_dimension,deal_II_dimension+1>;
+#endif
+
+
+template
+unsigned int
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+get_dof_index<1> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
+#if deal_II_dimension < 3
+template
+unsigned int
+MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
+get_dof_index<1> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+#endif
+
+#if deal_II_dimension >= 2
+template
+unsigned int
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+get_dof_index<2> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+
+#if deal_II_dimension < 3
+template
+unsigned int
+MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
+get_dof_index<2> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+#endif
+
+#if deal_II_dimension >= 3
+template
+unsigned int
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+get_dof_index<3> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index) const;
+#endif
+#endif
+
+template
+void
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+set_dof_index<1> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index) const;
+
+#if deal_II_dimension < 3
+template
+void
+MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
+set_dof_index<1> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index) const;
+#endif
+
+#if deal_II_dimension >= 2
+template
+void
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+set_dof_index<2> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index) const;
+
+#if deal_II_dimension < 3
+template
+void
+MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::
+set_dof_index<2> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index) const;
+#endif
+
+#if deal_II_dimension >= 3
+template
+void
+MGDoFHandler<deal_II_dimension,deal_II_dimension>::
+set_dof_index<3> (const unsigned int obj_level,
+ const unsigned int obj_index,
+ const unsigned int fe_index,
+ const unsigned int local_index,
+ const unsigned int global_index) const;
+#endif
+#endif
+ }
+
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2010 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <base/logstream.h>
-#include <lac/sparse_matrix.h>
-#include <lac/block_sparse_matrix.h>
-#include <lac/block_vector.h>
-#include <multigrid/mg_tools.h>
-#include <multigrid/mg_base.h>
-#include <base/mg_level_object.h>
-
-#include <vector>
-#include <algorithm>
-#include <numeric>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-template <typename number>
-void
-MGTools::apply_boundary_values (
- const std::set<unsigned int> &boundary_dofs,
- SparseMatrix<number>& matrix,
- const bool preserve_symmetry,
- const bool ignore_zeros)
-{
- // if no boundary values are to be applied
- // simply return
- if (boundary_dofs.size() == 0)
- return;
-
-
- const unsigned int n_dofs = matrix.m();
-
- // if a diagonal entry is zero
- // later, then we use another
- // number instead. take it to be
- // the first nonzero diagonal
- // element of the matrix, or 1 if
- // there is no such thing
- number first_nonzero_diagonal_entry = 1;
- for (unsigned int i=0; i<n_dofs; ++i)
- if (matrix.diag_element(i) != 0)
- {
- first_nonzero_diagonal_entry = matrix.diag_element(i);
- break;
- }
-
-
- std::set<unsigned int>::const_iterator dof = boundary_dofs.begin(),
- endd = boundary_dofs.end();
- const SparsityPattern &sparsity = matrix.get_sparsity_pattern();
- const std::size_t *sparsity_rowstart = sparsity.get_rowstart_indices();
- const unsigned int *sparsity_colnums = sparsity.get_column_numbers();
- for (; dof != endd; ++dof)
- {
- Assert (*dof < n_dofs, ExcInternalError());
-
- const unsigned int dof_number = *dof;
- // for each boundary dof:
-
- // set entries of this line
- // to zero except for the diagonal
- // entry. Note that the diagonal
- // entry is always the first one
- // for square matrices, i.e.
- // we shall not set
- // matrix.global_entry(
- // sparsity_rowstart[dof.first])
- const unsigned int last = sparsity_rowstart[dof_number+1];
- for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
- matrix.global_entry(j) = 0.;
-
-
- // set right hand side to
- // wanted value: if main diagonal
- // entry nonzero, don't touch it
- // and scale rhs accordingly. If
- // zero, take the first main
- // diagonal entry we can find, or
- // one if no nonzero main diagonal
- // element exists. Normally, however,
- // the main diagonal entry should
- // not be zero.
- //
- // store the new rhs entry to make
- // the gauss step more efficient
- if(!ignore_zeros)
- matrix.set (dof_number, dof_number,
- first_nonzero_diagonal_entry);
- // if the user wants to have
- // the symmetry of the matrix
- // preserved, and if the
- // sparsity pattern is
- // symmetric, then do a Gauss
- // elimination step with the
- // present row
- if (preserve_symmetry)
- {
- // we have to loop over all
- // rows of the matrix which
- // have a nonzero entry in
- // the column which we work
- // in presently. if the
- // sparsity pattern is
- // symmetric, then we can
- // get the positions of
- // these rows cheaply by
- // looking at the nonzero
- // column numbers of the
- // present row. we need not
- // look at the first entry,
- // since that is the
- // diagonal element and
- // thus the present row
- for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
- {
- const unsigned int row = sparsity_colnums[j];
-
- // find the position of
- // element
- // (row,dof_number)
- const unsigned int *
- p = std::lower_bound(&sparsity_colnums[sparsity_rowstart[row]+1],
- &sparsity_colnums[sparsity_rowstart[row+1]],
- dof_number);
-
- // check whether this line has
- // an entry in the regarding column
- // (check for ==dof_number and
- // != next_row, since if
- // row==dof_number-1, *p is a
- // past-the-end pointer but points
- // to dof_number anyway...)
- //
- // there should be such an entry!
- Assert ((*p == dof_number) &&
- (p != &sparsity_colnums[sparsity_rowstart[row+1]]),
- ExcInternalError());
-
- const unsigned int global_entry
- = (p - &sparsity_colnums[sparsity_rowstart[0]]);
-
- // correct right hand side
- // set matrix entry to zero
- matrix.global_entry(global_entry) = 0.;
- }
- }
- }
-}
-
-
-
-template <typename number>
-void
-MGTools::apply_boundary_values (
- const std::set<unsigned int>& boundary_dofs,
- BlockSparseMatrix<number>& matrix,
- const bool preserve_symmetry)
-{
- const unsigned int blocks = matrix.n_block_rows();
-
- Assert (matrix.n_block_rows() == matrix.n_block_cols(),
- ExcNotQuadratic());
- Assert (matrix.get_sparsity_pattern().get_row_indices() ==
- matrix.get_sparsity_pattern().get_column_indices(),
- ExcNotQuadratic());
-
- for (unsigned int i=0; i<blocks; ++i)
- Assert (matrix.block(i,i).get_sparsity_pattern().optimize_diagonal(),
- SparsityPattern::ExcDiagonalNotOptimized());
-
-
- // if no boundary values are to be applied
- // simply return
- if (boundary_dofs.size() == 0)
- return;
-
-
- const unsigned int n_dofs = matrix.m();
-
- // if a diagonal entry is zero
- // later, then we use another
- // number instead. take it to be
- // the first nonzero diagonal
- // element of the matrix, or 1 if
- // there is no such thing
- number first_nonzero_diagonal_entry = 0;
- for (unsigned int diag_block=0; diag_block<blocks; ++diag_block)
- {
- for (unsigned int i=0; i<matrix.block(diag_block,diag_block).n(); ++i)
- if (matrix.block(diag_block,diag_block).diag_element(i) != 0)
- {
- first_nonzero_diagonal_entry
- = matrix.block(diag_block,diag_block).diag_element(i);
- break;
- }
- // check whether we have found
- // something in the present
- // block
- if (first_nonzero_diagonal_entry != 0)
- break;
- }
- // nothing found on all diagonal
- // blocks? if so, use 1.0 instead
- if (first_nonzero_diagonal_entry == 0)
- first_nonzero_diagonal_entry = 1;
-
-
- std::set<unsigned int>::const_iterator dof = boundary_dofs.begin(),
- endd = boundary_dofs.end();
- const BlockSparsityPattern &
- sparsity_pattern = matrix.get_sparsity_pattern();
-
- // pointer to the mapping between
- // global and block indices. since
- // the row and column mappings are
- // equal, store a pointer on only
- // one of them
- const BlockIndices &
- index_mapping = sparsity_pattern.get_column_indices();
-
- // now loop over all boundary dofs
- for (; dof != endd; ++dof)
- {
- Assert (*dof < n_dofs, ExcInternalError());
-
- // get global index and index
- // in the block in which this
- // dof is located
- const unsigned int dof_number = *dof;
- const std::pair<unsigned int,unsigned int>
- block_index = index_mapping.global_to_local (dof_number);
-
- // for each boundary dof:
-
- // set entries of this line
- // to zero except for the diagonal
- // entry. Note that the diagonal
- // entry is always the first one
- // for square matrices, i.e.
- // we shall not set
- // matrix.global_entry(
- // sparsity_rowstart[dof.first])
- // of the diagonal block
- for (unsigned int block_col=0; block_col<blocks; ++block_col)
- {
- const SparsityPattern &
- local_sparsity = sparsity_pattern.block(block_index.first,
- block_col);
-
- // find first and last
- // entry in the present row
- // of the present
- // block. exclude the main
- // diagonal element, which
- // is the diagonal element
- // of a diagonal block,
- // which must be a square
- // matrix so the diagonal
- // element is the first of
- // this row.
- const unsigned int
- last = local_sparsity.get_rowstart_indices()[block_index.second+1],
- first = (block_col == block_index.first ?
- local_sparsity.get_rowstart_indices()[block_index.second]+1 :
- local_sparsity.get_rowstart_indices()[block_index.second]);
-
- for (unsigned int j=first; j<last; ++j)
- matrix.block(block_index.first,block_col).global_entry(j) = 0.;
- }
-
- matrix.block(block_index.first, block_index.first)
- .diag_element(block_index.second)
- = first_nonzero_diagonal_entry;
-
- // if the user wants to have
- // the symmetry of the matrix
- // preserved, and if the
- // sparsity pattern is
- // symmetric, then do a Gauss
- // elimination step with the
- // present row. this is a
- // little more complicated for
- // block matrices.
- if (preserve_symmetry)
- {
- // we have to loop over all
- // rows of the matrix which
- // have a nonzero entry in
- // the column which we work
- // in presently. if the
- // sparsity pattern is
- // symmetric, then we can
- // get the positions of
- // these rows cheaply by
- // looking at the nonzero
- // column numbers of the
- // present row.
- //
- // note that if we check
- // whether row @p{row} in
- // block (r,c) is non-zero,
- // then we have to check
- // for the existence of
- // column @p{row} in block
- // (c,r), i.e. of the
- // transpose block
- for (unsigned int block_row=0; block_row<blocks; ++block_row)
- {
- // get pointers to the
- // sparsity patterns of
- // this block and of
- // the transpose one
- const SparsityPattern &this_sparsity
- = sparsity_pattern.block (block_row, block_index.first);
- const SparsityPattern &transpose_sparsity
- = sparsity_pattern.block (block_index.first, block_row);
-
- // traverse the row of
- // the transpose block
- // to find the
- // interesting rows in
- // the present block.
- // don't use the
- // diagonal element of
- // the diagonal block
- const unsigned int
- first = (block_index.first == block_row ?
- transpose_sparsity.get_rowstart_indices()[block_index.second]+1 :
- transpose_sparsity.get_rowstart_indices()[block_index.second]),
- last = transpose_sparsity.get_rowstart_indices()[block_index.second+1];
-
- for (unsigned int j=first; j<last; ++j)
- {
- // get the number
- // of the column in
- // this row in
- // which a nonzero
- // entry is. this
- // is also the row
- // of the transpose
- // block which has
- // an entry in the
- // interesting row
- const unsigned int row = transpose_sparsity.get_column_numbers()[j];
-
- // find the
- // position of
- // element
- // (row,dof_number)
- // in this block
- // (not in the
- // transpose
- // one). note that
- // we have to take
- // care of special
- // cases with
- // square
- // sub-matrices
- const unsigned int *p = 0;
- if (this_sparsity.n_rows() == this_sparsity.n_cols())
- {
- if (this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]]
- ==
- block_index.second)
- p = &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]];
- else
- p = std::lower_bound(&this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]+1],
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]],
- block_index.second);
- }
- else
- p = std::lower_bound(&this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]],
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]],
- block_index.second);
-
- // check whether this line has
- // an entry in the regarding column
- // (check for ==dof_number and
- // != next_row, since if
- // row==dof_number-1, *p is a
- // past-the-end pointer but points
- // to dof_number anyway...)
- //
- // there should be
- // such an entry!
- // note, however,
- // that this
- // assertion will
- // fail sometimes
- // if the sparsity
- // pattern is not
- // symmetric!
- Assert ((*p == block_index.second) &&
- (p != &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]]),
- ExcInternalError());
-
- const unsigned int global_entry
- = (p
- -
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[0]]);
-
- // set matrix entry to zero
- matrix.block(block_row,block_index.first).global_entry(global_entry) = 0.;
- }
- }
- }
- }
-}
-
-
-template void MGTools::apply_boundary_values (
- const std::set<unsigned int>&,
- SparseMatrix<float>&, const bool, const bool);
-template void MGTools::apply_boundary_values (
- const std::set<unsigned int>&,
- SparseMatrix<double>&, const bool, const bool);
-template void MGTools::apply_boundary_values (
- const std::set<unsigned int>&,
- BlockSparseMatrix<float>&, const bool);
-template void MGTools::apply_boundary_values (
- const std::set<unsigned int>&,
- BlockSparseMatrix<double>&, const bool);
-
-DEAL_II_NAMESPACE_CLOSE
#include <lac/compressed_sparsity_pattern.h>
#include <lac/sparsity_pattern.h>
#include <lac/block_vector.h>
+#include <lac/sparse_matrix.h>
+#include <lac/block_sparse_matrix.h>
+#include <lac/block_vector.h>
#include <grid/tria.h>
#include <grid/tria_iterator.h>
#include <multigrid/mg_dof_handler.h>
DEAL_II_NAMESPACE_OPEN
-#if deal_II_dimension == 1
-template <int dim, int spacedim>
+ // specializations for 1D
+template <>
void
MGTools::compute_row_length_vector(
- const MGDoFHandler<dim,spacedim>&,
+ const MGDoFHandler<1,1>&,
const unsigned int,
std::vector<unsigned int>&,
const DoFTools::Coupling)
}
-template <int dim, int spacedim>
+
+template <>
void
MGTools::compute_row_length_vector(
- const MGDoFHandler<dim,spacedim>&,
+ const MGDoFHandler<1,1>&,
const unsigned int,
std::vector<unsigned int>&,
const Table<2,DoFTools::Coupling>&,
Assert(false, ExcNotImplemented());
}
-#else
+
+
+template <>
+void
+MGTools::compute_row_length_vector(
+ const MGDoFHandler<1,2>&,
+ const unsigned int,
+ std::vector<unsigned int>&,
+ const DoFTools::Coupling)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+template <>
+void
+MGTools::compute_row_length_vector(
+ const MGDoFHandler<1,2>&,
+ const unsigned int,
+ std::vector<unsigned int>&,
+ const Table<2,DoFTools::Coupling>&,
+ const Table<2,DoFTools::Coupling>&)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
// Template for 2D and 3D. For 1D see specialization above
template <int dim, int spacedim>
}
user_flags_triangulation.load_user_flags(old_flags);
}
-#endif
+
template <int dim, class SparsityPattern, int spacedim>
-
-
-
template <int dim, class SparsityPattern, int spacedim>
void
MGTools::make_flux_sparsity_pattern (
}
+
template <int dim, int spacedim>
void
MGTools::
}
+
template <int dim, int spacedim>
void
MGTools::count_dofs_per_block (
}
-#if deal_II_dimension == 1
-template <int dim, int spacedim>
+template <>
+void
+MGTools::make_boundary_list(
+ const MGDoFHandler<1,1>&,
+ const typename FunctionMap<1>::type&,
+ std::vector<std::set<unsigned int> >&,
+ const std::vector<bool>&)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
void
MGTools::make_boundary_list(
- const MGDoFHandler<dim,spacedim>&,
- const typename FunctionMap<dim>::type&,
+ const MGDoFHandler<1,2>&,
+ const typename FunctionMap<1>::type&,
std::vector<std::set<unsigned int> >&,
const std::vector<bool>&)
{
}
-#else
template <int dim, int spacedim>
void
}
}
-#endif
template <int dim, int spacedim>
}
-#if deal_II_dimension == 1
-template <int dim, int spacedim>
+template <>
void
MGTools::
extract_inner_interface_dofs (
- const MGDoFHandler<dim,spacedim>&,
+ const MGDoFHandler<1,1>&,
std::vector<std::vector<bool> > &,
std::vector<std::vector<bool> > &)
{
Assert(false, ExcNotImplemented());
}
-template <int dim, int spacedim>
+
+
+template <>
void
MGTools::
extract_inner_interface_dofs (
- const MGDoFHandler<dim,spacedim>&,
+ const MGDoFHandler<1,1>&,
+ std::vector<std::vector<bool> > &)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MGTools::
+extract_inner_interface_dofs (
+ const MGDoFHandler<1,2>&,
+ std::vector<std::vector<bool> > &,
+ std::vector<std::vector<bool> > &)
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MGTools::
+extract_inner_interface_dofs (
+ const MGDoFHandler<1,2>&,
std::vector<std::vector<bool> > &)
{
Assert(false, ExcNotImplemented());
}
-#else
template <int dim, int spacedim>
void
}
+
template <int dim, int spacedim>
void
MGTools::
}
}
-#endif
-DEAL_II_NAMESPACE_CLOSE
-
+template <typename number>
+void
+MGTools::apply_boundary_values (
+ const std::set<unsigned int> &boundary_dofs,
+ SparseMatrix<number>& matrix,
+ const bool preserve_symmetry,
+ const bool ignore_zeros)
+{
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_dofs.size() == 0)
+ return;
-// explicit instantiations
+ const unsigned int n_dofs = matrix.m();
+
+ // if a diagonal entry is zero
+ // later, then we use another
+ // number instead. take it to be
+ // the first nonzero diagonal
+ // element of the matrix, or 1 if
+ // there is no such thing
+ number first_nonzero_diagonal_entry = 1;
+ for (unsigned int i=0; i<n_dofs; ++i)
+ if (matrix.diag_element(i) != 0)
+ {
+ first_nonzero_diagonal_entry = matrix.diag_element(i);
+ break;
+ }
+
+
+ std::set<unsigned int>::const_iterator dof = boundary_dofs.begin(),
+ endd = boundary_dofs.end();
+ const SparsityPattern &sparsity = matrix.get_sparsity_pattern();
+ const std::size_t *sparsity_rowstart = sparsity.get_rowstart_indices();
+ const unsigned int *sparsity_colnums = sparsity.get_column_numbers();
+ for (; dof != endd; ++dof)
+ {
+ Assert (*dof < n_dofs, ExcInternalError());
+
+ const unsigned int dof_number = *dof;
+ // for each boundary dof:
+
+ // set entries of this line
+ // to zero except for the diagonal
+ // entry. Note that the diagonal
+ // entry is always the first one
+ // for square matrices, i.e.
+ // we shall not set
+ // matrix.global_entry(
+ // sparsity_rowstart[dof.first])
+ const unsigned int last = sparsity_rowstart[dof_number+1];
+ for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
+ matrix.global_entry(j) = 0.;
+
+
+ // set right hand side to
+ // wanted value: if main diagonal
+ // entry nonzero, don't touch it
+ // and scale rhs accordingly. If
+ // zero, take the first main
+ // diagonal entry we can find, or
+ // one if no nonzero main diagonal
+ // element exists. Normally, however,
+ // the main diagonal entry should
+ // not be zero.
+ //
+ // store the new rhs entry to make
+ // the gauss step more efficient
+ if(!ignore_zeros)
+ matrix.set (dof_number, dof_number,
+ first_nonzero_diagonal_entry);
+ // if the user wants to have
+ // the symmetry of the matrix
+ // preserved, and if the
+ // sparsity pattern is
+ // symmetric, then do a Gauss
+ // elimination step with the
+ // present row
+ if (preserve_symmetry)
+ {
+ // we have to loop over all
+ // rows of the matrix which
+ // have a nonzero entry in
+ // the column which we work
+ // in presently. if the
+ // sparsity pattern is
+ // symmetric, then we can
+ // get the positions of
+ // these rows cheaply by
+ // looking at the nonzero
+ // column numbers of the
+ // present row. we need not
+ // look at the first entry,
+ // since that is the
+ // diagonal element and
+ // thus the present row
+ for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
+ {
+ const unsigned int row = sparsity_colnums[j];
+
+ // find the position of
+ // element
+ // (row,dof_number)
+ const unsigned int *
+ p = std::lower_bound(&sparsity_colnums[sparsity_rowstart[row]+1],
+ &sparsity_colnums[sparsity_rowstart[row+1]],
+ dof_number);
+
+ // check whether this line has
+ // an entry in the regarding column
+ // (check for ==dof_number and
+ // != next_row, since if
+ // row==dof_number-1, *p is a
+ // past-the-end pointer but points
+ // to dof_number anyway...)
+ //
+ // there should be such an entry!
+ Assert ((*p == dof_number) &&
+ (p != &sparsity_colnums[sparsity_rowstart[row+1]]),
+ ExcInternalError());
+
+ const unsigned int global_entry
+ = (p - &sparsity_colnums[sparsity_rowstart[0]]);
+
+ // correct right hand side
+ // set matrix entry to zero
+ matrix.global_entry(global_entry) = 0.;
+ }
+ }
+ }
+}
-// Functions for building sparsity patterns are in a driver file. We
-// call it for all different patterns known.
-#define PATTERN SparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
-#define PATTERN CompressedSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
-#define PATTERN CompressedSetSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
+template <typename number>
+void
+MGTools::apply_boundary_values (
+ const std::set<unsigned int>& boundary_dofs,
+ BlockSparseMatrix<number>& matrix,
+ const bool preserve_symmetry)
+{
+ const unsigned int blocks = matrix.n_block_rows();
-#define PATTERN CompressedSimpleSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
+ Assert (matrix.n_block_rows() == matrix.n_block_cols(),
+ ExcNotQuadratic());
+ Assert (matrix.get_sparsity_pattern().get_row_indices() ==
+ matrix.get_sparsity_pattern().get_column_indices(),
+ ExcNotQuadratic());
-#define PATTERN BlockSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
+ for (unsigned int i=0; i<blocks; ++i)
+ Assert (matrix.block(i,i).get_sparsity_pattern().optimize_diagonal(),
+ SparsityPattern::ExcDiagonalNotOptimized());
-#define PATTERN BlockCompressedSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
-#define PATTERN BlockCompressedSetSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_dofs.size() == 0)
+ return;
-#define PATTERN BlockCompressedSimpleSparsityPattern
-#include "mg_tools.pattern.in.h"
-#undef PATTERN
+ const unsigned int n_dofs = matrix.m();
-DEAL_II_NAMESPACE_OPEN
-
-template void
-MGTools::compute_row_length_vector(
- const MGDoFHandler<deal_II_dimension>&, unsigned int,
- std::vector<unsigned int>&, const DoFTools::Coupling);
-template void
-MGTools::compute_row_length_vector(
- const MGDoFHandler<deal_II_dimension>&, unsigned int,
- std::vector<unsigned int>&,
- const Table<2,DoFTools::Coupling>&, const Table<2,DoFTools::Coupling>&);
-
-template void MGTools::count_dofs_per_component<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
- bool, std::vector<unsigned int>);
-template void MGTools::count_dofs_per_component<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
- std::vector<unsigned int>);
-template void MGTools::count_dofs_per_block<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
- std::vector<unsigned int>);
-
-template void MGTools::make_boundary_list(
- const MGDoFHandler<deal_II_dimension>&,
- const FunctionMap<deal_II_dimension>::type&,
- std::vector<std::set<unsigned int> >&,
- const std::vector<bool>&);
+ // if a diagonal entry is zero
+ // later, then we use another
+ // number instead. take it to be
+ // the first nonzero diagonal
+ // element of the matrix, or 1 if
+ // there is no such thing
+ number first_nonzero_diagonal_entry = 0;
+ for (unsigned int diag_block=0; diag_block<blocks; ++diag_block)
+ {
+ for (unsigned int i=0; i<matrix.block(diag_block,diag_block).n(); ++i)
+ if (matrix.block(diag_block,diag_block).diag_element(i) != 0)
+ {
+ first_nonzero_diagonal_entry
+ = matrix.block(diag_block,diag_block).diag_element(i);
+ break;
+ }
+ // check whether we have found
+ // something in the present
+ // block
+ if (first_nonzero_diagonal_entry != 0)
+ break;
+ }
+ // nothing found on all diagonal
+ // blocks? if so, use 1.0 instead
+ if (first_nonzero_diagonal_entry == 0)
+ first_nonzero_diagonal_entry = 1;
+
+
+ std::set<unsigned int>::const_iterator dof = boundary_dofs.begin(),
+ endd = boundary_dofs.end();
+ const BlockSparsityPattern &
+ sparsity_pattern = matrix.get_sparsity_pattern();
+
+ // pointer to the mapping between
+ // global and block indices. since
+ // the row and column mappings are
+ // equal, store a pointer on only
+ // one of them
+ const BlockIndices &
+ index_mapping = sparsity_pattern.get_column_indices();
+
+ // now loop over all boundary dofs
+ for (; dof != endd; ++dof)
+ {
+ Assert (*dof < n_dofs, ExcInternalError());
+
+ // get global index and index
+ // in the block in which this
+ // dof is located
+ const unsigned int dof_number = *dof;
+ const std::pair<unsigned int,unsigned int>
+ block_index = index_mapping.global_to_local (dof_number);
+
+ // for each boundary dof:
+
+ // set entries of this line
+ // to zero except for the diagonal
+ // entry. Note that the diagonal
+ // entry is always the first one
+ // for square matrices, i.e.
+ // we shall not set
+ // matrix.global_entry(
+ // sparsity_rowstart[dof.first])
+ // of the diagonal block
+ for (unsigned int block_col=0; block_col<blocks; ++block_col)
+ {
+ const SparsityPattern &
+ local_sparsity = sparsity_pattern.block(block_index.first,
+ block_col);
+
+ // find first and last
+ // entry in the present row
+ // of the present
+ // block. exclude the main
+ // diagonal element, which
+ // is the diagonal element
+ // of a diagonal block,
+ // which must be a square
+ // matrix so the diagonal
+ // element is the first of
+ // this row.
+ const unsigned int
+ last = local_sparsity.get_rowstart_indices()[block_index.second+1],
+ first = (block_col == block_index.first ?
+ local_sparsity.get_rowstart_indices()[block_index.second]+1 :
+ local_sparsity.get_rowstart_indices()[block_index.second]);
+
+ for (unsigned int j=first; j<last; ++j)
+ matrix.block(block_index.first,block_col).global_entry(j) = 0.;
+ }
-template void MGTools::make_boundary_list(
- const MGDoFHandler<deal_II_dimension>&,
- const FunctionMap<deal_II_dimension>::type&,
- std::vector<IndexSet>&,
- const std::vector<bool>&);
+ matrix.block(block_index.first, block_index.first)
+ .diag_element(block_index.second)
+ = first_nonzero_diagonal_entry;
+
+ // if the user wants to have
+ // the symmetry of the matrix
+ // preserved, and if the
+ // sparsity pattern is
+ // symmetric, then do a Gauss
+ // elimination step with the
+ // present row. this is a
+ // little more complicated for
+ // block matrices.
+ if (preserve_symmetry)
+ {
+ // we have to loop over all
+ // rows of the matrix which
+ // have a nonzero entry in
+ // the column which we work
+ // in presently. if the
+ // sparsity pattern is
+ // symmetric, then we can
+ // get the positions of
+ // these rows cheaply by
+ // looking at the nonzero
+ // column numbers of the
+ // present row.
+ //
+ // note that if we check
+ // whether row @p{row} in
+ // block (r,c) is non-zero,
+ // then we have to check
+ // for the existence of
+ // column @p{row} in block
+ // (c,r), i.e. of the
+ // transpose block
+ for (unsigned int block_row=0; block_row<blocks; ++block_row)
+ {
+ // get pointers to the
+ // sparsity patterns of
+ // this block and of
+ // the transpose one
+ const SparsityPattern &this_sparsity
+ = sparsity_pattern.block (block_row, block_index.first);
+ const SparsityPattern &transpose_sparsity
+ = sparsity_pattern.block (block_index.first, block_row);
+
+ // traverse the row of
+ // the transpose block
+ // to find the
+ // interesting rows in
+ // the present block.
+ // don't use the
+ // diagonal element of
+ // the diagonal block
+ const unsigned int
+ first = (block_index.first == block_row ?
+ transpose_sparsity.get_rowstart_indices()[block_index.second]+1 :
+ transpose_sparsity.get_rowstart_indices()[block_index.second]),
+ last = transpose_sparsity.get_rowstart_indices()[block_index.second+1];
+
+ for (unsigned int j=first; j<last; ++j)
+ {
+ // get the number
+ // of the column in
+ // this row in
+ // which a nonzero
+ // entry is. this
+ // is also the row
+ // of the transpose
+ // block which has
+ // an entry in the
+ // interesting row
+ const unsigned int row = transpose_sparsity.get_column_numbers()[j];
+
+ // find the
+ // position of
+ // element
+ // (row,dof_number)
+ // in this block
+ // (not in the
+ // transpose
+ // one). note that
+ // we have to take
+ // care of special
+ // cases with
+ // square
+ // sub-matrices
+ const unsigned int *p = 0;
+ if (this_sparsity.n_rows() == this_sparsity.n_cols())
+ {
+ if (this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]]
+ ==
+ block_index.second)
+ p = &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]];
+ else
+ p = std::lower_bound(&this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]+1],
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]],
+ block_index.second);
+ }
+ else
+ p = std::lower_bound(&this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]],
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]],
+ block_index.second);
+
+ // check whether this line has
+ // an entry in the regarding column
+ // (check for ==dof_number and
+ // != next_row, since if
+ // row==dof_number-1, *p is a
+ // past-the-end pointer but points
+ // to dof_number anyway...)
+ //
+ // there should be
+ // such an entry!
+ // note, however,
+ // that this
+ // assertion will
+ // fail sometimes
+ // if the sparsity
+ // pattern is not
+ // symmetric!
+ Assert ((*p == block_index.second) &&
+ (p != &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]]),
+ ExcInternalError());
+
+ const unsigned int global_entry
+ = (p
+ -
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[0]]);
+
+ // set matrix entry to zero
+ matrix.block(block_row,block_index.first).global_entry(global_entry) = 0.;
+ }
+ }
+ }
+ }
+}
-template
-void
-MGTools::
-extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
- std::vector<std::vector<bool> > &interface_dofs,
- std::vector<std::vector<bool> > &boundary_interface_dofs);
-template
-void
-MGTools::
-extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
- std::vector<std::vector<bool> > &interface_dofs);
-#if deal_II_dimension < 3
-template void MGTools::count_dofs_per_block<deal_II_dimension,deal_II_dimension+1> (
- const MGDoFHandler<deal_II_dimension,deal_II_dimension+1>&,
- std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
+// explicit instantiations
+#include "mg_tools.inst"
+
+template void MGTools::apply_boundary_values (
+ const std::set<unsigned int>&,
+ SparseMatrix<float>&, const bool, const bool);
+template void MGTools::apply_boundary_values (
+ const std::set<unsigned int>&,
+ SparseMatrix<double>&, const bool, const bool);
+template void MGTools::apply_boundary_values (
+ const std::set<unsigned int>&,
+ BlockSparseMatrix<float>&, const bool);
+template void MGTools::apply_boundary_values (
+ const std::set<unsigned int>&,
+ BlockSparseMatrix<double>&, const bool);
-#endif
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (PATTERN : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
+{
+template void
+MGTools::make_sparsity_pattern<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension> &,
+ PATTERN &,
+ const unsigned int);
+
+template void
+MGTools::make_flux_sparsity_pattern<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension> &,
+ PATTERN &,
+ const unsigned int);
+
+template void
+MGTools::make_flux_sparsity_pattern_edge<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension> &,
+ PATTERN &,
+ const unsigned int);
+
+#if deal_II_dimension > 1
+
+template void
+MGTools::make_flux_sparsity_pattern<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension> &,
+ PATTERN &,
+ const unsigned int,
+ const Table<2,DoFTools::Coupling>&,
+ const Table<2,DoFTools::Coupling>&);
+
+template void
+MGTools::make_flux_sparsity_pattern_edge<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension> &,
+ PATTERN &,
+ const unsigned int,
+ const Table<2,DoFTools::Coupling>&);
+
+#endif
+}
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+template void
+MGTools::compute_row_length_vector(
+ const MGDoFHandler<deal_II_dimension>&, unsigned int,
+ std::vector<unsigned int>&, const DoFTools::Coupling);
+template void
+MGTools::compute_row_length_vector(
+ const MGDoFHandler<deal_II_dimension>&, unsigned int,
+ std::vector<unsigned int>&,
+ const Table<2,DoFTools::Coupling>&, const Table<2,DoFTools::Coupling>&);
+
+template void MGTools::count_dofs_per_component<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+ bool, std::vector<unsigned int>);
+template void MGTools::count_dofs_per_component<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+ std::vector<unsigned int>);
+template void MGTools::count_dofs_per_block<deal_II_dimension> (
+ const MGDoFHandler<deal_II_dimension>&, std::vector<std::vector<unsigned int> >&,
+ std::vector<unsigned int>);
+
+template void MGTools::make_boundary_list(
+ const MGDoFHandler<deal_II_dimension>&,
+ const FunctionMap<deal_II_dimension>::type&,
+ std::vector<std::set<unsigned int> >&,
+ const std::vector<bool>&);
+
+template void MGTools::make_boundary_list(
+ const MGDoFHandler<deal_II_dimension>&,
+ const FunctionMap<deal_II_dimension>::type&,
+ std::vector<IndexSet>&,
+ const std::vector<bool>&);
+
+template
+void
+MGTools::
+extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
+ std::vector<std::vector<bool> > &interface_dofs,
+ std::vector<std::vector<bool> > &boundary_interface_dofs);
+template
+void
+MGTools::
+extract_inner_interface_dofs (const MGDoFHandler<deal_II_dimension> &mg_dof_handler,
+ std::vector<std::vector<bool> > &interface_dofs);
+
+#if deal_II_dimension < 3
+
+template void MGTools::count_dofs_per_block<deal_II_dimension,deal_II_dimension+1> (
+ const MGDoFHandler<deal_II_dimension,deal_II_dimension+1>&,
+ std::vector<std::vector<unsigned int> >&, std::vector<unsigned int>);
+
+#endif
+ }
+
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2002, 2003, 2005, 2006 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-// Driver file for MGTools::Make_*_sparsity_* routines.
-
-// Call this file after defining PATTERN to the desired sparsity
-// pattern type.
-
-DEAL_II_NAMESPACE_OPEN
-
-
-
-template void
-MGTools::make_sparsity_pattern<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension> &,
- PATTERN &,
- const unsigned int);
-
-template void
-MGTools::make_flux_sparsity_pattern<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension> &,
- PATTERN &,
- const unsigned int);
-
-template void
-MGTools::make_flux_sparsity_pattern_edge<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension> &,
- PATTERN &,
- const unsigned int);
-
-#if deal_II_dimension > 1
-
-template void
-MGTools::make_flux_sparsity_pattern<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension> &,
- PATTERN &,
- const unsigned int,
- const Table<2,DoFTools::Coupling>&,
- const Table<2,DoFTools::Coupling>&);
-
-template void
-MGTools::make_flux_sparsity_pattern_edge<deal_II_dimension> (
- const MGDoFHandler<deal_II_dimension> &,
- PATTERN &,
- const unsigned int,
- const Table<2,DoFTools::Coupling>&);
-
-#endif
-
-
-DEAL_II_NAMESPACE_CLOSE
// explicit instantiations
+#include "mg_transfer_block.inst"
-template
-void MGTransferBlock<float>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
- const std::vector<bool>&);
-
-template
-void MGTransferBlock<double>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
- const std::vector<bool>&);
-
-template
-void MGTransferBlockSelect<float>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
- const unsigned int);
-
-template
-void MGTransferBlockSelect<double>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
- const unsigned int);
-
-template void
-MGTransferBlock<float>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<float> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferBlock<float>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferBlock<float>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-
-template void
-MGTransferBlock<double>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<double> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferBlock<double>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferBlock<double>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
-
-template void
-MGTransferBlockSelect<float>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const Vector<double>&) const;
-template void
-MGTransferBlockSelect<float>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferBlockSelect<float>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferBlockSelect<float>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferBlockSelect<float>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferBlockSelect<float>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-
-template void
-MGTransferBlockSelect<double>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const Vector<double>&) const;
-template void
-MGTransferBlockSelect<double>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferBlockSelect<double>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferBlockSelect<double>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferBlockSelect<double>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferBlockSelect<double>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+template
+void MGTransferBlock<float>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
+ const std::vector<bool>&);
+
+template
+void MGTransferBlock<double>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
+ const std::vector<bool>&);
+
+template
+void MGTransferBlockSelect<float>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
+ const unsigned int);
+
+template
+void MGTransferBlockSelect<double>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&, const MGDoFHandler<deal_II_dimension>&,
+ const unsigned int);
+
+template void
+MGTransferBlock<float>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<float> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferBlock<float>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferBlock<float>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+
+template void
+MGTransferBlock<double>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<double> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferBlock<double>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferBlock<double>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+
+template void
+MGTransferBlockSelect<float>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const Vector<double>&) const;
+template void
+MGTransferBlockSelect<float>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferBlockSelect<float>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferBlockSelect<float>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferBlockSelect<float>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferBlockSelect<float>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+
+template void
+MGTransferBlockSelect<double>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const Vector<double>&) const;
+template void
+MGTransferBlockSelect<double>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferBlockSelect<double>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferBlockSelect<double>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferBlockSelect<double>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferBlockSelect<double>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+ }
+
#include <algorithm>
#include <numeric>
#include <iostream>
+
DEAL_II_NAMESPACE_OPEN
// explicit instantiations
+#include "mg_transfer_component.inst"
-template
-void MGTransferSelect<float>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &d,
- const MGDoFHandler<deal_II_dimension> &,
- unsigned int, unsigned int,
- const std::vector<unsigned int>&,
- const std::vector<unsigned int>&,
- const std::vector<std::set<unsigned int> >&);
-
-template
-void MGTransferSelect<double>::build_matrices<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &d,
- const MGDoFHandler<deal_II_dimension> &,
- unsigned int, unsigned int,
- const std::vector<unsigned int>&,
- const std::vector<unsigned int>&,
- const std::vector<std::set<unsigned int> >&);
-
-template void
-MGTransferSelect<float>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const Vector<double>&) const;
-template void
-MGTransferSelect<float>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferSelect<float>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferSelect<float>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferSelect<float>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferSelect<float>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-
-template void
-MGTransferSelect<double>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const Vector<double>&) const;
-template void
-MGTransferSelect<double>::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferSelect<double>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferSelect<double>::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferSelect<double>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferSelect<double>::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+template
+void MGTransferSelect<float>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &d,
+ const MGDoFHandler<deal_II_dimension> &,
+ unsigned int, unsigned int,
+ const std::vector<unsigned int>&,
+ const std::vector<unsigned int>&,
+ const std::vector<std::set<unsigned int> >&);
+
+template
+void MGTransferSelect<double>::build_matrices<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &d,
+ const MGDoFHandler<deal_II_dimension> &,
+ unsigned int, unsigned int,
+ const std::vector<unsigned int>&,
+ const std::vector<unsigned int>&,
+ const std::vector<std::set<unsigned int> >&);
+
+template void
+MGTransferSelect<float>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const Vector<double>&) const;
+template void
+MGTransferSelect<float>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferSelect<float>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferSelect<float>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferSelect<float>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferSelect<float>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+
+template void
+MGTransferSelect<double>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const Vector<double>&) const;
+template void
+MGTransferSelect<double>::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferSelect<double>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferSelect<double>::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferSelect<double>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferSelect<double>::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+ }
+
// need to filter away.
constrain_indices.resize (0);
constrain_indices.resize (prolongation_matrices[level]->n(), 0);
- std::set<unsigned int>::const_iterator dof
+ std::set<unsigned int>::const_iterator dof
= mg_constrained_dofs->get_boundary_indices()[level].begin(),
endd = mg_constrained_dofs->get_boundary_indices()[level].end();
for (; dof != endd; ++dof)
}
-//TODO: Use template expander script
-
-template
-void MGTransferPrebuilt<Vector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<Vector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<BlockVector<float> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template
-void MGTransferPrebuilt<BlockVector<double> >::build_matrices<deal_II_dimension>
-(const MGDoFHandler<deal_II_dimension> &mg_dof);
-
-template void
-MGTransferPrebuilt<Vector<float> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const Vector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<float> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-template void
-MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<float> >&) const;
-
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<float> >&,
- const Vector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<float> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<float> >&) const;
-
-template void
-MGTransferPrebuilt<Vector<double> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const Vector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<Vector<double> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-template void
-MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<Vector<double> >&) const;
-
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<double> >&,
- const Vector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
- const MGDoFHandler<deal_II_dimension>&,
- MGLevelObject<BlockVector<double> >&,
- const BlockVector<double>&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- Vector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
-template void
-MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
- const MGDoFHandler<deal_II_dimension>&,
- BlockVector<double>&,
- const MGLevelObject<BlockVector<double> >&) const;
+
+// explicit instantiation
+#include "mg_transfer_prebuilt.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS)
+ {
+//TODO: Use template expander script
+
+template
+void MGTransferPrebuilt<Vector<float> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template
+void MGTransferPrebuilt<Vector<double> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template
+void MGTransferPrebuilt<BlockVector<float> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template
+void MGTransferPrebuilt<BlockVector<double> >::build_matrices<deal_II_dimension>
+(const MGDoFHandler<deal_II_dimension> &mg_dof);
+
+template void
+MGTransferPrebuilt<Vector<float> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const Vector<double>&) const;
+template void
+MGTransferPrebuilt<Vector<float> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<float> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<Vector<float> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferPrebuilt<Vector<float> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+template void
+MGTransferPrebuilt<Vector<float> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<float> >&) const;
+
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<float> >&,
+ const Vector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<float> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<float> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<float> >&) const;
+
+template void
+MGTransferPrebuilt<Vector<double> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const Vector<double>&) const;
+template void
+MGTransferPrebuilt<Vector<double> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<Vector<double> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<Vector<double> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferPrebuilt<Vector<double> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+template void
+MGTransferPrebuilt<Vector<double> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<Vector<double> >&) const;
+
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<double> >&,
+ const Vector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_to_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ MGLevelObject<BlockVector<double> >&,
+ const BlockVector<double>&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ Vector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+template void
+MGTransferPrebuilt<BlockVector<double> >::copy_from_mg_add (
+ const MGDoFHandler<deal_II_dimension>&,
+ BlockVector<double>&,
+ const MGLevelObject<BlockVector<double> >&) const;
+ }
+
// If this function is to be used, its declaration must be added to
// the class Multigrid again.
+
+// TODO: deal_II_dimension not set any more, so this will not compile!
#ifdef MG_DEBUG
template <>
void
//
//---------------------------------------------------------------------------
-for (VEC : SERIAL_VECTORS; DH : DOFHANDLER_TEMPLATES)
+for (VEC : SERIAL_VECTORS; DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
{
// codim=0
}
-for (DH : DOFHANDLER_TEMPLATES)
+for (DH : DOFHANDLER_TEMPLATES; deal_II_dimension : DIMENSIONS)
{
template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension>;
template class DataOut_DoFData<DH<deal_II_dimension>,deal_II_dimension+1>;
}
+
// explicit instantiations
-// don't instantiate anything for the 1d
-#if deal_II_dimension >=2
-template class DataOutFaces<deal_II_dimension, DoFHandler<deal_II_dimension> >;
-template class DataOutFaces<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
-#endif
+#include "data_out_faces.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ // don't instantiate anything for the 1d
+#if deal_II_dimension >=2
+ template class DataOutFaces<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+ template class DataOutFaces<deal_II_dimension, hp::DoFHandler<deal_II_dimension> >;
+#endif
+}
patches.push_back (new_patches[i]);
patches.back().patch_index = patches.size()-1;
}
- }
+ }
}
}
-
-#if deal_II_dimension < 3
+
template <int dim, class DH>
void
DataOutRotation<dim,DH>::
internal::DataOutRotation::ParallelData<DH::dimension, DH::space_dimension> &data,
std::vector<DataOutBase::Patch<DH::dimension+1,DH::space_dimension+1> > &patches)
{
+ if (dim == 3)
+ {
+ // would this function make any
+ // sense after all? who would want
+ // to output/compute in four space
+ // dimensions?
+ Assert (false, ExcNotImplemented());
+ return;
+ }
+
Assert (!(*cell)->is_ghost() &&
!(*cell)->is_artificial(),
ExcNotImplemented());
// the number of q_points in each
// direction
const unsigned int n_points = data.n_subdivisions+1;
-
+
// set up an array that holds the
// directions in the plane of
// rotation in which we will put
angle_directions[i][DH::dimension] = std::sin(2*numbers::PI *
i/n_patches_per_circle);
}
-
+
for (unsigned int angle=0; angle<n_patches_per_circle; ++angle)
{
// first compute the
{
const double r1 = (*cell)->vertex(0)(0),
r2 = (*cell)->vertex(1)(0);
- Assert (r1 >= 0, ExcRadialVariableHasNegativeValues(r1));
+ Assert (r1 >= 0, ExcRadialVariableHasNegativeValues(r1));
Assert (r2 >= 0, ExcRadialVariableHasNegativeValues(r2));
-
+
patches[angle].vertices[0] = r1*angle_directions[angle];
patches[angle].vertices[1] = r2*angle_directions[angle];
patches[angle].vertices[2] = r1*angle_directions[angle+1];
break;
};
-
+
case 2:
{
for (unsigned int vertex=0;
++vertex)
{
const Point<DH::dimension> v = (*cell)->vertex(vertex);
-
+
// make sure that the
// radial variable does
// attain negative
// values
Assert (v(0) >= 0, ExcRadialVariableHasNegativeValues(v(0)));
-
+
// now set the vertices
// of the patch
patches[angle].vertices[vertex] = v(0) * angle_directions[angle];
patches[angle].vertices[vertex][0] = v(1);
-
+
patches[angle].vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell]
= v(0) * angle_directions[angle+1];
patches[angle].vertices[vertex+GeometryInfo<DH::dimension>::vertices_per_cell][0]
= v(1);
};
-
+
break;
};
default:
Assert (false, ExcNotImplemented());
};
-
+
unsigned int offset=0;
-
+
// then fill in data
if (data.n_datasets > 0)
{
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();
+ data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
std::vector<Point<DH::space_dimension> > dummy_normals;
postprocessor->
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();
-
+ data.patch_evaluation_points = fe_patch_values.get_quadrature_points();
+
std::vector<Point<DH::space_dimension> > dummy_normals;
postprocessor->
compute_derived_quantities_vector(data.patch_values_system,
data.patch_evaluation_points,
data.postprocessed_values[dataset]);
}
-
+
for (unsigned int component=0;
component<this->dof_data[dataset]->n_output_variables;
++component)
x*n_points + y)
= data.postprocessed_values[dataset][x](component);
break;
-
+
case 2:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int y=0; y<n_points; ++y)
z)
= data.postprocessed_values[dataset][x*n_points+z](component);
break;
-
+
default:
Assert (false, ExcNotImplemented());
}
{
this->dof_data[dataset]->get_function_values (fe_patch_values,
data.patch_values);
-
+
switch (DH::dimension)
{
case 1:
x*n_points + y)
= data.patch_values[x];
break;
-
+
case 2:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int y=0; y<n_points; ++y)
z*n_points)
= data.patch_values[x*n_points+z];
break;
-
+
default:
Assert (false, ExcNotImplemented());
}
{
this->dof_data[dataset]->get_function_values (fe_patch_values,
data.patch_values_system);
-
+
for (unsigned int component=0; component<data.n_components;
++component)
{
x*n_points + y)
= data.patch_values_system[x](component);
break;
-
+
case 2:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int y=0; y<n_points; ++y)
z)
= data.patch_values_system[x*n_points+z](component);
break;
-
+
default:
Assert (false, ExcNotImplemented());
}
}
offset+=this->dof_data[dataset]->n_output_variables;
}
-
+
// then do the cell data
for (unsigned int dataset=0; dataset<this->cell_data.size(); ++dataset)
{
y)
= value;
break;
-
+
case 2:
for (unsigned int x=0; x<n_points; ++x)
for (unsigned int y=0; y<n_points; ++y)
-#else
-
-template <int dim, class DH>
-void
-DataOutRotation<dim,DH>::
-build_one_patch (const cell_iterator *,
- internal::DataOutRotation::ParallelData<DH::dimension, DH::space_dimension> &,
- std::vector<DataOutBase::Patch<DH::dimension+1,DH::space_dimension+1> > &)
-{
- // would this function make any
- // sense after all? who would want
- // to output/compute in four space
- // dimensions?
- Assert (false, ExcNotImplemented());
-}
-
-#endif
-
-
-
template <int dim, class DH>
void DataOutRotation<dim,DH>::build_patches (const unsigned int n_patches_per_circle,
- const unsigned int nnnn_subdivisions)
+ const unsigned int nnnn_subdivisions)
{
// Check consistency of redundant
// template parameter
const unsigned int n_subdivisions = (nnnn_subdivisions != 0)
? nnnn_subdivisions
- : this->default_subdivisions;
+ : this->default_subdivisions;
Assert (n_subdivisions >= 1,
ExcInvalidNumberOfSubdivisions(n_subdivisions));
const QTrapez<1> q_trapez;
const QIterated<DH::dimension> patch_points (q_trapez, n_subdivisions);
-
+
const unsigned int n_components = this->dofs->get_fe().n_components();
unsigned int n_datasets=this->cell_data.size();
for (unsigned int i=0; i<this->dof_data.size(); ++i)
Assert (!(update_flags & update_normal_vectors),
ExcMessage("The update of normal vectors may not be requested for "
"evaluation of data on cells via DataPostprocessor."));
-
+
// first count the cells we want to
// create patches of and make sure
// there is enough memory for that
for (cell_iterator cell=first_cell(); cell != this->dofs->end();
cell = next_cell(cell))
all_cells.push_back (cell);
-
+
// then also take into account that
// we want more than one patch to
// come out of every cell, as they
// rotation
this->patches.clear();
this->patches.reserve (all_cells.size() * n_patches_per_circle);
-
-
+
+
std::vector<unsigned int> n_postprocessor_outputs (this->dof_data.size());
for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
if (this->dof_data[dataset]->postprocessor)
template <int dim, class DH>
typename DataOutRotation<dim,DH>::cell_iterator
-DataOutRotation<dim,DH>::first_cell ()
+DataOutRotation<dim,DH>::first_cell ()
{
return this->dofs->begin_active ();
}
template <int dim, class DH>
typename DataOutRotation<dim,DH>::cell_iterator
-DataOutRotation<dim,DH>::next_cell (const cell_iterator &cell)
+DataOutRotation<dim,DH>::next_cell (const cell_iterator &cell)
{
// convert the iterator to an
// active_iterator and advance
}
+
// explicit instantiations
-template class DataOutRotation<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+#include "data_out_rotation.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ template class DataOutRotation<deal_II_dimension, DoFHandler<deal_II_dimension> >;
+}
}
+
// explicit instantiations
-template class DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >;
-
-template void DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >::
-add_data_vector<double> (const Vector<double> &vec,
- const std::string &name);
-
-template void DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >::
-add_data_vector<float> (const Vector<float> &vec,
- const std::string &name);
-
-template class DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >;
-template void DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
-add_data_vector<double> (const Vector<double> &vec,
- const std::string &name);
-template void DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
-add_data_vector<float> (const Vector<float> &vec,
- const std::string &name);
+#include "data_out_stack.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+template class DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >;
+
+template void DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >::
+add_data_vector<double> (const Vector<double> &vec,
+ const std::string &name);
+
+template void DataOutStack<deal_II_dimension,deal_II_dimension,DoFHandler<deal_II_dimension> >::
+add_data_vector<float> (const Vector<float> &vec,
+ const std::string &name);
+
+template class DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >;
+template void DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
+add_data_vector<double> (const Vector<double> &vec,
+ const std::string &name);
+template void DataOutStack<deal_II_dimension,deal_II_dimension,hp::DoFHandler<deal_II_dimension> >::
+add_data_vector<float> (const Vector<float> &vec,
+ const std::string &name);
+}
// explicit instantiation
-template class DataPostprocessor<deal_II_dimension>;
+#include "data_postprocessor.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ template class DataPostprocessor<deal_II_dimension>;
+}
}
-#if deal_II_dimension == 1
template <>
inline
return std::fabs (d[0][0]);
}
-#endif
-#if deal_II_dimension == 2
template <>
inline
const double eigenvalues[2]
= { 0.5*(d[0][0] + d[1][1] + std::sqrt(radicand)),
0.5*(d[0][0] + d[1][1] - std::sqrt(radicand)) };
-
+
return std::max (std::fabs (eigenvalues[0]),
std::fabs (eigenvalues[1]));
}
-#endif
-
-#if deal_II_dimension == 3
template <>
inline
compute the three eigenvalues of the tensor @p{d} and take the
largest. one could use the following maple script to generate C
code:
-
+
with(linalg);
readlib(C);
A:=matrix(3,3,[[a00,a01,a02],[a01,a11,a12],[a02,a12,a22]]);
augmented by a test for R>0, since R==0 indicates that all three
eigenvalues are equal.)
-
+
PROGRAM MAIN
C FIND EIGENVALUES OF REAL SYMMETRIC MATRIX
A22 = -2.D0
A23 = 0.5D0
A33 = 4.D0
-
+
I1 = A11 + A22 + A33
AM = I1/3.D0
ENDIF
THETA = (ACOS(XX))/3.D0
-
+
A1 = AM + R*COS(THETA)
A2 = AM + R*COS(THETA + 2.D0*PI/3.D0)
A3 = AM + R*COS(THETA + 4.D0*PI/3.D0)
STOP
END
-
+
*/
const double am = trace(d) / 3.;
Tensor<2,3> s = d;
for (unsigned int i=0; i<3; ++i)
s[i][i] -= am;
-
+
const double ss01 = s[0][1] * s[0][1],
ss12 = s[1][2] * s[1][2],
ss02 = s[0][2] * s[0][2];
+ 3. * s[1][1] * (ss01 + ss12)
+ 3. * s[2][2] * (ss02 + ss12)
+ 6. * s[0][1] * s[0][2] * s[1][2]) / 3.;
-
+
const double R = std::sqrt (4. * J2 / 3.);
double EE[3] = { 0, 0, 0 };
const double YY = 1. - std::fabs(XX);
Assert (YY > -1e-14, ExcInternalError());
-
+
if (YY < 0)
{
// two roots are equal
std::fabs (EE[2])));
}
-#endif
template <int dim>
}
-#if deal_II_dimension == 1
template <>
inline
return std::fabs (d[0][0][0]);
}
-#endif
template <int dim>
= d[j][j][i]
= t;
};
-
+
}
template <int dim, template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
approximate_gradient (const Mapping<dim,spacedim> &mapping,
const DH<dim,spacedim> &dof_handler,
template <int dim, template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
approximate_gradient (const DH<dim,spacedim> &dof_handler,
const InputVector &solution,
template <int dim, template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
approximate_second_derivative (const Mapping<dim,spacedim> &mapping,
const DH<dim,spacedim> &dof_handler,
template <int dim, template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
approximate_second_derivative (const DH<dim,spacedim> &dof_handler,
const InputVector &solution,
template <class DerivativeDescription, int dim,
template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
approximate_derivative (const Mapping<dim,spacedim> &mapping,
const DH<dim,spacedim> &dof_handler,
template approximate<DerivativeDescription,dim,
DH,InputVector>;
-//TODO: Use WorkStream here
- Threads::TaskGroup<> tasks;
+//TODO: Use WorkStream here
+ Threads::TaskGroup<> tasks;
for (unsigned int i=0; i<n_threads; ++i)
tasks += Threads::new_task (fun_ptr,
mapping, dof_handler,
template <class DerivativeDescription, int dim,
template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::approximate (const Mapping<dim,spacedim> &mapping,
const DH<dim,spacedim> &dof_handler,
const InputVector &solution,
Vector<float>::iterator
derivative_norm_on_this_cell
= derivative_norm.begin() + index_interval.first;
-
+
typename DH<dim,spacedim>::active_cell_iterator cell, endc;
cell = endc = dof_handler.begin_active();
// (static_cast to avoid warnings
template <class DerivativeDescription, int dim,
template <int, int> class DH, class InputVector, int spacedim>
-void
+void
DerivativeApproximation::
-approximate_cell (const Mapping<dim,spacedim> &mapping,
- const DH<dim,spacedim> &dof_handler,
+approximate_cell (const Mapping<dim,spacedim> &mapping,
+ const DH<dim,spacedim> &dof_handler,
const InputVector &solution,
const unsigned int component,
const typename DH<dim,spacedim>::active_cell_iterator &cell,
- typename DerivativeDescription::Derivative &derivative)
-{
+ typename DerivativeDescription::Derivative &derivative)
+{
QMidpoint<dim> midpoint_rule;
// create collection objects from
const hp::QCollection<dim> q_collection (midpoint_rule);
const hp::FECollection<dim> fe_collection(dof_handler.get_fe());
const hp::MappingCollection<dim> mapping_collection (mapping);
-
+
hp::FEValues<dim> x_fe_midpoint_value (mapping_collection, fe_collection,
q_collection,
DerivativeDescription::update_flags |
update_quadrature_points);
-
+
// matrix Y=sum_i y_i y_i^T
Tensor<2,dim> Y;
-
+
// vector to hold iterators to all
// active neighbors of a cell
// g=sum_i y_i (f(x+y_i)-f(x))/|y_i|
// or related type for higher
// derivatives
- typename DerivativeDescription::Derivative projected_derivative;
+ typename DerivativeDescription::Derivative projected_derivative;
// reinit fe values object...
- x_fe_midpoint_value.reinit (cell);
- const FEValues<dim> &fe_midpoint_value
- = x_fe_midpoint_value.get_present_fe_values();
+ x_fe_midpoint_value.reinit (cell);
+ const FEValues<dim> &fe_midpoint_value
+ = x_fe_midpoint_value.get_present_fe_values();
// ...and get the value of the
// projected derivative...
- const typename DerivativeDescription::ProjectedDerivative
- this_midpoint_value
- = DerivativeDescription::get_projected_derivative (fe_midpoint_value,
- solution,
- component);
+ const typename DerivativeDescription::ProjectedDerivative
+ this_midpoint_value
+ = DerivativeDescription::get_projected_derivative (fe_midpoint_value,
+ solution,
+ component);
// ...and the place where it lives
- const Point<dim> this_center = fe_midpoint_value.quadrature_point(0);
+ const Point<dim> this_center = fe_midpoint_value.quadrature_point(0);
+
-
// loop over all neighbors and
// accumulate the difference
// quotients from them. note
// first collect all neighbor
// cells in a vector, and then
// collect the data from them
- GridTools::template get_active_neighbors<DH<dim,spacedim> >(cell, active_neighbors);
-
+ GridTools::template get_active_neighbors<DH<dim,spacedim> >(cell, active_neighbors);
+
// now loop over all active
// neighbors and collect the
// data we need
- typename std::vector<typename DH<dim,spacedim>::active_cell_iterator>::const_iterator
- neighbor_ptr = active_neighbors.begin();
- for (; neighbor_ptr!=active_neighbors.end(); ++neighbor_ptr)
- {
- const typename DH<dim,spacedim>::active_cell_iterator
- neighbor = *neighbor_ptr;
-
+ typename std::vector<typename DH<dim,spacedim>::active_cell_iterator>::const_iterator
+ neighbor_ptr = active_neighbors.begin();
+ for (; neighbor_ptr!=active_neighbors.end(); ++neighbor_ptr)
+ {
+ const typename DH<dim,spacedim>::active_cell_iterator
+ neighbor = *neighbor_ptr;
+
// reinit fe values object...
- x_fe_midpoint_value.reinit (neighbor);
- const FEValues<dim> &fe_midpoint_value
- = x_fe_midpoint_value.get_present_fe_values();
-
+ x_fe_midpoint_value.reinit (neighbor);
+ const FEValues<dim> &fe_midpoint_value
+ = x_fe_midpoint_value.get_present_fe_values();
+
// ...and get the value of the
// solution...
- const typename DerivativeDescription::ProjectedDerivative
- neighbor_midpoint_value
- = DerivativeDescription::get_projected_derivative (fe_midpoint_value,
+ const typename DerivativeDescription::ProjectedDerivative
+ neighbor_midpoint_value
+ = DerivativeDescription::get_projected_derivative (fe_midpoint_value,
solution, component);
-
+
// ...and the place where it lives
- const Point<dim>
- neighbor_center = fe_midpoint_value.quadrature_point(0);
-
-
+ const Point<dim>
+ neighbor_center = fe_midpoint_value.quadrature_point(0);
+
+
// vector for the
// normalized
// direction between
// the centers of two
// cells
- Point<dim> y = neighbor_center - this_center;
- const double distance = std::sqrt(y.square());
+ Point<dim> y = neighbor_center - this_center;
+ const double distance = std::sqrt(y.square());
// normalize y
- y /= distance;
+ y /= distance;
// *** note that unlike in
// the docs, y denotes the
// normalized vector
// of the two cells, rather
// than the normal
// difference! ***
-
+
// add up the
// contribution of
// this cell to Y
- for (unsigned int i=0; i<dim; ++i)
- for (unsigned int j=0; j<dim; ++j)
- Y[i][j] += y[i] * y[j];
-
+ for (unsigned int i=0; i<dim; ++i)
+ for (unsigned int j=0; j<dim; ++j)
+ Y[i][j] += y[i] * y[j];
+
// then update the sum
// of difference
// quotients
- typename DerivativeDescription::ProjectedDerivative
- projected_finite_difference
- = (neighbor_midpoint_value -
- this_midpoint_value);
- projected_finite_difference /= distance;
-
- typename DerivativeDescription::Derivative projected_derivative_update;
- outer_product (projected_derivative_update,
- y,
- projected_finite_difference);
- projected_derivative += projected_derivative_update;
- };
+ typename DerivativeDescription::ProjectedDerivative
+ projected_finite_difference
+ = (neighbor_midpoint_value -
+ this_midpoint_value);
+ projected_finite_difference /= distance;
+
+ typename DerivativeDescription::Derivative projected_derivative_update;
+ outer_product (projected_derivative_update,
+ y,
+ projected_finite_difference);
+ projected_derivative += projected_derivative_update;
+ };
// can we determine an
// approximation of the
// otherwise we would not have
// all components of the
// gradient
- AssertThrow (determinant(Y) != 0,
- ExcInsufficientDirections());
-
+ AssertThrow (determinant(Y) != 0,
+ ExcInsufficientDirections());
+
// compute Y^-1 g
- const Tensor<2,dim> Y_inverse = invert(Y);
-
- contract (derivative, Y_inverse, projected_derivative);
-
+ const Tensor<2,dim> Y_inverse = invert(Y);
+
+ contract (derivative, Y_inverse, projected_derivative);
+
// finally symmetrize the derivative
- DerivativeDescription::symmetrize (derivative);
+ DerivativeDescription::symmetrize (derivative);
}
}
-// --------------------------------------------------------------------
-
-// explicit instantiations
-#define INSTANTIATE(InputVector,DH) \
-template \
-void \
-DerivativeApproximation:: \
-approximate_gradient<deal_II_dimension> \
-(const Mapping<deal_II_dimension> &mapping, \
- const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- Vector<float> &derivative_norm, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_gradient<deal_II_dimension> \
-(const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- Vector<float> &derivative_norm, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_second_derivative<deal_II_dimension> \
-(const Mapping<deal_II_dimension> &mapping, \
- const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- Vector<float> &derivative_norm, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_second_derivative<deal_II_dimension> \
-(const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- Vector<float> &derivative_norm, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_derivative_tensor<deal_II_dimension> \
-(const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- const DH<deal_II_dimension>::active_cell_iterator &cell,\
- Tensor<1,deal_II_dimension> &derivative, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_derivative_tensor<deal_II_dimension> \
-(const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- const DH<deal_II_dimension>::active_cell_iterator &cell,\
- Tensor<2,deal_II_dimension> &derivative, \
- const unsigned int component); \
- \
-template \
-void \
-DerivativeApproximation:: \
-approximate_derivative_tensor<deal_II_dimension> \
-(const DH<deal_II_dimension> &dof_handler, \
- const InputVector &solution, \
- const DH<deal_II_dimension>::active_cell_iterator &cell,\
- Tensor<3,deal_II_dimension> &derivative, \
- const unsigned int component)
-
-
-INSTANTIATE(Vector<double>, DoFHandler);
-INSTANTIATE(Vector<float>, DoFHandler);
-INSTANTIATE(BlockVector<double>, DoFHandler);
-INSTANTIATE(BlockVector<float>, DoFHandler);
-
-INSTANTIATE(Vector<double>, hp::DoFHandler);
-INSTANTIATE(Vector<float>, hp::DoFHandler);
-INSTANTIATE(BlockVector<double>, hp::DoFHandler);
-INSTANTIATE(BlockVector<float>, hp::DoFHandler);
-
-#ifdef DEAL_II_USE_PETSC
-INSTANTIATE(PETScWrappers::Vector, DoFHandler);
-INSTANTIATE(PETScWrappers::BlockVector, DoFHandler);
-
-INSTANTIATE(PETScWrappers::Vector, hp::DoFHandler);
-INSTANTIATE(PETScWrappers::BlockVector, hp::DoFHandler);
-#endif
-
-#undef INSTANTIATE
-
-template
-double
-DerivativeApproximation::
-derivative_norm(const Tensor<1,deal_II_dimension> &derivative);
-
-template
-double
-DerivativeApproximation::
-derivative_norm(const Tensor<2,deal_II_dimension> &derivative);
-
-template
-double
-DerivativeApproximation::
-derivative_norm(const Tensor<3,deal_II_dimension> &derivative);
+// --------------------------- explicit instantiations ---------------------
+#include "derivative_approximation.inst"
-// static variables
-//
-// on AIX, the linker is unhappy about some missing symbols. they
-// should really be there, but explicitly instantiating them will also
-// not hurt
-template
-const UpdateFlags
-DerivativeApproximation::Gradient<deal_II_dimension>::update_flags;
-
-template
-const UpdateFlags
-DerivativeApproximation::SecondDerivative<deal_II_dimension>::update_flags;
-template
-const UpdateFlags
-DerivativeApproximation::ThirdDerivative<deal_II_dimension>::update_flags;
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+#define INSTANTIATE(InputVector,DH) \
+template \
+void \
+DerivativeApproximation:: \
+approximate_gradient<deal_II_dimension> \
+(const Mapping<deal_II_dimension> &mapping, \
+ const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ Vector<float> &derivative_norm, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_gradient<deal_II_dimension> \
+(const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ Vector<float> &derivative_norm, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_second_derivative<deal_II_dimension> \
+(const Mapping<deal_II_dimension> &mapping, \
+ const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ Vector<float> &derivative_norm, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_second_derivative<deal_II_dimension> \
+(const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ Vector<float> &derivative_norm, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_derivative_tensor<deal_II_dimension> \
+(const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ const DH<deal_II_dimension>::active_cell_iterator &cell,\
+ Tensor<1,deal_II_dimension> &derivative, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_derivative_tensor<deal_II_dimension> \
+(const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ const DH<deal_II_dimension>::active_cell_iterator &cell,\
+ Tensor<2,deal_II_dimension> &derivative, \
+ const unsigned int component); \
+ \
+template \
+void \
+DerivativeApproximation:: \
+approximate_derivative_tensor<deal_II_dimension> \
+(const DH<deal_II_dimension> &dof_handler, \
+ const InputVector &solution, \
+ const DH<deal_II_dimension>::active_cell_iterator &cell,\
+ Tensor<3,deal_II_dimension> &derivative, \
+ const unsigned int component)
+
+
+INSTANTIATE(Vector<double>, DoFHandler);
+INSTANTIATE(Vector<float>, DoFHandler);
+INSTANTIATE(BlockVector<double>, DoFHandler);
+INSTANTIATE(BlockVector<float>, DoFHandler);
+
+INSTANTIATE(Vector<double>, hp::DoFHandler);
+INSTANTIATE(Vector<float>, hp::DoFHandler);
+INSTANTIATE(BlockVector<double>, hp::DoFHandler);
+INSTANTIATE(BlockVector<float>, hp::DoFHandler);
+
+#ifdef DEAL_II_USE_PETSC
+INSTANTIATE(PETScWrappers::Vector, DoFHandler);
+INSTANTIATE(PETScWrappers::BlockVector, DoFHandler);
+
+INSTANTIATE(PETScWrappers::Vector, hp::DoFHandler);
+INSTANTIATE(PETScWrappers::BlockVector, hp::DoFHandler);
+#endif
+
+#undef INSTANTIATE
+
+template
+double
+DerivativeApproximation::
+derivative_norm(const Tensor<1,deal_II_dimension> &derivative);
+
+template
+double
+DerivativeApproximation::
+derivative_norm(const Tensor<2,deal_II_dimension> &derivative);
+
+template
+double
+DerivativeApproximation::
+derivative_norm(const Tensor<3,deal_II_dimension> &derivative);
+
+
+// static variables
+//
+// on AIX, the linker is unhappy about some missing symbols. they
+// should really be there, but explicitly instantiating them will also
+// not hurt
+template
+const UpdateFlags
+DerivativeApproximation::Gradient<deal_II_dimension>::update_flags;
+
+template
+const UpdateFlags
+DerivativeApproximation::SecondDerivative<deal_II_dimension>::update_flags;
+template
+const UpdateFlags
+DerivativeApproximation::ThirdDerivative<deal_II_dimension>::update_flags;
+}
-#if deal_II_dimension == 1
template <int spacedim>
}
-#else // #if deal_II_dimension !=1
-#endif
// explicit instantiations
-#if deal_II_dimension != 1
-template class KellyErrorEstimator<deal_II_dimension, deal_II_dimension>;
-#endif
-
-// instantiate the externally visible functions. define a list of functions
-// for vectors, where the vector/matrix can be replaced using a preprocessor
-// variable VectorType/MatrixType
-#define INSTANTIATE_1(InputVector,DH,Q) \
-template \
-void \
-KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
-estimate<InputVector,DH > (const Mapping<deal_II_dimension, deal_II_dimension> &, \
- const DH &, \
- const Q<deal_II_dimension-1> &, \
- const FunctionMap<deal_II_dimension>::type &, \
- const InputVector &, \
- Vector<float> &, \
- const std::vector<bool> &, \
- const Function<deal_II_dimension> *, \
- const unsigned int , \
- const unsigned int , \
- const unsigned int); \
- \
-template \
-void \
-KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
-estimate<InputVector,DH > (const DH &, \
- const Q<deal_II_dimension-1> &, \
- const FunctionMap<deal_II_dimension>::type &, \
- const InputVector &, \
- Vector<float> &, \
- const std::vector<bool> &, \
- const Function<deal_II_dimension> *, \
- const unsigned int , \
- const unsigned int , \
- const unsigned int); \
- \
-template \
-void \
-KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
-estimate<InputVector,DH > (const Mapping<deal_II_dimension, deal_II_dimension> &, \
- const DH &, \
- const Q<deal_II_dimension-1> &, \
- const FunctionMap<deal_II_dimension>::type &, \
- const std::vector<const InputVector *> &, \
- std::vector<Vector<float>*> &, \
- const std::vector<bool> &, \
- const Function<deal_II_dimension> *, \
- const unsigned int , \
- const unsigned int , \
- const unsigned int); \
- \
-template \
-void \
-KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
-estimate<InputVector,DH > (const DH &, \
- const Q<deal_II_dimension-1> &, \
- const FunctionMap<deal_II_dimension>::type &, \
- const std::vector<const InputVector *> &, \
- std::vector<Vector<float>*> &, \
- const std::vector<bool> &, \
- const Function<deal_II_dimension> *, \
- const unsigned int , \
- const unsigned int , \
- const unsigned int)
-
-#define INSTANTIATE(InputVector,DH) \
- INSTANTIATE_1(InputVector,DH,Quadrature); \
- INSTANTIATE_1(InputVector,DH,hp::QCollection)
-
-
-INSTANTIATE(Vector<double>,DoFHandler<deal_II_dimension>);
-INSTANTIATE(Vector<float>,DoFHandler<deal_II_dimension>);
-INSTANTIATE(BlockVector<double>,DoFHandler<deal_II_dimension>);
-INSTANTIATE(BlockVector<float>,DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(Vector<double>,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(Vector<float>,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(BlockVector<double>,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(BlockVector<float>,hp::DoFHandler<deal_II_dimension>);
-
-#ifdef DEAL_II_USE_PETSC
-INSTANTIATE(PETScWrappers::Vector,DoFHandler<deal_II_dimension>);
-INSTANTIATE(PETScWrappers::BlockVector,DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(PETScWrappers::Vector,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(PETScWrappers::BlockVector,hp::DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(PETScWrappers::MPI::Vector,DoFHandler<deal_II_dimension>);
-INSTANTIATE(PETScWrappers::MPI::BlockVector,DoFHandler<deal_II_dimension>);
-
-#endif
-
-#ifdef DEAL_II_USE_TRILINOS
-INSTANTIATE(TrilinosWrappers::Vector,DoFHandler<deal_II_dimension>);
-INSTANTIATE(TrilinosWrappers::BlockVector,DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(TrilinosWrappers::Vector,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(TrilinosWrappers::BlockVector,hp::DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(TrilinosWrappers::MPI::Vector,DoFHandler<deal_II_dimension>);
-INSTANTIATE(TrilinosWrappers::MPI::BlockVector,DoFHandler<deal_II_dimension>);
-
-INSTANTIATE(TrilinosWrappers::MPI::Vector,hp::DoFHandler<deal_II_dimension>);
-INSTANTIATE(TrilinosWrappers::MPI::BlockVector,hp::DoFHandler<deal_II_dimension>);
-#endif
-
-#undef INSTANTIATE
-#undef INSTANTIATE_1
+#include "error_estimator.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+#if deal_II_dimension != 1
+template class KellyErrorEstimator<deal_II_dimension, deal_II_dimension>;
+#endif
+
+// instantiate the externally visible functions. define a list of functions
+// for vectors, where the vector/matrix can be replaced using a preprocessor
+// variable VectorType/MatrixType
+#define INSTANTIATE_1(InputVector,DH,Q) \
+template \
+void \
+KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
+estimate<InputVector,DH > (const Mapping<deal_II_dimension, deal_II_dimension> &, \
+ const DH &, \
+ const Q<deal_II_dimension-1> &, \
+ const FunctionMap<deal_II_dimension>::type &, \
+ const InputVector &, \
+ Vector<float> &, \
+ const std::vector<bool> &, \
+ const Function<deal_II_dimension> *, \
+ const unsigned int , \
+ const unsigned int , \
+ const unsigned int); \
+ \
+template \
+void \
+KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
+estimate<InputVector,DH > (const DH &, \
+ const Q<deal_II_dimension-1> &, \
+ const FunctionMap<deal_II_dimension>::type &, \
+ const InputVector &, \
+ Vector<float> &, \
+ const std::vector<bool> &, \
+ const Function<deal_II_dimension> *, \
+ const unsigned int , \
+ const unsigned int , \
+ const unsigned int); \
+ \
+template \
+void \
+KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
+estimate<InputVector,DH > (const Mapping<deal_II_dimension, deal_II_dimension> &, \
+ const DH &, \
+ const Q<deal_II_dimension-1> &, \
+ const FunctionMap<deal_II_dimension>::type &, \
+ const std::vector<const InputVector *> &, \
+ std::vector<Vector<float>*> &, \
+ const std::vector<bool> &, \
+ const Function<deal_II_dimension> *, \
+ const unsigned int , \
+ const unsigned int , \
+ const unsigned int); \
+ \
+template \
+void \
+KellyErrorEstimator<deal_II_dimension, deal_II_dimension>:: \
+estimate<InputVector,DH > (const DH &, \
+ const Q<deal_II_dimension-1> &, \
+ const FunctionMap<deal_II_dimension>::type &, \
+ const std::vector<const InputVector *> &, \
+ std::vector<Vector<float>*> &, \
+ const std::vector<bool> &, \
+ const Function<deal_II_dimension> *, \
+ const unsigned int , \
+ const unsigned int , \
+ const unsigned int)
+
+#define INSTANTIATE(InputVector,DH) \
+ INSTANTIATE_1(InputVector,DH,Quadrature); \
+ INSTANTIATE_1(InputVector,DH,hp::QCollection)
+
+
+INSTANTIATE(Vector<double>,DoFHandler<deal_II_dimension>);
+INSTANTIATE(Vector<float>,DoFHandler<deal_II_dimension>);
+INSTANTIATE(BlockVector<double>,DoFHandler<deal_II_dimension>);
+INSTANTIATE(BlockVector<float>,DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(Vector<double>,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(Vector<float>,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(BlockVector<double>,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(BlockVector<float>,hp::DoFHandler<deal_II_dimension>);
+
+#ifdef DEAL_II_USE_PETSC
+INSTANTIATE(PETScWrappers::Vector,DoFHandler<deal_II_dimension>);
+INSTANTIATE(PETScWrappers::BlockVector,DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(PETScWrappers::Vector,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(PETScWrappers::BlockVector,hp::DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(PETScWrappers::MPI::Vector,DoFHandler<deal_II_dimension>);
+INSTANTIATE(PETScWrappers::MPI::BlockVector,DoFHandler<deal_II_dimension>);
+
+#endif
+
+#ifdef DEAL_II_USE_TRILINOS
+INSTANTIATE(TrilinosWrappers::Vector,DoFHandler<deal_II_dimension>);
+INSTANTIATE(TrilinosWrappers::BlockVector,DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(TrilinosWrappers::Vector,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(TrilinosWrappers::BlockVector,hp::DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(TrilinosWrappers::MPI::Vector,DoFHandler<deal_II_dimension>);
+INSTANTIATE(TrilinosWrappers::MPI::BlockVector,DoFHandler<deal_II_dimension>);
+
+INSTANTIATE(TrilinosWrappers::MPI::Vector,hp::DoFHandler<deal_II_dimension>);
+INSTANTIATE(TrilinosWrappers::MPI::BlockVector,hp::DoFHandler<deal_II_dimension>);
+#endif
+
+#undef INSTANTIATE
+#undef INSTANTIATE_1
+}
//---------------------------------------------------------------------------
-for (VECTOR : SERIAL_VECTORS)
+for (VECTOR : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
{
template class FEFieldFunction<deal_II_dimension,
DoFHandler<deal_II_dimension>,
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2008 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <numerics/matrices.h>
-#include <lac/full_matrix.h>
-#include <lac/vector.h>
-#include <lac/block_vector.h>
-#include <lac/sparse_matrix.h>
-#include <lac/block_sparse_matrix.h>
-
-#ifdef DEAL_II_USE_PETSC
-# include <lac/petsc_parallel_sparse_matrix.h>
-# include <lac/petsc_sparse_matrix.h>
-# include <lac/petsc_parallel_vector.h>
-# include <lac/petsc_vector.h>
-# include <lac/petsc_parallel_block_sparse_matrix.h>
-#endif
-
-#ifdef DEAL_II_USE_TRILINOS
-# include <lac/trilinos_sparse_matrix.h>
-# include <lac/trilinos_vector.h>
-# include <lac/trilinos_block_sparse_matrix.h>
-# include <lac/trilinos_block_vector.h>
-#endif
-
-#include <algorithm>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-//TODO:[WB] I don't think that the optimized storage of diagonals is needed (GK)
-template <typename number>
-void
-MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- SparseMatrix<number> &matrix,
- Vector<number> &solution,
- Vector<number> &right_hand_side,
- const bool eliminate_columns)
-{
- // Require that diagonals are first
- // in each row
- Assert (matrix.get_sparsity_pattern().optimize_diagonal(),
- typename SparsityPattern::ExcDiagonalNotOptimized());
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.n(), solution.size()));
- // if no boundary values are to be applied
- // simply return
- if (boundary_values.size() == 0)
- return;
-
-
- const unsigned int n_dofs = matrix.m();
-
- // if a diagonal entry is zero
- // later, then we use another
- // number instead. take it to be
- // the first nonzero diagonal
- // element of the matrix, or 1 if
- // there is no such thing
- number first_nonzero_diagonal_entry = 1;
- for (unsigned int i=0; i<n_dofs; ++i)
- if (matrix.diag_element(i) != 0)
- {
- first_nonzero_diagonal_entry = matrix.diag_element(i);
- break;
- }
-
-
- std::map<unsigned int,double>::const_iterator dof = boundary_values.begin(),
- endd = boundary_values.end();
- const SparsityPattern &sparsity = matrix.get_sparsity_pattern();
- const std::size_t *sparsity_rowstart = sparsity.get_rowstart_indices();
- const unsigned int *sparsity_colnums = sparsity.get_column_numbers();
- for (; dof != endd; ++dof)
- {
- Assert (dof->first < n_dofs, ExcInternalError());
-
- const unsigned int dof_number = dof->first;
- // for each boundary dof:
-
- // set entries of this line
- // to zero except for the diagonal
- // entry. Note that the diagonal
- // entry is always the first one
- // for square matrices, i.e.
- // we shall not set
- // matrix.global_entry(
- // sparsity_rowstart[dof.first])
- const unsigned int last = sparsity_rowstart[dof_number+1];
- for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
- matrix.global_entry(j) = 0.;
-
-
- // set right hand side to
- // wanted value: if main diagonal
- // entry nonzero, don't touch it
- // and scale rhs accordingly. If
- // zero, take the first main
- // diagonal entry we can find, or
- // one if no nonzero main diagonal
- // element exists. Normally, however,
- // the main diagonal entry should
- // not be zero.
- //
- // store the new rhs entry to make
- // the gauss step more efficient
- number new_rhs;
- if (matrix.diag_element(dof_number) != 0.0)
- {
- new_rhs = dof->second * matrix.diag_element(dof_number);
- right_hand_side(dof_number) = new_rhs;
- }
- else
- {
- matrix.set (dof_number, dof_number,
- first_nonzero_diagonal_entry);
- new_rhs = dof->second * first_nonzero_diagonal_entry;
- right_hand_side(dof_number) = new_rhs;
- }
-
-
- // if the user wants to have
- // the symmetry of the matrix
- // preserved, and if the
- // sparsity pattern is
- // symmetric, then do a Gauss
- // elimination step with the
- // present row
- if (eliminate_columns)
- {
- // store the only nonzero entry
- // of this line for the Gauss
- // elimination step
- const number diagonal_entry = matrix.diag_element(dof_number);
-
- // we have to loop over all
- // rows of the matrix which
- // have a nonzero entry in
- // the column which we work
- // in presently. if the
- // sparsity pattern is
- // symmetric, then we can
- // get the positions of
- // these rows cheaply by
- // looking at the nonzero
- // column numbers of the
- // present row. we need not
- // look at the first entry,
- // since that is the
- // diagonal element and
- // thus the present row
- for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
- {
- const unsigned int row = sparsity_colnums[j];
-
- // find the position of
- // element
- // (row,dof_number)
- const unsigned int *
- p = std::lower_bound(&sparsity_colnums[sparsity_rowstart[row]+1],
- &sparsity_colnums[sparsity_rowstart[row+1]],
- dof_number);
-
- // check whether this line has
- // an entry in the regarding column
- // (check for ==dof_number and
- // != next_row, since if
- // row==dof_number-1, *p is a
- // past-the-end pointer but points
- // to dof_number anyway...)
- //
- // there should be such an entry!
- Assert ((*p == dof_number) &&
- (p != &sparsity_colnums[sparsity_rowstart[row+1]]),
- ExcInternalError());
-
- const unsigned int global_entry
- = (p - &sparsity_colnums[sparsity_rowstart[0]]);
-
- // correct right hand side
- right_hand_side(row) -= matrix.global_entry(global_entry) /
- diagonal_entry * new_rhs;
-
- // set matrix entry to zero
- matrix.global_entry(global_entry) = 0.;
- }
- }
-
- // preset solution vector
- solution(dof_number) = dof->second;
- }
-}
-
-
-
-template <typename number>
-void
-MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- BlockSparseMatrix<number> &matrix,
- BlockVector<number> &solution,
- BlockVector<number> &right_hand_side,
- const bool eliminate_columns)
-{
- const unsigned int blocks = matrix.n_block_rows();
-
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.n(), solution.size()));
- Assert (matrix.n_block_rows() == matrix.n_block_cols(),
- ExcNotQuadratic());
- Assert (matrix.get_sparsity_pattern().get_row_indices() ==
- matrix.get_sparsity_pattern().get_column_indices(),
- ExcNotQuadratic());
- Assert (matrix.get_sparsity_pattern().get_column_indices() ==
- solution.get_block_indices (),
- ExcBlocksDontMatch ());
- Assert (matrix.get_sparsity_pattern().get_row_indices() ==
- right_hand_side.get_block_indices (),
- ExcBlocksDontMatch ());
-
- for (unsigned int i=0; i<blocks; ++i)
- Assert (matrix.block(i,i).get_sparsity_pattern().optimize_diagonal(),
- SparsityPattern::ExcDiagonalNotOptimized());
-
-
- // if no boundary values are to be applied
- // simply return
- if (boundary_values.size() == 0)
- return;
-
-
- const unsigned int n_dofs = matrix.m();
-
- // if a diagonal entry is zero
- // later, then we use another
- // number instead. take it to be
- // the first nonzero diagonal
- // element of the matrix, or 1 if
- // there is no such thing
- number first_nonzero_diagonal_entry = 0;
- for (unsigned int diag_block=0; diag_block<blocks; ++diag_block)
- {
- for (unsigned int i=0; i<matrix.block(diag_block,diag_block).n(); ++i)
- if (matrix.block(diag_block,diag_block).diag_element(i) != 0)
- {
- first_nonzero_diagonal_entry
- = matrix.block(diag_block,diag_block).diag_element(i);
- break;
- }
- // check whether we have found
- // something in the present
- // block
- if (first_nonzero_diagonal_entry != 0)
- break;
- }
- // nothing found on all diagonal
- // blocks? if so, use 1.0 instead
- if (first_nonzero_diagonal_entry == 0)
- first_nonzero_diagonal_entry = 1;
-
-
- std::map<unsigned int,double>::const_iterator dof = boundary_values.begin(),
- endd = boundary_values.end();
- const BlockSparsityPattern &
- sparsity_pattern = matrix.get_sparsity_pattern();
-
- // pointer to the mapping between
- // global and block indices. since
- // the row and column mappings are
- // equal, store a pointer on only
- // one of them
- const BlockIndices &
- index_mapping = sparsity_pattern.get_column_indices();
-
- // now loop over all boundary dofs
- for (; dof != endd; ++dof)
- {
- Assert (dof->first < n_dofs, ExcInternalError());
-
- // get global index and index
- // in the block in which this
- // dof is located
- const unsigned int dof_number = dof->first;
- const std::pair<unsigned int,unsigned int>
- block_index = index_mapping.global_to_local (dof_number);
-
- // for each boundary dof:
-
- // set entries of this line
- // to zero except for the diagonal
- // entry. Note that the diagonal
- // entry is always the first one
- // for square matrices, i.e.
- // we shall not set
- // matrix.global_entry(
- // sparsity_rowstart[dof.first])
- // of the diagonal block
- for (unsigned int block_col=0; block_col<blocks; ++block_col)
- {
- const SparsityPattern &
- local_sparsity = sparsity_pattern.block(block_index.first,
- block_col);
-
- // find first and last
- // entry in the present row
- // of the present
- // block. exclude the main
- // diagonal element, which
- // is the diagonal element
- // of a diagonal block,
- // which must be a square
- // matrix so the diagonal
- // element is the first of
- // this row.
- const unsigned int
- last = local_sparsity.get_rowstart_indices()[block_index.second+1],
- first = (block_col == block_index.first ?
- local_sparsity.get_rowstart_indices()[block_index.second]+1 :
- local_sparsity.get_rowstart_indices()[block_index.second]);
-
- for (unsigned int j=first; j<last; ++j)
- matrix.block(block_index.first,block_col).global_entry(j) = 0.;
- }
-
-
- // set right hand side to
- // wanted value: if main diagonal
- // entry nonzero, don't touch it
- // and scale rhs accordingly. If
- // zero, take the first main
- // diagonal entry we can find, or
- // one if no nonzero main diagonal
- // element exists. Normally, however,
- // the main diagonal entry should
- // not be zero.
- //
- // store the new rhs entry to make
- // the gauss step more efficient
- number new_rhs;
- if (matrix.block(block_index.first, block_index.first)
- .diag_element(block_index.second) != 0.0)
- new_rhs = dof->second *
- matrix.block(block_index.first, block_index.first)
- .diag_element(block_index.second);
- else
- {
- matrix.block(block_index.first, block_index.first)
- .diag_element(block_index.second)
- = first_nonzero_diagonal_entry;
- new_rhs = dof->second * first_nonzero_diagonal_entry;
- }
- right_hand_side.block(block_index.first)(block_index.second)
- = new_rhs;
-
-
- // if the user wants to have
- // the symmetry of the matrix
- // preserved, and if the
- // sparsity pattern is
- // symmetric, then do a Gauss
- // elimination step with the
- // present row. this is a
- // little more complicated for
- // block matrices.
- if (eliminate_columns)
- {
- // store the only nonzero entry
- // of this line for the Gauss
- // elimination step
- const number diagonal_entry
- = matrix.block(block_index.first,block_index.first)
- .diag_element(block_index.second);
-
- // we have to loop over all
- // rows of the matrix which
- // have a nonzero entry in
- // the column which we work
- // in presently. if the
- // sparsity pattern is
- // symmetric, then we can
- // get the positions of
- // these rows cheaply by
- // looking at the nonzero
- // column numbers of the
- // present row.
- //
- // note that if we check
- // whether row @p{row} in
- // block (r,c) is non-zero,
- // then we have to check
- // for the existence of
- // column @p{row} in block
- // (c,r), i.e. of the
- // transpose block
- for (unsigned int block_row=0; block_row<blocks; ++block_row)
- {
- // get pointers to the
- // sparsity patterns of
- // this block and of
- // the transpose one
- const SparsityPattern &this_sparsity
- = sparsity_pattern.block (block_row, block_index.first);
- const SparsityPattern &transpose_sparsity
- = sparsity_pattern.block (block_index.first, block_row);
-
- // traverse the row of
- // the transpose block
- // to find the
- // interesting rows in
- // the present block.
- // don't use the
- // diagonal element of
- // the diagonal block
- const unsigned int
- first = (block_index.first == block_row ?
- transpose_sparsity.get_rowstart_indices()[block_index.second]+1 :
- transpose_sparsity.get_rowstart_indices()[block_index.second]),
- last = transpose_sparsity.get_rowstart_indices()[block_index.second+1];
-
- for (unsigned int j=first; j<last; ++j)
- {
- // get the number
- // of the column in
- // this row in
- // which a nonzero
- // entry is. this
- // is also the row
- // of the transpose
- // block which has
- // an entry in the
- // interesting row
- const unsigned int row = transpose_sparsity.get_column_numbers()[j];
-
- // find the
- // position of
- // element
- // (row,dof_number)
- // in this block
- // (not in the
- // transpose
- // one). note that
- // we have to take
- // care of special
- // cases with
- // square
- // sub-matrices
- const unsigned int *p = 0;
- if (this_sparsity.n_rows() == this_sparsity.n_cols())
- {
- if (this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]]
- ==
- block_index.second)
- p = &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]];
- else
- p = std::lower_bound(&this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]+1],
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]],
- block_index.second);
- }
- else
- p = std::lower_bound(&this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row]],
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]],
- block_index.second);
-
- // check whether this line has
- // an entry in the regarding column
- // (check for ==dof_number and
- // != next_row, since if
- // row==dof_number-1, *p is a
- // past-the-end pointer but points
- // to dof_number anyway...)
- //
- // there should be
- // such an entry!
- // note, however,
- // that this
- // assertion will
- // fail sometimes
- // if the sparsity
- // pattern is not
- // symmetric!
- Assert ((*p == block_index.second) &&
- (p != &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[row+1]]),
- ExcInternalError());
-
- const unsigned int global_entry
- = (p
- -
- &this_sparsity.get_column_numbers()
- [this_sparsity.get_rowstart_indices()[0]]);
-
- // correct right hand side
- right_hand_side.block(block_row)(row)
- -= matrix.block(block_row,block_index.first).global_entry(global_entry) /
- diagonal_entry * new_rhs;
-
- // set matrix entry to zero
- matrix.block(block_row,block_index.first).global_entry(global_entry) = 0.;
- }
- }
- }
-
- // preset solution vector
- solution.block(block_index.first)(block_index.second) = dof->second;
- }
-}
-
-
-
-#ifdef DEAL_II_USE_PETSC
-
-namespace PETScWrappers
-{
- template <typename PETScMatrix, typename PETScVector>
- void
- apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- PETScMatrix &matrix,
- PETScVector &solution,
- PETScVector &right_hand_side,
- const bool eliminate_columns)
- {
- Assert (eliminate_columns == false, ExcNotImplemented());
-
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.n(), solution.size()));
-
- // if no boundary values are to be applied
- // simply return
- if (boundary_values.size() == 0)
- return;
-
- const std::pair<unsigned int, unsigned int> local_range
- = matrix.local_range();
- Assert (local_range == right_hand_side.local_range(),
- ExcInternalError());
- Assert (local_range == solution.local_range(),
- ExcInternalError());
-
-
- // we have to read and write from this
- // matrix (in this order). this will only
- // work if we compress the matrix first,
- // done here
- matrix.compress ();
-
- // determine the first nonzero diagonal
- // entry from within the part of the
- // matrix that we can see. if we can't
- // find such an entry, take one
- PetscScalar average_nonzero_diagonal_entry = 1;
- for (unsigned int i=local_range.first; i<local_range.second; ++i)
- if (matrix.diag_element(i) != 0)
- {
- average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
- break;
- }
-
- // figure out which rows of the matrix we
- // have to eliminate on this processor
- std::vector<unsigned int> constrained_rows;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- constrained_rows.push_back (dof->first);
-
- // then eliminate these rows and set
- // their diagonal entry to what we have
- // determined above. note that for petsc
- // matrices interleaving read with write
- // operations is very expensive. thus, we
- // here always replace the diagonal
- // element, rather than first checking
- // whether it is nonzero and in that case
- // preserving it. this is different from
- // the case of deal.II sparse matrices
- // treated in the other functions.
- matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
-
- // the next thing is to set right hand
- // side to the wanted value. there's one
- // drawback: if we write to individual
- // vector elements, then we have to do
- // that on all processors. however, some
- // processors may not need to set
- // anything because their chunk of
- // matrix/rhs do not contain any boundary
- // nodes. therefore, rather than using
- // individual calls, we use one call for
- // all elements, thereby making sure that
- // all processors call this function,
- // even if some only have an empty set of
- // elements to set
- right_hand_side.compress ();
- solution.compress ();
-
- std::vector<unsigned int> indices;
- std::vector<PetscScalar> solution_values;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- {
- indices.push_back (dof->first);
- solution_values.push_back (dof->second);
- }
- solution.set (indices, solution_values);
-
- // now also set appropriate values for
- // the rhs
- for (unsigned int i=0; i<solution_values.size(); ++i)
- solution_values[i] *= average_nonzero_diagonal_entry;
-
- right_hand_side.set (indices, solution_values);
-
- // clean up
- matrix.compress ();
- solution.compress ();
- right_hand_side.compress ();
- }
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- PETScWrappers::SparseMatrix &matrix,
- PETScWrappers::Vector &solution,
- PETScWrappers::Vector &right_hand_side,
- const bool eliminate_columns)
-{
- // simply redirect to the generic function
- // used for both petsc matrix types
- PETScWrappers::apply_boundary_values (boundary_values, matrix, solution,
- right_hand_side, eliminate_columns);
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- PETScWrappers::MPI::SparseMatrix &matrix,
- PETScWrappers::MPI::Vector &solution,
- PETScWrappers::MPI::Vector &right_hand_side,
- const bool eliminate_columns)
-{
- // simply redirect to the generic function
- // used for both petsc matrix types
- PETScWrappers::apply_boundary_values (boundary_values, matrix, solution,
- right_hand_side, eliminate_columns);
-
- // compress the matrix once we're done
- matrix.compress ();
-}
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- PETScWrappers::MPI::BlockSparseMatrix &matrix,
- PETScWrappers::MPI::BlockVector &solution,
- PETScWrappers::MPI::BlockVector &right_hand_side,
- const bool eliminate_columns)
-{
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.n(), solution.size()));
- Assert (matrix.n_block_rows() == matrix.n_block_cols(),
- ExcNotQuadratic());
-
- const unsigned int n_blocks = matrix.n_block_rows();
-
- matrix.compress();
-
- // We need to find the subdivision
- // into blocks for the boundary values.
- // To this end, generate a vector of
- // maps with the respective indices.
- std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
- {
- int offset = 0, block=0;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- {
- if (dof->first >= matrix.block(block,0).m() + offset)
- {
- offset += matrix.block(block,0).m();
- block++;
- }
- const unsigned int index = dof->first - offset;
- block_boundary_values[block].insert(std::pair<unsigned int, double> (index,dof->second));
- }
- }
-
- // Now call the non-block variants on
- // the diagonal subblocks and the
- // solution/rhs.
- for (unsigned int block=0; block<n_blocks; ++block)
- PETScWrappers::apply_boundary_values(block_boundary_values[block],
- matrix.block(block,block),
- solution.block(block),
- right_hand_side.block(block),
- eliminate_columns);
-
- // Finally, we need to do something
- // about the off-diagonal matrices. This
- // is luckily not difficult. Just clear
- // the whole row.
- for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
- {
- const std::pair<unsigned int, unsigned int> local_range
- = matrix.block(block_m,0).local_range();
-
- std::vector<unsigned int> constrained_rows;
- for (std::map<unsigned int,double>::const_iterator
- dof = block_boundary_values[block_m].begin();
- dof != block_boundary_values[block_m].end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- constrained_rows.push_back (dof->first);
-
- for (unsigned int block_n=0; block_n<n_blocks; ++block_n)
- if (block_m != block_n)
- matrix.block(block_m,block_n).clear_rows(constrained_rows);
- }
-}
-
-#endif
-
-
-
-#ifdef DEAL_II_USE_TRILINOS
-
-namespace TrilinosWrappers
-{
- template <typename TrilinosMatrix, typename TrilinosVector>
- void
- apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosMatrix &matrix,
- TrilinosVector &solution,
- TrilinosVector &right_hand_side,
- const bool eliminate_columns)
- {
- Assert (eliminate_columns == false, ExcNotImplemented());
-
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.m(), solution.size()));
-
- // if no boundary values are to be applied
- // simply return
- if (boundary_values.size() == 0)
- return;
-
- const std::pair<unsigned int, unsigned int> local_range
- = matrix.local_range();
- Assert (local_range == right_hand_side.local_range(),
- ExcInternalError());
- Assert (local_range == solution.local_range(),
- ExcInternalError());
-
- // we have to read and write from this
- // matrix (in this order). this will only
- // work if we compress the matrix first,
- // done here
- matrix.compress ();
-
- // determine the first nonzero diagonal
- // entry from within the part of the
- // matrix that we can see. if we can't
- // find such an entry, take one
- TrilinosScalar average_nonzero_diagonal_entry = 1;
- for (unsigned int i=local_range.first; i<local_range.second; ++i)
- if (matrix.diag_element(i) != 0)
- {
- average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
- break;
- }
-
- // figure out which rows of the matrix we
- // have to eliminate on this processor
- std::vector<unsigned int> constrained_rows;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- constrained_rows.push_back (dof->first);
-
- // then eliminate these rows and
- // set their diagonal entry to
- // what we have determined
- // above. if the value already is
- // nonzero, it will be preserved,
- // in accordance with the basic
- // matrix classes in deal.II.
- matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
-
- // the next thing is to set right
- // hand side to the wanted
- // value. there's one drawback:
- // if we write to individual
- // vector elements, then we have
- // to do that on all
- // processors. however, some
- // processors may not need to set
- // anything because their chunk
- // of matrix/rhs do not contain
- // any boundary nodes. therefore,
- // rather than using individual
- // calls, we use one call for all
- // elements, thereby making sure
- // that all processors call this
- // function, even if some only
- // have an empty set of elements
- // to set
- right_hand_side.compress ();
- solution.compress ();
-
- std::vector<unsigned int> indices;
- std::vector<TrilinosScalar> solution_values;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- {
- indices.push_back (dof->first);
- solution_values.push_back (dof->second);
- }
- solution.set (indices, solution_values);
-
- // now also set appropriate
- // values for the rhs
- for (unsigned int i=0; i<solution_values.size(); ++i)
- solution_values[i] *= matrix.diag_element(indices[i]);
-
- right_hand_side.set (indices, solution_values);
-
- // clean up
- matrix.compress ();
- solution.compress ();
- right_hand_side.compress ();
- }
-
-
-
- template <typename TrilinosMatrix, typename TrilinosBlockVector>
- void
- apply_block_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosMatrix &matrix,
- TrilinosBlockVector &solution,
- TrilinosBlockVector &right_hand_side,
- const bool eliminate_columns)
- {
- Assert (eliminate_columns == false, ExcNotImplemented());
-
- Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
- Assert (matrix.n() == solution.size(),
- ExcDimensionMismatch(matrix.n(), solution.size()));
- Assert (matrix.n_block_rows() == matrix.n_block_cols(),
- ExcNotQuadratic());
-
- const unsigned int n_blocks = matrix.n_block_rows();
-
- matrix.compress();
-
- // We need to find the subdivision
- // into blocks for the boundary values.
- // To this end, generate a vector of
- // maps with the respective indices.
- std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
- {
- int offset = 0, block=0;
- for (std::map<unsigned int,double>::const_iterator
- dof = boundary_values.begin();
- dof != boundary_values.end();
- ++dof)
- {
- if (dof->first >= matrix.block(block,0).m() + offset)
- {
- offset += matrix.block(block,0).m();
- block++;
- }
- const unsigned int index = dof->first - offset;
- block_boundary_values[block].insert(
- std::pair<unsigned int, double> (index,dof->second));
- }
- }
-
- // Now call the non-block variants on
- // the diagonal subblocks and the
- // solution/rhs.
- for (unsigned int block=0; block<n_blocks; ++block)
- TrilinosWrappers::apply_boundary_values(block_boundary_values[block],
- matrix.block(block,block),
- solution.block(block),
- right_hand_side.block(block),
- eliminate_columns);
-
- // Finally, we need to do something
- // about the off-diagonal matrices. This
- // is luckily not difficult. Just clear
- // the whole row.
- for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
- {
- const std::pair<unsigned int, unsigned int> local_range
- = matrix.block(block_m,0).local_range();
-
- std::vector<unsigned int> constrained_rows;
- for (std::map<unsigned int,double>::const_iterator
- dof = block_boundary_values[block_m].begin();
- dof != block_boundary_values[block_m].end();
- ++dof)
- if ((dof->first >= local_range.first) &&
- (dof->first < local_range.second))
- constrained_rows.push_back (dof->first);
-
- for (unsigned int block_n=0; block_n<n_blocks; ++block_n)
- if (block_m != block_n)
- matrix.block(block_m,block_n).clear_rows(constrained_rows);
- }
- }
-
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosWrappers::SparseMatrix &matrix,
- TrilinosWrappers::Vector &solution,
- TrilinosWrappers::Vector &right_hand_side,
- const bool eliminate_columns)
-{
- // simply redirect to the generic function
- // used for both trilinos matrix types
- TrilinosWrappers::apply_boundary_values (boundary_values, matrix, solution,
- right_hand_side, eliminate_columns);
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosWrappers::SparseMatrix &matrix,
- TrilinosWrappers::MPI::Vector &solution,
- TrilinosWrappers::MPI::Vector &right_hand_side,
- const bool eliminate_columns)
-{
- // simply redirect to the generic function
- // used for both trilinos matrix types
- TrilinosWrappers::apply_boundary_values (boundary_values, matrix, solution,
- right_hand_side, eliminate_columns);
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosWrappers::BlockSparseMatrix &matrix,
- TrilinosWrappers::BlockVector &solution,
- TrilinosWrappers::BlockVector &right_hand_side,
- const bool eliminate_columns)
-{
- TrilinosWrappers::apply_block_boundary_values (boundary_values, matrix,
- solution, right_hand_side,
- eliminate_columns);
-}
-
-
-
-void
-MatrixTools::
-apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- TrilinosWrappers::BlockSparseMatrix &matrix,
- TrilinosWrappers::MPI::BlockVector &solution,
- TrilinosWrappers::MPI::BlockVector &right_hand_side,
- const bool eliminate_columns)
-{
- TrilinosWrappers::apply_block_boundary_values (boundary_values, matrix,
- solution, right_hand_side,
- eliminate_columns);
-}
-
-#endif
-
-
-
-void
-MatrixTools::
-local_apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
- const std::vector<unsigned int> &local_dof_indices,
- FullMatrix<double> &local_matrix,
- Vector<double> &local_rhs,
- const bool eliminate_columns)
-{
- Assert (local_dof_indices.size() == local_matrix.m(),
- ExcDimensionMismatch(local_dof_indices.size(),
- local_matrix.m()));
- Assert (local_dof_indices.size() == local_matrix.n(),
- ExcDimensionMismatch(local_dof_indices.size(),
- local_matrix.n()));
- Assert (local_dof_indices.size() == local_rhs.size(),
- ExcDimensionMismatch(local_dof_indices.size(),
- local_rhs.size()));
-
- // if there is nothing to do, then exit
- // right away
- if (boundary_values.size() == 0)
- return;
-
- // otherwise traverse all the dofs used in
- // the local matrices and vectors and see
- // what's there to do
-
- // if we need to treat an entry, then we
- // set the diagonal entry to its absolute
- // value. if it is zero, we used to set it
- // to one, which is a really terrible
- // choice that can lead to hours of
- // searching for bugs in programs (I
- // experienced this :-( ) if the matrix
- // entries are otherwise very large. this
- // is so since iterative solvers would
- // simply not correct boundary nodes for
- // their correct values since the residual
- // contributions of their rows of the
- // linear system is almost zero if the
- // diagonal entry is one. thus, set it to
- // the average absolute value of the
- // nonzero diagonal elements.
- //
- // we only compute this value lazily the
- // first time we need it.
- double average_diagonal = 0;
- const unsigned int n_local_dofs = local_dof_indices.size();
- for (unsigned int i=0; i<n_local_dofs; ++i)
- {
- const std::map<unsigned int, double>::const_iterator
- boundary_value = boundary_values.find (local_dof_indices[i]);
- if (boundary_value != boundary_values.end())
- {
- // remove this row, except for the
- // diagonal element
- for (unsigned j=0; j<n_local_dofs; ++j)
- if (i != j)
- local_matrix(i,j) = 0;
-
- // replace diagonal entry by its
- // absolute value to make sure that
- // everything remains positive, or
- // by the average diagonal value if
- // zero
- if (local_matrix(i,i) == 0.)
- {
- // if average diagonal hasn't
- // yet been computed, do so now
- if (average_diagonal == 0.)
- {
- unsigned int nonzero_diagonals = 0;
- for (unsigned int k=0; k<n_local_dofs; ++k)
- if (local_matrix(k,k) != 0.)
- {
- average_diagonal += std::fabs(local_matrix(k,k));
- ++nonzero_diagonals;
- }
- if (nonzero_diagonals != 0)
- average_diagonal /= nonzero_diagonals;
- else
- average_diagonal = 0;
- }
-
- // only if all diagonal entries
- // are zero, then resort to the
- // last measure: choose one
- if (average_diagonal == 0.)
- average_diagonal = 1.;
-
- local_matrix(i,i) = average_diagonal;
- }
- else
- local_matrix(i,i) = std::fabs(local_matrix(i,i));
-
- // and replace rhs entry by correct
- // value
- local_rhs(i) = local_matrix(i,i) * boundary_value->second;
-
- // finally do the elimination step
- // if requested
- if (eliminate_columns == true)
- {
- for (unsigned int row=0; row<n_local_dofs; ++row)
- if (row != i)
- {
- local_rhs(row) -= local_matrix(row,i) * boundary_value->second;
- local_matrix(row,i) = 0;
- }
- }
- }
- }
-}
-
-
-
-
-
-// explicit instantiations
-
-template
-void
-MatrixTools::apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
- SparseMatrix<double> &matrix,
- Vector<double> &solution,
- Vector<double> &right_hand_side,
- const bool eliminate_columns);
-template
-void
-MatrixTools::apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
- SparseMatrix<float> &matrix,
- Vector<float> &solution,
- Vector<float> &right_hand_side,
- const bool eliminate_columns);
-
-template
-void
-MatrixTools::apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
- BlockSparseMatrix<double> &matrix,
- BlockVector<double> &solution,
- BlockVector<double> &right_hand_side,
- const bool eliminate_columns);
-template
-void
-MatrixTools::apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
- BlockSparseMatrix<float> &matrix,
- BlockVector<float> &solution,
- BlockVector<float> &right_hand_side,
- const bool eliminate_columns);
-
-DEAL_II_NAMESPACE_CLOSE
#include <numerics/matrices.h>
#include <lac/vector.h>
#include <lac/block_vector.h>
+#include <lac/full_matrix.h>
#include <lac/sparse_matrix.h>
#include <lac/block_sparse_matrix.h>
+#ifdef DEAL_II_USE_PETSC
+# include <lac/petsc_parallel_sparse_matrix.h>
+# include <lac/petsc_sparse_matrix.h>
+# include <lac/petsc_parallel_vector.h>
+# include <lac/petsc_vector.h>
+# include <lac/petsc_parallel_block_sparse_matrix.h>
+#endif
+
+#ifdef DEAL_II_USE_TRILINOS
+# include <lac/trilinos_sparse_matrix.h>
+# include <lac/trilinos_vector.h>
+# include <lac/trilinos_block_sparse_matrix.h>
+# include <lac/trilinos_block_vector.h>
+#endif
+
+#include <algorithm>
+
+
#include <algorithm>
#include <set>
#include <cmath>
-
-#if deal_II_dimension == 1
-
-template <>
-void MatrixCreator::create_boundary_mass_matrix (const Mapping<1,1>&,
- const DoFHandler<1,1>&,
- const Quadrature<0>&,
- SparseMatrix<double>&,
- const FunctionMap<1>::type&,
- Vector<double>&,
- std::vector<unsigned int>&,
- const Function<1>* const,
- std::vector<unsigned int>)
-{
- // what would that be in 1d? the
- // identity matrix on the boundary
- // dofs?
- Assert (false, ExcNotImplemented());
-}
-
-template <>
-void MatrixCreator::create_boundary_mass_matrix (const Mapping<1,2>&,
- const DoFHandler<1,2>&,
- const Quadrature<0>&,
- SparseMatrix<double>&,
- const FunctionMap<2>::type&,
- Vector<double>&,
- std::vector<unsigned int>&,
- const Function<2>* const,
- std::vector<unsigned int>)
-{
- // what would that be in 1d? the
- // identity matrix on the boundary
- // dofs?
- Assert (false, ExcNotImplemented());
-}
-
-
-#else
-
-
-
template <int dim, int spacedim>
void
MatrixCreator::create_boundary_mass_matrix (const Mapping<dim, spacedim> &mapping,
const Function<spacedim> * const coefficient,
std::vector<unsigned int> component_mapping)
{
+ // what would that be in 1d? the
+ // identity matrix on the boundary
+ // dofs?
+ if (dim == 1)
+ {
+ Assert (false, ExcNotImplemented());
+ return;
+ }
+
const FiniteElement<dim,spacedim> &fe = dof.get_fe();
const unsigned int n_components = fe.n_components();
}
-#if deal_II_dimension == 2
template <>
void
Assert(false,ExcNotImplemented());
}
-#endif
template <int dim, int spacedim>
}
}
-#endif
+
template <int dim, int spacedim>
void MatrixCreator::create_boundary_mass_matrix (const DoFHandler<dim,spacedim> &dof,
-#if deal_II_dimension == 1
-
-template <int dim, int spacedim>
-void
-MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection<dim,spacedim>&,
- const hp::DoFHandler<dim,spacedim>&,
- const hp::QCollection<dim-1>&,
- SparseMatrix<double>&,
- const typename FunctionMap<spacedim>::type&,
- Vector<double>&,
- std::vector<unsigned int>&,
- const Function<spacedim>* const,
- std::vector<unsigned int>)
-{
- // what would that be in 1d? the
- // identity matrix on the boundary
- // dofs?
- Assert (false, ExcNotImplemented());
-}
-
-
-#else
-
-
template <int dim, int spacedim>
void
MatrixCreator::create_boundary_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const Function<spacedim> * const coefficient,
std::vector<unsigned int> component_mapping)
{
+ // what would that be in 1d? the
+ // identity matrix on the boundary
+ // dofs?
+ if (dim == 1)
+ {
+ Assert (false, ExcNotImplemented());
+ return;
+ }
+
const hp::FECollection<dim,spacedim> &fe_collection = dof.get_fe();
const unsigned int n_components = fe_collection.n_components();
}
}
-#endif
+
template <int dim, int spacedim>
void MatrixCreator::create_boundary_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
+//TODO:[WB] I don't think that the optimized storage of diagonals is needed (GK)
+template <typename number>
+void
+MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ SparseMatrix<number> &matrix,
+ Vector<number> &solution,
+ Vector<number> &right_hand_side,
+ const bool eliminate_columns)
+{
+ // Require that diagonals are first
+ // in each row
+ Assert (matrix.get_sparsity_pattern().optimize_diagonal(),
+ typename SparsityPattern::ExcDiagonalNotOptimized());
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.n(), solution.size()));
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_values.size() == 0)
+ return;
+
+
+ const unsigned int n_dofs = matrix.m();
+
+ // if a diagonal entry is zero
+ // later, then we use another
+ // number instead. take it to be
+ // the first nonzero diagonal
+ // element of the matrix, or 1 if
+ // there is no such thing
+ number first_nonzero_diagonal_entry = 1;
+ for (unsigned int i=0; i<n_dofs; ++i)
+ if (matrix.diag_element(i) != 0)
+ {
+ first_nonzero_diagonal_entry = matrix.diag_element(i);
+ break;
+ }
+
+
+ std::map<unsigned int,double>::const_iterator dof = boundary_values.begin(),
+ endd = boundary_values.end();
+ const SparsityPattern &sparsity = matrix.get_sparsity_pattern();
+ const std::size_t *sparsity_rowstart = sparsity.get_rowstart_indices();
+ const unsigned int *sparsity_colnums = sparsity.get_column_numbers();
+ for (; dof != endd; ++dof)
+ {
+ Assert (dof->first < n_dofs, ExcInternalError());
+
+ const unsigned int dof_number = dof->first;
+ // for each boundary dof:
+
+ // set entries of this line
+ // to zero except for the diagonal
+ // entry. Note that the diagonal
+ // entry is always the first one
+ // for square matrices, i.e.
+ // we shall not set
+ // matrix.global_entry(
+ // sparsity_rowstart[dof.first])
+ const unsigned int last = sparsity_rowstart[dof_number+1];
+ for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
+ matrix.global_entry(j) = 0.;
+
+
+ // set right hand side to
+ // wanted value: if main diagonal
+ // entry nonzero, don't touch it
+ // and scale rhs accordingly. If
+ // zero, take the first main
+ // diagonal entry we can find, or
+ // one if no nonzero main diagonal
+ // element exists. Normally, however,
+ // the main diagonal entry should
+ // not be zero.
+ //
+ // store the new rhs entry to make
+ // the gauss step more efficient
+ number new_rhs;
+ if (matrix.diag_element(dof_number) != 0.0)
+ {
+ new_rhs = dof->second * matrix.diag_element(dof_number);
+ right_hand_side(dof_number) = new_rhs;
+ }
+ else
+ {
+ matrix.set (dof_number, dof_number,
+ first_nonzero_diagonal_entry);
+ new_rhs = dof->second * first_nonzero_diagonal_entry;
+ right_hand_side(dof_number) = new_rhs;
+ }
-// explicit instantiations
+ // if the user wants to have
+ // the symmetry of the matrix
+ // preserved, and if the
+ // sparsity pattern is
+ // symmetric, then do a Gauss
+ // elimination step with the
+ // present row
+ if (eliminate_columns)
+ {
+ // store the only nonzero entry
+ // of this line for the Gauss
+ // elimination step
+ const number diagonal_entry = matrix.diag_element(dof_number);
+
+ // we have to loop over all
+ // rows of the matrix which
+ // have a nonzero entry in
+ // the column which we work
+ // in presently. if the
+ // sparsity pattern is
+ // symmetric, then we can
+ // get the positions of
+ // these rows cheaply by
+ // looking at the nonzero
+ // column numbers of the
+ // present row. we need not
+ // look at the first entry,
+ // since that is the
+ // diagonal element and
+ // thus the present row
+ for (unsigned int j=sparsity_rowstart[dof_number]+1; j<last; ++j)
+ {
+ const unsigned int row = sparsity_colnums[j];
+
+ // find the position of
+ // element
+ // (row,dof_number)
+ const unsigned int *
+ p = std::lower_bound(&sparsity_colnums[sparsity_rowstart[row]+1],
+ &sparsity_colnums[sparsity_rowstart[row+1]],
+ dof_number);
+
+ // check whether this line has
+ // an entry in the regarding column
+ // (check for ==dof_number and
+ // != next_row, since if
+ // row==dof_number-1, *p is a
+ // past-the-end pointer but points
+ // to dof_number anyway...)
+ //
+ // there should be such an entry!
+ Assert ((*p == dof_number) &&
+ (p != &sparsity_colnums[sparsity_rowstart[row+1]]),
+ ExcInternalError());
+
+ const unsigned int global_entry
+ = (p - &sparsity_colnums[sparsity_rowstart[0]]);
+
+ // correct right hand side
+ right_hand_side(row) -= matrix.global_entry(global_entry) /
+ diagonal_entry * new_rhs;
+
+ // set matrix entry to zero
+ matrix.global_entry(global_entry) = 0.;
+ }
+ }
-// non-hp version of create_mass_matrix
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
+ // preset solution vector
+ solution(dof_number) = dof->second;
+ }
+}
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-
-// hp versions of functions
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
+template <typename number>
+void
+MatrixTools::apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ BlockSparseMatrix<number> &matrix,
+ BlockVector<number> &solution,
+ BlockVector<number> &right_hand_side,
+ const bool eliminate_columns)
+{
+ const unsigned int blocks = matrix.n_block_rows();
+
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.n(), solution.size()));
+ Assert (matrix.n_block_rows() == matrix.n_block_cols(),
+ ExcNotQuadratic());
+ Assert (matrix.get_sparsity_pattern().get_row_indices() ==
+ matrix.get_sparsity_pattern().get_column_indices(),
+ ExcNotQuadratic());
+ Assert (matrix.get_sparsity_pattern().get_column_indices() ==
+ solution.get_block_indices (),
+ ExcBlocksDontMatch ());
+ Assert (matrix.get_sparsity_pattern().get_row_indices() ==
+ right_hand_side.get_block_indices (),
+ ExcBlocksDontMatch ());
+
+ for (unsigned int i=0; i<blocks; ++i)
+ Assert (matrix.block(i,i).get_sparsity_pattern().optimize_diagonal(),
+ SparsityPattern::ExcDiagonalNotOptimized());
+
+
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_values.size() == 0)
+ return;
+
+
+ const unsigned int n_dofs = matrix.m();
+
+ // if a diagonal entry is zero
+ // later, then we use another
+ // number instead. take it to be
+ // the first nonzero diagonal
+ // element of the matrix, or 1 if
+ // there is no such thing
+ number first_nonzero_diagonal_entry = 0;
+ for (unsigned int diag_block=0; diag_block<blocks; ++diag_block)
+ {
+ for (unsigned int i=0; i<matrix.block(diag_block,diag_block).n(); ++i)
+ if (matrix.block(diag_block,diag_block).diag_element(i) != 0)
+ {
+ first_nonzero_diagonal_entry
+ = matrix.block(diag_block,diag_block).diag_element(i);
+ break;
+ }
+ // check whether we have found
+ // something in the present
+ // block
+ if (first_nonzero_diagonal_entry != 0)
+ break;
+ }
+ // nothing found on all diagonal
+ // blocks? if so, use 1.0 instead
+ if (first_nonzero_diagonal_entry == 0)
+ first_nonzero_diagonal_entry = 1;
+
+
+ std::map<unsigned int,double>::const_iterator dof = boundary_values.begin(),
+ endd = boundary_values.end();
+ const BlockSparsityPattern &
+ sparsity_pattern = matrix.get_sparsity_pattern();
+
+ // pointer to the mapping between
+ // global and block indices. since
+ // the row and column mappings are
+ // equal, store a pointer on only
+ // one of them
+ const BlockIndices &
+ index_mapping = sparsity_pattern.get_column_indices();
+
+ // now loop over all boundary dofs
+ for (; dof != endd; ++dof)
+ {
+ Assert (dof->first < n_dofs, ExcInternalError());
+
+ // get global index and index
+ // in the block in which this
+ // dof is located
+ const unsigned int dof_number = dof->first;
+ const std::pair<unsigned int,unsigned int>
+ block_index = index_mapping.global_to_local (dof_number);
+
+ // for each boundary dof:
+
+ // set entries of this line
+ // to zero except for the diagonal
+ // entry. Note that the diagonal
+ // entry is always the first one
+ // for square matrices, i.e.
+ // we shall not set
+ // matrix.global_entry(
+ // sparsity_rowstart[dof.first])
+ // of the diagonal block
+ for (unsigned int block_col=0; block_col<blocks; ++block_col)
+ {
+ const SparsityPattern &
+ local_sparsity = sparsity_pattern.block(block_index.first,
+ block_col);
+
+ // find first and last
+ // entry in the present row
+ // of the present
+ // block. exclude the main
+ // diagonal element, which
+ // is the diagonal element
+ // of a diagonal block,
+ // which must be a square
+ // matrix so the diagonal
+ // element is the first of
+ // this row.
+ const unsigned int
+ last = local_sparsity.get_rowstart_indices()[block_index.second+1],
+ first = (block_col == block_index.first ?
+ local_sparsity.get_rowstart_indices()[block_index.second]+1 :
+ local_sparsity.get_rowstart_indices()[block_index.second]);
+
+ for (unsigned int j=first; j<last; ++j)
+ matrix.block(block_index.first,block_col).global_entry(j) = 0.;
+ }
+
+
+ // set right hand side to
+ // wanted value: if main diagonal
+ // entry nonzero, don't touch it
+ // and scale rhs accordingly. If
+ // zero, take the first main
+ // diagonal entry we can find, or
+ // one if no nonzero main diagonal
+ // element exists. Normally, however,
+ // the main diagonal entry should
+ // not be zero.
+ //
+ // store the new rhs entry to make
+ // the gauss step more efficient
+ number new_rhs;
+ if (matrix.block(block_index.first, block_index.first)
+ .diag_element(block_index.second) != 0.0)
+ new_rhs = dof->second *
+ matrix.block(block_index.first, block_index.first)
+ .diag_element(block_index.second);
+ else
+ {
+ matrix.block(block_index.first, block_index.first)
+ .diag_element(block_index.second)
+ = first_nonzero_diagonal_entry;
+ new_rhs = dof->second * first_nonzero_diagonal_entry;
+ }
+ right_hand_side.block(block_index.first)(block_index.second)
+ = new_rhs;
+
+
+ // if the user wants to have
+ // the symmetry of the matrix
+ // preserved, and if the
+ // sparsity pattern is
+ // symmetric, then do a Gauss
+ // elimination step with the
+ // present row. this is a
+ // little more complicated for
+ // block matrices.
+ if (eliminate_columns)
+ {
+ // store the only nonzero entry
+ // of this line for the Gauss
+ // elimination step
+ const number diagonal_entry
+ = matrix.block(block_index.first,block_index.first)
+ .diag_element(block_index.second);
+
+ // we have to loop over all
+ // rows of the matrix which
+ // have a nonzero entry in
+ // the column which we work
+ // in presently. if the
+ // sparsity pattern is
+ // symmetric, then we can
+ // get the positions of
+ // these rows cheaply by
+ // looking at the nonzero
+ // column numbers of the
+ // present row.
+ //
+ // note that if we check
+ // whether row @p{row} in
+ // block (r,c) is non-zero,
+ // then we have to check
+ // for the existence of
+ // column @p{row} in block
+ // (c,r), i.e. of the
+ // transpose block
+ for (unsigned int block_row=0; block_row<blocks; ++block_row)
+ {
+ // get pointers to the
+ // sparsity patterns of
+ // this block and of
+ // the transpose one
+ const SparsityPattern &this_sparsity
+ = sparsity_pattern.block (block_row, block_index.first);
+ const SparsityPattern &transpose_sparsity
+ = sparsity_pattern.block (block_index.first, block_row);
+
+ // traverse the row of
+ // the transpose block
+ // to find the
+ // interesting rows in
+ // the present block.
+ // don't use the
+ // diagonal element of
+ // the diagonal block
+ const unsigned int
+ first = (block_index.first == block_row ?
+ transpose_sparsity.get_rowstart_indices()[block_index.second]+1 :
+ transpose_sparsity.get_rowstart_indices()[block_index.second]),
+ last = transpose_sparsity.get_rowstart_indices()[block_index.second+1];
+
+ for (unsigned int j=first; j<last; ++j)
+ {
+ // get the number
+ // of the column in
+ // this row in
+ // which a nonzero
+ // entry is. this
+ // is also the row
+ // of the transpose
+ // block which has
+ // an entry in the
+ // interesting row
+ const unsigned int row = transpose_sparsity.get_column_numbers()[j];
+
+ // find the
+ // position of
+ // element
+ // (row,dof_number)
+ // in this block
+ // (not in the
+ // transpose
+ // one). note that
+ // we have to take
+ // care of special
+ // cases with
+ // square
+ // sub-matrices
+ const unsigned int *p = 0;
+ if (this_sparsity.n_rows() == this_sparsity.n_cols())
+ {
+ if (this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]]
+ ==
+ block_index.second)
+ p = &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]];
+ else
+ p = std::lower_bound(&this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]+1],
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]],
+ block_index.second);
+ }
+ else
+ p = std::lower_bound(&this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row]],
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]],
+ block_index.second);
+
+ // check whether this line has
+ // an entry in the regarding column
+ // (check for ==dof_number and
+ // != next_row, since if
+ // row==dof_number-1, *p is a
+ // past-the-end pointer but points
+ // to dof_number anyway...)
+ //
+ // there should be
+ // such an entry!
+ // note, however,
+ // that this
+ // assertion will
+ // fail sometimes
+ // if the sparsity
+ // pattern is not
+ // symmetric!
+ Assert ((*p == block_index.second) &&
+ (p != &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[row+1]]),
+ ExcInternalError());
+
+ const unsigned int global_entry
+ = (p
+ -
+ &this_sparsity.get_column_numbers()
+ [this_sparsity.get_rowstart_indices()[0]]);
+
+ // correct right hand side
+ right_hand_side.block(block_row)(row)
+ -= matrix.block(block_row,block_index.first).global_entry(global_entry) /
+ diagonal_entry * new_rhs;
+
+ // set matrix entry to zero
+ matrix.block(block_row,block_index.first).global_entry(global_entry) = 0.;
+ }
+ }
+ }
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
+ // preset solution vector
+ solution.block(block_index.first)(block_index.second) = dof->second;
+ }
+}
-#if deal_II_dimension != 1
-template
-void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<double> &matrix,
- const FunctionMap<deal_II_dimension>::type &rhs,
- Vector<double> &rhs_vector,
- std::vector<unsigned int> &dof_to_boundary_mapping,
- const Function<deal_II_dimension> * const a,
- std::vector<unsigned int>);
+#ifdef DEAL_II_USE_PETSC
+
+namespace PETScWrappers
+{
+ template <typename PETScMatrix, typename PETScVector>
+ void
+ apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ PETScMatrix &matrix,
+ PETScVector &solution,
+ PETScVector &right_hand_side,
+ const bool eliminate_columns)
+ {
+ Assert (eliminate_columns == false, ExcNotImplemented());
+
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.n(), solution.size()));
+
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_values.size() == 0)
+ return;
+
+ const std::pair<unsigned int, unsigned int> local_range
+ = matrix.local_range();
+ Assert (local_range == right_hand_side.local_range(),
+ ExcInternalError());
+ Assert (local_range == solution.local_range(),
+ ExcInternalError());
+
+
+ // we have to read and write from this
+ // matrix (in this order). this will only
+ // work if we compress the matrix first,
+ // done here
+ matrix.compress ();
+
+ // determine the first nonzero diagonal
+ // entry from within the part of the
+ // matrix that we can see. if we can't
+ // find such an entry, take one
+ PetscScalar average_nonzero_diagonal_entry = 1;
+ for (unsigned int i=local_range.first; i<local_range.second; ++i)
+ if (matrix.diag_element(i) != 0)
+ {
+ average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
+ break;
+ }
+
+ // figure out which rows of the matrix we
+ // have to eliminate on this processor
+ std::vector<unsigned int> constrained_rows;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ constrained_rows.push_back (dof->first);
+
+ // then eliminate these rows and set
+ // their diagonal entry to what we have
+ // determined above. note that for petsc
+ // matrices interleaving read with write
+ // operations is very expensive. thus, we
+ // here always replace the diagonal
+ // element, rather than first checking
+ // whether it is nonzero and in that case
+ // preserving it. this is different from
+ // the case of deal.II sparse matrices
+ // treated in the other functions.
+ matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
+
+ // the next thing is to set right hand
+ // side to the wanted value. there's one
+ // drawback: if we write to individual
+ // vector elements, then we have to do
+ // that on all processors. however, some
+ // processors may not need to set
+ // anything because their chunk of
+ // matrix/rhs do not contain any boundary
+ // nodes. therefore, rather than using
+ // individual calls, we use one call for
+ // all elements, thereby making sure that
+ // all processors call this function,
+ // even if some only have an empty set of
+ // elements to set
+ right_hand_side.compress ();
+ solution.compress ();
+
+ std::vector<unsigned int> indices;
+ std::vector<PetscScalar> solution_values;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ {
+ indices.push_back (dof->first);
+ solution_values.push_back (dof->second);
+ }
+ solution.set (indices, solution_values);
+
+ // now also set appropriate values for
+ // the rhs
+ for (unsigned int i=0; i<solution_values.size(); ++i)
+ solution_values[i] *= average_nonzero_diagonal_entry;
+
+ right_hand_side.set (indices, solution_values);
+
+ // clean up
+ matrix.compress ();
+ solution.compress ();
+ right_hand_side.compress ();
+ }
+}
+
-template
-void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<double> &matrix,
- const FunctionMap<deal_II_dimension>::type &rhs,
- Vector<double> &rhs_vector,
- std::vector<unsigned int> &dof_to_boundary_mapping,
- const Function<deal_II_dimension> * const a,
- std::vector<unsigned int>);
-template
void
-MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension>&,
- const hp::DoFHandler<deal_II_dimension>&,
- const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<double>&,
- const FunctionMap<deal_II_dimension>::type&,
- Vector<double>&,
- std::vector<unsigned int>&,
- const Function<deal_II_dimension> * const,
- std::vector<unsigned int>);
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ PETScWrappers::SparseMatrix &matrix,
+ PETScWrappers::Vector &solution,
+ PETScWrappers::Vector &right_hand_side,
+ const bool eliminate_columns)
+{
+ // simply redirect to the generic function
+ // used for both petsc matrix types
+ PETScWrappers::apply_boundary_values (boundary_values, matrix, solution,
+ right_hand_side, eliminate_columns);
+}
-template
-void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension>&,
- const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<double>&,
- const FunctionMap<deal_II_dimension>::type&,
- Vector<double>&,
- std::vector<unsigned int>&,
- const Function<deal_II_dimension> * const,
- std::vector<unsigned int>);
+
+
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ PETScWrappers::MPI::SparseMatrix &matrix,
+ PETScWrappers::MPI::Vector &solution,
+ PETScWrappers::MPI::Vector &right_hand_side,
+ const bool eliminate_columns)
+{
+ // simply redirect to the generic function
+ // used for both petsc matrix types
+ PETScWrappers::apply_boundary_values (boundary_values, matrix, solution,
+ right_hand_side, eliminate_columns);
+
+ // compress the matrix once we're done
+ matrix.compress ();
+}
+
+
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ PETScWrappers::MPI::BlockSparseMatrix &matrix,
+ PETScWrappers::MPI::BlockVector &solution,
+ PETScWrappers::MPI::BlockVector &right_hand_side,
+ const bool eliminate_columns)
+{
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.n(), solution.size()));
+ Assert (matrix.n_block_rows() == matrix.n_block_cols(),
+ ExcNotQuadratic());
+
+ const unsigned int n_blocks = matrix.n_block_rows();
+
+ matrix.compress();
+
+ // We need to find the subdivision
+ // into blocks for the boundary values.
+ // To this end, generate a vector of
+ // maps with the respective indices.
+ std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
+ {
+ int offset = 0, block=0;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ {
+ if (dof->first >= matrix.block(block,0).m() + offset)
+ {
+ offset += matrix.block(block,0).m();
+ block++;
+ }
+ const unsigned int index = dof->first - offset;
+ block_boundary_values[block].insert(std::pair<unsigned int, double> (index,dof->second));
+ }
+ }
+
+ // Now call the non-block variants on
+ // the diagonal subblocks and the
+ // solution/rhs.
+ for (unsigned int block=0; block<n_blocks; ++block)
+ PETScWrappers::apply_boundary_values(block_boundary_values[block],
+ matrix.block(block,block),
+ solution.block(block),
+ right_hand_side.block(block),
+ eliminate_columns);
+
+ // Finally, we need to do something
+ // about the off-diagonal matrices. This
+ // is luckily not difficult. Just clear
+ // the whole row.
+ for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
+ {
+ const std::pair<unsigned int, unsigned int> local_range
+ = matrix.block(block_m,0).local_range();
+
+ std::vector<unsigned int> constrained_rows;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = block_boundary_values[block_m].begin();
+ dof != block_boundary_values[block_m].end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ constrained_rows.push_back (dof->first);
+
+ for (unsigned int block_n=0; block_n<n_blocks; ++block_n)
+ if (block_m != block_n)
+ matrix.block(block_m,block_n).clear_rows(constrained_rows);
+ }
+}
#endif
-// non-hp versions of create_laplace_matrix
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const Mapping<deal_II_dimension> &mapping,
- const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-
-// hp versions of create_laplace_matrix
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &mapping,
- const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
-template
-void MatrixCreator::create_laplace_matrix<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension> * const coefficient);
+#ifdef DEAL_II_USE_TRILINOS
+namespace TrilinosWrappers
+{
+ template <typename TrilinosMatrix, typename TrilinosVector>
+ void
+ apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosMatrix &matrix,
+ TrilinosVector &solution,
+ TrilinosVector &right_hand_side,
+ const bool eliminate_columns)
+ {
+ Assert (eliminate_columns == false, ExcNotImplemented());
+
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.m(), solution.size()));
+
+ // if no boundary values are to be applied
+ // simply return
+ if (boundary_values.size() == 0)
+ return;
+
+ const std::pair<unsigned int, unsigned int> local_range
+ = matrix.local_range();
+ Assert (local_range == right_hand_side.local_range(),
+ ExcInternalError());
+ Assert (local_range == solution.local_range(),
+ ExcInternalError());
+
+ // we have to read and write from this
+ // matrix (in this order). this will only
+ // work if we compress the matrix first,
+ // done here
+ matrix.compress ();
+
+ // determine the first nonzero diagonal
+ // entry from within the part of the
+ // matrix that we can see. if we can't
+ // find such an entry, take one
+ TrilinosScalar average_nonzero_diagonal_entry = 1;
+ for (unsigned int i=local_range.first; i<local_range.second; ++i)
+ if (matrix.diag_element(i) != 0)
+ {
+ average_nonzero_diagonal_entry = std::fabs(matrix.diag_element(i));
+ break;
+ }
+
+ // figure out which rows of the matrix we
+ // have to eliminate on this processor
+ std::vector<unsigned int> constrained_rows;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ constrained_rows.push_back (dof->first);
+
+ // then eliminate these rows and
+ // set their diagonal entry to
+ // what we have determined
+ // above. if the value already is
+ // nonzero, it will be preserved,
+ // in accordance with the basic
+ // matrix classes in deal.II.
+ matrix.clear_rows (constrained_rows, average_nonzero_diagonal_entry);
+
+ // the next thing is to set right
+ // hand side to the wanted
+ // value. there's one drawback:
+ // if we write to individual
+ // vector elements, then we have
+ // to do that on all
+ // processors. however, some
+ // processors may not need to set
+ // anything because their chunk
+ // of matrix/rhs do not contain
+ // any boundary nodes. therefore,
+ // rather than using individual
+ // calls, we use one call for all
+ // elements, thereby making sure
+ // that all processors call this
+ // function, even if some only
+ // have an empty set of elements
+ // to set
+ right_hand_side.compress ();
+ solution.compress ();
+
+ std::vector<unsigned int> indices;
+ std::vector<TrilinosScalar> solution_values;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ {
+ indices.push_back (dof->first);
+ solution_values.push_back (dof->second);
+ }
+ solution.set (indices, solution_values);
+
+ // now also set appropriate
+ // values for the rhs
+ for (unsigned int i=0; i<solution_values.size(); ++i)
+ solution_values[i] *= matrix.diag_element(indices[i]);
+
+ right_hand_side.set (indices, solution_values);
+
+ // clean up
+ matrix.compress ();
+ solution.compress ();
+ right_hand_side.compress ();
+ }
-#if deal_II_dimension != 3
-// non-hp version of create_mass_matrix
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension+1> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<double> &matrix,
- const Function<deal_II_dimension+1> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension+1> * const coefficient);
+ template <typename TrilinosMatrix, typename TrilinosBlockVector>
+ void
+ apply_block_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosMatrix &matrix,
+ TrilinosBlockVector &solution,
+ TrilinosBlockVector &right_hand_side,
+ const bool eliminate_columns)
+ {
+ Assert (eliminate_columns == false, ExcNotImplemented());
+
+ Assert (matrix.n() == right_hand_side.size(),
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
+ Assert (matrix.n() == solution.size(),
+ ExcDimensionMismatch(matrix.n(), solution.size()));
+ Assert (matrix.n_block_rows() == matrix.n_block_cols(),
+ ExcNotQuadratic());
+
+ const unsigned int n_blocks = matrix.n_block_rows();
+
+ matrix.compress();
+
+ // We need to find the subdivision
+ // into blocks for the boundary values.
+ // To this end, generate a vector of
+ // maps with the respective indices.
+ std::vector<std::map<unsigned int,double> > block_boundary_values(n_blocks);
+ {
+ int offset = 0, block=0;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = boundary_values.begin();
+ dof != boundary_values.end();
+ ++dof)
+ {
+ if (dof->first >= matrix.block(block,0).m() + offset)
+ {
+ offset += matrix.block(block,0).m();
+ block++;
+ }
+ const unsigned int index = dof->first - offset;
+ block_boundary_values[block].insert(
+ std::pair<unsigned int, double> (index,dof->second));
+ }
+ }
+
+ // Now call the non-block variants on
+ // the diagonal subblocks and the
+ // solution/rhs.
+ for (unsigned int block=0; block<n_blocks; ++block)
+ TrilinosWrappers::apply_boundary_values(block_boundary_values[block],
+ matrix.block(block,block),
+ solution.block(block),
+ right_hand_side.block(block),
+ eliminate_columns);
+
+ // Finally, we need to do something
+ // about the off-diagonal matrices. This
+ // is luckily not difficult. Just clear
+ // the whole row.
+ for (unsigned int block_m=0; block_m<n_blocks; ++block_m)
+ {
+ const std::pair<unsigned int, unsigned int> local_range
+ = matrix.block(block_m,0).local_range();
+
+ std::vector<unsigned int> constrained_rows;
+ for (std::map<unsigned int,double>::const_iterator
+ dof = block_boundary_values[block_m].begin();
+ dof != block_boundary_values[block_m].end();
+ ++dof)
+ if ((dof->first >= local_range.first) &&
+ (dof->first < local_range.second))
+ constrained_rows.push_back (dof->first);
+
+ for (unsigned int block_n=0; block_n<n_blocks; ++block_n)
+ if (block_m != block_n)
+ matrix.block(block_m,block_n).clear_rows(constrained_rows);
+ }
+ }
+
+}
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension+1> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension+1> * const coefficient);
-template
-void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<float> &matrix,
- const Function<deal_II_dimension+1> &rhs,
- Vector<double> &rhs_vector,
- const Function<deal_II_dimension+1> * const coefficient);
-#if deal_II_dimension == 2
-template
-void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<double> &matrix,
- const FunctionMap<deal_II_dimension+1>::type &rhs,
- Vector<double> &rhs_vector,
- std::vector<unsigned int> &dof_to_boundary_mapping,
- const Function<deal_II_dimension+1> * const a,
- std::vector<unsigned int>);
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosWrappers::SparseMatrix &matrix,
+ TrilinosWrappers::Vector &solution,
+ TrilinosWrappers::Vector &right_hand_side,
+ const bool eliminate_columns)
+{
+ // simply redirect to the generic function
+ // used for both trilinos matrix types
+ TrilinosWrappers::apply_boundary_values (boundary_values, matrix, solution,
+ right_hand_side, eliminate_columns);
+}
-template
-void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<double> &matrix,
- const FunctionMap<deal_II_dimension+1>::type &rhs,
- Vector<double> &rhs_vector,
- std::vector<unsigned int> &dof_to_boundary_mapping,
- const Function<deal_II_dimension+1> * const a,
- std::vector<unsigned int>);
-#endif
-// #if deal_II_dimension != 1
-// template
-// void
-// MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
-// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
-// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension-1> &q,
-// SparseMatrix<double> &matrix,
-// const FunctionMap<deal_II_dimension+1>::type &boundary_functions,
-// Vector<double> &rhs_vector,
-// std::vector<unsigned int> &dof_to_boundary_mapping,
-// const Function<deal_II_dimension+1> * const a,
-// std::vector<unsigned int> &component_mapping);
-// #endif
-
-// template
-// void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
-// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension-1> &q,
-// SparseMatrix<double> &matrix,
-// const FunctionMap<deal_II_dimension+1>::type &rhs,
-// Vector<double> &rhs_vector,
-// std::vector<unsigned int> &dof_to_boundary_mapping,
-// const Function<deal_II_dimension+1> * const a,
-// std::vector<unsigned int> &component_mapping);
-
-
-// // non-hp version of create_mass_matrix
-// template
-// void MatrixCreator::create_mass_matrix
-// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
-// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<double> &matrix,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<double> &matrix,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
-// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<double> &matrix,
-// const Function<deal_II_dimension+1> &rhs,
-// Vector<double> &rhs_vector,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<double> &matrix,
-// const Function<deal_II_dimension+1> &rhs,
-// Vector<double> &rhs_vector,
-// const Function<deal_II_dimension+1> * const coefficient);
-
-
-// template
-// void MatrixCreator::create_mass_matrix
-// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
-// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<float> &matrix,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<float> &matrix,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
-// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<float> &matrix,
-// const Function<deal_II_dimension+1> &rhs,
-// Vector<double> &rhs_vector,
-// const Function<deal_II_dimension+1> * const coefficient);
-// template
-// void MatrixCreator::create_mass_matrix
-// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
-// const Quadrature<deal_II_dimension> &q,
-// SparseMatrix<float> &matrix,
-// const Function<deal_II_dimension+1> &rhs,
-// Vector<double> &rhs_vector,
-// const Function<deal_II_dimension+1> * const coefficient);
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosWrappers::SparseMatrix &matrix,
+ TrilinosWrappers::MPI::Vector &solution,
+ TrilinosWrappers::MPI::Vector &right_hand_side,
+ const bool eliminate_columns)
+{
+ // simply redirect to the generic function
+ // used for both trilinos matrix types
+ TrilinosWrappers::apply_boundary_values (boundary_values, matrix, solution,
+ right_hand_side, eliminate_columns);
+}
+
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosWrappers::BlockSparseMatrix &matrix,
+ TrilinosWrappers::BlockVector &solution,
+ TrilinosWrappers::BlockVector &right_hand_side,
+ const bool eliminate_columns)
+{
+ TrilinosWrappers::apply_block_boundary_values (boundary_values, matrix,
+ solution, right_hand_side,
+ eliminate_columns);
+}
+
+
+
+void
+MatrixTools::
+apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ TrilinosWrappers::BlockSparseMatrix &matrix,
+ TrilinosWrappers::MPI::BlockVector &solution,
+ TrilinosWrappers::MPI::BlockVector &right_hand_side,
+ const bool eliminate_columns)
+{
+ TrilinosWrappers::apply_block_boundary_values (boundary_values, matrix,
+ solution, right_hand_side,
+ eliminate_columns);
+}
+
#endif
+
+
+void
+MatrixTools::
+local_apply_boundary_values (const std::map<unsigned int,double> &boundary_values,
+ const std::vector<unsigned int> &local_dof_indices,
+ FullMatrix<double> &local_matrix,
+ Vector<double> &local_rhs,
+ const bool eliminate_columns)
+{
+ Assert (local_dof_indices.size() == local_matrix.m(),
+ ExcDimensionMismatch(local_dof_indices.size(),
+ local_matrix.m()));
+ Assert (local_dof_indices.size() == local_matrix.n(),
+ ExcDimensionMismatch(local_dof_indices.size(),
+ local_matrix.n()));
+ Assert (local_dof_indices.size() == local_rhs.size(),
+ ExcDimensionMismatch(local_dof_indices.size(),
+ local_rhs.size()));
+
+ // if there is nothing to do, then exit
+ // right away
+ if (boundary_values.size() == 0)
+ return;
+
+ // otherwise traverse all the dofs used in
+ // the local matrices and vectors and see
+ // what's there to do
+
+ // if we need to treat an entry, then we
+ // set the diagonal entry to its absolute
+ // value. if it is zero, we used to set it
+ // to one, which is a really terrible
+ // choice that can lead to hours of
+ // searching for bugs in programs (I
+ // experienced this :-( ) if the matrix
+ // entries are otherwise very large. this
+ // is so since iterative solvers would
+ // simply not correct boundary nodes for
+ // their correct values since the residual
+ // contributions of their rows of the
+ // linear system is almost zero if the
+ // diagonal entry is one. thus, set it to
+ // the average absolute value of the
+ // nonzero diagonal elements.
+ //
+ // we only compute this value lazily the
+ // first time we need it.
+ double average_diagonal = 0;
+ const unsigned int n_local_dofs = local_dof_indices.size();
+ for (unsigned int i=0; i<n_local_dofs; ++i)
+ {
+ const std::map<unsigned int, double>::const_iterator
+ boundary_value = boundary_values.find (local_dof_indices[i]);
+ if (boundary_value != boundary_values.end())
+ {
+ // remove this row, except for the
+ // diagonal element
+ for (unsigned j=0; j<n_local_dofs; ++j)
+ if (i != j)
+ local_matrix(i,j) = 0;
+
+ // replace diagonal entry by its
+ // absolute value to make sure that
+ // everything remains positive, or
+ // by the average diagonal value if
+ // zero
+ if (local_matrix(i,i) == 0.)
+ {
+ // if average diagonal hasn't
+ // yet been computed, do so now
+ if (average_diagonal == 0.)
+ {
+ unsigned int nonzero_diagonals = 0;
+ for (unsigned int k=0; k<n_local_dofs; ++k)
+ if (local_matrix(k,k) != 0.)
+ {
+ average_diagonal += std::fabs(local_matrix(k,k));
+ ++nonzero_diagonals;
+ }
+ if (nonzero_diagonals != 0)
+ average_diagonal /= nonzero_diagonals;
+ else
+ average_diagonal = 0;
+ }
+
+ // only if all diagonal entries
+ // are zero, then resort to the
+ // last measure: choose one
+ if (average_diagonal == 0.)
+ average_diagonal = 1.;
+
+ local_matrix(i,i) = average_diagonal;
+ }
+ else
+ local_matrix(i,i) = std::fabs(local_matrix(i,i));
+
+ // and replace rhs entry by correct
+ // value
+ local_rhs(i) = local_matrix(i,i) * boundary_value->second;
+
+ // finally do the elimination step
+ // if requested
+ if (eliminate_columns == true)
+ {
+ for (unsigned int row=0; row<n_local_dofs; ++row)
+ if (row != i)
+ {
+ local_rhs(row) -= local_matrix(row,i) * boundary_value->second;
+ local_matrix(row,i) = 0;
+ }
+ }
+ }
+ }
+}
+
+
+
+// explicit instantiations
+#include "matrices.inst"
+
+template
+void
+MatrixTools::apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
+ SparseMatrix<double> &matrix,
+ Vector<double> &solution,
+ Vector<double> &right_hand_side,
+ const bool eliminate_columns);
+template
+void
+MatrixTools::apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
+ SparseMatrix<float> &matrix,
+ Vector<float> &solution,
+ Vector<float> &right_hand_side,
+ const bool eliminate_columns);
+
+template
+void
+MatrixTools::apply_boundary_values<double> (const std::map<unsigned int,double> &boundary_values,
+ BlockSparseMatrix<double> &matrix,
+ BlockVector<double> &solution,
+ BlockVector<double> &right_hand_side,
+ const bool eliminate_columns);
+template
+void
+MatrixTools::apply_boundary_values<float> (const std::map<unsigned int,double> &boundary_values,
+ BlockSparseMatrix<float> &matrix,
+ BlockVector<float> &solution,
+ BlockVector<float> &right_hand_side,
+ const bool eliminate_columns);
+
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+// non-hp version of create_mass_matrix
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+// hp versions of functions
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+
+#if deal_II_dimension != 1
+
+template
+void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension-1> &q,
+ SparseMatrix<double> &matrix,
+ const FunctionMap<deal_II_dimension>::type &rhs,
+ Vector<double> &rhs_vector,
+ std::vector<unsigned int> &dof_to_boundary_mapping,
+ const Function<deal_II_dimension> * const a,
+ std::vector<unsigned int>);
+
+template
+void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension-1> &q,
+ SparseMatrix<double> &matrix,
+ const FunctionMap<deal_II_dimension>::type &rhs,
+ Vector<double> &rhs_vector,
+ std::vector<unsigned int> &dof_to_boundary_mapping,
+ const Function<deal_II_dimension> * const a,
+ std::vector<unsigned int>);
+
+template
+void
+MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension>&,
+ const hp::DoFHandler<deal_II_dimension>&,
+ const hp::QCollection<deal_II_dimension-1>&,
+ SparseMatrix<double>&,
+ const FunctionMap<deal_II_dimension>::type&,
+ Vector<double>&,
+ std::vector<unsigned int>&,
+ const Function<deal_II_dimension> * const,
+ std::vector<unsigned int>);
+
+template
+void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension>&,
+ const hp::QCollection<deal_II_dimension-1>&,
+ SparseMatrix<double>&,
+ const FunctionMap<deal_II_dimension>::type&,
+ Vector<double>&,
+ std::vector<unsigned int>&,
+ const Function<deal_II_dimension> * const,
+ std::vector<unsigned int>);
+
+#endif
+
+
+// non-hp versions of create_laplace_matrix
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const Mapping<deal_II_dimension> &mapping,
+ const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+// hp versions of create_laplace_matrix
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+template
+void MatrixCreator::create_laplace_matrix<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension> * const coefficient);
+
+
+
+#if deal_II_dimension != 3
+
+// non-hp version of create_mass_matrix
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension+1> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<double> &matrix,
+ const Function<deal_II_dimension+1> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension+1> * const coefficient);
+
+
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension+1> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension+1> * const coefficient);
+template
+void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_dimension+1> &rhs,
+ Vector<double> &rhs_vector,
+ const Function<deal_II_dimension+1> * const coefficient);
+
+#if deal_II_dimension == 2
+
+template
+void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension-1> &q,
+ SparseMatrix<double> &matrix,
+ const FunctionMap<deal_II_dimension+1>::type &rhs,
+ Vector<double> &rhs_vector,
+ std::vector<unsigned int> &dof_to_boundary_mapping,
+ const Function<deal_II_dimension+1> * const a,
+ std::vector<unsigned int>);
+
+template
+void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+ const Quadrature<deal_II_dimension-1> &q,
+ SparseMatrix<double> &matrix,
+ const FunctionMap<deal_II_dimension+1>::type &rhs,
+ Vector<double> &rhs_vector,
+ std::vector<unsigned int> &dof_to_boundary_mapping,
+ const Function<deal_II_dimension+1> * const a,
+ std::vector<unsigned int>);
+
+#endif
+
+// #if deal_II_dimension != 1
+// template
+// void
+// MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
+// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension-1> &q,
+// SparseMatrix<double> &matrix,
+// const FunctionMap<deal_II_dimension+1>::type &boundary_functions,
+// Vector<double> &rhs_vector,
+// std::vector<unsigned int> &dof_to_boundary_mapping,
+// const Function<deal_II_dimension+1> * const a,
+// std::vector<unsigned int> &component_mapping);
+// #endif
+
+// template
+// void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_dimension+1>
+// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension-1> &q,
+// SparseMatrix<double> &matrix,
+// const FunctionMap<deal_II_dimension+1>::type &rhs,
+// Vector<double> &rhs_vector,
+// std::vector<unsigned int> &dof_to_boundary_mapping,
+// const Function<deal_II_dimension+1> * const a,
+// std::vector<unsigned int> &component_mapping);
+
+
+// // non-hp version of create_mass_matrix
+// template
+// void MatrixCreator::create_mass_matrix
+// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<double> &matrix,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<double> &matrix,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<double> &matrix,
+// const Function<deal_II_dimension+1> &rhs,
+// Vector<double> &rhs_vector,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<double> &matrix,
+// const Function<deal_II_dimension+1> &rhs,
+// Vector<double> &rhs_vector,
+// const Function<deal_II_dimension+1> * const coefficient);
+
+
+// template
+// void MatrixCreator::create_mass_matrix
+// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<float> &matrix,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<float> &matrix,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const Mapping<deal_II_dimension,deal_II_dimension+1> &mapping,
+// const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<float> &matrix,
+// const Function<deal_II_dimension+1> &rhs,
+// Vector<double> &rhs_vector,
+// const Function<deal_II_dimension+1> * const coefficient);
+// template
+// void MatrixCreator::create_mass_matrix
+// (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
+// const Quadrature<deal_II_dimension> &q,
+// SparseMatrix<float> &matrix,
+// const Function<deal_II_dimension+1> &rhs,
+// Vector<double> &rhs_vector,
+// const Function<deal_II_dimension+1> * const coefficient);
+
+
+#endif
+}
+
DEAL_II_NAMESPACE_OPEN
-
-namespace MeshWorker
-{
- template class IntegrationInfo<deal_II_dimension, deal_II_dimension>;
- template class IntegrationInfoBox<deal_II_dimension, deal_II_dimension>;
-
- template class DoFInfo<deal_II_dimension,deal_II_dimension,float>;
- template class DoFInfoBox<deal_II_dimension,
- DoFInfo<deal_II_dimension,deal_II_dimension,float> >;
-
- template void IntegrationInfo<deal_II_dimension>::fill_local_data(
- const DoFInfo<deal_II_dimension, deal_II_dimension, float>&, bool);
-
- template class DoFInfo<deal_II_dimension,deal_II_dimension,double>;
- template class DoFInfoBox<deal_II_dimension,
- DoFInfo<deal_II_dimension,deal_II_dimension,double> >;
-
- template void IntegrationInfo<deal_II_dimension>::fill_local_data(
- const DoFInfo<deal_II_dimension, deal_II_dimension, double>&, bool);
-
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FEValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FEValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FEFaceValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FEFaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FESubfaceValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FESubfaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
-}
+// explicit instantiations
+#include "mesh_worker_info.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2010 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+namespace MeshWorker
+\{
+ template class IntegrationInfo<deal_II_dimension, deal_II_dimension>;
+ template class IntegrationInfoBox<deal_II_dimension, deal_II_dimension>;
+
+ template class DoFInfo<deal_II_dimension,deal_II_dimension,float>;
+ template class DoFInfoBox<deal_II_dimension,
+ DoFInfo<deal_II_dimension,deal_II_dimension,float> >;
+
+ template void IntegrationInfo<deal_II_dimension>::fill_local_data(
+ const DoFInfo<deal_II_dimension, deal_II_dimension, float>&, bool);
+
+ template class DoFInfo<deal_II_dimension,deal_II_dimension,double>;
+ template class DoFInfoBox<deal_II_dimension,
+ DoFInfo<deal_II_dimension,deal_II_dimension,double> >;
+
+ template void IntegrationInfo<deal_II_dimension>::fill_local_data(
+ const DoFInfo<deal_II_dimension, deal_II_dimension, double>&, bool);
+
+// template void IntegrationInfo<deal_II_dimension>
+// ::initialize<FEValues<deal_II_dimension> >(
+// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
+// const Quadrature<FEValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
+// template void IntegrationInfo<deal_II_dimension>
+// ::initialize<FEFaceValues<deal_II_dimension> >(
+// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
+// const Quadrature<FEFaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
+// template void IntegrationInfo<deal_II_dimension>
+// ::initialize<FESubfaceValues<deal_II_dimension> >(
+// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
+// const Quadrature<FESubfaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
+\}
+}
DEAL_II_NAMESPACE_OPEN
-namespace MeshWorker
-{
- template class VectorDataBase<deal_II_dimension>;
-
#include "mesh_worker_vector_selector.inst"
-}
-
DEAL_II_NAMESPACE_CLOSE
//---------------------------------------------------------------------------
-for (VECTOR : SERIAL_VECTORS)
+for (deal_II_dimension : DIMENSIONS)
{
- template class VectorData<VECTOR,deal_II_dimension>;
- template class MGVectorData<VECTOR,deal_II_dimension>;
+ namespace MeshWorker
+ \{
+ template class VectorDataBase<deal_II_dimension>;
+ \}
+}
+
+for (VECTOR : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
+{
+ namespace MeshWorker
+ \{
+ template class VectorData<VECTOR,deal_II_dimension>;
+ template class MGVectorData<VECTOR,deal_II_dimension>;
+ \}
}
//
//---------------------------------------------------------------------------
-for (VEC : SERIAL_VECTORS)
+for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
{
template class DoFOutputOperator<VEC, deal_II_dimension, deal_II_dimension>;
}
DEAL_II_NAMESPACE_OPEN
-#include "point_value_history.inst"
namespace internal
{
}
+
// explicit instantiations
-template class PointValueHistory<deal_II_dimension>;
+#include "point_value_history.inst"
DEAL_II_NAMESPACE_CLOSE
//
//---------------------------------------------------------------------------
-for (VEC : SERIAL_VECTORS)
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ template class PointValueHistory<deal_II_dimension>;
+}
+
+
+for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
{
template
void PointValueHistory<deal_II_dimension>::evaluate_field
-template class SolutionTransfer<deal_II_dimension, Vector<float>, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, Vector<double>, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, Vector<float>, hp::DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, Vector<double>, hp::DoFHandler<deal_II_dimension> >;
-
-template class SolutionTransfer<deal_II_dimension, BlockVector<float>, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, BlockVector<double>, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, BlockVector<float>, hp::DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, BlockVector<double>, hp::DoFHandler<deal_II_dimension> >;
-
-
-#ifdef DEAL_II_USE_PETSC
-template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, hp::DoFHandler<deal_II_dimension> >;
-
-template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, hp::DoFHandler<deal_II_dimension> >;
-#endif
-
-#ifdef DEAL_II_USE_TRILINOS
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, hp::DoFHandler<deal_II_dimension> >;
-
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, hp::DoFHandler<deal_II_dimension> >;
-
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, hp::DoFHandler<deal_II_dimension> >;
-
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
-template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, hp::DoFHandler<deal_II_dimension> >;
-#endif
-
-#if deal_II_dimension < 3
-template class SolutionTransfer<deal_II_dimension, Vector<double>, DoFHandler<deal_II_dimension, deal_II_dimension+1> >;
-template class SolutionTransfer<deal_II_dimension, BlockVector<double>, hp::DoFHandler<deal_II_dimension, deal_II_dimension+1> >;
-
-#endif
-/*---------------------------- solution_transfer.cc ----------------------*/
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "solution_transfer.inst"
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+template class SolutionTransfer<deal_II_dimension, Vector<float>, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, Vector<double>, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, Vector<float>, hp::DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, Vector<double>, hp::DoFHandler<deal_II_dimension> >;
+
+template class SolutionTransfer<deal_II_dimension, BlockVector<float>, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, BlockVector<double>, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, BlockVector<float>, hp::DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, BlockVector<double>, hp::DoFHandler<deal_II_dimension> >;
+
+
+#ifdef DEAL_II_USE_PETSC
+template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, PETScWrappers::Vector, hp::DoFHandler<deal_II_dimension> >;
+
+template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, PETScWrappers::BlockVector, hp::DoFHandler<deal_II_dimension> >;
+#endif
+
+#ifdef DEAL_II_USE_TRILINOS
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::Vector, hp::DoFHandler<deal_II_dimension> >;
+
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::BlockVector, hp::DoFHandler<deal_II_dimension> >;
+
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::Vector, hp::DoFHandler<deal_II_dimension> >;
+
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, DoFHandler<deal_II_dimension> >;
+template class SolutionTransfer<deal_II_dimension, TrilinosWrappers::MPI::BlockVector, hp::DoFHandler<deal_II_dimension> >;
+#endif
+
+#if deal_II_dimension < 3
+template class SolutionTransfer<deal_II_dimension, Vector<double>, DoFHandler<deal_II_dimension, deal_II_dimension+1> >;
+template class SolutionTransfer<deal_II_dimension, BlockVector<double>, hp::DoFHandler<deal_II_dimension, deal_II_dimension+1> >;
+
+#endif
+}
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id: time_dependent.all_dimensions.cc 21627 2010-08-09 05:10:10Z bangerth $
-// Version: $Name$
-//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2008, 2009, 2010 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <numerics/time_dependent.h>
-#include <base/memory_consumption.h>
-#include <base/thread_management.h>
-
-#include <functional>
-#include <algorithm>
-#include <numeric>
-
-DEAL_II_NAMESPACE_OPEN
-
-TimeDependent::TimeSteppingData::TimeSteppingData (const unsigned int look_ahead,
- const unsigned int look_back)
- :
- look_ahead (look_ahead),
- look_back (look_back)
-{}
-
-
-TimeDependent::TimeDependent (const TimeSteppingData &data_primal,
- const TimeSteppingData &data_dual,
- const TimeSteppingData &data_postprocess):
- sweep_no (numbers::invalid_unsigned_int),
- timestepping_data_primal (data_primal),
- timestepping_data_dual (data_dual),
- timestepping_data_postprocess (data_postprocess)
-{}
-
-
-TimeDependent::~TimeDependent ()
-{
- while (timesteps.size() != 0)
- delete_timestep (0);
-}
-
-
-void
-TimeDependent::insert_timestep (const TimeStepBase *position,
- TimeStepBase *new_timestep)
-{
- Assert ((std::find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
- (position == 0),
- ExcInvalidPosition());
- // first insert the new time step
- // into the doubly linked list
- // of timesteps
- if (position == 0)
- {
- // at the end
- new_timestep->set_next_timestep (0);
- if (timesteps.size() > 0)
- {
- timesteps.back()->set_next_timestep (new_timestep);
- new_timestep->set_previous_timestep (timesteps.back());
- }
- else
- new_timestep->set_previous_timestep (0);
- }
- else
- if (position == timesteps[0])
- {
- // at the beginning
- new_timestep->set_previous_timestep (0);
- if (timesteps.size() > 0)
- {
- timesteps[0]->set_previous_timestep (new_timestep);
- new_timestep->set_next_timestep (timesteps[0]);
- }
- else
- new_timestep->set_next_timestep (0);
- }
- else
- {
- // inner time step
- std::vector<SmartPointer<TimeStepBase,TimeDependent> >::iterator insert_position
- = std::find(timesteps.begin(), timesteps.end(), position);
-
- (*(insert_position-1))->set_next_timestep (new_timestep);
- new_timestep->set_previous_timestep (*(insert_position-1));
- new_timestep->set_next_timestep (*insert_position);
- (*insert_position)->set_previous_timestep (new_timestep);
- };
-
- // finally enter it into the
- // array
- timesteps.insert ((position == 0 ?
- timesteps.end() :
- std::find(timesteps.begin(), timesteps.end(), position)),
- new_timestep);
-}
-
-
-void
-TimeDependent::add_timestep (TimeStepBase *new_timestep)
-{
- insert_timestep (0, new_timestep);
-}
-
-
-void TimeDependent::delete_timestep (const unsigned int position)
-{
- Assert (position<timesteps.size(),
- ExcInvalidPosition());
-
- // Remember time step object for
- // later deletion and unlock
- // SmartPointer
- TimeStepBase* t = timesteps[position];
- timesteps[position] = 0;
- // Now delete unsubscribed object
- delete t;
-
- timesteps.erase (timesteps.begin() + position);
-
- // reset "next" pointer of previous
- // time step if possible
- //
- // note that if now position==size,
- // then we deleted the last time step
- if (position != 0)
- timesteps[position-1]->set_next_timestep ((position<timesteps.size()) ?
- timesteps[position] :
- /*null*/SmartPointer<TimeStepBase,TimeDependent>());
-
- // same for "previous" pointer of next
- // time step
- if (position<timesteps.size())
- timesteps[position]->set_previous_timestep ((position!=0) ?
- timesteps[position-1] :
- /*null*/SmartPointer<TimeStepBase,TimeDependent>());
-}
-
-
-void
-TimeDependent::solve_primal_problem ()
-{
- do_loop (std::mem_fun(&TimeStepBase::init_for_primal_problem),
- std::mem_fun(&TimeStepBase::solve_primal_problem),
- timestepping_data_primal,
- forward);
-}
-
-
-void
-TimeDependent::solve_dual_problem ()
-{
- do_loop (std::mem_fun(&TimeStepBase::init_for_dual_problem),
- std::mem_fun(&TimeStepBase::solve_dual_problem),
- timestepping_data_dual,
- backward);
-}
-
-
-void
-TimeDependent::postprocess ()
-{
- do_loop (std::mem_fun(&TimeStepBase::init_for_postprocessing),
- std::mem_fun(&TimeStepBase::postprocess_timestep),
- timestepping_data_postprocess,
- forward);
-}
-
-
-
-void TimeDependent::start_sweep (const unsigned int s)
-{
- sweep_no = s;
-
- // reset the number each
- // time step has, since some time
- // steps might have been added since
- // the last time we visited them
- //
- // also set the sweep we will
- // process in the sequel
- for (unsigned int step=0; step<timesteps.size(); ++step)
- {
- timesteps[step]->set_timestep_no (step);
- timesteps[step]->set_sweep_no (sweep_no);
- };
-
- for (unsigned int step=0; step<timesteps.size(); ++step)
- timesteps[step]->start_sweep ();
-}
-
-
-
-void TimeDependent::end_sweep (const unsigned int n_threads)
-{
- if (DEAL_II_USE_MT && (n_threads > 1))
- {
- const unsigned int stride = timesteps.size() / n_threads;
- Threads::ThreadGroup<> threads;
- void (TimeDependent::*p) (const unsigned int, const unsigned int)
- = &TimeDependent::end_sweep;
- for (unsigned int i=0; i<n_threads; ++i)
- threads += Threads::new_thread (p, *this, i*stride,
- (i == n_threads-1 ?
- timesteps.size() :
- (i+1)*stride));
- threads.join_all();
- }
- else
- // now do the work
- end_sweep (0, timesteps.size());
-}
-
-
-
-void TimeDependent::end_sweep (const unsigned int begin,
- const unsigned int end)
-{
- for (unsigned int step=begin; step<end; ++step)
- timesteps[step]->end_sweep ();
-}
-
-
-
-unsigned int TimeDependent::memory_consumption () const
-{
- unsigned int mem = (MemoryConsumption::memory_consumption (timesteps) +
- MemoryConsumption::memory_consumption (sweep_no) +
- sizeof(timestepping_data_primal) +
- sizeof(timestepping_data_dual) +
- sizeof(timestepping_data_postprocess));
- for (unsigned int i=0; i<timesteps.size(); ++i)
- mem += MemoryConsumption::memory_consumption (*timesteps[i]);
-
- return mem;
-}
-
-
-
-/* --------------------------------------------------------------------- */
-
-
-TimeStepBase::TimeStepBase (const double time) :
- previous_timestep(0),
- next_timestep (0),
- sweep_no (numbers::invalid_unsigned_int),
- timestep_no (numbers::invalid_unsigned_int),
- time (time)
-{}
-
-
-
-TimeStepBase::~TimeStepBase ()
-{}
-
-
-
-void
-TimeStepBase::wake_up (const unsigned )
-{}
-
-
-
-void
-TimeStepBase::sleep (const unsigned)
-{}
-
-
-
-void
-TimeStepBase::start_sweep ()
-{}
-
-
-
-void
-TimeStepBase::end_sweep ()
-{}
-
-
-
-void
-TimeStepBase::init_for_primal_problem ()
-{
- next_action = primal_problem;
-}
-
-
-
-void
-TimeStepBase::init_for_dual_problem ()
-{
- next_action = dual_problem;
-}
-
-
-
-void
-TimeStepBase::init_for_postprocessing ()
-{
- next_action = postprocess;
-}
-
-
-
-void
-TimeStepBase::solve_dual_problem ()
-{
- Assert (false, ExcPureFunctionCalled());
-}
-
-
-
-void
-TimeStepBase::postprocess_timestep ()
-{
- Assert (false, ExcPureFunctionCalled());
-}
-
-
-
-double
-TimeStepBase::get_time () const
-{
- return time;
-}
-
-
-
-unsigned int
-TimeStepBase::get_timestep_no () const
-{
- return timestep_no;
-}
-
-
-
-double
-TimeStepBase::get_backward_timestep () const
-{
- Assert (previous_timestep != 0, ExcCantComputeTimestep());
- return time - previous_timestep->time;
-}
-
-
-
-double
-TimeStepBase::get_forward_timestep () const
-{
- Assert (next_timestep != 0, ExcCantComputeTimestep());
- return next_timestep->time - time;
-}
-
-
-
-void
-TimeStepBase::set_previous_timestep (const TimeStepBase *previous)
-{
- previous_timestep = previous;
-}
-
-
-
-void
-TimeStepBase::set_next_timestep (const TimeStepBase *next)
-{
- next_timestep = next;
-}
-
-
-
-void
-TimeStepBase::set_timestep_no (const unsigned int step_no)
-{
- timestep_no = step_no;
-}
-
-
-
-void
-TimeStepBase::set_sweep_no (const unsigned int sweep)
-{
- sweep_no = sweep;
-}
-
-
-
-unsigned int
-TimeStepBase::memory_consumption () const
-{
- // only simple data types
- return sizeof(*this);
-}
-
-
-DEAL_II_NAMESPACE_CLOSE
DEAL_II_NAMESPACE_OPEN
+TimeDependent::TimeSteppingData::TimeSteppingData (const unsigned int look_ahead,
+ const unsigned int look_back)
+ :
+ look_ahead (look_ahead),
+ look_back (look_back)
+{}
+
+
+TimeDependent::TimeDependent (const TimeSteppingData &data_primal,
+ const TimeSteppingData &data_dual,
+ const TimeSteppingData &data_postprocess):
+ sweep_no (numbers::invalid_unsigned_int),
+ timestepping_data_primal (data_primal),
+ timestepping_data_dual (data_dual),
+ timestepping_data_postprocess (data_postprocess)
+{}
+
+
+TimeDependent::~TimeDependent ()
+{
+ while (timesteps.size() != 0)
+ delete_timestep (0);
+}
+
+
+void
+TimeDependent::insert_timestep (const TimeStepBase *position,
+ TimeStepBase *new_timestep)
+{
+ Assert ((std::find(timesteps.begin(), timesteps.end(), position) != timesteps.end()) ||
+ (position == 0),
+ ExcInvalidPosition());
+ // first insert the new time step
+ // into the doubly linked list
+ // of timesteps
+ if (position == 0)
+ {
+ // at the end
+ new_timestep->set_next_timestep (0);
+ if (timesteps.size() > 0)
+ {
+ timesteps.back()->set_next_timestep (new_timestep);
+ new_timestep->set_previous_timestep (timesteps.back());
+ }
+ else
+ new_timestep->set_previous_timestep (0);
+ }
+ else
+ if (position == timesteps[0])
+ {
+ // at the beginning
+ new_timestep->set_previous_timestep (0);
+ if (timesteps.size() > 0)
+ {
+ timesteps[0]->set_previous_timestep (new_timestep);
+ new_timestep->set_next_timestep (timesteps[0]);
+ }
+ else
+ new_timestep->set_next_timestep (0);
+ }
+ else
+ {
+ // inner time step
+ std::vector<SmartPointer<TimeStepBase,TimeDependent> >::iterator insert_position
+ = std::find(timesteps.begin(), timesteps.end(), position);
+
+ (*(insert_position-1))->set_next_timestep (new_timestep);
+ new_timestep->set_previous_timestep (*(insert_position-1));
+ new_timestep->set_next_timestep (*insert_position);
+ (*insert_position)->set_previous_timestep (new_timestep);
+ };
+
+ // finally enter it into the
+ // array
+ timesteps.insert ((position == 0 ?
+ timesteps.end() :
+ std::find(timesteps.begin(), timesteps.end(), position)),
+ new_timestep);
+}
+
+
+void
+TimeDependent::add_timestep (TimeStepBase *new_timestep)
+{
+ insert_timestep (0, new_timestep);
+}
+
+
+void TimeDependent::delete_timestep (const unsigned int position)
+{
+ Assert (position<timesteps.size(),
+ ExcInvalidPosition());
+
+ // Remember time step object for
+ // later deletion and unlock
+ // SmartPointer
+ TimeStepBase* t = timesteps[position];
+ timesteps[position] = 0;
+ // Now delete unsubscribed object
+ delete t;
+
+ timesteps.erase (timesteps.begin() + position);
+
+ // reset "next" pointer of previous
+ // time step if possible
+ //
+ // note that if now position==size,
+ // then we deleted the last time step
+ if (position != 0)
+ timesteps[position-1]->set_next_timestep ((position<timesteps.size()) ?
+ timesteps[position] :
+ /*null*/SmartPointer<TimeStepBase,TimeDependent>());
+
+ // same for "previous" pointer of next
+ // time step
+ if (position<timesteps.size())
+ timesteps[position]->set_previous_timestep ((position!=0) ?
+ timesteps[position-1] :
+ /*null*/SmartPointer<TimeStepBase,TimeDependent>());
+}
+
+
+void
+TimeDependent::solve_primal_problem ()
+{
+ do_loop (std::mem_fun(&TimeStepBase::init_for_primal_problem),
+ std::mem_fun(&TimeStepBase::solve_primal_problem),
+ timestepping_data_primal,
+ forward);
+}
+
+
+void
+TimeDependent::solve_dual_problem ()
+{
+ do_loop (std::mem_fun(&TimeStepBase::init_for_dual_problem),
+ std::mem_fun(&TimeStepBase::solve_dual_problem),
+ timestepping_data_dual,
+ backward);
+}
+
+
+void
+TimeDependent::postprocess ()
+{
+ do_loop (std::mem_fun(&TimeStepBase::init_for_postprocessing),
+ std::mem_fun(&TimeStepBase::postprocess_timestep),
+ timestepping_data_postprocess,
+ forward);
+}
+
+
+
+void TimeDependent::start_sweep (const unsigned int s)
+{
+ sweep_no = s;
+
+ // reset the number each
+ // time step has, since some time
+ // steps might have been added since
+ // the last time we visited them
+ //
+ // also set the sweep we will
+ // process in the sequel
+ for (unsigned int step=0; step<timesteps.size(); ++step)
+ {
+ timesteps[step]->set_timestep_no (step);
+ timesteps[step]->set_sweep_no (sweep_no);
+ };
+
+ for (unsigned int step=0; step<timesteps.size(); ++step)
+ timesteps[step]->start_sweep ();
+}
+
+
+
+void TimeDependent::end_sweep (const unsigned int n_threads)
+{
+ if (DEAL_II_USE_MT && (n_threads > 1))
+ {
+ const unsigned int stride = timesteps.size() / n_threads;
+ Threads::ThreadGroup<> threads;
+ void (TimeDependent::*p) (const unsigned int, const unsigned int)
+ = &TimeDependent::end_sweep;
+ for (unsigned int i=0; i<n_threads; ++i)
+ threads += Threads::new_thread (p, *this, i*stride,
+ (i == n_threads-1 ?
+ timesteps.size() :
+ (i+1)*stride));
+ threads.join_all();
+ }
+ else
+ // now do the work
+ end_sweep (0, timesteps.size());
+}
+
+
+
+void TimeDependent::end_sweep (const unsigned int begin,
+ const unsigned int end)
+{
+ for (unsigned int step=begin; step<end; ++step)
+ timesteps[step]->end_sweep ();
+}
+
+
+
+unsigned int TimeDependent::memory_consumption () const
+{
+ unsigned int mem = (MemoryConsumption::memory_consumption (timesteps) +
+ MemoryConsumption::memory_consumption (sweep_no) +
+ sizeof(timestepping_data_primal) +
+ sizeof(timestepping_data_dual) +
+ sizeof(timestepping_data_postprocess));
+ for (unsigned int i=0; i<timesteps.size(); ++i)
+ mem += MemoryConsumption::memory_consumption (*timesteps[i]);
+
+ return mem;
+}
+
+
+
+/* --------------------------------------------------------------------- */
+
+
+TimeStepBase::TimeStepBase (const double time) :
+ previous_timestep(0),
+ next_timestep (0),
+ sweep_no (numbers::invalid_unsigned_int),
+ timestep_no (numbers::invalid_unsigned_int),
+ time (time)
+{}
+
+
+
+TimeStepBase::~TimeStepBase ()
+{}
+
+
+
+void
+TimeStepBase::wake_up (const unsigned )
+{}
+
+
+
+void
+TimeStepBase::sleep (const unsigned)
+{}
+
+
+
+void
+TimeStepBase::start_sweep ()
+{}
+
+
+
+void
+TimeStepBase::end_sweep ()
+{}
+
+
+
+void
+TimeStepBase::init_for_primal_problem ()
+{
+ next_action = primal_problem;
+}
+
+
+
+void
+TimeStepBase::init_for_dual_problem ()
+{
+ next_action = dual_problem;
+}
+
+
+
+void
+TimeStepBase::init_for_postprocessing ()
+{
+ next_action = postprocess;
+}
+
+
+
+void
+TimeStepBase::solve_dual_problem ()
+{
+ Assert (false, ExcPureFunctionCalled());
+}
+
+
+
+void
+TimeStepBase::postprocess_timestep ()
+{
+ Assert (false, ExcPureFunctionCalled());
+}
+
+
+
+double
+TimeStepBase::get_time () const
+{
+ return time;
+}
+
+
+
+unsigned int
+TimeStepBase::get_timestep_no () const
+{
+ return timestep_no;
+}
+
+
+
+double
+TimeStepBase::get_backward_timestep () const
+{
+ Assert (previous_timestep != 0, ExcCantComputeTimestep());
+ return time - previous_timestep->time;
+}
+
+
+
+double
+TimeStepBase::get_forward_timestep () const
+{
+ Assert (next_timestep != 0, ExcCantComputeTimestep());
+ return next_timestep->time - time;
+}
+
+
+
+void
+TimeStepBase::set_previous_timestep (const TimeStepBase *previous)
+{
+ previous_timestep = previous;
+}
+
+
+
+void
+TimeStepBase::set_next_timestep (const TimeStepBase *next)
+{
+ next_timestep = next;
+}
+
+
+
+void
+TimeStepBase::set_timestep_no (const unsigned int step_no)
+{
+ timestep_no = step_no;
+}
+
+
+
+void
+TimeStepBase::set_sweep_no (const unsigned int sweep)
+{
+ sweep_no = sweep;
+}
+
+
+
+unsigned int
+TimeStepBase::memory_consumption () const
+{
+ // only simple data types
+ return sizeof(*this);
+}
+
+
template <int dim>
TimeStepBase_Tria<dim>::TimeStepBase_Tria() :
}
-// explicit instantiations
-template class TimeStepBase_Tria<deal_II_dimension>;
-namespace TimeStepBase_Tria_Flags
-{
- template class Flags<deal_II_dimension>;
- template class RefinementFlags<deal_II_dimension>;
- template class RefinementData<deal_II_dimension>;
-}
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "time_dependent.inst"
+
DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------------------------------------------------------
+
+for (deal_II_dimension : DIMENSIONS)
+{
+ template class TimeStepBase_Tria<deal_II_dimension>;
+ namespace TimeStepBase_Tria_Flags
+ \{
+ template class Flags<deal_II_dimension>;
+ template class RefinementFlags<deal_II_dimension>;
+ template class RefinementData<deal_II_dimension>;
+ \}
+}
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <lac/vector.h>
-#include <numerics/vectors.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-
-void
-VectorTools::subtract_mean_value(Vector<double> &v,
- const std::vector<bool> &p_select)
-{
- const unsigned int n = v.size();
- Assert(n == p_select.size(),
- ExcDimensionMismatch(n, p_select.size()));
-
- double s = 0;
- unsigned int counter = 0;
-
- for (unsigned int i=0; i<n; ++i)
- if (p_select[i])
- {
- s += v(i);
- ++counter;
- }
- Assert (counter > 0, ExcNoComponentSelected());
-
- s /= counter;
-
- for (unsigned int i=0; i<n; ++i)
- if (p_select[i])
- v(i) -= s;
-}
-
-DEAL_II_NAMESPACE_CLOSE
#include<numerics/vectors.templates.h>
-// explicit instantiations
-
-
DEAL_II_NAMESPACE_OPEN
-#include "vectors.inst"
-
-template
-void VectorTools::create_right_hand_side<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const Quadrature<deal_II_dimension> &,
- const Function<deal_II_dimension> &,
- Vector<double> &);
-template
-void VectorTools::create_right_hand_side<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Quadrature<deal_II_dimension> &,
- const Function<deal_II_dimension> &,
- Vector<double> &);
-
-template
-void VectorTools::create_right_hand_side<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &,
- const hp::DoFHandler<deal_II_dimension> &,
- const hp::QCollection<deal_II_dimension> &,
- const Function<deal_II_dimension> &,
- Vector<double> &);
-template
-void VectorTools::create_right_hand_side<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &,
- const hp::QCollection<deal_II_dimension> &,
- const Function<deal_II_dimension> &,
- Vector<double> &);
-
-template
-void VectorTools::create_point_source_vector<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const Point<deal_II_dimension> &,
- Vector<double> &);
-template
-void VectorTools::create_point_source_vector<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Point<deal_II_dimension> &,
- Vector<double> &);
-
-template
-void VectorTools::create_point_source_vector<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &,
- const hp::DoFHandler<deal_II_dimension> &,
- const Point<deal_II_dimension> &,
- Vector<double> &);
-template
-void VectorTools::create_point_source_vector<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &,
- const Point<deal_II_dimension> &,
- Vector<double> &);
-
-template
-void
-VectorTools::create_boundary_right_hand_side<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const Quadrature<deal_II_dimension-1> &,
- const Function<deal_II_dimension> &,
- Vector<double> &,
- const std::set<unsigned char> &);
-
-template
-void
-VectorTools::create_boundary_right_hand_side<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const Quadrature<deal_II_dimension-1> &,
- const Function<deal_II_dimension> &,
- Vector<double> &,
- const std::set<unsigned char> &);
-
-template
-void
-VectorTools::create_boundary_right_hand_side<deal_II_dimension>
-(const hp::MappingCollection<deal_II_dimension> &,
- const hp::DoFHandler<deal_II_dimension> &,
- const hp::QCollection<deal_II_dimension-1> &,
- const Function<deal_II_dimension> &,
- Vector<double> &,
- const std::set<unsigned char> &);
-
-template
-void
-VectorTools::create_boundary_right_hand_side<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension> &,
- const hp::QCollection<deal_II_dimension-1> &,
- const Function<deal_II_dimension> &,
- Vector<double> &,
- const std::set<unsigned char> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension> &,
- const hp::DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension> &,
- const MGDoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-#if deal_II_dimension < 3
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values (
- const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- ConstraintMatrix &,
- const std::vector<bool> &);
-#endif
-
-template
-void VectorTools::project_boundary_values<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- const Quadrature<deal_II_dimension-1>&,
- std::map<unsigned int,double>&, std::vector<unsigned int>);
-
-template
-void VectorTools::project_boundary_values<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- const Quadrature<deal_II_dimension-1>&,
- std::map<unsigned int,double>&, std::vector<unsigned int>);
-
-
-template
-void VectorTools::project_boundary_values<deal_II_dimension>
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- const Quadrature<deal_II_dimension-1>&,
- ConstraintMatrix&, std::vector<unsigned int>);
-
-template
-void VectorTools::project_boundary_values<deal_II_dimension>
-(const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- const Quadrature<deal_II_dimension-1>&,
- ConstraintMatrix&, std::vector<unsigned int>);
-
-
-#if deal_II_dimension != 1
-template
-void VectorTools::project_boundary_values_curl_conforming<deal_II_dimension>
-(const DoFHandler<deal_II_dimension>&,
- const unsigned int,
- const Function<deal_II_dimension>&,
- const unsigned char,
- ConstraintMatrix&,
- const Mapping<deal_II_dimension>&);
-template
-void VectorTools::project_boundary_values_curl_conforming<deal_II_dimension>
-(const hp::DoFHandler<deal_II_dimension>&,
- const unsigned int,
- const Function<deal_II_dimension>&,
- const unsigned char,
- ConstraintMatrix&,
- const hp::MappingCollection<deal_II_dimension>&);
-template
void
-VectorTools::compute_no_normal_flux_constraints (const DoFHandler<deal_II_dimension> &dof_handler,
- const unsigned int first_vector_component,
- const std::set<unsigned char> &boundary_ids,
- ConstraintMatrix &constraints,
- const Mapping<deal_II_dimension> &mapping);
-#endif
-
-
-
-template
-void VectorTools::interpolate_boundary_values
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values
-(const Mapping<deal_II_dimension> &,
- const DoFHandler<deal_II_dimension> &,
- const unsigned char,
- const Function<deal_II_dimension> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-#if deal_II_dimension < 3
-template
-void VectorTools::interpolate_boundary_values
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const FunctionMap<deal_II_dimension+1>::type &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-template
-void VectorTools::interpolate_boundary_values
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const unsigned char,
- const Function<deal_II_dimension+1> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-#endif
-
-
-template
-void
-VectorTools::interpolate_boundary_values
-(const DoFHandler<deal_II_dimension> &,
- const FunctionMap<deal_II_dimension>::type &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-
-
-#if deal_II_dimension != 3
-
-template
-void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
-(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const Quadrature<deal_II_dimension> &,
- const Function<deal_II_dimension+1> &,
- Vector<double> &);
-template
-void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
-(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
- const Quadrature<deal_II_dimension> &,
- const Function<deal_II_dimension+1> &,
- Vector<double> &);
-
-// template
-// void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
-// (const hp::MappingCollection<deal_II_dimension,deal_II_dimension+1> &,
-// const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// const hp::QCollection<deal_II_dimension> &,
-// const Function<deal_II_dimension+1> &,
-// Vector<double> &);
-// template
-// void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
-// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
-// const hp::QCollection<deal_II_dimension> &,
-// const Function<deal_II_dimension+1> &,
-// Vector<double> &);
-
-#endif
+VectorTools::subtract_mean_value(Vector<double> &v,
+ const std::vector<bool> &p_select)
+{
+ const unsigned int n = v.size();
+ Assert(n == p_select.size(),
+ ExcDimensionMismatch(n, p_select.size()));
+
+ double s = 0;
+ unsigned int counter = 0;
+
+ for (unsigned int i=0; i<n; ++i)
+ if (p_select[i])
+ {
+ s += v(i);
+ ++counter;
+ }
+ Assert (counter > 0, ExcNoComponentSelected());
+
+ s /= counter;
+
+ for (unsigned int i=0; i<n; ++i)
+ if (p_select[i])
+ v(i) -= s;
+}
+
+
+
+// ---------------------------- explicit instantiations --------------------
+#include "vectors.inst"
DEAL_II_NAMESPACE_CLOSE
//
//---------------------------------------------------------------------------
-for (VEC : SERIAL_VECTORS)
+for (VEC : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
{
template
void VectorTools::interpolate
#endif
}
+
+
+for ( deal_II_dimension : DIMENSIONS )
+{
+template
+void VectorTools::create_right_hand_side<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &);
+template
+void VectorTools::create_right_hand_side<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &);
+
+template
+void VectorTools::create_right_hand_side<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &,
+ const hp::DoFHandler<deal_II_dimension> &,
+ const hp::QCollection<deal_II_dimension> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &);
+template
+void VectorTools::create_right_hand_side<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &,
+ const hp::QCollection<deal_II_dimension> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &);
+
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
+
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &,
+ const hp::DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
+template
+void VectorTools::create_point_source_vector<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &,
+ const Point<deal_II_dimension> &,
+ Vector<double> &);
+
+template
+void
+VectorTools::create_boundary_right_hand_side<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension-1> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &,
+ const std::set<unsigned char> &);
+
+template
+void
+VectorTools::create_boundary_right_hand_side<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension-1> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &,
+ const std::set<unsigned char> &);
+
+template
+void
+VectorTools::create_boundary_right_hand_side<deal_II_dimension>
+(const hp::MappingCollection<deal_II_dimension> &,
+ const hp::DoFHandler<deal_II_dimension> &,
+ const hp::QCollection<deal_II_dimension-1> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &,
+ const std::set<unsigned char> &);
+
+template
+void
+VectorTools::create_boundary_right_hand_side<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension> &,
+ const hp::QCollection<deal_II_dimension-1> &,
+ const Function<deal_II_dimension> &,
+ Vector<double> &,
+ const std::set<unsigned char> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension> &,
+ const hp::DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension> &,
+ const MGDoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+#if deal_II_dimension < 3
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values (
+ const MGDoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ ConstraintMatrix &,
+ const std::vector<bool> &);
+#endif
+
+template
+void VectorTools::project_boundary_values<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ const Quadrature<deal_II_dimension-1>&,
+ std::map<unsigned int,double>&, std::vector<unsigned int>);
+
+template
+void VectorTools::project_boundary_values<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ const Quadrature<deal_II_dimension-1>&,
+ std::map<unsigned int,double>&, std::vector<unsigned int>);
+
+
+template
+void VectorTools::project_boundary_values<deal_II_dimension>
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ const Quadrature<deal_II_dimension-1>&,
+ ConstraintMatrix&, std::vector<unsigned int>);
+
+template
+void VectorTools::project_boundary_values<deal_II_dimension>
+(const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ const Quadrature<deal_II_dimension-1>&,
+ ConstraintMatrix&, std::vector<unsigned int>);
+
+
+#if deal_II_dimension != 1
+template
+void VectorTools::project_boundary_values_curl_conforming<deal_II_dimension>
+(const DoFHandler<deal_II_dimension>&,
+ const unsigned int,
+ const Function<deal_II_dimension>&,
+ const unsigned char,
+ ConstraintMatrix&,
+ const Mapping<deal_II_dimension>&);
+template
+void VectorTools::project_boundary_values_curl_conforming<deal_II_dimension>
+(const hp::DoFHandler<deal_II_dimension>&,
+ const unsigned int,
+ const Function<deal_II_dimension>&,
+ const unsigned char,
+ ConstraintMatrix&,
+ const hp::MappingCollection<deal_II_dimension>&);
+template
+void
+VectorTools::compute_no_normal_flux_constraints (const DoFHandler<deal_II_dimension> &dof_handler,
+ const unsigned int first_vector_component,
+ const std::set<unsigned char> &boundary_ids,
+ ConstraintMatrix &constraints,
+ const Mapping<deal_II_dimension> &mapping);
+#endif
+
+
+
+template
+void VectorTools::interpolate_boundary_values
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values
+(const Mapping<deal_II_dimension> &,
+ const DoFHandler<deal_II_dimension> &,
+ const unsigned char,
+ const Function<deal_II_dimension> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+#if deal_II_dimension < 3
+template
+void VectorTools::interpolate_boundary_values
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const FunctionMap<deal_II_dimension+1>::type &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+template
+void VectorTools::interpolate_boundary_values
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const unsigned char,
+ const Function<deal_II_dimension+1> &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+#endif
+
+
+template
+void
+VectorTools::interpolate_boundary_values
+(const DoFHandler<deal_II_dimension> &,
+ const FunctionMap<deal_II_dimension>::type &,
+ std::map<unsigned int,double> &,
+ const std::vector<bool> &);
+
+
+#if deal_II_dimension != 3
+
+template
+void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
+(const Mapping<deal_II_dimension,deal_II_dimension+1> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const Quadrature<deal_II_dimension> &,
+ const Function<deal_II_dimension+1> &,
+ Vector<double> &);
+template
+void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
+(const DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+ const Quadrature<deal_II_dimension> &,
+ const Function<deal_II_dimension+1> &,
+ Vector<double> &);
+
+// template
+// void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
+// (const hp::MappingCollection<deal_II_dimension,deal_II_dimension+1> &,
+// const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+// const hp::QCollection<deal_II_dimension> &,
+// const Function<deal_II_dimension+1> &,
+// Vector<double> &);
+// template
+// void VectorTools::create_right_hand_side<deal_II_dimension,deal_II_dimension+1>
+// (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &,
+// const hp::QCollection<deal_II_dimension> &,
+// const Function<deal_II_dimension+1> &,
+// Vector<double> &);
+
+#endif
+}