/*@}*/
-/* -------------- declaration of explicit specializations ------------- */
-
-#ifndef DOXYGEN
-
-template <>
-std::vector<unsigned int> FE_ABF<1>::get_dpo_vector (const unsigned int);
-
-#endif // DOXYGEN
DEAL_II_NAMESPACE_CLOSE
#include <vector>
-using namespace dealii;
+
+DEAL_II_NAMESPACE_OPEN
/**
* The Brezzi-Douglas-Marini element.
std::vector<std::vector<double> > test_values;
};
+DEAL_II_NAMESPACE_CLOSE
+
#endif
};
-/* -------------- declaration of explicit specializations ------------- */
DEAL_II_NAMESPACE_CLOSE
const;
virtual unsigned int memory_consumption () const;
virtual FiniteElement<dim> * clone() const;
-
+
private:
/**
* Only for internal use. Its
* integration.
*/
Table<2, double> boundary_weights;
-
+
/**
* Allow access from other
* dimensions.
#ifndef DOXYGEN
-template <>
-std::vector<unsigned int> FE_Nedelec<1>::get_dpo_vector (const unsigned int);
template <>
void
FE_Nedelec<1>::initialize_restriction();
#ifndef DOXYGEN
-template <>
-std::vector<unsigned int> FE_RaviartThomas<1>::get_dpo_vector (const unsigned int);
template <>
void
FE_RaviartThomas<1>::initialize_restriction();
* see the documentation of Triangulation.
*
* @ingroup febase fe vector_valued
- *
+ *
* @author Wolfgang Bangerth, Guido Kanschat, 1999, 2002, 2003, 2006, Ralf Hartmann 2001.
*/
template <int dim, int spacedim=dim>
FESystem (const FiniteElement<dim,spacedim> &fe,
const unsigned int n_elements);
- /**
+ /**
* Constructor for mixed
* discretizations with two
* base elements.
FESystem (const FiniteElement<dim,spacedim> &fe1, const unsigned int n1,
const FiniteElement<dim,spacedim> &fe2, const unsigned int n2);
- /**
+ /**
* Constructor for mixed
* discretizations with three
* base elements.
const FiniteElement<dim,spacedim> &fe2, const unsigned int n2,
const FiniteElement<dim,spacedim> &fe3, const unsigned int n3);
- /**
+ /**
* Constructor for mixed
* discretizations with four
* base elements.
const FiniteElement<dim,spacedim> &fe3, const unsigned int n3,
const FiniteElement<dim,spacedim> &fe4, const unsigned int n4);
- /**
+ /**
* Constructor for mixed
* discretizations with five
* base elements.
virtual double shape_value_component (const unsigned int i,
const Point<dim> &p,
const unsigned int component) const;
-
+
/**
* Return the gradient of the
* @p ith shape function at the
shape_grad_grad_component (const unsigned int i,
const Point<dim> &p,
const unsigned int component) const;
-
+
/**
* Return the matrix
* interpolating from the given
get_interpolation_matrix (const FiniteElement<dim,spacedim> &source,
FullMatrix<double> &matrix) const;
- /**
+ /**
* Number of different base
* elements of this object.
*
*/
virtual const FiniteElement<dim,spacedim> &
base_element (const unsigned int index) const;
-
+
/**
* Check for non-zero values on a
* face.
virtual
Point<dim>
unit_support_point (const unsigned int index) const;
-
+
/**
* Implementation of the
* respective function in the
unit_face_support_point (const unsigned int index) const;
/**
- * @name Functions to support hp
+ * @name Functions to support hp
* @{
*/
-
+
/**
* Return whether this element
* implements its hanging node
* this function.
*/
virtual bool hp_constraints_are_implemented () const;
-
+
/**
* Return the matrix
* interpolating from a face of
* of one element to the face of
- * the neighboring element.
+ * the neighboring element.
* The size of the matrix is
* then <tt>source.dofs_per_face</tt> times
* <tt>this->dofs_per_face</tt>.
virtual void
get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &source,
FullMatrix<double> &matrix) const;
-
+
/**
* Return the matrix
* interpolating from a face of
* of one element to the subface of
- * the neighboring element.
+ * the neighboring element.
* The size of the matrix is
* then <tt>source.dofs_per_face</tt> times
* <tt>this->dofs_per_face</tt>.
virtual
std::vector<std::pair<unsigned int, unsigned int> >
hp_quad_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
-
+
/**
* Return whether this element dominates
* the one given as argument when they
FiniteElementDomination::Domination
compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const;
//@}
-
+
/**
* Determine an estimate for the
* memory consumption (in bytes)
* pointers to their base class,
* rather than the class itself.
*/
- virtual unsigned int memory_consumption () const;
-
+ virtual unsigned int memory_consumption () const;
+
protected:
/**
* Compute flags for initial
* update only.
*/
virtual UpdateFlags update_once (const UpdateFlags flags) const;
-
+
/**
* Compute flags for update on
* each cell.
* constructors of @p FESystem.
*/
virtual FiniteElement<dim,spacedim> * clone() const;
-
+
/**
* Prepare internal data
* structures and fill in values
* @p compute_fill that does the
* work for all three
* <tt>fill_fe*_values</tt> functions.
- */
+ */
virtual void
fill_fe_face_values (const Mapping<dim,spacedim> &mapping,
const typename Triangulation<dim,spacedim>::cell_iterator &cell,
typename Mapping<dim,spacedim>::InternalDataBase &mapping_data,
typename Mapping<dim,spacedim>::InternalDataBase &fe_data,
FEValuesData<dim,spacedim> &data) const ;
-
+
/**
* Do the work for the three
* <tt>fill_fe*_values</tt> functions.
- *
+ *
* Calls (among other things)
* <tt>fill_fe_([sub]face)_values</tt>
* of the base elements. Calls
* invalid.
*/
static const unsigned int invalid_face_number = numbers::invalid_unsigned_int;
-
+
/**
* Pairs of multiplicity and
* element type.
*/
typedef std::pair<const FiniteElement<dim,spacedim> *, unsigned int> ElementPair;
-
+
/**
* Pointer to underlying finite
* element classes.
* constructor.
*/
void initialize_quad_dof_index_permutation ();
-
+
/**
* Helper function used in the constructor:
* take a @p FiniteElementData object
static FiniteElementData<dim>
multiply_dof_numbers (const FiniteElementData<dim> &fe_data,
const unsigned int N);
-
+
/**
* Same as above for mixed elements
* with two different sub-elements.
compute_restriction_is_additive_flags (
const FiniteElement<dim,spacedim> &fe,
const unsigned int N);
-
+
/**
* Same as above for mixed elements
* with two different sub-elements.
compute_restriction_is_additive_flags (
const std::vector<const FiniteElement<dim,spacedim>*> &fes,
const std::vector<unsigned int> &multiplicities);
-
-
+
+
/**
* Compute the non-zero vector
* components of a composed
static std::vector<std::vector<bool> >
compute_nonzero_components (const std::vector<const FiniteElement<dim,spacedim>*> &fes,
const std::vector<unsigned int> &multiplicities);
-
+
/**
* This function is simply
* singled out of the
* Used by @p initialize.
*/
void build_cell_tables();
-
+
/**
* Used by @p initialize.
*/
template <int structdim>
std::vector<std::pair<unsigned int, unsigned int> >
hp_object_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const;
-
+
/**
* Usually: Fields of
* cell-independent data.
* @p n_base_elements.
*/
InternalData (const unsigned int n_base_elements);
-
+
/**
* Destructor. Deletes all
* @p InternalDatas whose
* be computed.
*/
bool compute_hessians;
-
+
/**
* Gives write-access to the
* pointer to a
* pointer to a
* @p InternalData of the
* @p base_noth base element.
- */
+ */
typename FiniteElement<dim,spacedim>::InternalDataBase &
get_fe_data (const unsigned int base_no) const;
* pointer to a
* @p FEValuesData for the
* @p base_noth base element.
- */
+ */
FEValuesData<dim,spacedim> & get_fe_values_data (const unsigned int base_no) const;
/**
* of the sub-data objects.
*/
virtual void clear_first_cell ();
-
+
private:
-
+
/**
* Pointers to
* @p InternalData objects
};
-/* -------------- declaration of explicit specializations ------------- */
-
-
-template <> void FESystem<1>::initialize_unit_face_support_points ();
-template <> void FESystem<1,2>::initialize_unit_face_support_points ();
-
DEAL_II_NAMESPACE_CLOSE
# list the dimension dependent and dimension independent directories
-dim-dep-dirs := dofs fe hp multigrid numerics distributed
-dim-indep-dirs := base lac grid
+dim-dep-dirs := dofs hp multigrid numerics
+dim-indep-dirs := base lac fe grid distributed
all-dirs := $(dim-dep-dirs) $(dim-indep-dirs)
# create lists of file names.
// explicit instantiations
-
-namespace parallel
-{
- namespace distributed
- {
-#if deal_II_dimension > 1
- template class SolutionTransfer<deal_II_dimension,Vector<double>, 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::BlockVector, DoFHandler<deal_II_dimension> >;
-
- template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
-
- template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::BlockVector, 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::BlockVector, 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::BlockVector, DoFHandler<deal_II_dimension> >;
-#endif
-#endif
- }
-}
+#include "solution_transfer.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 parallel
+ \{
+ namespace distributed
+ \{
+#if deal_II_dimension > 1
+ template class SolutionTransfer<deal_II_dimension,Vector<double>, 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::BlockVector, DoFHandler<deal_II_dimension> >;
+
+ template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::Vector, DoFHandler<deal_II_dimension> >;
+
+ template class SolutionTransfer<deal_II_dimension, PETScWrappers::MPI::BlockVector, 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::BlockVector, 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::BlockVector, DoFHandler<deal_II_dimension> >;
+#endif
+#endif
+ \}
+ \}
+
+ }
+
size_t (&connectivity_memory_used) (types<2>::connectivity * p4est);
};
-#if deal_II_dimension == 2
int (&functions<2>::quadrant_compare) (const void *v1, const void *v2)
= p4est_quadrant_compare;
size_t (&functions<2>::connectivity_memory_used) (types<2>::connectivity * p4est)
= p4est_connectivity_memory_used;
-#endif
-
template <> struct functions<3>
{
static
size_t (&connectivity_memory_used) (types<3>::connectivity * p4est);
};
-#if deal_II_dimension == 3
-
+
int (&functions<3>::quadrant_compare) (const void *v1, const void *v2)
= p8est_quadrant_compare;
size_t (&functions<3>::connectivity_memory_used) (types<3>::connectivity * p4est)
= p8est_connectivity_memory_used;
-#endif
template <int dim>
-#if deal_II_dimension == 2
-
- template <int dim, int spacedim>
+ template <>
void
- Triangulation<dim,spacedim>::copy_new_triangulation_to_p4est (internal::int2type<2>)
+ Triangulation<2,2>::copy_new_triangulation_to_p4est (internal::int2type<2>)
{
+ const unsigned int dim = 2, spacedim = 2;
Assert (this->n_cells(0) > 0, ExcInternalError());
Assert (this->n_levels() == 1, ExcInternalError());
/* user_pointer */ this);
}
+
+
+ // TODO: This is a verbatim copy of the 2,2
+ // case. However, we can't just specialize the
+ // dim template argument, but let spacedim open
+ template <>
+ void
+ Triangulation<2,3>::copy_new_triangulation_to_p4est (internal::int2type<2>)
+ {
+ const unsigned int dim = 2, spacedim = 3;
+ Assert (this->n_cells(0) > 0, ExcInternalError());
+ Assert (this->n_levels() == 1, ExcInternalError());
+
+ // data structures that counts how many
+ // cells touch each vertex
+ // (vertex_touch_count), and which cells
+ // touch a given vertex (together with
+ // the local numbering of that vertex
+ // within the cells that touch it)
+ std::vector<unsigned int> vertex_touch_count;
+ std::vector<
+ std::list<
+ std::pair<typename Triangulation<dim,spacedim>::active_cell_iterator,
+ unsigned int> > >
+ vertex_to_cell;
+ get_vertex_to_cell_mappings (*this,
+ vertex_touch_count,
+ vertex_to_cell);
+ const internal::p4est::types<2>::locidx
+ num_vtt = std::accumulate (vertex_touch_count.begin(),
+ vertex_touch_count.end(),
+ 0);
+
+ // now create a connectivity
+ // object with the right sizes
+ // for all arrays. set vertex
+ // information only in debug
+ // mode (saves a few bytes in
+ // optimized mode)
+ const bool set_vertex_info
+#ifdef DEBUG
+ = true
+#else
+ = false
#endif
+ ;
-#if deal_II_dimension == 3
+ connectivity
+ = internal::p4est::functions<2>::
+ connectivity_new ((set_vertex_info == true ? this->n_vertices() : 0),
+ this->n_cells(0),
+ this->n_vertices(),
+ num_vtt);
- template <int dim, int spacedim>
+ set_vertex_and_cell_info (*this,
+ vertex_touch_count,
+ vertex_to_cell,
+ coarse_cell_to_p4est_tree_permutation,
+ set_vertex_info,
+ connectivity);
+
+ Assert (p4est_connectivity_is_valid (connectivity) == 1,
+ ExcInternalError());
+
+ // now create a forest out of the
+ // connectivity data structure
+ parallel_forest
+ = internal::p4est::functions<2>::
+ new_forest (mpi_communicator,
+ connectivity,
+ /* minimum initial number of quadrants per tree */ 0,
+ /* minimum level of upfront refinement */ 0,
+ /* use uniform upfront refinement */ 1,
+ /* user_data_size = */ 0,
+ /* user_data_constructor = */ NULL,
+ /* user_pointer */ this);
+ }
+
+
+
+ template <>
void
- Triangulation<dim,spacedim>::copy_new_triangulation_to_p4est (internal::int2type<3>)
+ Triangulation<3,3>::copy_new_triangulation_to_p4est (internal::int2type<3>)
{
+ const int dim = 3, spacedim = 3;
Assert (this->n_cells(0) > 0, ExcInternalError());
Assert (this->n_levels() == 1, ExcInternalError());
/* user_pointer */ this);
}
-#endif
template <int dim, int spacedim>
types::subdomain_id_t
Triangulation<dim,spacedim>::locally_owned_subdomain () const
{
+ Assert (dim > 1, ExcNotImplemented());
return my_subdomain;
}
MPI_Comm
Triangulation<dim,spacedim>::get_communicator () const
{
- return mpi_communicator;
+ return mpi_communicator;
}
p4est_coarse_cell,
attached_data_pack_callbacks);
}
+ }
+
+ // TODO: again problems with specialization in
+ // only one template argument
+ template <>
+ Triangulation<1,1>::Triangulation (MPI_Comm)
+ {
+ Assert (false, ExcNotImplemented());
+ }
+ template <>
+ Triangulation<1,1>::~Triangulation ()
+ {
+ Assert (false, ExcNotImplemented());
}
+ template <>
+ types::subdomain_id_t
+ Triangulation<1,1>::locally_owned_subdomain () const
+ {
+ Assert (false, ExcNotImplemented());
+ return 0;
+ }
-#if deal_II_dimension == 1
- template <int spacedim>
- Triangulation<1,spacedim>::Triangulation (MPI_Comm)
+
+ template <>
+ MPI_Comm
+ Triangulation<1,1>::get_communicator () const
+ {
+ return MPI_COMM_WORLD;
+ }
+
+
+
+ template <>
+ Triangulation<1,2>::Triangulation (MPI_Comm)
{
Assert (false, ExcNotImplemented());
}
- template <int spacedim>
- Triangulation<1,spacedim>::~Triangulation ()
+ template <>
+ Triangulation<1,2>::~Triangulation ()
{
Assert (false, ExcNotImplemented());
}
- template <int spacedim>
+ template <>
types::subdomain_id_t
- Triangulation<1,spacedim>::locally_owned_subdomain () const
+ Triangulation<1,2>::locally_owned_subdomain () const
{
Assert (false, ExcNotImplemented());
return 0;
}
- template <int spacedim>
+ template <>
MPI_Comm
- Triangulation<1,spacedim>::get_communicator () const
+ Triangulation<1,2>::get_communicator () const
{
return MPI_COMM_WORLD;
}
-#endif
-
}
}
-#ifdef DEAL_II_USE_P4EST
-
-// explicit instantiations
-namespace internal
-{
- namespace p4est
- {
-# if deal_II_dimension > 1
- template
- void
- init_quadrant_children<deal_II_dimension>
- (const types<deal_II_dimension>::quadrant & p4est_cell,
- types<deal_II_dimension>::quadrant (&p4est_children)[GeometryInfo<deal_II_dimension>::max_children_per_cell]);
-
- template
- void
- init_coarse_quadrant<deal_II_dimension>
- (types<deal_II_dimension>::quadrant & quad);
-
- template
- bool
- quadrant_is_equal<deal_II_dimension>
- (const types<deal_II_dimension>::quadrant & q1,
- const types<deal_II_dimension>::quadrant & q2);
-
- template
- bool
- quadrant_is_ancestor<deal_II_dimension>
- (const types<deal_II_dimension>::quadrant & q1,
- const types<deal_II_dimension>::quadrant & q2);
-#endif
- }
-}
-namespace parallel
-{
- namespace distributed
- {
- template class Triangulation<deal_II_dimension>;
-# if deal_II_dimension < 3
- template class Triangulation<deal_II_dimension, deal_II_dimension+1>;
-# endif
- }
-}
-#endif // DEAL_II_USE_P4EST
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "tria.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)
+ {
+
+# ifdef DEAL_II_USE_P4EST
+
+ namespace internal
+ \{
+ namespace p4est
+ \{
+#if deal_II_dimension > 1
+ template
+ void
+ init_quadrant_children<deal_II_dimension>
+ (const types<deal_II_dimension>::quadrant & p4est_cell,
+ types<deal_II_dimension>::quadrant (&p4est_children)[GeometryInfo<deal_II_dimension>::max_children_per_cell]);
+
+ template
+ void
+ init_coarse_quadrant<deal_II_dimension>
+ (types<deal_II_dimension>::quadrant & quad);
+
+ template
+ bool
+ quadrant_is_equal<deal_II_dimension>
+ (const types<deal_II_dimension>::quadrant & q1,
+ const types<deal_II_dimension>::quadrant & q2);
+
+ template
+ bool
+ quadrant_is_ancestor<deal_II_dimension>
+ (const types<deal_II_dimension>::quadrant & q1,
+ const types<deal_II_dimension>::quadrant & q2);
+# endif
+ \}
+ \}
+ namespace parallel
+ \{
+ namespace distributed
+ \{
+ template class Triangulation<deal_II_dimension>;
+# if deal_II_dimension < 3
+ template class Triangulation<deal_II_dimension, deal_II_dimension+1>;
+# endif
+ \}
+ \}
+
+# endif // DEAL_II_USE_P4EST
+
+ }
+
/*------------------------------- FiniteElement ----------------------*/
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const double FiniteElement<dim,spacedim>::fd_step_length = 1.0e-6;
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::
InternalDataBase::initialize_2nd (const FiniteElement<dim,spacedim> *element,
// FEValues objects with slightly
// shifted positions
std::vector<Point<dim> > diff_points (quadrature.size());
-
+
differences.resize(2*dim);
for (unsigned int d=0; d<dim; ++d)
{
diff_points[i] = quadrature.point(i) - shift;
const Quadrature<dim> minus_quad (diff_points, quadrature.get_weights());
differences[d+dim] = new FEValues<dim,spacedim> (mapping, *element,
- minus_quad, update_gradients);
+ minus_quad, update_gradients);
}
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElement<dim,spacedim>::InternalDataBase::~InternalDataBase ()
{
for (unsigned int i=0; i<differences.size (); ++i)
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElement<dim,spacedim>::FiniteElement (
const FiniteElementData<dim> &fe_data,
const std::vector<bool> &r_i_a_f,
adjust_line_dof_index_for_line_orientation_table (dim == 3 ?
this->dofs_per_line : 0),
system_to_base_table(this->dofs_per_cell),
- face_system_to_base_table(this->dofs_per_face),
+ face_system_to_base_table(this->dofs_per_face),
component_to_base_table (this->components,
std::make_pair(std::make_pair(0U, 0U), 0U)),
restriction_is_additive_flags(r_i_a_f),
= const_cast<std::vector<bool>&> (restriction_is_additive_flags);
aux.resize(ndofs, restriction_is_additive_flags[0]);
}
-
+
if (nonzero_components.size() == 1 && ndofs > 1)
{
std::vector<std::vector<bool> >& aux
std::bind2nd(std::not_equal_to<unsigned int>(),
1U))
== n_nonzero_components_table.end());
-
-
+
+
Assert (restriction_is_additive_flags.size() == this->dofs_per_cell,
ExcDimensionMismatch(restriction_is_additive_flags.size(),
this->dofs_per_cell));
Assert (n_nonzero_components_table[i] >= 1,
ExcInternalError());
Assert (n_nonzero_components_table[i] <= this->n_components(),
- ExcInternalError());
+ ExcInternalError());
};
-
+
// initialize some tables in the
// default way, i.e. if there is
// only one (vector-)component; if
for (unsigned int j=0 ; j<this->dofs_per_cell ; ++j)
{
system_to_component_table[j] = std::pair<unsigned,unsigned>(0,j);
- system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
+ system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
}
for (unsigned int j=0 ; j<this->dofs_per_face ; ++j)
{
face_system_to_component_table[j] = std::pair<unsigned,unsigned>(0,j);
- face_system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
+ face_system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j);
}
}
// Fill with default value; may be
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElement<dim,spacedim>::~FiniteElement ()
{}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
double
FiniteElement<dim,spacedim>::shape_value (const unsigned int,
const Point<dim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
double
FiniteElement<dim,spacedim>::shape_value_component (const unsigned int,
const Point<dim> &,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<1,dim>
FiniteElement<dim,spacedim>::shape_grad (const unsigned int,
const Point<dim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<1,dim>
FiniteElement<dim,spacedim>::shape_grad_component (const unsigned int,
const Point<dim> &,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<2,dim>
FiniteElement<dim,spacedim>::shape_grad_grad (const unsigned int,
const Point<dim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<2,dim>
FiniteElement<dim,spacedim>::shape_grad_grad_component (const unsigned int,
const Point<dim> &,
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::reinit_restriction_and_prolongation_matrices (
const bool isotropic_restriction_only,
ref_case <= RefinementCase<dim>::isotropic_refinement; ++ref_case)
{
const unsigned int nc = GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
-
+
for (unsigned int i=0; i<nc; ++i)
{
if (!isotropic_restriction_only || ref_case==RefinementCase<dim>::isotropic_refinement)
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const FullMatrix<double> &
FiniteElement<dim,spacedim>::get_prolongation_matrix (const unsigned int child,
const RefinementCase<dim> &refinement_case) const
//TODO:[GK] This is probably not the most efficient way of doing this.
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FiniteElement<dim,spacedim>::component_to_block_index (const unsigned int index) const
{
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FiniteElement<dim,spacedim>::adjust_quad_dof_index_for_face_orientation (const unsigned int index,
- const bool,
- const bool,
- const bool) const
+ const bool face_orientation,
+ const bool face_flip,
+ const bool face_rotation) const
{
// general template for 1D and 2D: not
// implemented. in fact, the function
// shouldn't even be called unless we are
// in 3d, so throw an internal error
- Assert (false, ExcInternalError());
- return index;
-}
-
-#if deal_II_dimension == 3
+ Assert (dim==3, ExcInternalError());
+ if (dim < 3)
+ return index;
-template <>
-unsigned int
-FiniteElement<3>::adjust_quad_dof_index_for_face_orientation (const unsigned int index,
- const bool face_orientation,
- const bool face_flip,
- const bool face_rotation) const
-{
// adjust dofs on 3d faces if the face is
// flipped. note that we query a table that
// derived elements need to have set up
return index+adjust_quad_dof_index_for_face_orientation_table(index,4*face_orientation+2*face_flip+face_rotation);
}
-#endif
-
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FiniteElement<dim,spacedim>::adjust_line_dof_index_for_line_orientation (const unsigned int index,
- const bool) const
+ const bool line_orientation) const
{
// general template for 1D and 2D: do
// nothing. Do not throw an Assertion,
// however, in order to allow to call this
// function in 2D as well
- return index;
-}
-
-#if deal_II_dimension == 3
+ if (dim<3)
+ return index;
-template <>
-unsigned int
-FiniteElement<3>::adjust_line_dof_index_for_line_orientation (const unsigned int index,
- const bool line_orientation) const
-{
Assert (index<this->dofs_per_line, ExcIndexRange(index,0,this->dofs_per_line));
Assert (adjust_line_dof_index_for_line_orientation_table.size()==this->dofs_per_line,
ExcInternalError());
return index+adjust_line_dof_index_for_line_orientation_table[index];
}
-#endif
-
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::prolongation_is_implemented () const
{
FiniteElement<dim,spacedim>::isotropic_prolongation_is_implemented () const
{
const RefinementCase<dim> ref_case=RefinementCase<dim>::isotropic_refinement;
-
+
for (unsigned int c=0;
c<GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case)); ++c)
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::isotropic_restriction_is_implemented () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::constraints_are_implemented (const internal::SubfaceCase<dim> &subface_case) const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::hp_constraints_are_implemented () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const FullMatrix<double> &
FiniteElement<dim,spacedim>::constraints (const internal::SubfaceCase<dim> &subface_case) const
{
Assert (subface_case==internal::SubfaceCase<dim>::case_isotropic, ExcConstraintsVoid());
Assert ((this->dofs_per_face == 0) || (interface_constraints.m() != 0),
ExcConstraintsVoid());
-
+
if (dim==1)
Assert ((interface_constraints.m()==0) && (interface_constraints.n()==0),
ExcWrongInterfaceMatrixSize(interface_constraints.m(),
interface_constraints.n()));
-
+
return interface_constraints;
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
TableIndices<2>
-FiniteElement<dim,spacedim>::interface_constraints_size () const
+FiniteElement<dim,spacedim>::interface_constraints_size () const
{
switch (dim)
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::
get_interpolation_matrix (const FiniteElement<dim,spacedim> &,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::
get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &,
typename FEE::
ExcInterpolationNotImplemented());
}
-
-
-template <int dim, int spacedim>
+
+
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::
get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &,
AssertThrow (false,
typename FEE::ExcInterpolationNotImplemented());
}
-
-template <int dim, int spacedim>
+
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FiniteElement<dim,spacedim>::
hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FiniteElement<dim,spacedim>::
hp_line_dof_identities (const FiniteElement<dim,spacedim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FiniteElement<dim,spacedim>::
hp_quad_dof_identities (const FiniteElement<dim,spacedim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElementDomination::Domination
FiniteElement<dim,spacedim>::
compare_for_face_domination (const FiniteElement<dim,spacedim> &) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::operator == (const FiniteElement<dim,spacedim> &f) const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const std::vector<Point<dim> > &
FiniteElement<dim,spacedim>::get_unit_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::has_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const std::vector<Point<dim> > &
FiniteElement<dim,spacedim>::get_generalized_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::has_generalized_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Point<dim>
FiniteElement<dim,spacedim>::unit_support_point (const unsigned index) const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const std::vector<Point<dim-1> > &
FiniteElement<dim,spacedim>::get_unit_face_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::has_face_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const std::vector<Point<dim-1> > &
FiniteElement<dim,spacedim>::get_generalized_face_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::has_generalized_face_support_points () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Point<dim-1>
FiniteElement<dim,spacedim>::unit_face_support_point (const unsigned index) const
{
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FiniteElement<dim,spacedim>::has_support_on_face (
const unsigned int,
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::interpolate(
std::vector<double>& local_dofs,
ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
Assert (this->n_components() == 1,
ExcDimensionMismatch(this->n_components(), 1));
-
+
std::copy(values.begin(), values.end(), local_dofs.begin());
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::interpolate(
std::vector<double>& local_dofs,
ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
Assert (values[0].size() >= offset+this->n_components(),
ExcDimensionMismatch(values[0].size(),offset+this->n_components()));
-
+
for (unsigned int i=0;i<this->dofs_per_cell;++i)
{
const std::pair<unsigned int, unsigned int> index
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::interpolate(
std::vector<double>& local_dofs,
ExcDimensionMismatch(local_dofs.size(),this->dofs_per_cell));
Assert (values.size() == this->n_components(),
ExcDimensionMismatch(values.size(), this->n_components()));
-
+
for (unsigned int i=0;i<this->dofs_per_cell;++i)
{
const std::pair<unsigned int, unsigned int> index
-
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FiniteElement<dim,spacedim>::memory_consumption () const
{
MemoryConsumption::memory_consumption (system_to_component_table) +
MemoryConsumption::memory_consumption (face_system_to_component_table) +
MemoryConsumption::memory_consumption (system_to_base_table) +
- MemoryConsumption::memory_consumption (face_system_to_base_table) +
+ MemoryConsumption::memory_consumption (face_system_to_base_table) +
MemoryConsumption::memory_consumption (component_to_base_table) +
MemoryConsumption::memory_consumption (restriction_is_additive_flags) +
MemoryConsumption::memory_consumption (nonzero_components) +
}
-#if deal_II_dimension == 1
-
template<>
void
FiniteElement<1,2>::compute_2nd (
Assert(false, ExcNotImplemented());
}
-#endif
-#if deal_II_dimension == 2
template<>
void
Assert(false, ExcNotImplemented());
}
-#endif
-template <int dim, int spacedim>
+
+template <int dim, int spacedim>
void
FiniteElement<dim,spacedim>::compute_2nd (
const Mapping<dim,spacedim> &mapping,
& update_hessians,
ExcInternalError());
-// make sure we have as many entries as there are nonzero components
+// make sure we have as many entries as there are nonzero components
// Assert (data.shape_hessians.size() ==
// std::accumulate (n_nonzero_components_table.begin(),
// n_nonzero_components_table.end(),
left = fe_internal.differences[d1+dim]
->shape_grad_component(shape_index, q+offset, component);
};
-
+
// compute the second
// derivative from a
// symmetric difference
for (unsigned int d=0; d<dim; ++d)
diff_quot[d][q][d1] = 1./(2*fd_step_length) * (right[d]-left[d]);
}
-
+
// up to now we still have
// difference quotients on the
// unit cell, so transform it
ExcInternalError());
mapping.transform (diff_quot[d], diff_quot2,
mapping_internal, mapping_covariant);
-
+
for (unsigned int q=0; q<n_q_points; ++q)
for (unsigned int d1=0; d1<dim; ++d1)
data.shape_hessians[total_index][q][d][d1]
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<unsigned int>
FiniteElement<dim,spacedim>::compute_n_nonzero_components (
const std::vector<std::vector<bool> > &nonzero_components)
/*------------------------------- FiniteElement ----------------------*/
-template <int dim, int spacedim>
+template <int dim, int spacedim>
typename Mapping<dim,spacedim>::InternalDataBase *
FiniteElement<dim,spacedim>::get_face_data (const UpdateFlags flags,
const Mapping<dim,spacedim> &mapping,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
typename Mapping<dim,spacedim>::InternalDataBase *
FiniteElement<dim,spacedim>::get_subface_data (const UpdateFlags flags,
const Mapping<dim,spacedim> &mapping,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const FiniteElement<dim,spacedim>&
FiniteElement<dim,spacedim>::base_element(const unsigned index) const
{
return *this;
}
-/*------------------------------- Explicit Instantiations -------------*/
-
-template class FiniteElement<deal_II_dimension>;
-
-
-#if deal_II_dimension != 3
-template class FiniteElement<deal_II_dimension,deal_II_dimension+1>;
-#endif
+/*------------------------------- Explicit Instantiations -------------*/
+#include "fe.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)
+ {
+ template class FiniteElement<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class FiniteElement<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ }
+
{
Assert (dim >= 2, ExcImpossibleInDim(dim));
const unsigned int n_dofs = this->dofs_per_cell;
-
+
this->mapping_type = mapping_piola;
// First, initialize the
// generalized support points and
// From now on, the shape functions
// will be the correct ones, not
// the raw shape functions anymore.
-
+
// Reinit the vectors of
// restriction and prolongation
// matrices to the right sizes.
#else
std::ostrstream namebuf;
#endif
-
+
namebuf << "FE_ABF<" << dim << ">(" << rt_order << ")";
#ifndef HAVE_STD_STRINGSTREAM
//---------------------------------------------------------------------------
-#if deal_II_dimension == 1
-
-template <int dim>
-void
-FE_ABF<dim>::initialize_support_points (const unsigned int deg)
-{
- return;
-
- Assert (false, ExcNotImplemented());
-
- QGauss<dim> cell_quadrature(deg+1);
- const unsigned int n_interior_points
- = (deg>0) ? cell_quadrature.size() : 0;
-
- this->generalized_support_points.resize (2 + n_interior_points);
-
- // Number of the point being entered
- unsigned int current = 0;
-
-
- if (deg==0) return;
-
- interior_weights.reinit(TableIndices<3>(2+n_interior_points, 0, dim));
-
- for (unsigned int k=0;k<cell_quadrature.size();++k)
- this->generalized_support_points[current++] = cell_quadrature.point(k);
-
- Assert (current == this->generalized_support_points.size(),
- ExcInternalError());
-}
-
-#else
// Version for 2d and higher. See above for 1d version
template <int dim>
if (dim>1)
{
QGauss<dim-1> face_points (deg+1);
- TensorProductPolynomials<dim-1> legendre
- = Polynomials::Legendre::generate_complete_basis(deg);
+ TensorProductPolynomials<dim-1> legendre =
+ Polynomials::Legendre::generate_complete_basis(deg);
boundary_weights.reinit(n_face_points, legendre.n());
-
+
// Assert (face_points.size() == this->dofs_per_face,
// ExcInternalError());
-
+
for (unsigned int k=0;k<n_face_points;++k)
{
this->generalized_face_support_points[k] = face_points.point(k);
}
}
}
-
+
// Create Legendre basis for the
// space D_xi Q_k
if (deg>0)
{
std::vector<AnisotropicPolynomials<dim>* > polynomials(dim);
-
+
for (unsigned int dd=0;dd<dim;++dd)
{
std::vector<std::vector<Polynomials::Polynomial<double> > > poly(dim);
polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
}
-
+
interior_weights.reinit(TableIndices<3>(n_interior_points, polynomials[0]->n(), dim));
-
+
for (unsigned int k=0;k<cell_quadrature.size();++k)
{
for (unsigned int i=0;i<polynomials[0]->n();++i)
interior_weights(k,i,d) = cell_quadrature.weight(k)
* polynomials[d]->compute_value(i,cell_quadrature.point(k));
}
-
+
for (unsigned int d=0;d<dim;++d)
delete polynomials[d];
}
-
- // Decouple the creation of the generalized support points
+
+ // Decouple the creation of the generalized support points
// from computation of interior weights.
for (unsigned int k=0;k<cell_quadrature.size();++k)
this->generalized_support_points[current++] = cell_quadrature.point(k);
// TODO: Here the canonical extension of the principle
// behind the ABF elements is implemented. It is unclear,
// if this really leads to the ABF spaces in 3D!
- interior_weights_abf.reinit(TableIndices<3>(cell_quadrature.size(),
+ interior_weights_abf.reinit(TableIndices<3>(cell_quadrature.size(),
polynomials_abf[0]->n() * dim, dim));
Tensor<1, dim> poly_grad;
ExcInternalError());
}
-#endif
-
-#if deal_II_dimension == 1
-
-template <int dim>
-void
-FE_ABF<dim>::initialize_restriction()
-{
- unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
- for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
- this->restriction[iso][i].reinit(0,0);
-}
-
-#else
// This function is the same Raviart-Thomas interpolation performed by
// interpolate. Still, we cannot use interpolate, since it was written
void
FE_ABF<dim>::initialize_restriction()
{
+ if (dim==1)
+ {
+ unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
+ for (unsigned int i=0;i<GeometryInfo<dim>::max_children_per_cell;++i)
+ this->restriction[iso][i].reinit(0,0);
+ return;
+ }
unsigned int iso=RefinementCase<dim>::isotropic_refinement-1;
QGauss<dim-1> q_base (rt_order+1);
const unsigned int n_face_points = q_base.size();
const unsigned int child
= GeometryInfo<dim>::child_cell_on_face(
RefinementCase<dim>::isotropic_refinement, face, sub);
-
+
// On a certain face, we must
// compute the moments of ALL
// fine level functions with
}
}
}
-
+
if (rt_order==0) return;
-
+
// Create Legendre basis for the
// space D_xi Q_k. Here, we cannot
// use the shape functions
polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
}
-
+
QGauss<dim> q_cell(rt_order+1);
const unsigned int start_cell_dofs
= GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
for (unsigned int d=0;d<dim;++d)
cached_values(i,k,d) = this->shape_value_component(i, q_cell.point(k), d);
-
+
for (unsigned int child=0;child<GeometryInfo<dim>::max_children_per_cell;++child)
{
Quadrature<dim> q_sub = QProjector<dim>::project_to_child(q_cell, child);
-
+
for (unsigned int k=0;k<q_sub.size();++k)
for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child)
for (unsigned int d=0;d<dim;++d)
* polynomials[d]->compute_value(i_weight, q_sub.point(k));
}
}
-
+
for (unsigned int d=0;d<dim;++d)
delete polynomials[d];
}
-#endif
-
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_ABF<1>::get_dpo_vector (const unsigned int)
-{
- Assert (false, ExcImpossibleInDim(1));
- return std::vector<unsigned int>();
-}
-
-#endif
template <int dim>
std::vector<unsigned int>
FE_ABF<dim>::get_dpo_vector (const unsigned int rt_order)
{
+ if (dim == 1)
+ {
+ Assert (false, ExcImpossibleInDim(1));
+ return std::vector<unsigned int>();
+ }
+
// the element is face-based (not
// to be confused with George
// W. Bush's Faith Based
// and then there are interior dofs
const unsigned int
interior_dofs = dim*(rt_order+1)*dofs_per_face;
-
+
std::vector<unsigned int> dpo(dim+1);
dpo[dim-1] = dofs_per_face;
dpo[dim] = interior_dofs;
-
+
return dpo;
}
| update_piola
| update_JxW_values;
if (flags & update_gradients)
- out |= update_gradients | update_covariant_transformation
+ out |= update_gradients | update_covariant_transformation
| update_piola
| update_JxW_values;
//TODO: Set update flags appropriately and figure out, how the second
// these in a table
return (face_index != GeometryInfo<dim>::opposite_face[shape_index]);
}
-
+
default:
return true;
};
};
-
+
default: // other rt_order
return true;
};
-
+
return true;
}
local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
* values[face*n_face_points+k](GeometryInfo<dim>::unit_normal_direction[face]+offset);
}
-
+
const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-
+
for (unsigned int k=0;k<interior_weights.size(0);++k)
for (unsigned int i=0;i<interior_weights.size(1);++i)
for (unsigned int d=0;d<dim;++d)
// TODO: Check what the face_orientation, face_flip and face_rotation have to be in 3D
unsigned int k = QProjector<dim>::DataSetDescriptor::face (face, false, false, false, n_face_points);
for (unsigned int i=0; i<boundary_weights_abf.size(1); ++i)
- local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
+ local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
* values[k + fp](GeometryInfo<dim>::unit_normal_direction[face]+offset);
}
}
local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
* values[GeometryInfo<dim>::unit_normal_direction[face]][face*n_face_points+k];
}
-
+
const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
// TODO: Check what the face_orientation, face_flip and face_rotation have to be in 3D
unsigned int k = QProjector<dim>::DataSetDescriptor::face (face, false, false, false, n_face_points);
for (unsigned int i=0; i<boundary_weights_abf.size(1); ++i)
- local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
+ local_dofs[start_abf_dofs+i] += n_orient * boundary_weights_abf(k + fp, i)
* values[GeometryInfo<dim>::unit_normal_direction[face]][k + fp];
}
}
}
-template class FE_ABF<deal_II_dimension>;
+
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_abf.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)
+ {
+ template class FE_ABF<deal_II_dimension>;
+ }
+
#include <iostream>
#include <sstream>
+
+DEAL_II_NAMESPACE_OPEN
+
template <int dim>
FE_BDM<dim>::FE_BDM (const unsigned int deg)
:
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_BDM<1>::get_dpo_vector (const unsigned int deg)
-{
- std::vector<unsigned int> dpo(2);
- dpo[0] = 1;
- dpo[1] = deg;
- return dpo;
-}
-
-#endif
-
-
template <int dim>
std::vector<unsigned int>
FE_BDM<dim>::get_dpo_vector (const unsigned int deg)
// and then there are interior dofs
unsigned int
- interior_dofs = dim*deg*(deg-1)/2;
+ interior_dofs = dim==1?deg:dim*deg*(deg-1)/2;
if (dim>2)
{
interior_dofs *= deg-2;
-#if deal_II_dimension == 1
-
-template <>
-std::vector<bool>
-FE_BDM<1>::get_ria_vector (const unsigned int)
-{
- Assert (false, ExcImpossibleInDim(1));
- return std::vector<bool>();
-}
-
-#endif
-
-
template <int dim>
std::vector<bool>
FE_BDM<dim>::get_ria_vector (const unsigned int deg)
{
+ if (dim==1)
+ {
+ Assert (false, ExcImpossibleInDim(1));
+ return std::vector<bool>();
+ }
+
Assert(dim==2, ExcNotImplemented());
const unsigned int dofs_per_cell = PolynomialsBDM<dim>::compute_n_pols(deg);
const unsigned int dofs_per_face = deg+1;
}
-template class FE_BDM<deal_II_dimension>;
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_bdm.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)
+ {
+ template class FE_BDM<deal_II_dimension>;
+ }
+
DEAL_II_NAMESPACE_OPEN
-template class FE_DGVector<PolynomialsABF<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsBDM<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
-template class FE_DGVector<PolynomialsRaviartThomas<deal_II_dimension>, deal_II_dimension>;
+#include "fe_dg_vector.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)
+ {
+ template class FE_DGVector<PolynomialsABF<deal_II_dimension>, deal_II_dimension>;
+ template class FE_DGVector<PolynomialsBDM<deal_II_dimension>, deal_II_dimension>;
+ template class FE_DGVector<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+ template class FE_DGVector<PolynomialsRaviartThomas<deal_II_dimension>, deal_II_dimension>;
+ }
+
// this function returns, so they
// have to be kept in synch
- std::ostringstream namebuf;
+ std::ostringstream namebuf;
namebuf << "FE_DGP<" << dim << ">(" << this->degree << ")";
return namebuf.str();
(dynamic_cast<const FEDGP*>(&x_source_fe) != 0),
typename FE::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
(dynamic_cast<const FEDGP*>(&x_source_fe) != 0),
typename FE::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
-template class FE_DGP<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgp.inst"
-#if deal_II_dimension != 3
-template class FE_DGP<deal_II_dimension, deal_II_dimension+1>;
-#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 FE_DGP<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class FE_DGP<deal_II_dimension, deal_II_dimension+1>;
+#endif
+ }
+
DEAL_II_NAMESPACE_OPEN
// namespace for some functions that are used in this file.
-namespace
+namespace
{
// storage of hand-chosen support
// points
//
-#if deal_II_dimension == 2
// For dim=2, dofs_per_cell of
// FE_DGPMonomial(k) is given by
// 0.5(k+1)(k+2), i.e.
- //
+ //
// k 0 1 2 3 4 5 6 7
// dofs 1 3 6 10 15 21 28 36
- //
+ //
// indirect access of unit points:
// the points for degree k are
// located at
{0,0},{1,0},{0,1},{1,1},{1./3.,0},{2./3.,0},{0,1./3.},{0,2./3.},{0.5,1},{1,0.5},
{0,0},{1,0},{0,1},{1,1},{0.25,0},{0.5,0},{0.75,0},{0,0.25},{0,0.5},{0,0.75},{1./3.,1},{2./3.,1},{1,1./3.},{1,2./3.},{0.5,0.5}
};
-#endif
-#if deal_II_dimension == 3
// For dim=3, dofs_per_cell of
// FE_DGPMonomial(k) is given by
// 1./6.(k+1)(k+2)(k+3), i.e.
- //
+ //
// k 0 1 2 3 4 5 6 7
// dofs 1 4 10 20 35 56 84 120
const unsigned int start_index3d[6]={0,1,5,15/*,35*/};
{0,0,0},{1,0,0},{0,1,0},{0,0,1},
{0,0,0},{1,0,0},{0,1,0},{0,0,1},{0.5,0,0},{0,0.5,0},{0,0,0.5},{1,1,0},{1,0,1},{0,1,1}
};
-#endif
-
+
template<int dim>
void generate_unit_points (const unsigned int,
std::vector<Point<dim> > &);
-#if deal_II_dimension == 1
template <>
void generate_unit_points (const unsigned int k,
std::vector<Point<1> > &p)
for (unsigned int i=0; i<p.size(); ++i)
p[i](0)=i*h;
}
-#endif
-
-#if deal_II_dimension == 2
+
template <>
void generate_unit_points (const unsigned int k,
std::vector<Point<2> > &p)
p[i](1)=points2d[start_index2d[k]+i][1];
}
}
-#endif
-
-#if deal_II_dimension == 3
+
template <>
void generate_unit_points (const unsigned int k,
std::vector<Point<3> > &p)
p[i](2)=points3d[start_index3d[k]+i][2];
}
}
-#endif
}
{
Assert(this->poly_space.n()==this->dofs_per_cell, ExcInternalError());
Assert(this->poly_space.degree()==this->degree, ExcInternalError());
-
+
// DG doesn't have constraints, so
// leave them empty
FE_DGPMonomial<dim>::
get_interpolation_matrix (const FiniteElement<dim> &source_fe,
FullMatrix<double> &interpolation_matrix) const
-{
+{
const FE_DGPMonomial<dim> *source_dgp_monomial
= dynamic_cast<const FE_DGPMonomial<dim> *>(&source_fe);
Assert (m == this->dofs_per_cell, ExcDimensionMismatch (m, this->dofs_per_cell));
Assert (n == source_dgp_monomial->dofs_per_cell,
ExcDimensionMismatch (n, source_dgp_monomial->dofs_per_cell));
-
+
const unsigned int min_mn=
interpolation_matrix.m()<interpolation_matrix.n() ?
interpolation_matrix.m() : interpolation_matrix.n();
-
+
for (unsigned int i=0; i<min_mn; ++i)
interpolation_matrix(i,i)=1.;
}
this_matrix(k,j)=this->poly_space.compute_value (j, unit_points[k]);
this_matrix.gauss_jordan();
-
+
this_matrix.mmult(interpolation_matrix, source_fe_matrix);
}
}
(dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
(dynamic_cast<const FE_DGPMonomial<dim>*>(&x_source_fe) != 0),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
-#if deal_II_dimension == 1
-
template <>
bool
FE_DGPMonomial<1>::has_support_on_face (const unsigned int,
return face_index==1 || (face_index==0 && this->degree==0);
}
-#endif
-#if deal_II_dimension == 2
template <>
bool
return support_on_face;
}
-#endif
-#if deal_II_dimension == 3
template <>
bool
return support_on_face;
}
-#endif
template <int dim>
-template class FE_DGPMonomial<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgp_monomial.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)
+ {
+ template class FE_DGPMonomial<deal_II_dimension>;
+ }
+
DEAL_II_NAMESPACE_OPEN
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FE_DGPNonparametric<dim,spacedim>::FE_DGPNonparametric (const unsigned int degree)
:
FiniteElement<dim,spacedim> (
// refinement is not
// implemented so far
continue;
-
+
const unsigned int nc = GeometryInfo<dim>::n_children(RefinementCase<dim>(ref_case));
for (unsigned int i=0;i<nc;++i)
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::string
FE_DGPNonparametric<dim,spacedim>::get_name () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElement<dim,spacedim> *
FE_DGPNonparametric<dim,spacedim>::clone() const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
double
FE_DGPNonparametric<dim,spacedim>::shape_value (const unsigned int i,
const Point<dim> &p) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
double
FE_DGPNonparametric<dim,spacedim>::shape_value_component (const unsigned int i,
const Point<dim> &p,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<1,dim>
FE_DGPNonparametric<dim,spacedim>::shape_grad (const unsigned int i,
const Point<dim> &p) const
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<1,dim>
FE_DGPNonparametric<dim,spacedim>::shape_grad_component (const unsigned int i,
const Point<dim> &p,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<2,dim>
FE_DGPNonparametric<dim,spacedim>::shape_grad_grad (const unsigned int i,
const Point<dim> &p) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
Tensor<2,dim>
FE_DGPNonparametric<dim,spacedim>::shape_grad_grad_component (const unsigned int i,
const Point<dim> &p,
//---------------------------------------------------------------------------
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<unsigned int>
FE_DGPNonparametric<dim,spacedim>::get_dpo_vector (const unsigned int deg)
{
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
UpdateFlags
FE_DGPNonparametric<dim,spacedim>::update_once (const UpdateFlags) const
{
}
-template <int dim, int spacedim>
+template <int dim, int spacedim>
UpdateFlags
FE_DGPNonparametric<dim,spacedim>::update_each (const UpdateFlags flags) const
{
// Data field initialization
//---------------------------------------------------------------------------
-template <int dim, int spacedim>
+template <int dim, int spacedim>
typename Mapping<dim,spacedim>::InternalDataBase *
FE_DGPNonparametric<dim,spacedim>::get_data (
const UpdateFlags update_flags,
// Fill data of FEValues
//---------------------------------------------------------------------------
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FE_DGPNonparametric<dim,spacedim>::fill_fe_values (
const Mapping<dim,spacedim>&,
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FE_DGPNonparametric<dim,spacedim>::fill_fe_face_values (
const Mapping<dim,spacedim>&,
Assert (flags & update_quadrature_points, ExcInternalError());
const unsigned int n_q_points = data.quadrature_points.size();
-
+
if (flags & (update_values | update_gradients))
for (unsigned int i=0; i<n_q_points; ++i)
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FE_DGPNonparametric<dim,spacedim>::fill_fe_subface_values (
const Mapping<dim,spacedim>&,
Assert (dynamic_cast<InternalData *> (&fedata) != 0,
ExcInternalError());
InternalData &fe_data = static_cast<InternalData &> (fedata);
-
+
const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
Assert (flags & update_quadrature_points, ExcInternalError());
const unsigned int n_q_points = data.quadrature_points.size();
-
+
if (flags & (update_values | update_gradients))
for (unsigned int i=0; i<n_q_points; ++i)
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FE_DGPNonparametric<dim,spacedim>::n_base_elements () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
const FiniteElement<dim,spacedim> &
FE_DGPNonparametric<dim,spacedim>::base_element (const unsigned int index) const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FE_DGPNonparametric<dim,spacedim>::element_multiplicity (const unsigned int index) const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FE_DGPNonparametric<dim,spacedim>::
get_face_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
(dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
typename FEE::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
-template <int dim, int spacedim>
+template <int dim, int spacedim>
void
FE_DGPNonparametric<dim,spacedim>::
get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &x_source_fe,
(dynamic_cast<const FE_DGPNonparametric<dim,spacedim>*>(&x_source_fe) != 0),
typename FEE::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FE_DGPNonparametric<dim,spacedim>::hp_constraints_are_implemented () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FE_DGPNonparametric<dim,spacedim>::
hp_vertex_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FE_DGPNonparametric<dim,spacedim>::
hp_line_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
std::vector<std::pair<unsigned int, unsigned int> >
FE_DGPNonparametric<dim,spacedim>::
hp_quad_dof_identities (const FiniteElement<dim,spacedim> &fe_other) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
FiniteElementDomination::Domination
FE_DGPNonparametric<dim,spacedim>::
compare_for_face_domination (const FiniteElement<dim,spacedim> &fe_other) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
bool
FE_DGPNonparametric<dim,spacedim>::has_support_on_face (const unsigned int,
const unsigned int) const
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FE_DGPNonparametric<dim,spacedim>::memory_consumption () const
{
-template <int dim, int spacedim>
+template <int dim, int spacedim>
unsigned int
FE_DGPNonparametric<dim,spacedim>::get_degree () const
{
+// explicit instantiations
+#include "fe_dgp_nonparametric.inst"
-template class FE_DGPNonparametric<deal_II_dimension>;
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 FE_DGPNonparametric<deal_II_dimension>;
+ }
+
-template class FE_DGQ<deal_II_dimension>;
+// explicit instantiations
+#include "fe_dgq.inst"
-//codimension 1
-
-#if deal_II_dimension != 3
-template class FE_DGQ<deal_II_dimension, deal_II_dimension+1>;
-#endif
-
-template class FE_DGQArbitraryNodes<deal_II_dimension>;
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 FE_DGQ<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class FE_DGQ<deal_II_dimension, deal_II_dimension+1>;
+#endif
+
+ template class FE_DGQArbitraryNodes<deal_II_dimension>;
+ }
+
// this function returns, so they
// have to be kept in synch
- std::ostringstream namebuf;
+ std::ostringstream namebuf;
namebuf << "FE_FaceQ<" << dim << ">(" << this->degree << ")";
return namebuf.str();
{
return (face_index == (shape_index/this->dofs_per_face));
}
-
-
+
+
template <int dim, int spacedim>
std::vector<unsigned int>
FE_FaceQ<dim,spacedim>::get_dpo_vector (const unsigned int deg)
}
-
-#if deal_II_dimension > 1
- template class FE_PolyFace<TensorProductPolynomials<deal_II_dimension-1> >;
-//template class FE_PolyFace<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
-//template class FE_PolyFace<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
- template class FE_FaceQ<deal_II_dimension>;
-#endif
-
+// explicit instantiations
+#include "fe_face.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)
+ {
+#if deal_II_dimension > 1
+ template class FE_PolyFace<TensorProductPolynomials<deal_II_dimension-1> >;
+ //template class FE_PolyFace<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
+ //template class FE_PolyFace<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+ template class FE_FaceQ<deal_II_dimension>;
+#endif
+ }
+
//---------------------------------------------------------------------------
-#if deal_II_dimension == 1
// Set the generalized support
// points and precompute the
Assert (false, ExcNotImplemented ());
}
-#elif deal_II_dimension == 2
+
template <>
void
FE_Nedelec<2>::initialize_support_points (const unsigned int degree)
{
const int dim = 2;
-
+
// Create polynomial basis.
const std::vector<Polynomials::Polynomial<double> >& lobatto_polynomials
= Polynomials::Lobatto::generate_complete_basis (degree + 1);
}
}
-#else
+
template <>
void
FE_Nedelec<3>::initialize_support_points (const unsigned int degree)
{
const int dim = 3;
-
+
// Create polynomial basis.
const std::vector<Polynomials::Polynomial<double> >& lobatto_polynomials
= Polynomials::Lobatto::generate_complete_basis (degree + 1);
}
}
-#endif
-#if deal_II_dimension == 1
-
// Set the restriction matrices.
template <>
void
this->restriction[0][i].reinit(0, 0);
}
-#endif
+
// Restriction operator
template <int dim>
n_edge_quadrature_points = edge_quadrature.size ();
const unsigned int
index = RefinementCase<dim>::isotropic_refinement - 1;
-
+
switch (dim)
{
case 2:
++q_point)
{
const double weight = 2.0 * edge_quadrature.weight (q_point);
-
+
if (edge_quadrature_points[q_point] (0) < 0.5)
{
Point<dim> quadrature_point (0.0,
2.0 * edge_quadrature_points[q_point] (0));
-
+
this->restriction[index][0] (0, dof) += weight
* this->shape_value_component
(dof,
quadrature_point,
0);
}
-
+
else
{
Point<dim> quadrature_point (0.0,
2.0 * edge_quadrature_points[q_point] (0)
- 1.0);
-
+
this->restriction[index][2] (0, dof) += weight
* this->shape_value_component
(dof,
0);
}
}
-
+
// Then project the shape functions
// of the child cells to the higher
// order shape functions of the
legendre_polynomials
= Polynomials::Legendre::generate_complete_basis (deg);
FullMatrix<double> system_matrix_inv (deg, deg);
-
+
{
FullMatrix<double> assembling_matrix (deg,
n_edge_quadrature_points);
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const double weight
= std::sqrt (edge_quadrature.weight (q_point));
-
+
for (unsigned int i = 0; i < deg; ++i)
assembling_matrix (i, q_point) = weight
* legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
}
-
+
FullMatrix<double> system_matrix (deg, deg);
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.invert (system_matrix);
}
-
+
FullMatrix<double> solution (deg, 4);
FullMatrix<double> system_rhs (deg, 4);
Vector<double> tmp (4);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
for (unsigned int i = 0; i < 2; ++i)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const Point<dim> quadrature_point_1
(edge_quadrature_points[q_point] (0),
i);
-
+
if (edge_quadrature_points[q_point] (0) < 0.5)
{
Point<dim> quadrature_point_2 (i,
2.0 * edge_quadrature_points[q_point] (0));
-
+
tmp (0) = weight
* (2.0 * this->shape_value_component
(dof, quadrature_point_2, 1)
((i + 2) * this->degree,
quadrature_point_1, 0);
}
-
+
else
{
tmp (0) = -1.0 * weight
* this->shape_value_component
(i * this->degree,
quadrature_point_0, 1);
-
+
Point<dim> quadrature_point_2 (i,
2.0 * edge_quadrature_points[q_point] (0)
- 1.0);
-
+
tmp (1) = weight
* (2.0 * this->shape_value_component
(dof, quadrature_point_2, 1)
((i + 2) * this->degree,
quadrature_point_1, 0));
}
-
+
for (unsigned int j = 0; j < deg; ++j)
{
const double L_j
= legendre_polynomials[j + 1].value
(edge_quadrature_points[q_point] (0));
-
+
for (unsigned int k = 0; k < tmp.size (); ++k)
system_rhs (j, k) += tmp (k) * L_j;
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int j = 0; j < deg; ++j)
for (unsigned int k = 0; k < 2; ++k)
{
this->restriction[index][i + 2 * k]
(i * this->degree + j + 1, dof)
= solution (j, k);
-
+
if (std::abs (solution (j, k + 2)) > 1e-14)
this->restriction[index][2 * i + k]
((i + 2) * this->degree + j + 1, dof)
= solution (j, k + 2);
}
}
-
+
const QGauss<dim> quadrature (2 * this->degree);
const std::vector<Point<dim> >&
quadrature_points = quadrature.get_points ();
const unsigned int n_boundary_dofs
= GeometryInfo<dim>::faces_per_cell * this->degree;
const unsigned int& n_quadrature_points = quadrature.size ();
-
+
{
FullMatrix<double> assembling_matrix (deg * this->degree,
n_quadrature_points);
-
+
for (unsigned int q_point = 0; q_point < n_quadrature_points;
++q_point)
{
const double weight
= std::sqrt (quadrature.weight (q_point));
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i = weight
* legendre_polynomials[i].value
(quadrature_points[q_point] (0));
-
+
for (unsigned int j = 0; j < deg; ++j)
assembling_matrix (i * deg + j, q_point)
= L_i * lobatto_polynomials[j + 2].value
(quadrature_points[q_point] (1));
}
}
-
+
FullMatrix<double> system_matrix (assembling_matrix.m (),
assembling_matrix.m ());
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.reinit (system_matrix.m (), system_matrix.m ());
system_matrix_inv.invert (system_matrix);
}
-
+
solution.reinit (system_matrix_inv.m (), 8);
system_rhs.reinit (system_matrix_inv.m (), 8);
tmp.reinit (8);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_quadrature_points; ++q_point)
{
tmp = 0.0;
-
+
if (quadrature_points[q_point] (0) < 0.5)
{
if (quadrature_points[q_point] (1) < 0.5)
const Point<dim> quadrature_point
(2.0 * quadrature_points[q_point] (0),
2.0 * quadrature_points[q_point] (1));
-
+
tmp (0) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (1) += 2.0 * this->shape_value_component
(dof, quadrature_point, 1);
}
-
+
else
{
const Point<dim> quadrature_point
(2.0 * quadrature_points[q_point] (0),
2.0 * quadrature_points[q_point] (1)
- 1.0);
-
+
tmp (4) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (5) += 2.0 * this->shape_value_component
(dof, quadrature_point, 1);
}
}
-
+
else
if (quadrature_points[q_point] (1) < 0.5)
{
(2.0 * quadrature_points[q_point] (0)
- 1.0,
2.0 * quadrature_points[q_point] (1));
-
+
tmp (2) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (3) += 2.0 * this->shape_value_component
(dof, quadrature_point, 1);
}
-
+
else
{
const Point<dim> quadrature_point
- 1.0,
2.0 * quadrature_points[q_point] (1)
- 1.0);
-
+
tmp (6) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (7) += 2.0 * this->shape_value_component
(dof, quadrature_point, 1);
}
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j <= deg; ++j)
{
(i * this->degree + j,
quadrature_points[q_point], 1);
}
-
+
tmp *= quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i_0
const double L_i_1
= legendre_polynomials[i].value
(quadrature_points[q_point] (1));
-
+
for (unsigned int j = 0; j < deg; ++j)
{
const double l_j_0
const double l_j_1
= L_i_1 * lobatto_polynomials[j + 2].value
(quadrature_points[q_point] (0));
-
+
for (unsigned int k = 0; k < 4; ++k)
{
system_rhs (i * deg + j, 2 * k)
}
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int i = 0; i <= deg; ++i)
for (unsigned int j = 0; j < deg; ++j)
for (unsigned int k = 0; k < 4; ++k)
this->restriction[index][k]
(i * deg + j + n_boundary_dofs, dof)
= solution (i * deg + j, 2 * k);
-
+
if (std::abs (solution (i * deg + j, 2 * k + 1))
> 1e-14)
this->restriction[index][k]
++q_point)
{
const double weight = 2.0 * edge_quadrature.weight (q_point);
-
+
if (edge_quadrature_points[q_point] (0) < 0.5)
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j < 2; ++j)
Point<dim> quadrature_point (i,
2.0 * edge_quadrature_points[q_point] (0),
j);
-
+
this->restriction[index][i + 4 * j]
((i + 4 * j) * this->degree, dof)
+= weight * this->shape_value_component (dof,
quadrature_point,
2);
}
-
+
else
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j < 2; ++j)
Point<dim> quadrature_point (i,
2.0 * edge_quadrature_points[q_point] (0)
- 1.0, j);
-
+
this->restriction[index][i + 4 * j + 2]
((i + 4 * j) * this->degree, dof)
+= weight * this->shape_value_component (dof,
2);
}
}
-
+
// Then project the shape functions
// of the child cells to the higher
// order shape functions of the
legendre_polynomials
= Polynomials::Legendre::generate_complete_basis (deg);
FullMatrix<double> system_matrix_inv (deg, deg);
-
+
{
FullMatrix<double> assembling_matrix (deg,
n_edge_quadrature_points);
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const double weight = std::sqrt (edge_quadrature.weight
(q_point));
-
+
for (unsigned int i = 0; i < deg; ++i)
assembling_matrix (i, q_point) = weight
* legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
}
-
+
FullMatrix<double> system_matrix (deg, deg);
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.invert (system_matrix);
}
-
+
FullMatrix<double> solution (deg, 6);
FullMatrix<double> system_rhs (deg, 6);
Vector<double> tmp (6);
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j < 2; ++j)
for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
(edge_quadrature_points[q_point] (0), i, j);
const Point<dim> quadrature_point_2 (i, j,
edge_quadrature_points[q_point] (0));
-
+
if (edge_quadrature_points[q_point] (0) < 0.5)
{
Point<dim> quadrature_point_3 (i,
2.0 * edge_quadrature_points[q_point] (0),
j);
-
+
tmp (0) = weight
* (2.0 * this->shape_value_component
(dof, quadrature_point_3, 1)
((i + 2 * (j + 4)) * this->degree,
quadrature_point_2, 2);
}
-
+
else
{
tmp (0) = -1.0 * weight
* this->shape_value_component
((i + 4 * j) * this->degree,
quadrature_point_0, 1);
-
+
Point<dim> quadrature_point_3 (i,
2.0 * edge_quadrature_points[q_point] (0)
- 1.0, j);
-
+
tmp (1) = weight
* (2.0 * this->shape_value_component
(dof, quadrature_point_3, 1)
((i + 2 * (j + 4)) * this->degree,
quadrature_point_2, 2));
}
-
+
for (unsigned int k = 0; k < deg; ++k)
{
const double L_k
= legendre_polynomials[k + 1].value
(edge_quadrature_points[q_point] (0));
-
+
for (unsigned int l = 0; l < tmp.size (); ++l)
system_rhs (k, l) += tmp (l) * L_k;
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int k = 0; k < 2; ++k)
for (unsigned int l = 0; l < deg; ++l)
{
this->restriction[index][i + 2 * (2 * j + k)]
((i + 4 * j) * this->degree + l + 1, dof)
= solution (l, k);
-
+
if (std::abs (solution (l, k + 2)) > 1e-14)
this->restriction[index][2 * (i + 2 * j) + k]
((i + 4 * j + 2) * this->degree + l + 1, dof)
= solution (l, k + 2);
-
+
if (std::abs (solution (l, k + 4)) > 1e-14)
this->restriction[index][i + 2 * (j + 2 * k)]
((i + 2 * (j + 4)) * this->degree + l + 1,
= solution (l, k + 4);
}
}
-
+
const QGauss<2> face_quadrature (2 * this->degree);
const std::vector<Point<2> >& face_quadrature_points
= face_quadrature.get_points ();
= GeometryInfo<dim>::lines_per_cell * this->degree;
const unsigned int& n_face_quadrature_points
= face_quadrature.size ();
-
+
{
FullMatrix<double> assembling_matrix
(deg * this->degree,
n_face_quadrature_points);
-
+
for (unsigned int q_point = 0;
q_point < n_face_quadrature_points; ++q_point)
{
const double weight
= std::sqrt (face_quadrature.weight (q_point));
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i = weight
* legendre_polynomials[i].value
(face_quadrature_points[q_point] (0));
-
+
for (unsigned int j = 0; j < deg; ++j)
assembling_matrix (i * deg + j, q_point)
= L_i * lobatto_polynomials[j + 2].value
(face_quadrature_points[q_point] (1));
}
}
-
+
FullMatrix<double> system_matrix (assembling_matrix.m (),
assembling_matrix.m ());
-
+
assembling_matrix.mTmult (system_matrix,
assembling_matrix);
system_matrix_inv.reinit (system_matrix.m (),
system_matrix.m ());
system_matrix_inv.invert (system_matrix);
}
-
+
solution.reinit (system_matrix_inv.m (), 24);
system_rhs.reinit (system_matrix_inv.m (), 24);
tmp.reinit (24);
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_face_quadrature_points; ++q_point)
{
tmp = 0.0;
-
+
if (face_quadrature_points[q_point] (0) < 0.5)
{
if (face_quadrature_points[q_point] (1) < 0.5)
Point<dim> quadrature_point_0 (i,
2.0 * face_quadrature_points[q_point] (0),
2.0 * face_quadrature_points[q_point] (1));
-
+
tmp (0) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
tmp (1) += 2.0 * this->shape_value_component
tmp (17) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
}
-
+
else
{
Point<dim> quadrature_point_0 (i,
2.0 * face_quadrature_points[q_point] (0),
2.0 * face_quadrature_points[q_point] (1)
- 1.0);
-
+
tmp (2) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
tmp (3) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
}
}
-
+
else
if (face_quadrature_points[q_point] (1) < 0.5)
{
2.0 * face_quadrature_points[q_point] (0)
- 1.0,
2.0 * face_quadrature_points[q_point] (1));
-
+
tmp (4) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
tmp (5) += 2.0 * this->shape_value_component
tmp (21) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
}
-
+
else
{
Point<dim> quadrature_point_0 (i,
- 1.0,
2.0 * face_quadrature_points[q_point] (1)
- 1.0);
-
+
tmp (6) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
tmp (7) += 2.0 * this->shape_value_component
tmp (23) += 2.0 * this->shape_value_component
(dof, quadrature_point_0, 1);
}
-
+
const Point<dim> quadrature_point_0 (i,
face_quadrature_points[q_point] (0),
face_quadrature_points[q_point] (1));
(face_quadrature_points[q_point] (0),
face_quadrature_points[q_point] (1),
i);
-
+
for (unsigned int j = 0; j < 2; ++j)
for (unsigned int k = 0; k < 2; ++k)
for (unsigned int l = 0; l <= deg; ++l)
((4 * i + k) * this->degree + l,
quadrature_point_2, 1);
}
-
+
tmp *= face_quadrature.weight (q_point);
-
+
for (unsigned int j = 0; j <= deg; ++j)
{
const double L_j_0
const double L_j_1
= legendre_polynomials[j].value
(face_quadrature_points[q_point] (1));
-
+
for (unsigned int k = 0; k < deg; ++k)
{
const double l_k_0
const double l_k_1
= L_j_1 * lobatto_polynomials[k + 2].value
(face_quadrature_points[q_point] (0));
-
+
for (unsigned int l = 0; l < 4; ++l)
{
system_rhs (j * deg + k, 2 * l)
}
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int j = 0; j < 2; ++j)
for (unsigned int k = 0; k < 2; ++k)
for (unsigned int l = 0; l <= deg; ++l)
> 1e-14)
this->restriction[index][i + 2 * (2 * j + k)]
((2 * i * this->degree + l) * deg + m
- + n_edge_dofs,
+ + n_edge_dofs,
dof) = solution (l * deg + m,
2 * (j + 2 * k));
-
+
if (std::abs (solution (l * deg + m,
2 * (j + 2 * k) + 1))
> 1e-14)
+ n_edge_dofs, dof)
= solution (l * deg + m,
2 * (j + 2 * k) + 1);
-
+
if (std::abs (solution (l * deg + m,
2 * (j + 2 * (k + 2))))
> 1e-14)
+ n_edge_dofs,
dof) = solution (l * deg + m,
2 * (j + 2 * (k + 2)));
-
+
if (std::abs (solution (l * deg + m,
2 * (j + 2 * k) + 9))
> 1e-14)
+ n_edge_dofs, dof)
= solution (l * deg + m,
2 * (j + 2 * k) + 9);
-
+
if (std::abs (solution (l * deg + m,
2 * (j + 2 * (k + 4))))
> 1e-14)
+ n_edge_dofs,
dof) = solution (l * deg + m,
2 * (j + 2 * (k + 4)));
-
+
if (std::abs (solution (l * deg + m,
2 * (j + 2 * k) + 17))
> 1e-14)
2 * (j + 2 * k) + 17);
}
}
-
+
const QGauss<dim> quadrature (2 * this->degree);
const std::vector<Point<dim> >&
quadrature_points = quadrature.get_points ();
= 2 * GeometryInfo<dim>::faces_per_cell * deg * this->degree
+ n_edge_dofs;
const unsigned int& n_quadrature_points = quadrature.size ();
-
+
{
FullMatrix<double>
assembling_matrix (deg * deg * this->degree,
n_quadrature_points);
-
+
for (unsigned int q_point = 0; q_point < n_quadrature_points;
++q_point)
{
const double weight = std::sqrt (quadrature.weight
(q_point));
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i = weight
* legendre_polynomials[i].value
(quadrature_points[q_point] (0));
-
+
for (unsigned int j = 0; j < deg; ++j)
{
const double l_j
= L_i * lobatto_polynomials[j + 2].value
(quadrature_points[q_point] (1));
-
+
for (unsigned int k = 0; k < deg; ++k)
assembling_matrix ((i * deg + j) * deg + k,
q_point)
}
}
}
-
+
FullMatrix<double> system_matrix (assembling_matrix.m (),
assembling_matrix.m ());
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.reinit (system_matrix.m (),
system_matrix.m ());
system_matrix_inv.invert (system_matrix);
}
-
+
solution.reinit (system_matrix_inv.m (), 24);
system_rhs.reinit (system_matrix_inv.m (), 24);
tmp.reinit (24);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_quadrature_points; ++q_point)
{
tmp = 0.0;
-
+
if (quadrature_points[q_point] (0) < 0.5)
{
if (quadrature_points[q_point] (1) < 0.5)
(2.0 * quadrature_points[q_point] (0),
2.0 * quadrature_points[q_point] (1),
2.0 * quadrature_points[q_point] (2));
-
+
tmp (0) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (1) += 2.0 * this->shape_value_component
tmp (2) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
-
+
else
{
const Point<dim> quadrature_point
2.0 * quadrature_points[q_point] (1),
2.0 * quadrature_points[q_point] (2)
- 1.0);
-
+
tmp (3) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (4) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
}
-
+
else
if (quadrature_points[q_point] (2) < 0.5)
{
2.0 * quadrature_points[q_point] (1)
- 1.0,
2.0 * quadrature_points[q_point] (2));
-
+
tmp (6) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (7) += 2.0 * this->shape_value_component
tmp (8) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
-
+
else
{
const Point<dim> quadrature_point
- 1.0,
2.0 * quadrature_points[q_point] (2)
- 1.0);
-
+
tmp (9) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (10) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
}
-
+
else
if (quadrature_points[q_point] (1) < 0.5)
{
- 1.0,
2.0 * quadrature_points[q_point] (1),
2.0 * quadrature_points[q_point] (2));
-
+
tmp (12) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (13) += 2.0 * this->shape_value_component
tmp (14) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
-
+
else
{
const Point<dim> quadrature_point
2.0 * quadrature_points[q_point] (1),
2.0 * quadrature_points[q_point] (2)
- 1.0);
-
+
tmp (15) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (16) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
}
-
+
else
if (quadrature_points[q_point] (2) < 0.5)
{
2.0 * quadrature_points[q_point] (1)
- 1.0,
2.0 * quadrature_points[q_point] (2));
-
+
tmp (18) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (19) += 2.0 * this->shape_value_component
tmp (20) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
-
+
else
{
const Point<dim> quadrature_point
- 1.0,
2.0 * quadrature_points[q_point] (2)
- 1.0);
-
+
tmp (21) += 2.0 * this->shape_value_component
(dof, quadrature_point, 0);
tmp (22) += 2.0 * this->shape_value_component
tmp (23) += 2.0 * this->shape_value_component
(dof, quadrature_point, 2);
}
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j < 2; ++j)
for (unsigned int k = 0; k < 2; ++k)
* this->shape_value_component
((2 * (j + 4) + k) * this->degree + l,
quadrature_points[q_point], 2);
-
+
for (unsigned int m = 0; m < deg; ++m)
{
tmp (3 * (i + 2 * (j + 2 * k)))
quadrature_points[q_point], 2);
}
}
-
+
tmp *= quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i_0
const double L_i_2
= legendre_polynomials[i].value
(quadrature_points[q_point] (2));
-
+
for (unsigned int j = 0; j < deg; ++j)
{
const double l_j_0
const double l_j_2
= L_i_2 * lobatto_polynomials[j + 2].value
(quadrature_points[q_point] (0));
-
+
for (unsigned int k = 0; k < deg; ++k)
{
const double l_k_0
const double l_k_2
= l_j_2 * lobatto_polynomials[k + 2].value
(quadrature_points[q_point] (1));
-
+
for (unsigned int l = 0; l < 8; ++l)
{
system_rhs ((i * deg + j) * deg + k,
}
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j < 2; ++j)
for (unsigned int k = 0; k < 2; ++k)
((l * deg + m) * deg + n + n_boundary_dofs,
dof) = solution ((l * deg + m) * deg + n,
3 * (i + 2 * (j + 2 * k)));
-
+
if (std::abs (solution
((l * deg + m) * deg + n,
3 * (i + 2 * (j + 2 * k)) + 1))
+ n_boundary_dofs,
dof) = solution ((l * deg + m) * deg + n,
3 * (i + 2 * (j + 2 * k)) + 1);
-
+
if (std::abs (solution
((l * deg + m) * deg + n,
3 * (i + 2 * (j + 2 * k)) + 2))
}
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_Nedelec<1>::get_dpo_vector (const unsigned int degree)
-{
- std::vector<unsigned int> dpo (2);
-
- dpo[0] = 1;
- dpo[1] = degree;
- return dpo;
-}
-
-#endif
-
template <int dim>
std::vector<unsigned int>
}
}
-#if deal_II_dimension == 1
-template <int dim>
+
+template <>
void
-FE_Nedelec<dim>::get_subface_interpolation_matrix(
- const FiniteElement<dim>&,
+FE_Nedelec<1>::get_subface_interpolation_matrix(
+ const FiniteElement<1>&,
const unsigned int,
FullMatrix<double>&) const
{
Assert (false, ExcNotImplemented ());
}
-#else
+
// In this function we compute the
// subface interpolation matrix.
const std::vector<Point<1> >&
edge_quadrature_points = edge_quadrature.get_points ();
const unsigned int& n_edge_quadrature_points = edge_quadrature.size ();
-
+
switch (dim)
{
case 2:
const Point<dim> quadrature_point (0.0,
0.5 * (edge_quadrature_points[q_point] (0)
+ subface));
-
+
interpolation_matrix (0, dof) += 0.5
* edge_quadrature.weight (q_point)
* this->shape_value_component
(dof, quadrature_point, 1);
}
-
+
if (deg > 0)
{
const std::vector<Polynomials::Polynomial<double> >&
legendre_polynomials
= Polynomials::Legendre::generate_complete_basis (deg);
FullMatrix<double> system_matrix_inv (deg, deg);
-
+
{
FullMatrix<double> assembling_matrix (deg,
n_edge_quadrature_points);
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const double weight
= std::sqrt (edge_quadrature.weight (q_point));
-
+
for (unsigned int i = 0; i < deg; ++i)
assembling_matrix (i, q_point) = weight
* legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
}
-
+
FullMatrix<double> system_matrix (deg, deg);
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.invert (system_matrix);
}
-
+
Vector<double> solution (deg);
Vector<double> system_rhs (deg);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
dof)
* source_fe.shape_value_component
(0, quadrature_point_1, 1));
-
+
for (unsigned int i = 0; i < deg; ++i)
system_rhs (i) += tmp
* legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
}
-
+
system_matrix_inv.vmult (solution, system_rhs);
-
+
for (unsigned int i = 0; i < deg; ++i)
if (std::abs (solution (i)) > 1e-14)
interpolation_matrix (i + 1, dof) = solution (i);
}
}
-
+
break;
}
{
const double shifts[4][2] = { { 0.0, 0.0 }, { 1.0, 0.0 },
{ 0.0, 1.0 }, { 1.0, 1.0 } };
-
+
for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
for (unsigned int q_point = 0; q_point < n_edge_quadrature_points;
++q_point)
{
const double weight = 0.5 * edge_quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i < 2; ++i)
{
Point<dim>
quadrature_point (0.5 * (i + shifts[subface][0]),
0.5 * (edge_quadrature_points[q_point] (0)
+ shifts[subface][1]), 0.0);
-
+
interpolation_matrix (i * source_fe.degree, dof) += weight
* this->shape_value_component
(this->face_to_cell_index (dof, 4),
quadrature_point, 0);
}
}
-
+
if (deg > 0)
{
const std::vector<Polynomials::Polynomial<double> >&
legendre_polynomials
= Polynomials::Legendre::generate_complete_basis (deg);
FullMatrix<double> system_matrix_inv (deg, deg);
-
+
{
FullMatrix<double> assembling_matrix (deg,
n_edge_quadrature_points);
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const double weight
= std::sqrt (edge_quadrature.weight (q_point));
-
+
for (unsigned int i = 0; i < deg; ++i)
assembling_matrix (i, q_point) = weight
* legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
}
-
+
FullMatrix<double> system_matrix (deg, deg);
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.invert (system_matrix);
}
-
+
FullMatrix<double> solution (deg,
GeometryInfo<dim>::lines_per_face);
FullMatrix<double> system_rhs (deg,
GeometryInfo<dim>::lines_per_face);
Vector<double> tmp (GeometryInfo<dim>::lines_per_face);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_edge_quadrature_points; ++q_point)
{
const double weight = edge_quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i < 2; ++i)
{
Point<dim>
Point<dim> quadrature_point_1 (i,
edge_quadrature_points[q_point] (0),
0.0);
-
+
tmp (i) = weight
* (0.5 * this->shape_value_component
(this->face_to_cell_index (dof, 4),
((i + 2) * source_fe.degree,
quadrature_point_1, 0));
}
-
+
for (unsigned int i = 0; i < deg; ++i)
{
const double L_i
= legendre_polynomials[i + 1].value
(edge_quadrature_points[q_point] (0));
-
+
for (unsigned int j = 0;
j < GeometryInfo<dim>::lines_per_face; ++j)
system_rhs (i, j) += tmp (j) * L_i;
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int i = 0;
i < GeometryInfo<dim>::lines_per_face; ++i)
for (unsigned int j = 0; j < deg; ++j)
interpolation_matrix (i * source_fe.degree + j + 1,
dof) = solution (j, i);
}
-
+
const QGauss<2> quadrature (source_fe.degree);
const std::vector<Point<2> >&
quadrature_points = quadrature.get_points ();
const unsigned int n_boundary_dofs
= GeometryInfo<dim>::lines_per_face * source_fe.degree;
const unsigned int& n_quadrature_points = quadrature.size ();
-
+
{
FullMatrix<double> assembling_matrix (deg * this->degree,
n_quadrature_points);
-
+
for (unsigned int q_point = 0; q_point < n_quadrature_points;
++q_point)
{
const double weight = quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i = weight
* legendre_polynomials[i].value
(quadrature_points[q_point] (0));
-
+
for (unsigned int j = 0; j < deg; ++j)
assembling_matrix (i * deg + j, q_point)
= L_i * lobatto_polynomials[j + 2].value
(quadrature_points[q_point] (1));
}
}
-
+
FullMatrix<double> system_matrix (assembling_matrix.m (),
assembling_matrix.m ());
-
+
assembling_matrix.mTmult (system_matrix, assembling_matrix);
system_matrix_inv.reinit (system_matrix.m (),
system_matrix.m ());
system_matrix_inv.invert (system_matrix);
}
-
+
solution.reinit (system_matrix_inv.m (), 2);
system_rhs.reinit (system_matrix_inv.m (), 2);
tmp.reinit (2);
-
+
for (unsigned int dof = 0; dof < this->dofs_per_face; ++dof)
{
system_rhs = 0.0;
-
+
for (unsigned int q_point = 0;
q_point < n_quadrature_points; ++q_point)
{
quadrature_point
= Point<dim> (quadrature_points[q_point] (0),
quadrature_points[q_point] (1), 0.0);
-
+
for (unsigned int i = 0; i < 2; ++i)
for (unsigned int j = 0; j <= deg; ++j)
{
(i * source_fe.degree + j,
quadrature_point, 1);
}
-
+
tmp *= quadrature.weight (q_point);
-
+
for (unsigned int i = 0; i <= deg; ++i)
{
const double L_i_0 = legendre_polynomials[i].value
(quadrature_points[q_point] (0));
const double L_i_1 = legendre_polynomials[i].value
(quadrature_points[q_point] (1));
-
+
for (unsigned int j = 0; j < deg; ++j)
{
system_rhs (i * deg + j, 0) += tmp (0) * L_i_0
}
}
}
-
+
system_matrix_inv.mmult (solution, system_rhs);
-
+
for (unsigned int i = 0; i <= deg; ++i)
for (unsigned int j = 0; j < deg; ++j)
{
interpolation_matrix (i * deg + j + n_boundary_dofs,
dof) = solution (i * deg + j,
0);
-
+
if (std::abs (solution (i * deg + j, 1)) > 1e-14)
interpolation_matrix (i + (j + deg)
* source_fe.degree
}
}
}
-
+
break;
}
}
}
-#endif
+
// Since this is a vector valued element,
// we cannot interpolate a scalar function.
// for the horizontal shape
// functions.
system_rhs = 0;
-
+
for (unsigned int q_point = 0;
q_point < n_face_points; ++q_point)
{
}
-template class FE_Nedelec<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_nedelec.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)
+ {
+ template class FE_Nedelec<deal_II_dimension>;
+ }
+
else
return FiniteElementDomination::this_element_dominates;
}
-
-
+
+
template <int dim>
std::vector<std::pair<unsigned int, unsigned int> >
FE_Nothing<dim> ::
return std::vector<std::pair<unsigned int, unsigned int> > ();
}
-
+
template <int dim>
std::vector<std::pair<unsigned int, unsigned int> >
FE_Nothing<dim> ::
return std::vector<std::pair<unsigned int, unsigned int> > ();
}
-
+
template <int dim>
bool
FE_Nothing<dim> ::
{
return true;
}
-
-
+
+
template <int dim>
void
FE_Nothing<dim>::
{
// since this element has no face dofs, the
// interpolation matrix is necessarily empty
-
+
Assert (interpolation_matrix.m() == 0,
ExcDimensionMismatch (interpolation_matrix.m(),
0));
0));
}
-
-template class FE_Nothing<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_nothing.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)
+ {
+ template class FE_Nothing<deal_II_dimension>;
+ }
+
DEAL_II_NAMESPACE_OPEN
-template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension>;
-template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
-template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+#include "fe_poly.inst"
-#if deal_II_dimension != 3
-
-template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-//template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
-
-#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 FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension>;
+ template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension>;
+ template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension>;
+
+#if deal_II_dimension != 3
+
+ template class FE_Poly<TensorProductPolynomials<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+ template class FE_Poly<PolynomialSpace<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+ //template class FE_Poly<PolynomialsP<deal_II_dimension>, deal_II_dimension, deal_II_dimension+1>;
+
+#endif
+ }
+
* algorithm, which determines the DoFs, which need this sign change for a
* given cell.
*/
-#if deal_II_dimension == 1
void
get_face_sign_change (const Triangulation<1>::cell_iterator &,
const unsigned int ,
// nothing to do in 1d
std::fill (face_sign.begin (), face_sign.end (), 1.0);
}
-#endif
-#if deal_II_dimension == 2
+
+
void
get_face_sign_change (const Triangulation<2>::cell_iterator &cell,
const unsigned int dofs_per_face,
{
const unsigned int dim = 2;
const unsigned int spacedim = 2;
-
+
// Default is no sign
// change. I.e. multiply by one.
std::fill (face_sign.begin (), face_sign.end (), 1.0);
-
- for (unsigned int f = GeometryInfo<dim>::faces_per_cell / 2;
+
+ for (unsigned int f = GeometryInfo<dim>::faces_per_cell / 2;
f < GeometryInfo<dim>::faces_per_cell; ++f)
{
Triangulation<dim,spacedim>::face_iterator face = cell->face (f);
if (!face->at_boundary ())
{
const unsigned int nn = cell->neighbor_face_no(f);
-
+
if (nn < GeometryInfo<dim>::faces_per_cell / 2)
for (unsigned int j = 0; j < dofs_per_face; ++j)
{
}
}
}
-#endif
-#if deal_II_dimension == 3
+
void
get_face_sign_change (const Triangulation<3>::cell_iterator &/*cell*/,
const unsigned int /*dofs_per_face*/,
std::vector<double> &face_sign)
{
std::fill (face_sign.begin (), face_sign.end (), 1.0);
-//TODO: think about what it would take here
+//TODO: think about what it would take here
}
-#endif
}
{
Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
Assert (component < dim, ExcIndexRange (component, 0, dim));
-
+
if (cached_point != p || cached_values.size() == 0)
{
cached_point = p;
cached_values.resize(poly_space.n());
poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
}
-
+
double s = 0;
if (inverse_node_matrix.n_cols() == 0)
return cached_values[i][component];
{
Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
Assert (component < dim, ExcIndexRange (component, 0, dim));
-
+
if (cached_point != p || cached_grads.size() == 0)
{
cached_point = p;
cached_grads.resize(poly_space.n());
poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
}
-
+
Tensor<1,dim> s;
if (inverse_node_matrix.n_cols() == 0)
return cached_grads[i][component];
else
for (unsigned int j=0;j<inverse_node_matrix.n_cols();++j)
s += inverse_node_matrix(j,i) * cached_grads[j][component];
-
+
return s;
}
{
Assert (i<this->dofs_per_cell, ExcIndexRange(i,0,this->dofs_per_cell));
Assert (component < dim, ExcIndexRange (component, 0, dim));
-
+
if (cached_point != p || cached_grad_grads.size() == 0)
{
cached_point = p;
cached_grad_grads.resize(poly_space.n());
poly_space.compute(p, cached_values, cached_grads, cached_grad_grads);
}
-
+
Tensor<2,dim> s;
if (inverse_node_matrix.n_cols() == 0)
return cached_grad_grads[i][component];
else
for (unsigned int j=0;j<inverse_node_matrix.n_cols();++j)
s += inverse_node_matrix(i,j) * cached_grad_grads[j][component];
-
+
return s;
}
const UpdateFlags flags(data->update_flags);
const unsigned int n_q_points = quadrature.size();
-
+
// some scratch arrays
std::vector<Tensor<1,dim> > values(0);
std::vector<Tensor<2,dim> > grads(0);
// that
if (flags & update_hessians)
{
-// grad_grads.resize (this->dofs_per_cell);
+// grad_grads.resize (this->dofs_per_cell);
data->initialize_2nd (this, mapping, quadrature);
}
{
poly_space.compute(quadrature.point(k),
values, grads, grad_grads);
-
+
if (flags & update_values)
{
if (inverse_node_matrix.n_cols() == 0)
data->shape_values[i][k] = add_values;
}
}
-
+
if (flags & update_gradients)
{
if (inverse_node_matrix.n_cols() == 0)
data->shape_grads[i][k] = add_grads;
}
}
-
+
}
return data;
}
const unsigned int n_q_points = quadrature.size();
const UpdateFlags flags(fe_data.current_update_flags());
-
+
Assert(!(flags & update_values) || fe_data.shape_values.size() == this->dofs_per_cell,
ExcDimensionMismatch(fe_data.shape_values.size(), this->dofs_per_cell));
Assert(!(flags & update_values) || fe_data.shape_values[0].size() == n_q_points,
if (mapping_type == mapping_piola)
if (cell_similarity == CellSimilarity::translation)
cell_similarity = CellSimilarity::none;
-
+
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
-
+
if (flags & update_values && cell_similarity != CellSimilarity::translation)
switch (mapping_type)
{
data.shape_values(first+d,k) = fe_data.shape_values[i][k][d];
break;
}
-
+
case mapping_covariant:
case mapping_contravariant:
{
= sign_change[i] * shape_values[k][d];
break;
}
-
+
case mapping_nedelec:
{
std::vector<Tensor<1,dim> > shape_values (n_q_points);
mapping.transform (fe_data.shape_values[i], shape_values,
mapping_data, mapping_covariant);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
data.shape_values(first+d,k) = shape_values[k][d];
-
+
break;
}
default:
Assert(false, ExcNotImplemented());
}
-
+
if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
{
std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
{
mapping.transform(fe_data.shape_grads[i], shape_grads1,
mapping_data, mapping_covariant_gradient);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
-
+
break;
}
case mapping_contravariant:
{
mapping.transform(fe_data.shape_grads[i], shape_grads1,
mapping_data, mapping_contravariant_gradient);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads2[k][d];
-
+
break;
}
case mapping_piola:
{
mapping.transform(fe_data.shape_grads[i], shape_grads1,
mapping_data, mapping_piola);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-
+
break;
}
-
+
case mapping_nedelec: {
// treat the gradients of
// this particular shape
// (J^-1) from the right,
// we have to trick a
// little in between
-
+
// do first transformation
mapping.transform (fe_data.shape_grads[i], shape_grads1,
mapping_data, mapping_covariant);
- // transpose matrix
+ // transpose matrix
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
- // do second transformation
+ // do second transformation
mapping.transform (shape_grads2, shape_grads1,
mapping_data, mapping_covariant);
- // transpose back
+ // transpose back
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
- data.shape_gradients[first + d][k] = shape_grads2[k][d];
+ data.shape_gradients[first + d][k] = shape_grads2[k][d];
// then copy over to target:
break;
}
-
+
default:
Assert(false, ExcNotImplemented());
}
}
}
-
+
if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
this->compute_2nd (mapping, cell,
typename QProjector<dim>::DataSetDescriptor().cell(),
// offset determines which data set
// to take (all data sets for all
// faces are stored contiguously)
-
+
const typename QProjector<dim>::DataSetDescriptor dsd;
const typename QProjector<dim>::DataSetDescriptor offset
= dsd.face (face,
cell->face_flip(face),
cell->face_rotation(face),
n_q_points);
-
+
const UpdateFlags flags(fe_data.update_once | fe_data.update_each);
//TODO: Size assertions
// on the neighborhood between two faces.
std::vector<double> sign_change (this->dofs_per_cell, 1.0);
get_face_sign_change (cell, this->dofs_per_face, sign_change);
-
+
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
-
+
if (flags & update_values)
{
switch (mapping_type)
data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
break;
}
-
+
case mapping_covariant:
case mapping_contravariant:
{
std::vector<Tensor<1,dim> > shape_values (n_q_points);
mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points),
shape_values, mapping_data, mapping_type);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k) = shape_values[k][d];
-
+
break;
}
case mapping_piola:
= sign_change[i] * shape_values[k][d];
break;
}
-
+
case mapping_nedelec: {
std::vector<Tensor<1,dim> > shape_values (n_q_points);
mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
shape_values, mapping_data, mapping_covariant);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
data.shape_values(first+d,k) = shape_values[k][d];
-
+
break;
}
-
+
default:
Assert(false, ExcNotImplemented());
- }
+ }
}
-
+
if (flags & update_gradients)
{
std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
-
+
case mapping_covariant:
{
mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
shape_grads1, mapping_data, mapping_covariant_gradient);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
-
+
break;
}
case mapping_piola:
{
mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
shape_grads1, mapping_data, mapping_piola);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-
+
break;
}
-
+
case mapping_nedelec: {
// treat the gradients of
// this particular shape
// (J^-1) from the right,
// we have to trick a
// little in between
-
+
// do first transformation
mapping.transform (make_slice (fe_data.shape_grads[i], offset, n_q_points),
shape_grads1, mapping_data, mapping_covariant);
- // transpose matrix
+ // transpose matrix
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
- // do second transformation
+ // do second transformation
mapping.transform (shape_grads2, shape_grads1,
mapping_data, mapping_covariant);
- // transpose back
+ // transpose back
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
- data.shape_gradients[first + d][k] = shape_grads2[k][d];
+ data.shape_gradients[first + d][k] = shape_grads2[k][d];
// then copy over to target:
break;
}
-
+
default:
Assert(false, ExcNotImplemented());
}
}
}
-
+
if (flags & update_hessians)
this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data);
}
// on the neighborhood between two faces.
std::vector<double> sign_change (this->dofs_per_cell, 1.0);
get_face_sign_change (cell, this->dofs_per_face, sign_change);
-
+
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
{
const unsigned int first = data.shape_function_to_row_table[i];
-
+
if (flags & update_values)
{
switch (mapping_type)
data.shape_values(first+d,k) = fe_data.shape_values[i][k+offset][d];
break;
}
-
+
case mapping_covariant:
case mapping_contravariant:
{
std::vector<Tensor<1,dim> > shape_values (n_q_points);
mapping.transform(make_slice(fe_data.shape_values[i], offset, n_q_points),
shape_values, mapping_data, mapping_type);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_values(first+d,k) = shape_values[k][d];
-
+
break;
}
case mapping_piola:
std::vector<Tensor<1,dim> > shape_values (n_q_points);
mapping.transform (make_slice (fe_data.shape_values[i], offset, n_q_points),
shape_values, mapping_data, mapping_covariant);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
data.shape_values(first+d,k) = shape_values[k][d];
-
+
break;
}
default:
Assert(false, ExcNotImplemented());
}
}
-
+
if (flags & update_gradients)
{
std::vector<Tensor<2,dim> > shape_grads1 (n_q_points);
data.shape_gradients[first+d][k] = shape_grads1[k][d];
break;
}
-
+
case mapping_covariant:
{
mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
{
mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
shape_grads1, mapping_data, mapping_contravariant_gradient);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = shape_grads1[k][d];
-
+
break;
}
mapping.transform(make_slice(fe_data.shape_grads[i], offset, n_q_points),
shape_grads1,
mapping_data, mapping_piola);
-
+
for (unsigned int k=0; k<n_q_points; ++k)
for (unsigned int d=0; d<dim; ++d)
data.shape_gradients[first+d][k] = sign_change[i] * shape_grads1[k][d];
-
+
break;
}
-
+
case mapping_nedelec: {
// treat the gradients of
// this particular shape
// (J^-1) from the right,
// we have to trick a
// little in between
-
+
// do first transformation
mapping.transform (make_slice (fe_data.shape_grads[i], offset, n_q_points),
shape_grads1, mapping_data, mapping_covariant);
- // transpose matrix
+ // transpose matrix
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
- // do second transformation
+ // do second transformation
mapping.transform (shape_grads2, shape_grads1,
mapping_data, mapping_covariant);
- // transpose back
+ // transpose back
for (unsigned int k = 0; k < n_q_points; ++k)
shape_grads2[k] = transpose (shape_grads1[k]);
-
+
for (unsigned int k = 0; k < n_q_points; ++k)
for (unsigned int d = 0; d < dim; ++d)
- data.shape_gradients[first + d][k] = shape_grads2[k][d];
+ data.shape_gradients[first + d][k] = shape_grads2[k][d];
// then copy over to target:
break;
}
-
+
default:
Assert(false, ExcNotImplemented());
}
}
}
-
+
if (flags & update_hessians)
this->compute_2nd (mapping, cell, offset, mapping_data, fe_data, data);
}
FE_PolyTensor<POLY,dim,spacedim>::update_once (const UpdateFlags flags) const
{
const bool values_once = (mapping_type == mapping_none);
-
+
UpdateFlags out = update_default;
if (values_once && (flags & update_values))
{
if (flags & update_values)
out |= update_values | update_piola;
-
+
if (flags & update_gradients)
out |= update_gradients | update_piola | update_covariant_transformation;
-
+
if (flags & update_hessians)
out |= update_hessians | update_piola | update_covariant_transformation;
-
+
break;
}
-
+
case mapping_nedelec: {
if (flags & update_values)
out |= update_values | update_covariant_transformation;
-
+
if (flags & update_gradients)
out |= update_gradients | update_covariant_transformation;
-
+
if (flags & update_hessians)
out |= update_hessians | update_covariant_transformation;
-
+
break;
}
Assert (false, ExcNotImplemented());
}
}
-
+
return out;
}
-template class FE_PolyTensor<PolynomialsRaviartThomas<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsABF<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsBDM<deal_II_dimension>,deal_II_dimension>;
-template class FE_PolyTensor<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+// explicit instantiations
+#include "fe_poly_tensor.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)
+ {
+ template class FE_PolyTensor<PolynomialsRaviartThomas<deal_II_dimension>,deal_II_dimension>;
+ template class FE_PolyTensor<PolynomialsABF<deal_II_dimension>,deal_II_dimension>;
+ template class FE_PolyTensor<PolynomialsBDM<deal_II_dimension>,deal_II_dimension>;
+ template class FE_PolyTensor<PolynomialsNedelec<deal_II_dimension>, deal_II_dimension>;
+ }
+
// embedding operators
FETools::compute_embedding_matrices (*this, this->prolongation);
- // Fill restriction matrices
+ // Fill restriction matrices
initialize_restriction();
initialize_quad_dof_index_permutation();
}
-#if deal_II_dimension == 1
template <>
void
ExcInterpolationNotImplemented ());
}
-#endif
-
-#if deal_II_dimension > 1
template <int dim, int spacedim>
void
}
}
-#endif
template <int dim, int spacedim>
}
-#if deal_II_dimension == 1
template <>
void FE_Q<1>::initialize_unit_face_support_points ()
// no faces in 1d, so nothing to do
}
-#endif
template <int dim, int spacedim>
}
-#if deal_II_dimension == 3
template <>
void
this->adjust_line_dof_index_for_line_orientation_table[i]=this->dofs_per_line-1-i - i;
}
-#endif
}
-#if deal_II_dimension == 1
template <>
std::vector<unsigned int>
return std::vector<unsigned int>();
}
-#endif
+
template <int dim, int spacedim>
void
// value per row. Still, the
// values should sum up to 1
double sum_check = 0;
- for (unsigned int child_dof = 0; child_dof<this->dofs_per_cell;
+ for (unsigned int child_dof = 0; child_dof<this->dofs_per_cell;
++child_dof)
{
const double val
sum_check += val;
}
- Assert (std::fabs(sum_check-1) < this->degree*eps,
+ Assert (std::fabs(sum_check-1) < this->degree*eps,
ExcInternalError());
}
}
}
+
//---------------------------------------------------------------------------
// Data field initialization
//---------------------------------------------------------------------------
-#if deal_II_dimension == 1
template <>
bool
-
-#else
-
-
template <int dim, int spacedim>
bool
FE_Q<dim,spacedim>::has_support_on_face (const unsigned int shape_index,
return false;
}
-#endif
template <int dim, int spacedim>
-template class FE_Q<deal_II_dimension>;
-
-#if deal_II_dimension !=3
-template class FE_Q<deal_II_dimension,deal_II_dimension+1>;
-#endif
-
-
+// explicit instantiations
+#include "fe_q.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)
+ {
+ template class FE_Q<deal_II_dimension>;
+
+#if deal_II_dimension !=3
+ template class FE_Q<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ }
+
DEAL_II_NAMESPACE_OPEN
-namespace
+namespace
{
inline
std::vector<unsigned int>
{
this->poly_space.set_numbering(
hierarchic_to_fe_q_hierarchical_numbering(*this));
-
- // The matrix @p{dofs_cell} contains the
- // values of the linear functionals of
- // the master 1d cell applied to the
+
+ // The matrix @p{dofs_cell} contains the
+ // values of the linear functionals of
+ // the master 1d cell applied to the
// shape functions of the two 1d subcells.
// The matrix @p{dofs_subcell} constains
- // the values of the linear functionals
- // on each 1d subcell applied to the
- // shape functions on the master 1d
- // subcell.
- // We use @p{dofs_cell} and
- // @p{dofs_subcell} to compute the
- // @p{prolongation}, @p{restriction} and
- // @p{interface_constraints} matrices
+ // the values of the linear functionals
+ // on each 1d subcell applied to the
+ // shape functions on the master 1d
+ // subcell.
+ // We use @p{dofs_cell} and
+ // @p{dofs_subcell} to compute the
+ // @p{prolongation}, @p{restriction} and
+ // @p{interface_constraints} matrices
// for all dimensions.
std::vector<FullMatrix<double> >
dofs_cell (GeometryInfo<1>::max_children_per_cell,
// this function returns, so they
// have to be kept in synch
- std::ostringstream namebuf;
+ std::ostringstream namebuf;
namebuf << "FE_Q_Hierarchical<" << dim << ">(" << this->degree << ")";
return namebuf.str();
// upper diagonal block
if ((j<=1) && (k<=1))
{
- if (((c==0) && (j==0) && (k==0)) ||
+ if (((c==0) && (j==0) && (k==0)) ||
((c==1) && (j==1) && (k==1)))
dofs_cell[c](j,k) = 1.;
- else
+ else
dofs_cell[c](j,k) = 0.;
-
+
if (((c==0) && (j==1)) || ((c==1) && (j==0)))
dofs_subcell[c](j,k) = .5;
else if (((c==0) && (k==0)) || ((c==1) && (k==1)))
factor *= ((double) (k-i+1))/((double) i);
if (c==0)
{
- dofs_subcell[c](j,k) = ((k+j) % 2 == 0) ?
+ dofs_subcell[c](j,k) = ((k+j) % 2 == 0) ?
std::pow(.5,static_cast<double>(k))*factor :
-std::pow(.5,static_cast<double>(k))*factor;
dofs_cell[c](j,k) = std::pow(2.,static_cast<double>(j))*factor;
else
{
dofs_subcell[c](j,k) = std::pow(.5,static_cast<double>(k))*factor;
- dofs_cell[c](j,k) = ((k+j) % 2 == 0) ?
+ dofs_cell[c](j,k) = ((k+j) % 2 == 0) ?
std::pow(2.,static_cast<double>(j))*factor :
-std::pow(2.,static_cast<double>(j))*factor;
}
// no constraints in 1d
break;
}
-
+
case 2:
{
// vertex node
for (unsigned int i=0; i<dofs_1d; ++i)
- this->interface_constraints(0,i) = dofs_subcell[0](1,i);
+ this->interface_constraints(0,i) = dofs_subcell[0](1,i);
// edge nodes
for (unsigned int c=0; c<GeometryInfo<1>::max_children_per_cell; ++c)
for (unsigned int i=0; i<dofs_1d; ++i)
for (unsigned int j=2; j<dofs_1d; ++j)
- this->interface_constraints(1 + c*(degree-1) + j - 2,i) =
+ this->interface_constraints(1 + c*(degree-1) + j - 2,i) =
dofs_subcell[c](j,i);
break;
}
-
+
case 3:
{
for (unsigned int i=0; i<dofs_1d * dofs_1d; i++)
{
- // center vertex node
- this->interface_constraints(0,face_renumber[i]) =
- dofs_subcell[0](1,i % dofs_1d) *
+ // center vertex node
+ this->interface_constraints(0,face_renumber[i]) =
+ dofs_subcell[0](1,i % dofs_1d) *
dofs_subcell[0](1,(i - (i % dofs_1d)) / dofs_1d);
// boundary vertex nodes
- this->interface_constraints(1,face_renumber[i]) =
- dofs_subcell[0](0, i % dofs_1d) *
+ this->interface_constraints(1,face_renumber[i]) =
+ dofs_subcell[0](0, i % dofs_1d) *
dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(2,face_renumber[i]) =
- dofs_subcell[1](1, i % dofs_1d) *
+ this->interface_constraints(2,face_renumber[i]) =
+ dofs_subcell[1](1, i % dofs_1d) *
dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(3,face_renumber[i]) =
- dofs_subcell[0](1, i % dofs_1d) *
+ this->interface_constraints(3,face_renumber[i]) =
+ dofs_subcell[0](1, i % dofs_1d) *
dofs_subcell[0](0, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(4,face_renumber[i]) =
- dofs_subcell[1](0, i % dofs_1d) *
+ this->interface_constraints(4,face_renumber[i]) =
+ dofs_subcell[1](0, i % dofs_1d) *
dofs_subcell[1](1, (i - (i % dofs_1d)) / dofs_1d);
-
+
// interior edges
for (unsigned int j=0; j<(degree-1); j++)
{
- this->interface_constraints(5 + j,face_renumber[i]) =
- dofs_subcell[0](1, i % dofs_1d) *
+ this->interface_constraints(5 + j,face_renumber[i]) =
+ dofs_subcell[0](1, i % dofs_1d) *
dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(5 + (degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](1,i % dofs_1d) *
+ this->interface_constraints(5 + (degree-1) + j,face_renumber[i]) =
+ dofs_subcell[0](1,i % dofs_1d) *
dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(5 + 2*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](2 + j,i % dofs_1d) *
+ this->interface_constraints(5 + 2*(degree-1) + j,face_renumber[i]) =
+ dofs_subcell[0](2 + j,i % dofs_1d) *
dofs_subcell[1](0, (i - (i % dofs_1d)) / dofs_1d);
- this->interface_constraints(5 + 3*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[1](2 + j, i % dofs_1d) *
+ this->interface_constraints(5 + 3*(degree-1) + j,face_renumber[i]) =
+ dofs_subcell[1](2 + j, i % dofs_1d) *
dofs_subcell[0](1, (i - (i % dofs_1d)) / dofs_1d);
}
{
// left edge
this->interface_constraints(5 + 4*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](0, i % dofs_1d) *
+ dofs_subcell[0](0, i % dofs_1d) *
dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
this->interface_constraints(5 + 4*(degree-1) + (degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](0, i % dofs_1d) *
+ dofs_subcell[0](0, i % dofs_1d) *
dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
// right edge
this->interface_constraints(5 + 4*(degree-1) + 2*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[1](1, i % dofs_1d) *
+ dofs_subcell[1](1, i % dofs_1d) *
dofs_subcell[0](2 + j, (i - (i % dofs_1d)) / dofs_1d);
this->interface_constraints(5 + 4*(degree-1) + 3*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[1](1, i % dofs_1d) *
+ dofs_subcell[1](1, i % dofs_1d) *
dofs_subcell[1](2 + j, (i - (i % dofs_1d)) / dofs_1d);
- // bottom edge
+ // bottom edge
this->interface_constraints(5 + 4*(degree-1) + 4*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](2 + j, i % dofs_1d) *
+ dofs_subcell[0](2 + j, i % dofs_1d) *
dofs_subcell[0](0, (i - (i % dofs_1d)) / dofs_1d);
this->interface_constraints(5 + 4*(degree-1) + 5*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[1](2 + j, i % dofs_1d) *
+ dofs_subcell[1](2 + j, i % dofs_1d) *
dofs_subcell[0](0, (i - (i % dofs_1d)) / dofs_1d);
// top edge
this->interface_constraints(5 + 4*(degree-1) + 6*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[0](2 + j, i % dofs_1d) *
+ dofs_subcell[0](2 + j, i % dofs_1d) *
dofs_subcell[1](1, (i - (i % dofs_1d)) / dofs_1d);
this->interface_constraints(5 + 4*(degree-1) + 7*(degree-1) + j,face_renumber[i]) =
- dofs_subcell[1](2 + j, i % dofs_1d) *
+ dofs_subcell[1](2 + j, i % dofs_1d) *
dofs_subcell[1](1, (i - (i % dofs_1d)) / dofs_1d);
}
{
// subcell 0
this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1),face_renumber[i]) =
- dofs_subcell[0](2 + j, i % dofs_1d) *
+ dofs_subcell[0](2 + j, i % dofs_1d) *
dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d);
// subcell 1
this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + (degree-1)*(degree-1),face_renumber[i]) =
- dofs_subcell[1](2 + j, i % dofs_1d) *
+ dofs_subcell[1](2 + j, i % dofs_1d) *
dofs_subcell[0](2 + k, (i - (i % dofs_1d)) / dofs_1d);
// subcell 2
this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + 2*(degree-1)*(degree-1),face_renumber[i]) =
- dofs_subcell[0](2 + j, i % dofs_1d) *
+ dofs_subcell[0](2 + j, i % dofs_1d) *
dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d);
// subcell 3
this->interface_constraints(5 + 12*(degree-1) + j + k*(degree-1) + 3*(degree-1)*(degree-1),face_renumber[i]) =
- dofs_subcell[1](2 + j, i % dofs_1d) *
+ dofs_subcell[1](2 + j, i % dofs_1d) *
dofs_subcell[1](2 + k, (i - (i % dofs_1d)) / dofs_1d);
}
}
break;
}
-
+
default:
Assert (false, ExcNotImplemented());
}
const unsigned int dofs_1d = 2*this->dofs_per_vertex + this->dofs_per_line;
const std::vector<unsigned int> &renumber=
this->poly_space.get_numbering();
-
+
for (unsigned int c=0; c<GeometryInfo<dim>::max_children_per_cell; ++c)
{
this->prolongation[iso][c].reinit (this->dofs_per_cell, this->dofs_per_cell);
// for higher dimensions, things
// are a little more tricky:
-
+
// j loops over dofs in the
// subcell. These are the rows in
// the embedding matrix.
// bottom/top line: 0/1
const unsigned int c1 = c/2;
- this->prolongation[iso][c](j,i) =
+ this->prolongation[iso][c](j,i) =
dofs_subcell[c0](renumber[j] % dofs_1d,
renumber[i] % dofs_1d) *
dofs_subcell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d,
(renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d);
- this->restriction[iso][c](j,i) =
+ this->restriction[iso][c](j,i) =
dofs_cell[c0](renumber[j] % dofs_1d,
renumber[i] % dofs_1d) *
dofs_cell[c1]((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d,
}
break;
}
-
+
case 3:
{
for (unsigned int c=0; c<GeometryInfo<3>::max_children_per_cell; ++c)
// bottom/top face: 0/1
const unsigned int c2 = c/4;
- this->prolongation[iso][c](j,i) =
+ this->prolongation[iso][c](j,i) =
dofs_subcell[c0](renumber[j] % dofs_1d,
renumber[i] % dofs_1d) *
dofs_subcell[c1](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d) % dofs_1d,
dofs_subcell[c2](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d - (((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d ) % dofs_1d)) / dofs_1d,
((renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d - (((renumber[i] - (renumber[i] % dofs_1d)) / dofs_1d ) % dofs_1d)) / dofs_1d);
- this->restriction[iso][c](j,i) =
+ this->restriction[iso][c](j,i) =
dofs_cell[c0](renumber[j] % dofs_1d,
renumber[i] % dofs_1d) *
dofs_cell[c1](((renumber[j] - (renumber[j] % dofs_1d)) / dofs_1d) % dofs_1d,
unsigned int n = this->degree+1;
for (unsigned int i=1; i<dim; ++i)
n *= this->degree+1;
-
+
this->unit_support_points.resize(n);
const std::vector<unsigned int> &index_map_inverse=
this->poly_space.get_numbering_inverse();
-
+
Point<dim> p;
// the method of numbering allows
// each dof to be associated with a
}
-#if deal_II_dimension == 1
template <>
void FE_Q_Hierarchical<1>::initialize_unit_face_support_points ()
ExcInterpolationNotImplemented ());
}
-#endif
-#if deal_II_dimension > 1
-
template <int dim>
void
FE_Q_Hierarchical<dim>::
typename FEL::
ExcInterpolationNotImplemented ());
interpolation_matrix = 0;
-
+
switch (dim) {
case 2: {
for (unsigned int i = 0; i < this->dofs_per_face; ++i)
interpolation_matrix (i, i) = 1;
-
+
break;
}
-
+
case 3: {
for (unsigned int i = 0; i < GeometryInfo<3>::vertices_per_face; ++i)
interpolation_matrix (i, i) = 1;
-
+
for (unsigned int i = 0; i < this->degree - 1; ++i) {
for (unsigned int j = 0; j < GeometryInfo<3>::lines_per_face; ++j)
interpolation_matrix (
i + j * (x_source_fe.degree - 1) + GeometryInfo<3>::vertices_per_face,
i + j * (this->degree - 1) + GeometryInfo<3>::vertices_per_face) = 1;
-
+
for (unsigned int j = 0; j < this->degree - 1; ++j)
interpolation_matrix (
(i + GeometryInfo<3>::lines_per_face) * (x_source_fe.degree - 1) + j
Assert (this->dofs_per_face <= source_fe.dofs_per_face,
typename FEL::
ExcInterpolationNotImplemented ());
-
+
switch (dim)
{
case 2:
interpolation_matrix (0, 0) = 1.0;
interpolation_matrix (1, 0) = 0.5;
interpolation_matrix (1, 1) = 0.5;
-
+
for (unsigned int dof = 2; dof < this->dofs_per_face;)
{
interpolation_matrix (1, dof) = -1.0;
dof = dof + 2;
}
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
-
+
for (int i = 2; i < (int) this->dofs_per_face; ++i)
{
interpolation_matrix (i, i) = std::pow (0.5, i);
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j < (int) this->dofs_per_face; ++j)
{
factorial_ij *= j - i;
factorial_j *= j;
-
+
if ((i + j) & 1)
interpolation_matrix (i, j)
= -1.0 * std::pow (0.5, j) *
factorial_j / (factorial_i * factorial_ij);
-
+
else
interpolation_matrix (i, j)
= std::pow (0.5, j) *
factorial_j / (factorial_i * factorial_ij);
}
}
-
+
break;
}
-
+
case 1:
{
interpolation_matrix (0, 0) = 0.5;
interpolation_matrix (0, 1) = 0.5;
-
+
for (unsigned int dof = 2; dof < this->dofs_per_face;)
{
interpolation_matrix (0, dof) = -1.0;
dof = dof + 2;
}
-
+
interpolation_matrix (1, 1) = 1.0;
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
-
+
for (int i = 2; i < (int) this->dofs_per_face; ++i)
{
interpolation_matrix (i, i) = std::pow (0.5, i);
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j < (int) this->dofs_per_face; ++j)
{
factorial_ij *= j - i;
}
}
}
-
+
break;
}
-
+
case 3:
{
switch (subface)
interpolation_matrix (1, 1) = 0.5;
interpolation_matrix (2, 0) = 0.5;
interpolation_matrix (2, 2) = 0.5;
-
+
for (unsigned int i = 0; i < this->degree - 1;)
{
for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
interpolation_matrix (3, i + line * (this->degree - 1) + 4) = -0.5;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (3, i + (j + 4) * this->degree - j) = 1.0;
j = j + 2;
}
-
+
interpolation_matrix (1, i + 2 * (this->degree + 1)) = -1.0;
interpolation_matrix (2, i + 4) = -1.0;
i = i + 2;
}
-
+
for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
interpolation_matrix (3, vertex) = 0.25;
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
int factorial_k;
int factorial_kl;
int factorial_l;
-
+
for (int i = 2; i <= (int) this->degree; ++i)
{
double tmp = std::pow (0.5, i);
interpolation_matrix (i + 3 * source_fe.degree - 1, i + 2 * this->degree) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (i + source_fe.degree + 1, (i + 2) * this->degree + j + 2 - i) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, i + (j + 4) * this->degree - j - 2) = tmp;
j = j + 2;
}
-
+
factorial_k = 1;
-
+
for (int j = 2; j <= (int) this->degree; ++j)
{
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
factorial_k *= j;
factorial_kl = 1;
factorial_l = factorial_k;
-
+
for (int k = j + 1; k < (int) this->degree; ++k)
{
factorial_kl *= k - j;
factorial_l *= k;
-
+
if ((j + k) & 1)
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = -1.0 * std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
-
+
else
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j <= (int) this->degree; ++j)
{
factorial_ij *= j - i;
factorial_j *= j;
-
+
if ((i + j) & 1)
{
tmp = -1.0 * std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
interpolation_matrix (i + 2, j + 2) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
factorial_k = 1;
-
+
for (int k = 2; k <= (int) this->degree; ++k)
{
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
factorial_k *= k;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int l = k + 1; l <= (int) this->degree; ++l) {
factorial_kl *= l - k;
factorial_l *= l;
-
+
if ((k + l) & 1)
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-
+
else
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
tmp *= 0.5;
interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + source_fe.degree + 1, (j + 2) * this->degree + k + 2 - j) = tmp;
interpolation_matrix (i + 2, j + 2) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
factorial_k = 1;
-
+
for (int k = 2; k <= (int) this->degree; ++k)
{
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
factorial_k *= k;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int l = k + 1; l <= (int) this->degree; ++l)
{
factorial_kl *= l - k;
factorial_l *= l;
-
+
if ((k + l) & 1)
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-
+
else
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
tmp *= 0.5;
interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + source_fe.degree + 1, (j + 2) * this->degree + k + 2 - j) = tmp;
}
}
}
-
+
break;
}
-
+
case 1:
{
interpolation_matrix (0, 0) = 0.5;
interpolation_matrix (1, 1) = 1.0;
interpolation_matrix (3, 1) = 0.5;
interpolation_matrix (3, 3) = 0.5;
-
+
for (unsigned int i = 0; i < this->degree - 1;)
{
for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
interpolation_matrix (2, i + line * (this->degree - 1) + 4) = -0.5;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (2, i + (j + 4) * this->degree - j) = 1.0;
j = j + 2;
}
-
+
interpolation_matrix (0, i + 2 * (this->degree + 1)) = -1.0;
interpolation_matrix (3, i + this->degree + 3) = -1.0;
i = i + 2;
}
-
+
for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
interpolation_matrix (2, vertex) = 0.25;
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
int factorial_k;
int factorial_kl;
int factorial_l;
-
+
for (int i = 2; i <= (int) this->degree; ++i)
{
double tmp = std::pow (0.5, i + 1);
interpolation_matrix (i + 3 * source_fe.degree - 1, i + 2 * this->degree) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (i + 2, j + (i + 2) * this->degree + 2 - i) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, i + (j + 4) * this->degree - j - 2) = tmp;
j = j + 2;
}
-
+
tmp *= - 1.0;
interpolation_matrix (i + source_fe.degree + 1, i + this->degree + 1) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j <= (int) this->degree; ++j)
{
factorial_ij *= j - i;
tmp = std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
factorial_k = 1;
-
+
for (int k = 2; k <= (int) this->degree; ++k)
{
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
factorial_k *= k;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int l = k + 1; l <= (int) this->degree; ++l)
{
factorial_kl *= l - k;
factorial_l *= l;
-
+
if ((k + l) & 1)
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = -1.0 * tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
-
+
else
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
tmp *= -1.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + 3 * source_fe.degree - 1, j + (k + 4) * this->degree - k - 2) = tmp;
k = k + 2;
}
-
+
tmp *= -0.5;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 2 * this->degree) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
-
+
if ((i + j) & 1)
tmp *= -1.0;
-
+
interpolation_matrix (i + 2, j + 2) = tmp;
interpolation_matrix (i + 2, j + this->degree + 1) = tmp;
interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = 2.0 * tmp;
tmp *= -2.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + 2, k + (j + 2) * this->degree + 2 - j) = tmp;
k = k + 2;
}
}
-
+
factorial_k = 1;
-
+
for (int j = 2; j <= (int) this->degree; ++j)
{
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
factorial_k *= j;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int k = j + 1; k <= (int) this->degree; ++k)
{
factorial_kl *= k - j;
factorial_l *= k;
-
+
if ((j + k) & 1)
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = -1.0 * std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
-
+
else
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
}
}
}
-
+
break;
}
-
+
case 2:
{
interpolation_matrix (0, 0) = 0.5;
interpolation_matrix (2, 2) = 1.0;
interpolation_matrix (3, 2) = 0.5;
interpolation_matrix (3, 3) = 0.5;
-
+
for (unsigned int i = 0; i < this->degree - 1;)
{
for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
interpolation_matrix (1, i + line * (this->degree - 1) + 4) = -0.5;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (1, i + (j + 4) * this->degree - j) = 1.0;
j = j + 2;
}
-
+
interpolation_matrix (0, i + 4) = -1.0;
interpolation_matrix (3, i + 3 * this->degree + 1) = -1.0;
i = i + 2;
}
-
+
for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
interpolation_matrix (1, vertex) = 0.25;
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
int factorial_k;
int factorial_kl;
int factorial_l;
-
+
for (int i = 2; i <= (int) this->degree; ++i)
{
double tmp = std::pow (0.5, i);
interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, i + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (i + source_fe.degree + 1, j + (i + 2) * this->degree + 2 - i) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, i + (j + 4) * this->degree - j - 2) = tmp;
j = j + 2;
}
-
+
factorial_k = 1;
-
+
for (int j = 2; j <= (int) this->degree; ++j)
{
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
factorial_k *= j;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int k = j + 1; k <= (int) this->degree; ++k)
{
factorial_kl *= k - j;
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j <= (int) this->degree; ++j)
{
factorial_ij *= j - i;
tmp = std::pow (0.5, j) * factorial_j / (factorial_i * factorial_ij);
interpolation_matrix (i + 2, j + 2) = tmp;
tmp *= -1.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + source_fe.degree + 1, k + (j + 2) * this->degree + 2 - j) = tmp;
k = k + 2;
}
-
+
tmp *= -0.5;
interpolation_matrix (i + source_fe.degree + 1, j + 2) = tmp;
interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
-
+
if ((i + j) & 1)
tmp *= -1.0;
-
+
interpolation_matrix (i + 2 * source_fe.degree, j + 2 * this->degree) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, j + 3 * this->degree - 1) = tmp;
tmp *= 2.0;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
factorial_k = 1;
-
+
for (int k = 2; k <= (int) this->degree; ++k)
{
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
factorial_k *= k;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int l = k + 1; l <= (int) this->degree; ++l)
{
factorial_kl *= l - k;
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
tmp *= -1.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + 2 * source_fe.degree, j + (k + 4) * this->degree - k - 2) = tmp;
}
}
}
-
+
break;
}
-
+
case 3:
{
for (unsigned int vertex = 0; vertex < GeometryInfo<3>::vertices_per_face; ++vertex)
interpolation_matrix (0, vertex) = 0.25;
-
+
for (unsigned int i = 0; i < this->degree - 1;)
{
for (unsigned int line = 0; line < GeometryInfo<3>::lines_per_face; ++line)
interpolation_matrix (0, i + line * (this->degree - 1) + 4) = -0.5;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (0, i + (j + 4) * this->degree - j) = 1.0;
j = j + 2;
}
-
+
interpolation_matrix (1, i + 4) = -1.0;
interpolation_matrix (2, i + 3 * this->degree + 1) = -1.0;
i = i + 2;
}
-
+
interpolation_matrix (1, 0) = 0.5;
interpolation_matrix (1, 1) = 0.5;
interpolation_matrix (2, 2) = 0.5;
interpolation_matrix (2, 3) = 0.5;
interpolation_matrix (3, 3) = 1.0;
-
+
int factorial_i = 1;
int factorial_ij;
int factorial_j;
int factorial_k;
int factorial_kl;
int factorial_l;
-
+
for (int i = 2; i <= (int) this->degree; ++i)
{
double tmp = std::pow (0.5, i + 1);
interpolation_matrix (i + 2 * source_fe.degree, i + 2 * this->degree) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, i + 3 * this->degree - 1) = tmp;
tmp *= -2.0;
-
+
for (unsigned int j = 0; j < this->degree - 1;)
{
interpolation_matrix (i + 2, j + (i + 2) * this->degree + 2 - i) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, i + (j + 4) * this->degree - 2) = tmp;
j = j + 2;
}
-
+
tmp *= -1.0;
interpolation_matrix (i + source_fe.degree + 1, i + this->degree + 1) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, i + 3 * this->degree - 1) = tmp;
factorial_k = 1;
-
+
for (int j = 2; j <= (int) this->degree; ++j)
{
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (j + 2) * this->degree - j) = std::pow (0.5, i + j);
factorial_k *= j;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int k = j + 1; k <= (int) this->degree; ++k)
{
factorial_kl *= k - j;
interpolation_matrix (i + (j + 2) * source_fe.degree - j, i + (k + 2) * this->degree - k) = std::pow (0.5, i + k) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
factorial_i *= i;
factorial_j = factorial_i;
factorial_ij = 1;
-
+
for (int j = i + 1; j <= (int) this->degree; ++j)
{
factorial_ij *= j - i;
interpolation_matrix (i + source_fe.degree + 1, j + this->degree + 1) = tmp;
interpolation_matrix (i + 3 * source_fe.degree - 1, j + 3 * this->degree - 1) = tmp;
factorial_k = 1;
-
+
for (int k = 2; k <= (int) this->degree; ++k)
{
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (k + 2) * this->degree - k) = tmp * std::pow (0.5, k);
factorial_k *= k;
factorial_l = factorial_k;
factorial_kl = 1;
-
+
for (int l = k + 1; l <= (int) this->degree; ++l)
{
factorial_kl *= l - k;
interpolation_matrix (i + (k + 2) * source_fe.degree - k, j + (l + 2) * this->degree - l) = tmp * std::pow (0.5, l) * factorial_l / (factorial_k * factorial_kl);
}
}
-
+
tmp *= -1.0;
-
+
for (unsigned int k = 0; k < this->degree - 1;)
{
interpolation_matrix (i + 2, k + (j + 2) * this->degree + 2 - j) = tmp;
interpolation_matrix (i + 2 * source_fe.degree, j + (k + 4) * this->degree - 2) = tmp;
k = k + 2;
- }
+ }
}
}
}
}
}
-#endif
template <int dim>
void FE_Q_Hierarchical<dim>::initialize_unit_face_support_points ()
{
const unsigned int codim = dim-1;
-
+
// number of points: (degree+1)^codim
unsigned int n = this->degree+1;
for (unsigned int i=1; i<codim; ++i)
n *= this->degree+1;
-
+
this->unit_face_support_points.resize(n);
-
+
Point<codim> p;
-
+
unsigned int k=0;
for (unsigned int iz=0; iz <= ((codim>2) ? this->degree : 0) ; ++iz)
for (unsigned int iy=0; iy <= ((codim>1) ? this->degree : 0) ; ++iy)
h2l[next_index++] = (2+i)*n2+(2+j)*n+2+k;
Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
+
break;
- }
+ }
default:
Assert (false, ExcNotImplemented());
}
-#if (deal_II_dimension == 1)
template <>
std::vector<unsigned int>
((shape_index == 1) && (face_index == 1)));
}
-#endif
||
((dim==3) && (shape_index>=this->first_hex_index)))
return false;
-
+
// let's see whether this is a
// vertex
- if (shape_index < this->first_line_index)
+ if (shape_index < this->first_line_index)
{
// for Q elements, there is
// one dof per vertex, so
= (shape_index - this->first_line_index) / this->dofs_per_line;
Assert (line_index < GeometryInfo<dim>::lines_per_cell,
ExcInternalError());
-
+
for (unsigned int i=0; i<GeometryInfo<dim>::lines_per_face; ++i)
if (GeometryInfo<dim>::face_to_cell_lines(face_index,i) == line_index)
return true;
else if (shape_index < this->first_hex_index)
// dof is on a quad
{
- const unsigned int quad_index
+ const unsigned int quad_index
= (shape_index - this->first_quad_index) / this->dofs_per_quad;
Assert (static_cast<signed int>(quad_index) <
static_cast<signed int>(GeometryInfo<dim>::quads_per_cell),
ExcInternalError());
-
+
// in 2d, cell bubble are
// zero on all faces. but
// we have treated this
// case above already
Assert (dim != 2, ExcInternalError());
-
+
// in 3d,
// quad_index=face_index
if (dim == 3)
template <int dim>
-std::vector<unsigned int>
+std::vector<unsigned int>
FE_Q_Hierarchical<dim>::get_embedding_dofs (const unsigned int sub_degree) const
{
Assert ((sub_degree>0) && (sub_degree<=this->degree),
return embedding_dofs;
}
-
+
if (sub_degree==1)
{
std::vector<unsigned int> embedding_dofs (GeometryInfo<dim>::vertices_per_cell);
if ((dim==2) || (dim==3))
{
- std::vector<unsigned int> embedding_dofs ( (dim==2) ?
+ std::vector<unsigned int> embedding_dofs ( (dim==2) ?
(sub_degree+1) * (sub_degree+1) :
(sub_degree+1) * (sub_degree+1) * (sub_degree+1) );
- for (unsigned int i=0; i<( (dim==2) ?
+ for (unsigned int i=0; i<( (dim==2) ?
(sub_degree+1) * (sub_degree+1) :
(sub_degree+1) * (sub_degree+1) * (sub_degree+1) ); ++i)
{
if (i<GeometryInfo<dim>::vertices_per_cell)
embedding_dofs[i] = i;
// line
- else if (i<(GeometryInfo<dim>::vertices_per_cell +
+ else if (i<(GeometryInfo<dim>::vertices_per_cell +
GeometryInfo<dim>::lines_per_cell * (sub_degree-1)))
{
const unsigned int j = (i - GeometryInfo<dim>::vertices_per_cell) %
(sub_degree-1);
const unsigned int line = (i - GeometryInfo<dim>::vertices_per_cell - j) / (sub_degree-1);
- embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
+ embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
line * (this->degree-1) + j;
}
// quad
- else if (i<(GeometryInfo<dim>::vertices_per_cell +
- GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
+ else if (i<(GeometryInfo<dim>::vertices_per_cell +
+ GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1))
{
const unsigned int j = (i - GeometryInfo<dim>::vertices_per_cell -
GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) % (sub_degree-1);
const unsigned int k = ( (i - GeometryInfo<dim>::vertices_per_cell -
GeometryInfo<dim>::lines_per_cell * (sub_degree-1) - j) / (sub_degree-1) ) % (sub_degree-1);
- const unsigned int face = (i - GeometryInfo<dim>::vertices_per_cell -
+ const unsigned int face = (i - GeometryInfo<dim>::vertices_per_cell -
GeometryInfo<dim>::lines_per_cell * (sub_degree-1) - k * (sub_degree-1) - j) / ( (sub_degree-1) * (sub_degree-1) );
- embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
+ embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
GeometryInfo<dim>::lines_per_cell * (this->degree-1) +
face * (this->degree-1) * (this->degree-1) +
k * (this->degree-1) + j;
}
// hex
- else if (i<(GeometryInfo<dim>::vertices_per_cell +
- GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
+ else if (i<(GeometryInfo<dim>::vertices_per_cell +
+ GeometryInfo<dim>::lines_per_cell * (sub_degree-1)) +
GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1) +
GeometryInfo<dim>::hexes_per_cell * (sub_degree-1) * (sub_degree-1) * (sub_degree-1))
{
const unsigned int l = (i - GeometryInfo<dim>::vertices_per_cell -
GeometryInfo<dim>::lines_per_cell * (sub_degree-1) -
GeometryInfo<dim>::quads_per_cell * (sub_degree-1) * (sub_degree-1) - j - k * (sub_degree-1)) / ( (sub_degree-1) * (sub_degree-1) );
-
- embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
+
+ embedding_dofs[i] = GeometryInfo<dim>::vertices_per_cell +
GeometryInfo<dim>::lines_per_cell * (this->degree-1) +
GeometryInfo<dim>::quads_per_cell * (this->degree-1) * (this->degree-1) +
l * (this->degree-1) * (this->degree-1) + k * (this->degree-1) + j;
-template class FE_Q_Hierarchical<deal_II_dimension>;
+// explicit instantiations
+#include "fe_q_hierarchical.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)
+ {
+ template class FE_Q_Hierarchical<deal_II_dimension>;
+ }
+
{
Assert (dim >= 2, ExcImpossibleInDim(dim));
const unsigned int n_dofs = this->dofs_per_cell;
-
+
this->mapping_type = mapping_raviart_thomas;
// First, initialize the
// generalized support points and
//matrix, generating the correct
//basis functions from the raw
//ones.
-
+
// We use an auxiliary matrix in
// this function. Therefore,
// inverse_node_matrix is still
// From now on, the shape functions
// will be the correct ones, not
// the raw shape functions anymore.
-
+
// Reinit the vectors of
// restriction and prolongation
// matrices to the right sizes.
// polynomial degree and is thus one higher
// than the argument given to the
// constructor
- std::ostringstream namebuf;
+ std::ostringstream namebuf;
namebuf << "FE_RaviartThomas<" << dim << ">(" << this->degree-1 << ")";
return namebuf.str();
//---------------------------------------------------------------------------
-#if deal_II_dimension == 1
-
template <int dim>
void
FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
{
- return;
-
- Assert (false, ExcNotImplemented());
-
QGauss<dim> cell_quadrature(deg+1);
const unsigned int n_interior_points
= (deg>0) ? cell_quadrature.size() : 0;
-
- this->generalized_support_points.resize (2 + n_interior_points);
-
- // Number of the point being entered
- unsigned int current = 0;
-
-
- if (deg==0) return;
- interior_weights.reinit(TableIndices<3>(2+n_interior_points, 0, dim));
-
- for (unsigned int k=0;k<cell_quadrature.size();++k)
- this->generalized_support_points[current++] = cell_quadrature.point(k);
-
- Assert (current == this->generalized_support_points.size(),
- ExcInternalError());
-}
-
-#else
-
-// Version for 2d and higher. See above for 1d version
-template <int dim>
-void
-FE_RaviartThomas<dim>::initialize_support_points (const unsigned int deg)
-{
- QGauss<dim> cell_quadrature(deg+1);
- const unsigned int n_interior_points
- = (deg>0) ? cell_quadrature.size() : 0;
-
unsigned int n_face_points = (dim>1) ? 1 : 0;
// compute (deg+1)^(dim-1)
for (unsigned int d=1;d<dim;++d)
n_face_points *= deg+1;
-
+
this->generalized_support_points.resize (GeometryInfo<dim>::faces_per_cell*n_face_points
+ n_interior_points);
this->generalized_face_support_points.resize (n_face_points);
-
+
// Number of the point being entered
unsigned int current = 0;
= Polynomials::Legendre::generate_complete_basis(deg);
boundary_weights.reinit(n_face_points, legendre.n());
-
+
// Assert (face_points.size() == this->dofs_per_face,
// ExcInternalError());
-
+
for (unsigned int k=0;k<n_face_points;++k)
{
this->generalized_face_support_points[k] = face_points.point(k);
this->generalized_support_points[current] = faces.point(current+QProjector<dim>::DataSetDescriptor::face(0,true,false,false,n_face_points));
}
}
-
+
if (deg==0) return;
-
+
// Create Legendre basis for the
// space D_xi Q_k
std::vector<AnisotropicPolynomials<dim>* > polynomials(dim);
polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
}
-
+
interior_weights.reinit(TableIndices<3>(n_interior_points, polynomials[0]->n(), dim));
-
+
for (unsigned int k=0;k<cell_quadrature.size();++k)
{
this->generalized_support_points[current++] = cell_quadrature.point(k);
for (unsigned int d=0;d<dim;++d)
delete polynomials[d];
-
+
Assert (current == this->generalized_support_points.size(),
ExcInternalError());
}
-#endif
-
-#if deal_II_dimension == 1
template <>
void
this->restriction[0][i].reinit(0,0);
}
-#endif
+
// This function is the same Raviart-Thomas interpolation performed by
// interpolate. Still, we cannot use interpolate, since it was written
const unsigned int child
= GeometryInfo<dim>::child_cell_on_face(
RefinementCase<dim>::isotropic_refinement, face, sub);
-
+
// On a certain face, we must
// compute the moments of ALL
// fine level functions with
}
}
}
-
+
if (this->degree == 1) return;
-
+
// Create Legendre basis for the
// space D_xi Q_k. Here, we cannot
// use the shape functions
polynomials[dd] = new AnisotropicPolynomials<dim>(poly);
}
-
+
QGauss<dim> q_cell(this->degree);
const unsigned int start_cell_dofs
= GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
for (unsigned int d=0;d<dim;++d)
cached_values(i,k,d) = this->shape_value_component(i, q_cell.point(k), d);
-
+
for (unsigned int child=0;child<GeometryInfo<dim>::max_children_per_cell;++child)
{
Quadrature<dim> q_sub = QProjector<dim>::project_to_child(q_cell, child);
-
+
for (unsigned int k=0;k<q_sub.size();++k)
for (unsigned int i_child = 0; i_child < this->dofs_per_cell; ++i_child)
for (unsigned int d=0;d<dim;++d)
* polynomials[d]->compute_value(i_weight, q_sub.point(k));
}
}
-
+
for (unsigned int d=0;d<dim;++d)
delete polynomials[d];
}
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_RaviartThomas<1>::get_dpo_vector (const unsigned int deg)
-{
- std::vector<unsigned int> dpo(2);
- dpo[0] = 1;
- dpo[1] = deg;
- return dpo;
-}
-
-#endif
-
template <int dim>
std::vector<unsigned int>
// and then there are interior dofs
const unsigned int
interior_dofs = dim*deg*dofs_per_face;
-
+
std::vector<unsigned int> dpo(dim+1);
dpo[dim-1] = dofs_per_face;
dpo[dim] = interior_dofs;
-
+
return dpo;
}
// these in a table
return (face_index != GeometryInfo<dim>::opposite_face[shape_index]);
}
-
+
default:
return true;
};
};
-
+
default: // other rt_order
return true;
};
-
+
return true;
}
local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
* values[face*n_face_points+k](GeometryInfo<dim>::unit_normal_direction[face]+offset);
}
-
+
const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-
+
for (unsigned int k=0;k<interior_weights.size(0);++k)
for (unsigned int i=0;i<interior_weights.size(1);++i)
for (unsigned int d=0;d<dim;++d)
local_dofs[i+face*this->dofs_per_face] += boundary_weights(k,i)
* values[GeometryInfo<dim>::unit_normal_direction[face]][face*n_face_points+k];
}
-
+
const unsigned start_cell_dofs = GeometryInfo<dim>::faces_per_cell*this->dofs_per_face;
const unsigned start_cell_points = GeometryInfo<dim>::faces_per_cell*n_face_points;
-
+
for (unsigned int k=0;k<interior_weights.size(0);++k)
for (unsigned int i=0;i<interior_weights.size(1);++i)
for (unsigned int d=0;d<dim;++d)
}
-template class FE_RaviartThomas<deal_II_dimension>;
+
+// explicit instantiations
+#include "fe_raviart_thomas.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)
+ {
+ template class FE_RaviartThomas<deal_II_dimension>;
+ }
+
{
Assert (dim >= 2, ExcImpossibleInDim(dim));
const unsigned int n_dofs = this->dofs_per_cell;
-
+
this->mapping_type = mapping_raviart_thomas;
// First, initialize the
// generalized support points and
//matrix, generating the correct
//basis functions from the raw
//ones.
-
+
// We use an auxiliary matrix in
// this function. Therefore,
// inverse_node_matrix is still
// From now on, the shape functions
// will be the correct ones, not
// the raw shape functions anymore.
-
+
// Reinit the vectors of
// prolongation matrices to the
// right sizes. There are no
// polynomial degree and is thus one higher
// than the argument given to the
// constructor
- std::ostringstream namebuf;
+ std::ostringstream namebuf;
namebuf << "FE_RaviartThomasNodal<" << dim << ">(" << this->degree-1 << ")";
return namebuf.str();
current = this->dofs_per_face*GeometryInfo<dim>::faces_per_cell;
}
-
+
if (deg==0) return;
// In the interior, we need
// anisotropic Gauss quadratures,
((d==1) ? low : high),
((d==2) ? low : high));
Assert(dim<=3, ExcNotImplemented());
-
+
for (unsigned int k=0;k<quadrature->size();++k)
this->generalized_support_points[current++] = quadrature->point(k);
delete quadrature;
}
-#if deal_II_dimension == 1
-
-template <>
-std::vector<unsigned int>
-FE_RaviartThomasNodal<1>::get_dpo_vector (const unsigned int deg)
-{
- std::vector<unsigned int> dpo(2);
- dpo[0] = 1;
- dpo[1] = deg;
- return dpo;
-}
-
-#endif
-
template <int dim>
std::vector<unsigned int>
// and then there are interior dofs
const unsigned int
interior_dofs = dim*deg*dofs_per_face;
-
+
std::vector<unsigned int> dpo(dim+1);
dpo[dim-1] = dofs_per_face;
dpo[dim] = interior_dofs;
-
+
return dpo;
}
-#if deal_II_dimension == 1
-
template <>
std::vector<bool>
FE_RaviartThomasNodal<1>::get_ria_vector (const unsigned int)
return std::vector<bool>();
}
-#endif
template <int dim>
// on the faces and each face has
// degree degrees.
const unsigned int support_face = shape_index / this->degree;
-
+
// The only thing we know for sure
// is that shape functions with
// support on one face are zero on
// the opposite face.
if (support_face < GeometryInfo<dim>::faces_per_cell)
return (face_index != GeometryInfo<dim>::opposite_face[support_face]);
-
+
// In all other cases, return true,
// which is safe
return true;
else
{
Assert(false, ExcNotImplemented());
- return std::vector<std::pair<unsigned int, unsigned int> > ();
+ return std::vector<std::pair<unsigned int, unsigned int> > ();
}
}
// only lines in 2d
if (dim != 2)
return std::vector<std::pair<unsigned int, unsigned int> >();
-
+
// dofs are located along lines, so two
// dofs are identical only if in the
// following two cases (remember that
// the constructor
const unsigned int p = this->degree-1;
const unsigned int q = fe_q_other->degree-1;
-
+
std::vector<std::pair<unsigned int, unsigned int> > identities;
if (p==q)
else
if (p%2==0 && q%2==0)
identities.push_back(std::make_pair(p/2,q/2));
-
+
return identities;
}
else
// case above
const unsigned int p = this->dofs_per_quad;
const unsigned int q = fe_q_other->dofs_per_quad;
-
+
std::vector<std::pair<unsigned int, unsigned int> > identities;
if (p==q)
else
return FiniteElementDomination::other_element_dominates;
}
-
+
Assert (false, ExcNotImplemented());
return FiniteElementDomination::neither_element_dominates;
}
-#if deal_II_dimension == 1
template <>
void
Assert (false, ExcImpossibleInDim(1));
}
-#endif
-#if deal_II_dimension > 1
-
template <int dim>
void
FE_RaviartThomasNodal<dim>::get_face_interpolation_matrix (
(dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.n() == this->dofs_per_face,
ExcDimensionMismatch (interpolation_matrix.n(),
this->dofs_per_face));
Assert (this->dofs_per_face <= source_fe.dofs_per_face,
typename FiniteElement<dim>::
ExcInterpolationNotImplemented ());
-
+
// generate a quadrature
// with the generalized support points.
// This is later based as a
// which returns the support
// points on the face.
Quadrature<dim-1> quad_face_support (source_fe.get_generalized_face_support_points ());
-
+
// Rule of thumb for FP accuracy,
// that can be expected for a
// given polynomial degree.
// This value is used to cut
// off values close to zero.
double eps = 2e-13*this->degree*(dim-1);
-
+
// compute the interpolation
// matrix by simply taking the
// value at the support points.
const Quadrature<dim> face_projection
= QProjector<dim>::project_to_face (quad_face_support, 0);
-
+
for (unsigned int i=0; i<source_fe.dofs_per_face; ++i)
{
const Point<dim> &p = face_projection.point (i);
for (unsigned int j=0; j<this->dofs_per_face; ++j)
- {
+ {
double matrix_entry
= this->shape_value_component (this->face_to_cell_index(j, 0),
p, 0);
matrix_entry = 0.0;
interpolation_matrix(i,j) = matrix_entry;
- }
+ }
}
// make sure that the row sum of
(dynamic_cast<const FE_RaviartThomasNodal<dim>*>(&x_source_fe) != 0),
typename FiniteElement<dim>::
ExcInterpolationNotImplemented());
-
+
Assert (interpolation_matrix.n() == this->dofs_per_face,
ExcDimensionMismatch (interpolation_matrix.n(),
this->dofs_per_face));
Assert (this->dofs_per_face <= source_fe.dofs_per_face,
typename FiniteElement<dim>::
ExcInterpolationNotImplemented ());
-
+
// generate a quadrature
// with the generalized support points.
// This is later based as a
// which returns the support
// points on the face.
Quadrature<dim-1> quad_face_support (source_fe.get_generalized_face_support_points ());
-
+
// Rule of thumb for FP accuracy,
// that can be expected for a
// given polynomial degree.
// This value is used to cut
// off values close to zero.
double eps = 2e-13*this->degree*(dim-1);
-
+
// compute the interpolation
// matrix by simply taking the
// value at the support points.
const Point<dim> &p = subface_projection.point (i);
for (unsigned int j=0; j<this->dofs_per_face; ++j)
- {
+ {
double matrix_entry
= this->shape_value_component (this->face_to_cell_index(j, 0), p, 0);
matrix_entry = 0.0;
interpolation_matrix(i,j) = matrix_entry;
- }
+ }
}
// make sure that the row sum of
}
}
-#endif
+// explicit instantiations
+#include "fe_raviart_thomas_nodal.inst"
-template class FE_RaviartThomasNodal<deal_II_dimension>;
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 FE_RaviartThomasNodal<deal_II_dimension>;
+ }
+
}
-#if deal_II_dimension == 1
-
-template <>
-void
-FESystem<1>::
-initialize_unit_face_support_points ()
-{
- // no faces no work
-}
-
-
-template <>
-void
-FESystem<1,2>::
-initialize_unit_face_support_points ()
-{
- // no faces no work
-}
-
-#endif
-
template <int dim, int spacedim>
void
FESystem<dim,spacedim>::
initialize_unit_face_support_points ()
{
+ // Nothing to do in 1D
+ if (dim == 1)
+ return;
+
// if one of the base elements has
// no support points, then it makes
// no sense to define support
void
FESystem<dim,spacedim>::initialize_quad_dof_index_permutation ()
{
- // general template for 1D and 2D, do nothing
-}
-
-
+ // nothing to do in other dimensions than 3
+ if (dim < 3)
+ return;
-#if deal_II_dimension == 3
-
-template <>
-void
-FESystem<3>::initialize_quad_dof_index_permutation ()
-{
// the array into which we want to write
// should have the correct size already.
- Assert (adjust_quad_dof_index_for_face_orientation_table.n_elements()==8*this->dofs_per_quad,
- ExcInternalError());
+ Assert (this->adjust_quad_dof_index_for_face_orientation_table.n_elements()==
+ 8*this->dofs_per_quad, ExcInternalError());
+
// to obtain the shifts for this composed
// element, copy the shift information of
// the base elements
{
for (unsigned int i=0; i<temp.size(0); ++i)
for (unsigned int j=0; j<8; ++j)
- adjust_quad_dof_index_for_face_orientation_table(index+i,j)=temp(i,j);
+ this->adjust_quad_dof_index_for_face_orientation_table(index+i,j)=
+ temp(i,j);
index += temp.size(0);
}
}
// aditionally compose the permutation
// information for lines
- Assert (adjust_line_dof_index_for_line_orientation_table.size()==this->dofs_per_line,
- ExcInternalError());
+ Assert (this->adjust_line_dof_index_for_line_orientation_table.size()==
+ this->dofs_per_line, ExcInternalError());
index = 0;
for (unsigned int b=0; b<n_base_elements();++b)
{
for (unsigned int c=0; c<element_multiplicity(b); ++c)
{
std::copy(temp2.begin(), temp2.end(),
- adjust_line_dof_index_for_line_orientation_table.begin()+index);
+ this->adjust_line_dof_index_for_line_orientation_table.begin()
+ +index);
index += temp2.size();
}
}
ExcInternalError());
}
-#endif
-
template <int dim, int spacedim>
// explicit instantiations
-template class FESystem<deal_II_dimension>;
-#if deal_II_dimension != 3
-template class FESystem<deal_II_dimension, deal_II_dimension+1>;
-#endif
+#include "fe_system.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)
+ {
+ template class FESystem<deal_II_dimension>;
+#if deal_II_dimension != 3
+ template class FESystem<deal_II_dimension, deal_II_dimension+1>;
+#endif
+ }
+
+++ /dev/null
-//---------------------------------------------------------------------------
-// $Id$
-// Version: $Name$
-//
-// Copyright (C) 2005, 2006, 2008, 2010 by the deal.II authors
-//
-// This file is subject to QPL and may not be distributed
-// without copyright and license information. Please refer
-// to the file deal.II/doc/license.html for the text and
-// further information on this license.
-//
-//---------------------------------------------------------------------------
-
-
-#include <base/utilities.h>
-#include <fe/fe.h>
-#include <fe/fe_tools.h>
-
-DEAL_II_NAMESPACE_OPEN
-
-namespace FETools
-{
-
- template <int dim>
- void
- hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe,
- std::vector<unsigned int> &h2l)
- {
- Assert (h2l.size() == fe.dofs_per_cell,
- ExcDimensionMismatch (h2l.size(), fe.dofs_per_cell));
- h2l = hierarchic_to_lexicographic_numbering (fe);
- }
-
-
-
- template <int dim>
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe)
- {
- Assert (fe.n_components() == 1, ExcInvalidFE());
-
- std::vector<unsigned int> h2l (fe.dofs_per_cell);
-
- const unsigned int dofs_per_cell = fe.dofs_per_cell;
- // polynomial degree
- const unsigned int degree = fe.dofs_per_line+1;
- // number of grid points in each
- // direction
- const unsigned int n = degree+1;
-
- // the following lines of code are
- // somewhat odd, due to the way the
- // hierarchic numbering is
- // organized. if someone would
- // really want to understand these
- // lines, you better draw some
- // pictures where you indicate the
- // indices and orders of vertices,
- // lines, etc, along with the
- // numbers of the degrees of
- // freedom in hierarchical and
- // lexicographical order
- switch (dim)
- {
- case 1:
- {
- h2l[0] = 0;
- h2l[1] = dofs_per_cell-1;
- for (unsigned int i=2; i<dofs_per_cell; ++i)
- h2l[i] = i-1;
-
- break;
- }
-
- case 2:
- {
- unsigned int next_index = 0;
- // first the four vertices
- h2l[next_index++] = 0;
- h2l[next_index++] = n-1;
- h2l[next_index++] = n*(n-1);
- h2l[next_index++] = n*n-1;
-
- // left line
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (1+i)*n;
-
- // right line
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (2+i)*n-1;
-
- // bottom line
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = 1+i;
-
- // top line
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n*(n-1)+i+1;
-
- // inside quad
- Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
- ExcInternalError());
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = n*(i+1)+j+1;
-
- Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
- break;
- }
-
- case 3:
- {
- unsigned int next_index = 0;
- // first the eight vertices
- h2l[next_index++] = 0; // 0
- h2l[next_index++] = ( 1)*degree; // 1
- h2l[next_index++] = ( n )*degree; // 2
- h2l[next_index++] = ( n+1)*degree; // 3
- h2l[next_index++] = (n*n )*degree; // 4
- h2l[next_index++] = (n*n +1)*degree; // 5
- h2l[next_index++] = (n*n+n )*degree; // 6
- h2l[next_index++] = (n*n+n+1)*degree; // 7
-
- // line 0
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (i+1)*n;
- // line 1
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n-1+(i+1)*n;
- // line 2
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = 1+i;
- // line 3
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = 1+i+n*(n-1);
-
- // line 4
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (n-1)*n*n+(i+1)*n;
- // line 5
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
- // line 6
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n*n*(n-1)+i+1;
- // line 7
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
-
- // line 8
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (i+1)*n*n;
- // line 9
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n-1+(i+1)*n*n;
- // line 10
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = (i+1)*n*n+n*(n-1);
- // line 11
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
-
-
- // inside quads
- Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
- ExcInternalError());
- // face 0
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = (i+1)*n*n+n*(j+1);
- // face 1
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
- // face 2, note the orientation!
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = (j+1)*n*n+i+1;
- // face 3, note the orientation!
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
- // face 4
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = n*(i+1)+j+1;
- // face 5
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
-
- // inside hex
- Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
- ExcInternalError());
- for (unsigned int i=0; i<fe.dofs_per_line; ++i)
- for (unsigned int j=0; j<fe.dofs_per_line; ++j)
- for (unsigned int k=0; k<fe.dofs_per_line; ++k)
- h2l[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
-
- Assert (next_index == fe.dofs_per_cell, ExcInternalError());
-
- break;
- }
-
- default:
- Assert (false, ExcNotImplemented());
- }
-
- return h2l;
- }
-
-
-
- template <int dim>
- void
- lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe,
- std::vector<unsigned int> &l2h)
- {
- l2h = lexicographic_to_hierarchic_numbering (fe);
- }
-
-
-
- template <int dim>
- std::vector<unsigned int>
- lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe)
- {
- return Utilities::invert_permutation(hierarchic_to_lexicographic_numbering (fe));
- }
-
-}
-
-
-// explicit instantiations
-namespace FETools
-{
- template
- void
- hierarchic_to_lexicographic_numbering<1>
- (const FiniteElementData<1> &fe,
- std::vector<unsigned int> &h2l);
- template
- void
- hierarchic_to_lexicographic_numbering<2>
- (const FiniteElementData<2> &fe,
- std::vector<unsigned int> &h2l);
- template
- void
- hierarchic_to_lexicographic_numbering<3>
- (const FiniteElementData<3> &fe,
- std::vector<unsigned int> &h2l);
-
-
- template
- void
- lexicographic_to_hierarchic_numbering<1>
- (const FiniteElementData<1> &fe,
- std::vector<unsigned int> &l2h);
- template
- void
- lexicographic_to_hierarchic_numbering<2>
- (const FiniteElementData<2> &fe,
- std::vector<unsigned int> &l2h);
- template
- void
- lexicographic_to_hierarchic_numbering<3>
- (const FiniteElementData<3> &fe,
- std::vector<unsigned int> &l2h);
-
-
-
- template
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering<1>
- (const FiniteElementData<1> &fe);
- template
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering<2>
- (const FiniteElementData<2> &fe);
- template
- std::vector<unsigned int>
- hierarchic_to_lexicographic_numbering<3>
- (const FiniteElementData<3> &fe);
-
-
- template
- std::vector<unsigned int>
- lexicographic_to_hierarchic_numbering<1>
- (const FiniteElementData<1> &fe);
- template
- std::vector<unsigned int>
- lexicographic_to_hierarchic_numbering<2>
- (const FiniteElementData<2> &fe);
- template
- std::vector<unsigned int>
- lexicographic_to_hierarchic_numbering<3>
- (const FiniteElementData<3> &fe);
-}
-
-
-DEAL_II_NAMESPACE_CLOSE
namespace
{
- // a shared pointer to factory
+ // use a shared pointer to factory
// objects, to ensure that they get
// deleted at the end of the
// program run and don't end up as
// apparent memory leaks to
- // programs like valgrind
- typedef
- std_cxx1x::shared_ptr<const FETools::FEFactoryBase<deal_II_dimension> >
- FEFactoryPointer;
-
+ // programs like valgrind.
// a function that returns the
// default set of finite element
// names and factory objects for
// them. used to initialize
// fe_name_map below
+ template <int dim>
#ifdef DEAL_II_ANON_NAMESPACE_BUG
static
#endif
- std::map<std::string,FEFactoryPointer>
+ std::map<std::string,std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > >
get_default_fe_names ()
{
- std::map<std::string,FEFactoryPointer> default_map;
+ std::map<std::string,
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > > default_map;
+
+ typedef std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> >
+ FEFactoryPointer;
default_map["FE_Q_Hierarchical"]
- = FEFactoryPointer(new FETools::FEFactory<FE_Q_Hierarchical<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_Q_Hierarchical<dim> >);
default_map["FE_ABF"]
- = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<dim> >);
default_map["FE_RaviartThomas"]
- = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomas<dim> >);
default_map["FE_RaviartThomasNodal"]
- = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomasNodal<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_RaviartThomasNodal<dim> >);
default_map["FE_Nedelec"]
- = FEFactoryPointer(new FETools::FEFactory<FE_Nedelec<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_Nedelec<dim> >);
default_map["FE_DGPNonparametric"]
- = FEFactoryPointer(new FETools::FEFactory<FE_DGPNonparametric<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_DGPNonparametric<dim> >);
default_map["FE_DGP"]
- = FEFactoryPointer(new FETools::FEFactory<FE_DGP<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_DGP<dim> >);
default_map["FE_DGPMonomial"]
- = FEFactoryPointer(new FETools::FEFactory<FE_DGPMonomial<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_DGPMonomial<dim> >);
default_map["FE_DGQ"]
- = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<dim> >);
default_map["FE_DGQArbitraryNodes"]
- = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_DGQ<dim> >);
default_map["FE_Q"]
- = FEFactoryPointer(new FETools::FEFactory<FE_Q<deal_II_dimension> >);
+ = FEFactoryPointer(new FETools::FEFactory<FE_Q<dim> >);
return default_map;
}
// static so that we can link
// several dimensions together.
//
- // it is initialized at program
- // start time using the function
- // above. because at this time
- // there are no threads running,
- // there are no thread-safety
- // issues here
+ // it is initialized at program start time
+ // using the function above. because at
+ // this time there are no threads running,
+ // there are no thread-safety issues
+ // here. since this is compiled for all
+ // dimensions at once, need to create
+ // objects for each dimension and then
+ // separate between them further down
+ static
+ std::map<std::string,
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<1> > >
+ fe_name_map_1d
+ = get_default_fe_names<1> ();
static
std::map<std::string,
- std_cxx1x::shared_ptr<const FETools::FEFactoryBase<deal_II_dimension> > >
- fe_name_map
- = get_default_fe_names ();
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<2> > >
+ fe_name_map_2d
+ = get_default_fe_names<2> ();
+ static
+ std::map<std::string,
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<3> > >
+ fe_name_map_3d
+ = get_default_fe_names<3> ();
}
}
}
-#if deal_II_dimension == 1
+
+
template<>
void
compute_embedding_matrices(const FiniteElement<1,2> &,
Assert(false, ExcNotImplemented());
}
-#elif deal_II_dimension == 2
+
+
template<>
void
compute_embedding_matrices(const FiniteElement<2,3>&,
Assert(false, ExcNotImplemented());
}
-#endif
namespace {
}
-// This function is tested by tests/fe/internals, since it produces the matrices printed there
+// This function is tested by tests/fe/internals, since it produces the matrices printed there
template <int dim, typename number, int spacedim>
void
compute_face_embedding_matrices(const FiniteElement<dim,spacedim>& fe,
{
Assert(face_coarse==0, ExcNotImplemented());
Assert(face_fine==0, ExcNotImplemented());
-
+
const unsigned int nc = GeometryInfo<dim>::max_children_per_face;
const unsigned int n = fe.dofs_per_face;
const unsigned int nd = fe.n_components();
const unsigned int degree = fe.degree;
-
+
const bool normal = fe.conforms(FiniteElementData<dim>::Hdiv);
const bool tangential = fe.conforms(FiniteElementData<dim>::Hcurl);
-
+
for (unsigned int i=0;i<nc;++i)
{
Assert(matrices[i].n() == n, ExcDimensionMismatch(matrices[i].n(),n));
Assert(matrices[i].m() == n, ExcDimensionMismatch(matrices[i].m(),n));
}
-
+
// In order to make the loops below
// simpler, we introduce vectors
// containing for indices 0-n the
for (unsigned int d=1;d<dim;++d)
A(k*nd+d,j) = fine.shape_value_component(face_f_dofs[j],k,d);
}
-
+
Householder<double> H(A);
-
+
Vector<number> v_coarse(nq*nd);
Vector<number> v_fine(n);
}
}
-#if deal_II_dimension == 1
+
+
template <>
void
compute_projection_matrices(const FiniteElement<1,2>&,
Assert(false, ExcNotImplemented());
}
-#elif deal_II_dimension == 2
+
+
template <>
void
compute_projection_matrices(const FiniteElement<2,3>&,
Assert(false, ExcNotImplemented());
}
-#endif
template <int dim, typename number, int spacedim>
}
- template <int dim, int spacedim>
+ template <>
+ void
+ add_fe_name(const std::string& parameter_name,
+ const FEFactoryBase<1,1>* factory)
+ {
+ // Erase everything after the
+ // actual class name
+ std::string name = parameter_name;
+ unsigned int name_end =
+ name.find_first_not_of(std::string("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
+ if (name_end < name.size())
+ name.erase(name_end);
+ // first make sure that no other
+ // thread intercepts the
+ // operation of this function;
+ // for this, acquire the lock
+ // until we quit this function
+ Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+
+ Assert(fe_name_map_1d.find(name) == fe_name_map_1d.end(),
+ ExcMessage("Cannot change existing element in finite element name list"));
+
+ // Insert the normalized name into
+ // the map
+ fe_name_map_1d[name] =
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<1> > (factory);
+ }
+
+
+
+ template <>
+ void
+ add_fe_name(const std::string& parameter_name,
+ const FEFactoryBase<2,2>* factory)
+ {
+ // Erase everything after the
+ // actual class name
+ std::string name = parameter_name;
+ unsigned int name_end =
+ name.find_first_not_of(std::string("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"));
+ if (name_end < name.size())
+ name.erase(name_end);
+ // first make sure that no other
+ // thread intercepts the
+ // operation of this function;
+ // for this, acquire the lock
+ // until we quit this function
+ Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
+
+ Assert(fe_name_map_2d.find(name) == fe_name_map_2d.end(),
+ ExcMessage("Cannot change existing element in finite element name list"));
+
+ // Insert the normalized name into
+ // the map
+ fe_name_map_2d[name] =
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<2> > (factory);
+ }
+
+
+ template <>
void
add_fe_name(const std::string& parameter_name,
- const FEFactoryBase<dim,spacedim>* factory)
+ const FEFactoryBase<3,3>* factory)
{
// Erase everything after the
// actual class name
// until we quit this function
Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock);
- Assert(fe_name_map.find(name) == fe_name_map.end(),
+ Assert(fe_name_map_3d.find(name) == fe_name_map_3d.end(),
ExcMessage("Cannot change existing element in finite element name list"));
// Insert the normalized name into
// the map
- fe_name_map[name] = FEFactoryPointer(factory);
+ fe_name_map_3d[name] =
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<3> > (factory);
}
{
namespace
{
+ // TODO: this encapsulates the call to the
+ // dimension-dependent fe_name_map so that we
+ // have a unique interface. could be done
+ // smarter?
template <int dim, int spacedim>
FiniteElement<dim,spacedim>*
- get_fe_from_name (std::string &name)
+ get_fe_from_name_ext (std::string &name,
+ const std::map<std::string,
+ std_cxx1x::shared_ptr<const FETools::FEFactoryBase<dim> > >
+ &fe_name_map)
{
// Extract the name of the
// finite element class, which only
// Now, the name of the
// first base element is
// first... Let's get it
- base_fes.push_back (get_fe_from_name<dim,spacedim> (name));
+ base_fes.push_back (get_fe_from_name_ext<dim,spacedim> (name,
+ fe_name_map));
// next check whether
// FESystem placed a
// multiplicity after
// here after throwing
return 0;
}
+
+
+
+ // need to work around problem with different
+ // name map names for different dimensions
+ // TODO: should be possible to do nicer!
+ template <int dim,int spacedim>
+ FiniteElement<dim,spacedim>* get_fe_from_name (std::string &name);
+
+ template <>
+ FiniteElement<1,1>*
+ get_fe_from_name<1> (std::string &name)
+ {
+ return get_fe_from_name_ext<1,1> (name, fe_name_map_1d);
+ }
+
+ template <>
+ FiniteElement<2,2>*
+ get_fe_from_name<2> (std::string &name)
+ {
+ return get_fe_from_name_ext<2,2> (name, fe_name_map_2d);
+ }
+
+ template <>
+ FiniteElement<3,3>*
+ get_fe_from_name<3> (std::string &name)
+ {
+ return get_fe_from_name_ext<3,3> (name, fe_name_map_3d);
+ }
}
}
Assert (X.n() == rhs_quadrature.size(), ExcInternalError());
}
-}
+ template <int dim>
+ void
+ hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe,
+ std::vector<unsigned int> &h2l)
+ {
+ Assert (h2l.size() == fe.dofs_per_cell,
+ ExcDimensionMismatch (h2l.size(), fe.dofs_per_cell));
+ h2l = hierarchic_to_lexicographic_numbering (fe);
+ }
-/*-------------- Explicit Instantiations -------------------------------*/
-
-namespace FETools
-{
- template class FEFactoryBase<deal_II_dimension>;
-
- template
- void compute_node_matrix(
- FullMatrix<double>&,
- const FiniteElement<deal_II_dimension>&);
- template
- void compute_component_wise(
- const FiniteElement<deal_II_dimension>& element,
- std::vector<unsigned int>&, std::vector<std::vector<unsigned int> >&);
- template
- void compute_block_renumbering (
- const FiniteElement<deal_II_dimension>& element,
- std::vector<unsigned int>&, std::vector<unsigned int>&_indices, bool);
- template
- void get_interpolation_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<double> &);
- template
- void get_back_interpolation_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<double> &);
- template
- void get_interpolation_difference_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<double> &);
- template
- void get_interpolation_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
- template
- void get_back_interpolation_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
- template
- void get_interpolation_difference_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<float> &);
-
- template
- void get_projection_matrix<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &,
- const FiniteElement<deal_II_dimension> &,
- FullMatrix<double> &);
-
- template
- void compute_embedding_matrices<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&,bool);
-
- template
- void compute_face_embedding_matrices<deal_II_dimension,double>
- (const FiniteElement<deal_II_dimension> &, FullMatrix<double> (&matrices)[GeometryInfo<deal_II_dimension>::max_children_per_face],
- unsigned int, unsigned int);
-
- template
- void compute_projection_matrices<deal_II_dimension>
- (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&, bool);
-
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, Vector<double> &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
-
-#if deal_II_dimension != 3
- template
- void compute_block_renumbering (
- const FiniteElement<deal_II_dimension,deal_II_dimension+1>& element,
- std::vector<unsigned int>&, std::vector<unsigned int>&_indices, bool);
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<double> &);
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
- Vector<double> &);
-#endif
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const FiniteElement<deal_II_dimension> &, Vector<double> &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const FiniteElement<deal_II_dimension> &, Vector<double> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, Vector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, Vector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
-
-
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, Vector<float> &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
-
-#if deal_II_dimension != 3
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<float> &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
- Vector<float> &);
-#endif
-
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const FiniteElement<deal_II_dimension> &, Vector<float> &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const FiniteElement<deal_II_dimension> &, Vector<float> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, Vector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, Vector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
-
-
-#ifdef DEAL_II_USE_TRILINOS
-
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::Vector &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::Vector &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::Vector &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::Vector &);
+ template <int dim>
+ std::vector<unsigned int>
+ hierarchic_to_lexicographic_numbering (const FiniteElementData<dim> &fe)
+ {
+ Assert (fe.n_components() == 1, ExcInvalidFE());
+
+ std::vector<unsigned int> h2l (fe.dofs_per_cell);
+
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
+ // polynomial degree
+ const unsigned int degree = fe.dofs_per_line+1;
+ // number of grid points in each
+ // direction
+ const unsigned int n = degree+1;
+
+ // the following lines of code are
+ // somewhat odd, due to the way the
+ // hierarchic numbering is
+ // organized. if someone would
+ // really want to understand these
+ // lines, you better draw some
+ // pictures where you indicate the
+ // indices and orders of vertices,
+ // lines, etc, along with the
+ // numbers of the degrees of
+ // freedom in hierarchical and
+ // lexicographical order
+ switch (dim)
+ {
+ case 1:
+ {
+ h2l[0] = 0;
+ h2l[1] = dofs_per_cell-1;
+ for (unsigned int i=2; i<dofs_per_cell; ++i)
+ h2l[i] = i-1;
-#endif
+ break;
+ }
+ case 2:
+ {
+ unsigned int next_index = 0;
+ // first the four vertices
+ h2l[next_index++] = 0;
+ h2l[next_index++] = n-1;
+ h2l[next_index++] = n*(n-1);
+ h2l[next_index++] = n*n-1;
+
+ // left line
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (1+i)*n;
+
+ // right line
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (2+i)*n-1;
+
+ // bottom line
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = 1+i;
+
+ // top line
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n*(n-1)+i+1;
+
+ // inside quad
+ Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+ ExcInternalError());
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = n*(i+1)+j+1;
+
+ Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+ break;
+ }
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<double> &);
-
-#if deal_II_dimension != 3
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<double> &);
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
- BlockVector<double> &);
-#endif
+ case 3:
+ {
+ unsigned int next_index = 0;
+ // first the eight vertices
+ h2l[next_index++] = 0; // 0
+ h2l[next_index++] = ( 1)*degree; // 1
+ h2l[next_index++] = ( n )*degree; // 2
+ h2l[next_index++] = ( n+1)*degree; // 3
+ h2l[next_index++] = (n*n )*degree; // 4
+ h2l[next_index++] = (n*n +1)*degree; // 5
+ h2l[next_index++] = (n*n+n )*degree; // 6
+ h2l[next_index++] = (n*n+n+1)*degree; // 7
+
+ // line 0
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (i+1)*n;
+ // line 1
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n-1+(i+1)*n;
+ // line 2
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = 1+i;
+ // line 3
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = 1+i+n*(n-1);
+
+ // line 4
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (n-1)*n*n+(i+1)*n;
+ // line 5
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (n-1)*(n*n+1)+(i+1)*n;
+ // line 6
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n*n*(n-1)+i+1;
+ // line 7
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n*n*(n-1)+i+1+n*(n-1);
+
+ // line 8
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (i+1)*n*n;
+ // line 9
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n-1+(i+1)*n*n;
+ // line 10
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = (i+1)*n*n+n*(n-1);
+ // line 11
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ h2l[next_index++] = n-1+(i+1)*n*n+n*(n-1);
+
+
+ // inside quads
+ Assert (fe.dofs_per_quad == fe.dofs_per_line*fe.dofs_per_line,
+ ExcInternalError());
+ // face 0
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = (i+1)*n*n+n*(j+1);
+ // face 1
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = (i+1)*n*n+n-1+n*(j+1);
+ // face 2, note the orientation!
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = (j+1)*n*n+i+1;
+ // face 3, note the orientation!
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = (j+1)*n*n+n*(n-1)+i+1;
+ // face 4
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = n*(i+1)+j+1;
+ // face 5
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ h2l[next_index++] = (n-1)*n*n+n*(i+1)+j+1;
+
+ // inside hex
+ Assert (fe.dofs_per_hex == fe.dofs_per_quad*fe.dofs_per_line,
+ ExcInternalError());
+ for (unsigned int i=0; i<fe.dofs_per_line; ++i)
+ for (unsigned int j=0; j<fe.dofs_per_line; ++j)
+ for (unsigned int k=0; k<fe.dofs_per_line; ++k)
+ h2l[next_index++] = n*n*(i+1)+n*(j+1)+k+1;
+
+ Assert (next_index == fe.dofs_per_cell, ExcInternalError());
+
+ break;
+ }
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<double> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<double> &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, Vector<double> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
-
-
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<float> &);
-
-#if deal_II_dimension != 3
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<float> &);
- template
- void interpolate<deal_II_dimension,deal_II_dimension+1>
- (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
- BlockVector<float> &);
-#endif
+ default:
+ Assert (false, ExcNotImplemented());
+ }
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<float> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<float> &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- BlockVector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, Vector<float> &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
-
-
-#ifdef DEAL_II_USE_TRILINOS
-
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
- template
- void interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::BlockVector &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
- template
- void back_interpolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::BlockVector &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
- template
- void interpolation_difference<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::BlockVector &);
- template
- void project_dg<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
- template
- void extrapolate<deal_II_dimension>
- (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
- const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- TrilinosWrappers::BlockVector &);
+ return h2l;
+ }
-#endif
- template
- void interpolate<deal_II_dimension>
- (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const hp::DoFHandler<deal_II_dimension> &, Vector<double> &);
- template
- void interpolate<deal_II_dimension>
- (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
- const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<double> &);
- template
- void interpolate<deal_II_dimension>
- (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const hp::DoFHandler<deal_II_dimension> &, Vector<float> &);
- template
- void interpolate<deal_II_dimension>
- (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
- const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
- Vector<float> &);
-
-
- template FiniteElement<deal_II_dimension,deal_II_dimension> *
- get_fe_from_name<deal_II_dimension> (const std::string &);
-
-
- template
- void add_fe_name<deal_II_dimension>(
- const std::string& name,
- const FEFactoryBase<deal_II_dimension>* factory);
-
- template
+ template <int dim>
void
- compute_projection_from_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
- const Quadrature<deal_II_dimension> &lhs_quadrature,
- const Quadrature<deal_II_dimension> &rhs_quadrature,
- FullMatrix<double> &X);
+ lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe,
+ std::vector<unsigned int> &l2h)
+ {
+ l2h = lexicographic_to_hierarchic_numbering (fe);
+ }
- template
- void
- compute_projection_from_quadrature_points(
- const FullMatrix<double> &projection_matrix,
- const std::vector< Tensor<1, deal_II_dimension > > &vector_of_tensors_at_qp,
- std::vector< Tensor<1, deal_II_dimension > > &vector_of_tensors_at_nodes);
- template
- void
- compute_projection_from_quadrature_points(
- const FullMatrix<double> &projection_matrix,
- const std::vector<SymmetricTensor<2, deal_II_dimension> > &vector_of_tensors_at_qp,
- std::vector<SymmetricTensor<2, deal_II_dimension> > &vector_of_tensors_at_nodes);
+ template <int dim>
+ std::vector<unsigned int>
+ lexicographic_to_hierarchic_numbering (const FiniteElementData<dim> &fe)
+ {
+ return Utilities::invert_permutation(hierarchic_to_lexicographic_numbering (fe));
+ }
- template
- void
- compute_interpolation_to_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
- const Quadrature<deal_II_dimension> &quadrature,
- FullMatrix<double> &I_q);
+}
-#if deal_II_dimension != 1
- template
- void
- compute_projection_from_face_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &fe,
- const Quadrature<deal_II_dimension-1> &lhs_quadrature,
- const Quadrature<deal_II_dimension-1> &rhs_quadrature,
- const DoFHandler<deal_II_dimension>::active_cell_iterator & cell,
- unsigned int face,
- FullMatrix<double> &X);
-#endif
-}
+/*-------------- Explicit Instantiations -------------------------------*/
+#include "fe_tools.inst"
/*---------------------------- fe_tools.cc ---------------------------*/
--- /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 FETools
+ \{
+ template class FEFactoryBase<deal_II_dimension>;
+
+ template
+ void compute_node_matrix(
+ FullMatrix<double>&,
+ const FiniteElement<deal_II_dimension>&);
+
+ template
+ void compute_component_wise(
+ const FiniteElement<deal_II_dimension>& ,
+ std::vector<unsigned int>&, std::vector<std::vector<unsigned int> >&);
+ template
+ void compute_block_renumbering (
+ const FiniteElement<deal_II_dimension>& ,
+ std::vector<unsigned int>&, std::vector<unsigned int>&, bool);
+ template
+ void get_interpolation_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<double> &);
+ template
+ void get_back_interpolation_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<double> &);
+ template
+ void get_interpolation_difference_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<double> &);
+ template
+ void get_interpolation_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+ template
+ void get_back_interpolation_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+ template
+ void get_interpolation_difference_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<float> &);
+
+ template
+ void get_projection_matrix<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &,
+ const FiniteElement<deal_II_dimension> &,
+ FullMatrix<double> &);
+
+ template
+ void compute_embedding_matrices<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&,bool);
+
+ template
+ void compute_face_embedding_matrices<deal_II_dimension,double>
+ (const FiniteElement<deal_II_dimension> &, FullMatrix<double> (&)[GeometryInfo<deal_II_dimension>::max_children_per_face],
+ unsigned int, unsigned int);
+
+ template
+ void compute_projection_matrices<deal_II_dimension>
+ (const FiniteElement<deal_II_dimension> &, std::vector<std::vector<FullMatrix<double> > >&, bool);
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+
+#if deal_II_dimension != 3
+ template
+ void compute_block_renumbering (
+ const FiniteElement<deal_II_dimension,deal_II_dimension+1>& ,
+ std::vector<unsigned int>&, std::vector<unsigned int>&, bool);
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<double> &);
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+ Vector<double> &);
+#endif
+
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const FiniteElement<deal_II_dimension> &, Vector<double> &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const FiniteElement<deal_II_dimension> &, Vector<double> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+
+#if deal_II_dimension != 3
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, Vector<float> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+ Vector<float> &);
+#endif
+
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const FiniteElement<deal_II_dimension> &, Vector<float> &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const FiniteElement<deal_II_dimension> &, Vector<float> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+
+
+#ifdef DEAL_II_USE_TRILINOS
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::Vector &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::Vector &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const FiniteElement<deal_II_dimension> &, TrilinosWrappers::Vector &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::Vector &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::Vector &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::Vector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::Vector &);
+
+#endif
+
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
+
+#if deal_II_dimension != 3
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<double> &);
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+ BlockVector<double> &);
+#endif
+
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<double> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, Vector<double> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<double> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<float> &);
+
+#if deal_II_dimension != 3
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, BlockVector<float> &);
+ template
+ void interpolate<deal_II_dimension,deal_II_dimension+1>
+ (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension,deal_II_dimension+1> &, const ConstraintMatrix &,
+ BlockVector<float> &);
+#endif
+
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<float> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const FiniteElement<deal_II_dimension> &, BlockVector<float> &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<float> &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, BlockVector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ BlockVector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, Vector<float> &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const BlockVector<float> &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+
+
+#ifdef DEAL_II_USE_TRILINOS
+
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+ template
+ void interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::BlockVector &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+ template
+ void back_interpolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::BlockVector &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const FiniteElement<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+ template
+ void interpolation_difference<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::BlockVector &);
+ template
+ void project_dg<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, TrilinosWrappers::BlockVector &);
+ template
+ void extrapolate<deal_II_dimension>
+ (const DoFHandler<deal_II_dimension> &, const TrilinosWrappers::BlockVector &,
+ const DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ TrilinosWrappers::BlockVector &);
+
+#endif
+
+
+ template
+ void interpolate<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const hp::DoFHandler<deal_II_dimension> &, Vector<double> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension> &, const Vector<double> &,
+ const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<double> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const hp::DoFHandler<deal_II_dimension> &, Vector<float> &);
+ template
+ void interpolate<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension> &, const Vector<float> &,
+ const hp::DoFHandler<deal_II_dimension> &, const ConstraintMatrix &,
+ Vector<float> &);
+
+
+ template FiniteElement<deal_II_dimension,deal_II_dimension> *
+ get_fe_from_name<deal_II_dimension> (const std::string &);
+
+
+ template
+ void add_fe_name<deal_II_dimension>(
+ const std::string& ,
+ const FEFactoryBase<deal_II_dimension>* );
+
+ template
+ void
+ compute_projection_from_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension> &,
+ FullMatrix<double> &);
+
+ template
+ void
+ compute_projection_from_quadrature_points(
+ const FullMatrix<double> &,
+ const std::vector< Tensor<1, deal_II_dimension > > &,
+ std::vector< Tensor<1, deal_II_dimension > > &);
+
+ template
+ void
+ compute_projection_from_quadrature_points(
+ const FullMatrix<double> &,
+ const std::vector<SymmetricTensor<2, deal_II_dimension> > &,
+ std::vector<SymmetricTensor<2, deal_II_dimension> > &);
+
+
+ template
+ void
+ compute_interpolation_to_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension> &,
+ FullMatrix<double> &);
+
+#if deal_II_dimension != 1
+ template
+ void
+ compute_projection_from_face_quadrature_points_matrix (const FiniteElement<deal_II_dimension> &,
+ const Quadrature<deal_II_dimension-1> &,
+ const Quadrature<deal_II_dimension-1> &,
+ const DoFHandler<deal_II_dimension>::active_cell_iterator & ,
+ unsigned int,
+ FullMatrix<double> &);
+#endif
+
+ template
+ void
+ hierarchic_to_lexicographic_numbering<deal_II_dimension>
+ (const FiniteElementData<deal_II_dimension> &,
+ std::vector<unsigned int> &);
+
+ template
+ void
+ lexicographic_to_hierarchic_numbering<deal_II_dimension>
+ (const FiniteElementData<deal_II_dimension> &,
+ std::vector<unsigned int> &);
+
+ template
+ std::vector<unsigned int>
+ hierarchic_to_lexicographic_numbering<deal_II_dimension>
+ (const FiniteElementData<deal_II_dimension> &);
+
+ template
+ std::vector<unsigned int>
+ lexicographic_to_hierarchic_numbering<deal_II_dimension>
+ (const FiniteElementData<deal_II_dimension> &);
+ \}
+ }
+
}
-#if deal_II_dimension == 1
-
-template <>
-void
-FEValues<1,2>::reinit (const MGDoFHandler<1,2>::cell_iterator &)
-{
- Assert(false, ExcNotImplemented());
-}
-
-#endif
-
-#if deal_II_dimension == 2
-
-template <>
-void
-FEValues<2,3>::reinit (const MGDoFHandler<2,3>::cell_iterator &)
-{
- Assert(false, ExcNotImplemented());
-}
-
-#endif
-
template <int dim, int spacedim>
void
FEValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell)
{
+ if (spacedim > dim)
+ {
+ Assert(false, ExcNotImplemented());
+ return;
+ }
+
// assert that the finite elements
// passed to the constructor and
// used by the DoFHandler used by
}
-#if deal_II_dimension == 1
-
-template <>
-void FEFaceValues<1,2>::reinit (const MGDoFHandler<1,2>::cell_iterator &,
- const unsigned int)
-{
- Assert(false,ExcNotImplemented());
-}
-
-#endif
-
-#if deal_II_dimension == 2
-
-template <>
-void FEFaceValues<2,3>::reinit (const MGDoFHandler<2,3>::cell_iterator &,
- const unsigned int)
-{
- Assert(false,ExcNotImplemented());
-}
-
-#endif
template <int dim, int spacedim>
void FEFaceValues<dim,spacedim>::reinit (const typename MGDoFHandler<dim,spacedim>::cell_iterator &cell,
const unsigned int face_no)
{
+ if (spacedim > dim)
+ {
+ Assert(false,ExcNotImplemented());
+ return;
+ }
// assert that the finite elements
// passed to the constructor and
// used by the DoFHandler used by
/*------------------------------- Explicit Instantiations -------------*/
-
-template class FEValuesData<deal_II_dimension>;
-template class FEValuesBase<deal_II_dimension>;
-template class FEValues<deal_II_dimension>;
-template class FEValuesBase<deal_II_dimension>::
-CellIterator<DoFHandler<deal_II_dimension>::cell_iterator>;
-template class FEValuesBase<deal_II_dimension>::
-CellIterator<MGDoFHandler<deal_II_dimension>::cell_iterator>;
-
-#if deal_II_dimension >= 2
-template class FEFaceValuesBase<deal_II_dimension>;
-template class FEFaceValues<deal_II_dimension>;
-template class FESubfaceValues<deal_II_dimension>;
-#endif
-
-#if deal_II_dimension != 3
-template class FEValuesData<deal_II_dimension,deal_II_dimension+1>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>;
-template class FEValues<deal_II_dimension,deal_II_dimension+1>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
-CellIterator<DoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
-template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
- CellIterator<MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
-
-#if deal_II_dimension == 2
-template class FEFaceValuesBase<deal_II_dimension,deal_II_dimension+1>;
-template class FEFaceValues<deal_II_dimension,deal_II_dimension+1>;
-template class FESubfaceValues<deal_II_dimension,deal_II_dimension+1>;
-#endif
-#endif
-
-
-namespace FEValuesViews
-{
- template class Scalar<deal_II_dimension, deal_II_dimension>;
- template class Vector<deal_II_dimension, deal_II_dimension>;
- template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension>;
-
-#if deal_II_dimension != 3
- template class Scalar<deal_II_dimension, deal_II_dimension+1>;
- template class Vector<deal_II_dimension, deal_II_dimension+1>;
- template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>;
-#endif
-}
-
-
-//---------------------------------------------------------------------------
-// Instantiations are in a different file using the macro IN for the vector type.
-// This way, we avoid code reduplication
-
#include "fe_values.inst"
DEAL_II_NAMESPACE_CLOSE
// Instantiations of functions in FEValuesViews (explicitly write
// dealii:: namespace in order to not confuse the compiler with
// FEValuesViews::Vector).
-for (VEC : SERIAL_VECTORS)
+for (deal_II_dimension : DIMENSIONS)
+{
+template class FEValuesData<deal_II_dimension>;
+template class FEValuesBase<deal_II_dimension>;
+template class FEValues<deal_II_dimension>;
+template class FEValuesBase<deal_II_dimension>::
+CellIterator<DoFHandler<deal_II_dimension>::cell_iterator>;
+template class FEValuesBase<deal_II_dimension>::
+CellIterator<MGDoFHandler<deal_II_dimension>::cell_iterator>;
+
+#if deal_II_dimension >= 2
+template class FEFaceValuesBase<deal_II_dimension>;
+template class FEFaceValues<deal_II_dimension>;
+template class FESubfaceValues<deal_II_dimension>;
+#endif
+
+#if deal_II_dimension != 3
+template class FEValuesData<deal_II_dimension,deal_II_dimension+1>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>;
+template class FEValues<deal_II_dimension,deal_II_dimension+1>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
+CellIterator<DoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
+template class FEValuesBase<deal_II_dimension,deal_II_dimension+1>::
+ CellIterator<MGDoFHandler<deal_II_dimension,deal_II_dimension+1>::cell_iterator>;
+
+#if deal_II_dimension == 2
+template class FEFaceValuesBase<deal_II_dimension,deal_II_dimension+1>;
+template class FEFaceValues<deal_II_dimension,deal_II_dimension+1>;
+template class FESubfaceValues<deal_II_dimension,deal_II_dimension+1>;
+#endif
+#endif
+
+
+namespace FEValuesViews
+\{
+ template class Scalar<deal_II_dimension, deal_II_dimension>;
+ template class Vector<deal_II_dimension, deal_II_dimension>;
+ template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class Scalar<deal_II_dimension, deal_II_dimension+1>;
+ template class Vector<deal_II_dimension, deal_II_dimension+1>;
+ template class SymmetricTensor<2, deal_II_dimension, deal_II_dimension+1>;
+#endif
+\}
+
+}
+
+for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS)
{
template
void FEValuesViews::Scalar<deal_II_dimension>::get_function_values<dealii::VEC>
// Instantiations of functions in FEValuesBase
-for (VEC : SERIAL_VECTORS)
+for (VEC : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS)
{
template
void FEValuesBase<deal_II_dimension>::get_function_values<VEC>
#endif
}
+
const typename Mapping<dim,spacedim>::InternalDataBase &mapping_data) const
{
Assert (offset == 0, ExcInternalError());
-
- transform(input, output, mapping_data, mapping_covariant);
+
+ transform(input, output, mapping_data, mapping_covariant);
}
-template class Mapping<deal_II_dimension>;
+// explicit instantiations
+#include "mapping.inst"
-#if deal_II_dimension != 3
-template class Mapping<deal_II_dimension,deal_II_dimension+1>;
-#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 Mapping<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class Mapping<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ }
+
}
-#if deal_II_dimension == 1
template <>
void
Assert (dim > 1, ExcImpossibleInDim(dim));
}
-#endif
-#if deal_II_dimension == 2
-
template <>
void
MappingC1<2>::add_line_support_points (const Triangulation<2>::cell_iterator &cell,
{
const unsigned int dim = 2;
std::vector<Point<dim> > line_points (2);
-
+
// loop over each of the lines,
// and if it is at the
// boundary, then first get the
(face_vertex_normals[1][1] * std::cos(alpha)
-face_vertex_normals[1][0] * std::sin(alpha)))
-2*c;
-
+
// next evaluate the so
// determined cubic
};
}
-#endif
-
template<int dim, int spacedim>
-
-#if deal_II_dimension == 1
-
template <>
void
MappingC1<1>::add_quad_support_points (const Triangulation<1>::cell_iterator &,
Assert (dim > 2, ExcImpossibleInDim(dim));
}
-#endif
-
-#if deal_II_dimension == 2
-
template <>
void
MappingC1<2>::add_quad_support_points (const Triangulation<2>::cell_iterator &,
Assert (dim > 2, ExcImpossibleInDim(dim));
}
-#endif
-
-
template<int dim, int spacedim>
// explicit instantiations
-template class MappingC1<deal_II_dimension>;
+#include "mapping_c1.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)
+ {
+ template class MappingC1<deal_II_dimension>;
+ }
+
UpdateFlags out = in;
if (out & update_boundary_forms)
out |= update_normal_vectors;
-
+
return out;
}
data->update_once = update_once(update_flags);
data->update_each = update_each(update_flags);
data->update_flags = data->update_once | data->update_each;
-
+
return data;
}
data->update_once = update_once(update_flags);
data->update_each = update_each(update_flags);
data->update_flags = data->update_once | data->update_each;
-
+
return data;
}
data->update_once = update_once(update_flags);
data->update_each = update_each(update_flags);
data->update_flags = data->update_once | data->update_each;
-
+
return data;
}
// tests/fe/mapping.cc). Therefore,
// we must use following workaround
// of two separate assertions
-#if deal_II_dimension != 1
Assert ((sub_no == invalid_face_number) ||
cell->face(face_no)->has_children() ||
(sub_no+1 < GeometryInfo<dim>::max_children_per_face+1),
!cell->face(face_no)->has_children() ||
(sub_no < cell->face(face_no)->n_children()),
ExcIndexRange (sub_no, 0, cell->face(face_no)->n_children()));
-#endif
}
else
// invalid face number, so
// chosen as the (lower) left
// vertex
const Point<dim> start = cell->vertex(0);
-
+
// Compute start point and sizes
// along axes. Strange vertex
// numbering makes this complicated
Assert(false, ExcNotImplemented());
}
}
-
+
// transform quadrature point. this
// is obtained simply by scaling
{
Assert (face_no < GeometryInfo<dim>::faces_per_cell,
ExcInternalError());
-
+
switch (dim)
{
case 2:
void
MappingCartesian<dim, spacedim>::
fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator& cell,
- const Quadrature<dim>& q,
+ const Quadrature<dim>& q,
typename Mapping<dim,spacedim>::InternalDataBase& mapping_data,
std::vector<Point<spacedim> >& quadrature_points,
std::vector<double>& JxW_values,
InternalData &data = static_cast<InternalData&> (mapping_data);
std::vector<Point<dim> > dummy;
-
+
compute_fill (cell, invalid_face_number, invalid_face_number, cell_similarity,
data,
quadrature_points,
if (cell_similarity != CellSimilarity::translation)
for (unsigned int i=0; i<jacobian_grads.size();++i)
jacobian_grads[i]=Tensor<3,dim>();
- // "compute" inverse Jacobian at the
- // quadrature points, which are all
+ // "compute" inverse Jacobian at the
+ // quadrature points, which are all
// the same
if (data.current_update_flags() & update_inverse_jacobians)
if (cell_similarity != CellSimilarity::translation)
-#if (deal_II_dimension == 1)
+template <>
+void
+MappingCartesian<1,1>::fill_fe_face_values (
+ const typename Triangulation<1,1>::cell_iterator &,
+ const unsigned int,
+ const Quadrature<0>&,
+ typename Mapping<1,1>::InternalDataBase&,
+ std::vector<Point<1> >&,
+ std::vector<double>&,
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<1> >&) const
+{
+ Assert(false, ExcNotImplemented());
+}
+
-template <int dim, int spacedim>
+template <>
void
-MappingCartesian<dim,spacedim>::fill_fe_face_values (
- const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingCartesian<1,2>::fill_fe_face_values (
+ const typename Triangulation<1,2>::cell_iterator &,
const unsigned int,
- const Quadrature<dim-1>&,
- typename Mapping<dim,spacedim>::InternalDataBase&,
- std::vector<Point<dim> >&,
+ const Quadrature<0>&,
+ typename Mapping<1,2>::InternalDataBase&,
+ std::vector<Point<1> >&,
std::vector<double>&,
- std::vector<Tensor<1,dim> >&,
- std::vector<Point<spacedim> >&) const
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<2> >&) const
{
Assert(false, ExcNotImplemented());
}
-template <int dim, int spacedim>
+
+template <>
+void
+MappingCartesian<1,1>::fill_fe_subface_values (
+ const typename Triangulation<1,1>::cell_iterator &,
+ const unsigned int,
+ const unsigned int,
+ const Quadrature<0>&,
+ typename Mapping<1,1>::InternalDataBase&,
+ std::vector<Point<1> >&,
+ std::vector<double>&,
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<1> >&) const
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
void
-MappingCartesian<dim,spacedim>::fill_fe_subface_values (
- const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingCartesian<1,2>::fill_fe_subface_values (
+ const typename Triangulation<1,2>::cell_iterator &,
const unsigned int,
const unsigned int,
- const Quadrature<dim-1>&,
- typename Mapping<dim,spacedim>::InternalDataBase&,
- std::vector<Point<dim> >&,
+ const Quadrature<0>&,
+ typename Mapping<1,2>::InternalDataBase&,
+ std::vector<Point<1> >&,
std::vector<double>&,
- std::vector<Tensor<1,dim> >&,
- std::vector<Point<spacedim> >&) const
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<2> >&) const
{
Assert(false, ExcNotImplemented());
}
-#else
// Implementation for dim != 1
-
+
template<int dim, int spacedim>
void
MappingCartesian<dim, spacedim>::fill_fe_face_values (
ExcInternalError());
InternalData &data = static_cast<InternalData&> (mapping_data);
- compute_fill (cell, face_no, invalid_face_number,
+ compute_fill (cell, face_no, invalid_face_number,
CellSimilarity::none,
data,
quadrature_points,
for (unsigned int d=0; d<dim; ++d)
if (d != GeometryInfo<dim>::unit_normal_direction[face_no])
J *= data.length[d];
-
+
if (data.current_update_flags() & update_JxW_values)
for (unsigned int i=0; i<JxW_values.size();++i)
JxW_values[i] = J * q.weight(i);
for (unsigned int d=0; d<dim; ++d)
if (d != GeometryInfo<dim>::unit_normal_direction[face_no])
J *= data.length[d];
-
+
if (data.current_update_flags() & update_JxW_values)
{
// Here,
}
}
-
-#endif
-
+
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::transform (
const MappingType mapping_type) const
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
- ExcInternalError());
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ ExcInternalError());
const InternalData &data = static_cast<const InternalData&> (mapping_data);
-
+
switch (mapping_type)
{
case mapping_covariant:
{
Assert (data.update_flags & update_covariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d=0;d<dim;++d)
output[i][d] = input[i][d]/data.length[d];
return;
}
-
+
case mapping_contravariant:
{
Assert (data.update_flags & update_contravariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d=0;d<dim;++d)
output[i][d] = input[i][d]*data.length[d];
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
Assert (data.update_flags & update_volume_elements,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d=0;d<dim;++d)
output[i][d] = input[i][d] * data.length[d] / data.volume_element;
}
}
+
+
template<int dim, int spacedim>
void
MappingCartesian<dim,spacedim>::transform (
const MappingType mapping_type) const
{
AssertDimension (input.size(), output.size());
- Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
+ Assert (dynamic_cast<const InternalData *>(&mapping_data) != 0,
ExcInternalError());
const InternalData &data = static_cast<const InternalData&>(mapping_data);
-
+
switch (mapping_type)
{
case mapping_covariant:
{
Assert (data.update_flags & update_covariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d1=0;d1<dim;++d1)
for (unsigned int d2=0;d2<dim;++d2)
output[i][d1][d2] = input[i][d1][d2] / data.length[d2];
return;
}
-
+
case mapping_contravariant:
{
Assert (data.update_flags & update_contravariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d1=0;d1<dim;++d1)
for (unsigned int d2=0;d2<dim;++d2)
{
Assert (data.update_flags & update_covariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d1=0;d1<dim;++d1)
for (unsigned int d2=0;d2<dim;++d2)
{
Assert (data.update_flags & update_contravariant_transformation,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d1=0;d1<dim;++d1)
for (unsigned int d2=0;d2<dim;++d2)
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
Assert (data.update_flags & update_volume_elements,
typename FEValuesBase<dim>::ExcAccessToUninitializedField());
-
+
for (unsigned int i=0; i<output.size(); ++i)
for (unsigned int d1=0;d1<dim;++d1)
for (unsigned int d2=0;d2<dim;++d2)
/ data.length[d1] / data.volume_element;
return;
}
-
+
default:
Assert(false, ExcNotImplemented());
}
//---------------------------------------------------------------------------
// explicit instantiations
+#include "mapping_cartesian.inst"
-template class MappingCartesian<deal_II_dimension>;
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 MappingCartesian<deal_II_dimension>;
+ }
+
-#if deal_II_dimension == 1
-
// in 1d, it is irrelevant which polynomial degree to use, since all
// cells are scaled linearly. Unless codimension is equal to two
template<>
MappingQ<1>::~MappingQ ()
{}
-#endif
-
namespace
-#if deal_II_dimension == 1
-
template<>
void
MappingQ<1>::compute_shapes_virtual (const std::vector<Point<1> > &unit_points,
MappingQ1<1>::compute_shapes_virtual(unit_points, data);
}
-#endif
-
template<int dim, int spacedim>
}
-#if deal_II_dimension==1
template <>
void
Assert(false, ExcInternalError());
}
-#else
+
template<int dim, int spacedim>
void
ExcInternalError());
}
-#endif
-
-#if deal_II_dimension==3
template <>
void
ExcInternalError());
}
-#endif
template<int dim, int spacedim>
-
-#if deal_II_dimension==1
-
template <>
void
MappingQ<1>::compute_laplace_vector(Table<2,double> &) const
Assert(false, ExcInternalError());
}
-#else
template<int dim, int spacedim>
lvs(i,k) = -S_1_T(i,k);
}
-#endif
-
template<int dim, int spacedim>
-
-
-#if deal_II_dimension==1
-
template <>
void
MappingQ<1>::add_line_support_points (const Triangulation<1>::cell_iterator &,
}
+
template <>
void
MappingQ<1,2>::add_line_support_points (const Triangulation<1,2>::cell_iterator &cell,
}
}
-#endif
template<int dim, int spacedim>
-
-#if deal_II_dimension==3
-
-
template<>
void
MappingQ<3>::
}
}
-#endif
-#if deal_II_dimension == 2
template<>
void
a.push_back(quad_points[i]);
}
-#endif
template<int dim, int spacedim>
}
+
template<int dim, int spacedim>
void
MappingQ<dim,spacedim>::transform (
}
+
template<int dim, int spacedim>
void
MappingQ<dim,spacedim>::transform (
}
-// explicit instantiation
-template class MappingQ<deal_II_dimension>;
-#if deal_II_dimension < 3
-template class MappingQ<deal_II_dimension, deal_II_dimension+1>;
-#endif
+// explicit instantiations
+#include "mapping_q.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)
+ {
+ template class MappingQ<deal_II_dimension>;
+
+#if deal_II_dimension < 3
+ template class MappingQ<deal_II_dimension, deal_II_dimension+1>;
+#endif
+ }
+
}
-#if deal_II_dimension == 2
template<>
void
Assert(false, ExcNotImplemented());
}
-#endif
-#if (deal_II_dimension == 1)
-template <int dim, int spacedim>
+template <>
void
-MappingQ1<dim,spacedim>::compute_fill_face (
- const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,1>::compute_fill_face (
+ const typename Triangulation<1,1>::cell_iterator &,
+ const unsigned int,
+ const unsigned int,
+ const unsigned int,
+ const DataSetDescriptor,
+ const std::vector<double> &,
+ InternalData &,
+ std::vector<Point<1> > &,
+ std::vector<double> &,
+ std::vector<Tensor<1,1> > &,
+ std::vector<Point<1> > &) const
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,2>::compute_fill_face (
+ const typename Triangulation<1,2>::cell_iterator &,
const unsigned int,
const unsigned int,
const unsigned int,
const DataSetDescriptor,
const std::vector<double> &,
InternalData &,
- std::vector<Point<spacedim> > &,
+ std::vector<Point<2> > &,
std::vector<double> &,
- std::vector<Tensor<1,spacedim> > &,
- std::vector<Point<spacedim> > &) const
+ std::vector<Tensor<1,2> > &,
+ std::vector<Point<2> > &) const
{
Assert(false, ExcNotImplemented());
}
-template <int dim,int spacedim>
+
+template <>
void
-MappingQ1<dim,spacedim>::fill_fe_face_values (
- const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,1>::fill_fe_face_values (
+ const typename Triangulation<1,1>::cell_iterator &,
const unsigned,
- const Quadrature<dim-1>&,
- typename Mapping<dim,spacedim>::InternalDataBase&,
- std::vector<Point<spacedim> >&,
+ const Quadrature<0>&,
+ typename Mapping<1,1>::InternalDataBase&,
+ std::vector<Point<1> >&,
std::vector<double>&,
- std::vector<Tensor<1,spacedim> >&,
- std::vector<Point<spacedim> >&) const
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<1> >&) const
{
Assert(false, ExcNotImplemented());
}
-template <int dim,int spacedim>
+
+template <>
void
-MappingQ1<dim,spacedim>::fill_fe_subface_values (
- const typename Triangulation<dim,spacedim>::cell_iterator &,
+MappingQ1<1,2>::fill_fe_face_values (
+ const typename Triangulation<1,2>::cell_iterator &,
+ const unsigned,
+ const Quadrature<0>&,
+ typename Mapping<1,2>::InternalDataBase&,
+ std::vector<Point<2> >&,
+ std::vector<double>&,
+ std::vector<Tensor<1,2> >&,
+ std::vector<Point<2> >&) const
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,1>::fill_fe_subface_values (
+ const typename Triangulation<1,1>::cell_iterator &,
const unsigned,
const unsigned,
- const Quadrature<dim-1>&,
- typename Mapping<dim,spacedim>::InternalDataBase&,
- std::vector<Point<spacedim> >&,
+ const Quadrature<0>&,
+ typename Mapping<1,1>::InternalDataBase&,
+ std::vector<Point<1> >&,
std::vector<double>&,
- std::vector<Tensor<1,spacedim> >&,
- std::vector<Point<spacedim> >&) const
+ std::vector<Tensor<1,1> >&,
+ std::vector<Point<1> >&) const
+{
+ Assert(false, ExcNotImplemented());
+}
+
+
+
+template <>
+void
+MappingQ1<1,2>::fill_fe_subface_values (
+ const typename Triangulation<1,2>::cell_iterator &,
+ const unsigned,
+ const unsigned,
+ const Quadrature<0>&,
+ typename Mapping<1,2>::InternalDataBase&,
+ std::vector<Point<2> >&,
+ std::vector<double>&,
+ std::vector<Tensor<1,2> >&,
+ std::vector<Point<2> >&) const
{
Assert(false, ExcNotImplemented());
}
-#else
-// Implementation for 2D and 3D
template<int dim, int spacedim>
void
}
-#endif
-
template<int dim, int spacedim>
void
}
-#if deal_II_dimension == 1
template<>
void
Assert(false, ExcNotImplemented());
}
-#endif
-#if deal_II_dimension == 2
template<>
void
Assert(false, ExcNotImplemented());
}
-#endif
template<int dim, int spacedim>
-//---------------------------------------------------------------------------
+//--------------------------- Explicit instantiations -----------------------
+#include "mapping_q1.inst"
-template class MappingQ1<deal_II_dimension>;
-template struct StaticMappingQ1<deal_II_dimension>;
-#if deal_II_dimension != 3
-template class MappingQ1<deal_II_dimension,deal_II_dimension+1>;
-template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
-#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 MappingQ1<deal_II_dimension>;
+ template struct StaticMappingQ1<deal_II_dimension>;
+
+#if deal_II_dimension != 3
+ template class MappingQ1<deal_II_dimension,deal_II_dimension+1>;
+ template struct StaticMappingQ1<deal_II_dimension,deal_II_dimension+1>;
+#endif
+ }
+
-// explicit instantiation
-template class MappingQ1Eulerian<deal_II_dimension, Vector<double> >;
-template class MappingQ1Eulerian<deal_II_dimension, Vector<float> >;
-#ifdef DEAL_II_USE_PETSC
-template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector>;
-#endif
-
-// Explicit instantiation for codimension one problems.
-#if deal_II_dimension != 3
-template class MappingQ1Eulerian<deal_II_dimension, Vector<double>, deal_II_dimension+1 >;
-# ifdef DEAL_II_USE_PETSC
-template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector, deal_II_dimension+1>;
-# endif
-#endif
+// explicit instantiations
+#include "mapping_q1_eulerian.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)
+ {
+ template class MappingQ1Eulerian<deal_II_dimension, Vector<double> >;
+ template class MappingQ1Eulerian<deal_II_dimension, Vector<float> >;
+#ifdef DEAL_II_USE_PETSC
+ template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector>;
+#endif
+
+#if deal_II_dimension != 3
+ template class MappingQ1Eulerian<deal_II_dimension, Vector<double>, deal_II_dimension+1 >;
+# ifdef DEAL_II_USE_PETSC
+ template class MappingQ1Eulerian<deal_II_dimension, PETScWrappers::Vector, deal_II_dimension+1>;
+# endif
+#endif
+ }
+
-// explicit instantiation
-template class MappingQEulerian<deal_II_dimension, Vector<double> >;
-#ifdef DEAL_II_USE_PETSC
-template class MappingQEulerian<deal_II_dimension, PETScWrappers::Vector>;
-#endif
-
-#if deal_II_dimension != 3
-template class MappingQEulerian<deal_II_dimension, Vector<double>,
- deal_II_dimension+1>;
-
-# ifdef DEAL_II_USE_PETSC
-template class MappingQEulerian<deal_II_dimension,
- PETScWrappers::Vector, deal_II_dimension+1>;
-# endif
-
-#endif
+// explicit instantiations
+#include "mapping_q_eulerian.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)
+ {
+ template class MappingQEulerian<deal_II_dimension, Vector<double> >;
+#ifdef DEAL_II_USE_PETSC
+ template class MappingQEulerian<deal_II_dimension, PETScWrappers::Vector>;
+#endif
+
+#if deal_II_dimension != 3
+ template class MappingQEulerian<deal_II_dimension, Vector<double>,
+ deal_II_dimension+1>;
+
+# ifdef DEAL_II_USE_PETSC
+ template class MappingQEulerian<deal_II_dimension,
+ PETScWrappers::Vector, deal_II_dimension+1>;
+# endif
+
+#endif
+ }
+