const std::vector<bool> &component_mask = std::vector<bool>());
/**
- * Declaration of specialization
- * of the previous function for
- * 1d and a DoFHandler.
- */
- static
- void
- interpolate_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const FunctionMap<1>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
-
- /**
- * Declaration of specialization
- * of the previous function for
- * 1d and a hp::DoFHandler().
- */
- static
- void
- interpolate_boundary_values (const Mapping<1> &mapping,
- const hp::DoFHandler<1> &dof,
- const FunctionMap<1>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
-
- /**
+ * @deprecated This function is there mainly
+ * for backward compatibility.
+ *
* Same function as above, but
* taking only one pair of
* boundary indicator and
* function with remapped
* arguments.
*
- * This function is there mainly
- * for backward compatibility.
*/
template <int dim, template <int> class DH>
static
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask = std::vector<bool>());
- /**
- * Declaration of specialization
- * of the previous function for
- * 1d.
- */
- template <template <int> class DH>
- static
- void
- interpolate_boundary_values (const Mapping<1> &mapping,
- const DH<1> &dof,
- const unsigned char boundary_component,
- const Function<1> &boundary_function,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask = std::vector<bool>());
-
-
/**
* Calls the other
* @p interpolate_boundary_values
* matches that of the finite
* element used by @p dof.
*
+ * In 1d, projection equals
+ * interpolation. Therefore,
+ * interpolate_boundary_values is
+ * called.
+ *
* See the general documentation of this
* class for further information.
*/
const Quadrature<dim-1> &q,
std::map<unsigned int,double> &boundary_values);
- /**
- * Declaration of specialization
- * of the previous function for
- * 1d. Since in 1d projection
- * equals interpolation, the
- * interpolation function is
- * called.
- */
- static void project_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const FunctionMap<1>::type &boundary_functions,
- const Quadrature<0> &q,
- std::map<unsigned int,double> &boundary_values);
-
/**
* Calls the @p project_boundary_values
* function, see above, with
Vector<double> &rhs_vector,
const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
- /**
- * Specialization of above
- * function for 1d. Since the
- * computation is not useful in
- * 1d, this function simply
- * throws an exception.
- */
- static void create_boundary_right_hand_side (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const Quadrature<0> &q,
- const Function<1> &rhs,
- Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
-
/**
* Calls the
* @p create_boundary_right_hand_side
Vector<double> &rhs_vector,
const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
- /**
- * Specialization of above
- * function for 1d. Since the
- * computation is not useful in
- * 1d, this function simply
- * throws an exception.
- */
- static void create_boundary_right_hand_side (const hp::MappingCollection<1> &mapping,
- const hp::DoFHandler<1> &dof,
- const hp::QCollection<0> &q,
- const Function<1> &rhs,
- Vector<double> &rhs_vector,
- const std::set<unsigned char> &boundary_indicators = std::set<unsigned char>());
-
/**
* Calls the @p
* create_boundary_right_hand_side
#else
+// Implementation for 1D
+template <int dim>
void
-VectorTools::create_boundary_right_hand_side (const Mapping<1> &,
- const DoFHandler<1> &,
- const Quadrature<0> &,
- const Function<1> &,
+VectorTools::create_boundary_right_hand_side (const Mapping<dim> &,
+ const DoFHandler<dim> &,
+ const Quadrature<dim-1> &,
+ const Function<dim> &,
Vector<double> &,
const std::set<unsigned char> &)
{
- Assert (false, ExcImpossibleInDim(1));
+ Assert (false, ExcImpossibleInDim(dim));
}
#endif
#else
+// Implementation for 1D
+template <int dim>
void
-VectorTools::create_boundary_right_hand_side (const hp::MappingCollection<1> &,
- const hp::DoFHandler<1> &,
- const hp::QCollection<0> &,
- const Function<1> &,
+VectorTools::create_boundary_right_hand_side (const hp::MappingCollection<dim> &,
+ const hp::DoFHandler<dim> &,
+ const hp::QCollection<dim-1> &,
+ const Function<dim> &,
Vector<double> &,
const std::set<unsigned char> &)
{
//TODO[?] Actually the Mapping object should be a MappingCollection object for the
// hp::DoFHandler.
-template <template <int> class DH>
+template <int dim, template <int> class DH>
void
-VectorTools::interpolate_boundary_values (const Mapping<1> &,
- const DH<1> &dof,
+VectorTools::interpolate_boundary_values (const Mapping<dim> &,
+ const DH<dim> &dof,
const unsigned char boundary_component,
- const Function<1> &boundary_function,
+ const Function<dim> &boundary_function,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask_)
{
// cell by first traversing the coarse
// grid to its end and then going
// to the children
- typename DH<1>::cell_iterator outermost_cell = dof.begin(0);
+ typename DH<dim>::cell_iterator outermost_cell = dof.begin(0);
while (outermost_cell->neighbor(direction).state() == IteratorState::valid)
outermost_cell = outermost_cell->neighbor(direction);
// get the FE corresponding to this
// cell
- const FiniteElement<1> &fe = outermost_cell->get_fe();
+ const FiniteElement<dim> &fe = outermost_cell->get_fe();
Assert (fe.n_components() == boundary_function.n_components,
ExcDimensionMismatch(fe.n_components(), boundary_function.n_components));
//TODO[?] Actually the Mapping object should be a MappingCollection object for the
// hp::DoFHandler.
+
+// Implementation for 1D
+template <int dim, template <int> class DH>
void
-VectorTools::interpolate_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const FunctionMap<1>::type &function_map,
+VectorTools::interpolate_boundary_values (const Mapping<dim> &mapping,
+ const DH<dim> &dof,
+ const typename FunctionMap<dim>::type &function_map,
std::map<unsigned int,double> &boundary_values,
const std::vector<bool> &component_mask)
{
- for (FunctionMap<1>::type::const_iterator i=function_map.begin();
+ for (typename FunctionMap<dim>::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.
-void
-VectorTools::interpolate_boundary_values (const Mapping<1> &mapping,
- const hp::DoFHandler<1> &dof,
- const FunctionMap<1>::type &function_map,
- std::map<unsigned int,double> &boundary_values,
- const std::vector<bool> &component_mask)
-{
- for (FunctionMap<1>::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);
-}
-#endif
+#else
template <int dim, template <int> class DH>
component_mask);
}
-
+#endif
//TODO[?] Change for real hp::DoFHandler
// This function might not work anymore if the real hp::DoFHandler is available.
#if deal_II_dimension == 1
+// Implementation for 1D
+template <int dim>
void
-VectorTools::project_boundary_values (const Mapping<1> &mapping,
- const DoFHandler<1> &dof,
- const FunctionMap<1>::type &boundary_functions,
- const Quadrature<0> &,
+VectorTools::project_boundary_values (const Mapping<dim> &mapping,
+ const DoFHandler<dim> &dof,
+ const typename FunctionMap<dim>::type &boundary_functions,
+ const Quadrature<dim-1> &,
std::map<unsigned int,double> &boundary_values)
{
// projection in 1d is equivalent
boundary_values, std::vector<bool>());
}
-#endif
+#else
template <int dim>
boundary_values[i] = boundary_projection(dof_to_boundary_mapping[i]);
}
+#endif
template <int dim>
void
const Point<deal_II_dimension> &,
Vector<double> &);
-#if deal_II_dimension != 1
template
void
VectorTools::create_boundary_right_hand_side<deal_II_dimension>
const Function<deal_II_dimension> &,
Vector<double> &,
const std::set<unsigned char> &);
-#endif
template
void
Vector<double> &,
const std::set<unsigned char> &);
-#if deal_II_dimension != 1
template
void
VectorTools::create_boundary_right_hand_side<deal_II_dimension>
const Function<deal_II_dimension> &,
Vector<double> &,
const std::set<unsigned char> &);
-#endif
template
void
std::map<unsigned int,double> &,
const std::vector<bool> &);
-#if deal_II_dimension != 1
template
void VectorTools::project_boundary_values<deal_II_dimension>
(const Mapping<deal_II_dimension> &,
const FunctionMap<deal_II_dimension>::type &,
const Quadrature<deal_II_dimension-1>&,
std::map<unsigned int,double> &);
-#endif
template
void VectorTools::project_boundary_values<deal_II_dimension>
-// Due to introducing the DoFHandler as a template parameter,
-// the following instantiations are required in 1d
-#if deal_II_dimension == 1
-template
-void VectorTools::interpolate_boundary_values<deal_II_dimension>
-(const Mapping<1> &,
- const DoFHandler<1> &,
- const unsigned char,
- const Function<1> &,
- std::map<unsigned int,double> &,
- const std::vector<bool> &);
-#endif
+// // Due to introducing the DoFHandler as a template parameter,
+// // the following instantiations are required in 1d
+// #if deal_II_dimension == 1
+// template
+// void VectorTools::interpolate_boundary_values<deal_II_dimension>
+// (const Mapping<1> &,
+// const DoFHandler<1> &,
+// const unsigned char,
+// const Function<1> &,
+// std::map<unsigned int,double> &,
+// const std::vector<bool> &);
+// #endif
// the following two functions are not derived from a template in 1d
// and thus need no explicit instantiation
-#if deal_II_dimension > 1
+//#if deal_II_dimension > 1
template
void VectorTools::interpolate_boundary_values<deal_II_dimension>
(const Mapping<deal_II_dimension> &,
std::map<unsigned int,double> &,
const std::vector<bool> &);
-#endif
+//#endif
template