const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const a = 0,
const ConstraintMatrix &constraints = ConstraintMatrix());
const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const a = 0,
const ConstraintMatrix &constraints = ConstraintMatrix());
const hp::QCollection<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const a = 0,
const ConstraintMatrix &constraints = ConstraintMatrix());
const hp::QCollection<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const a = 0,
const ConstraintMatrix &constraints = ConstraintMatrix());
* shape functions.
*/
template <int dim, int spacedim>
-
void create_boundary_mass_matrix (const Mapping<dim, spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
* <tt>mapping=MappingQ1@<dim@>()</tt>.
*/
template <int dim, int spacedim>
-
void create_boundary_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
SparseMatrix<double> &matrix,
* Same function as above, but for hp objects.
*/
template <int dim, int spacedim>
-
void create_boundary_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
* Same function as above, but for hp objects.
*/
template <int dim, int spacedim>
-
void create_boundary_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
SparseMatrix<double> &matrix,
};
+ template <typename number>
struct CopyData
{
std::vector<types::global_dof_index> dof_indices;
- FullMatrix<double> cell_matrix;
- dealii::Vector<double> cell_rhs;
+ FullMatrix<number> cell_matrix;
+ dealii::Vector<number> cell_rhs;
const ConstraintMatrix *constraints;
};
}
template <int dim,
int spacedim,
- typename CellIterator>
+ typename CellIterator,
+ typename number>
void mass_assembler (const CellIterator &cell,
MatrixCreator::internal::AssemblerData::Scratch<dim,spacedim> &data,
- MatrixCreator::internal::AssemblerData::CopyData ©_data)
+ MatrixCreator::internal::AssemblerData::CopyData<number> ©_data)
{
data.x_fe_values.reinit (cell);
const FEValues<dim,spacedim> &fe_values = data.x_fe_values.get_present_fe_values ();
typename CellIterator>
void laplace_assembler (const CellIterator &cell,
MatrixCreator::internal::AssemblerData::Scratch<dim,spacedim> &data,
- MatrixCreator::internal::AssemblerData::CopyData ©_data)
+ MatrixCreator::internal::AssemblerData::CopyData<double> ©_data)
{
data.x_fe_values.reinit (cell);
const FEValues<dim,spacedim> &fe_values = data.x_fe_values.get_present_fe_values ();
- template <typename MatrixType,
+ template <typename number,
+ typename MatrixType,
typename VectorType>
- void copy_local_to_global (const AssemblerData::CopyData &data,
+ void copy_local_to_global (const AssemblerData::CopyData<number> &data,
MatrixType *matrix,
VectorType *right_hand_side)
{
coefficient, /*rhs_function=*/0,
q_collection, mapping_collection);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
WorkStream::run (dof.begin_active(),
static_cast<typename DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
- &MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator>,
+ &MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<number>, Vector<double> >,
- std_cxx11::_1, &matrix, (Vector<double> *)0),
+ copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
+ std_cxx11::_1, &matrix, (Vector<number> *)0),
assembler_data,
copy_data);
}
const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const coefficient,
const ConstraintMatrix &constraints)
{
update_JxW_values | update_quadrature_points,
coefficient, &rhs,
q_collection, mapping_collection);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
WorkStream::run (dof.begin_active(),
static_cast<typename DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
- &MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator>,
+ &MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std_cxx11::bind(&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<number>, Vector<double> >,
+ copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
std_cxx11::_1, &matrix, &rhs_vector),
assembler_data,
copy_data);
const Quadrature<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const coefficient,
const ConstraintMatrix &constraints)
{
(coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
coefficient, /*rhs_function=*/0,
q, mapping);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
WorkStream::run (dof.begin_active(),
static_cast<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
- &MatrixCreator::internal::mass_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>,
+ &MatrixCreator::internal::mass_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<number>, Vector<double> >,
- std_cxx11::_1, &matrix, (Vector<double> *)0),
+ copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
+ std_cxx11::_1, &matrix, (Vector<number> *)0),
assembler_data,
copy_data);
}
const hp::QCollection<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const coefficient,
const ConstraintMatrix &constraints)
{
update_JxW_values | update_quadrature_points,
coefficient, &rhs,
q, mapping);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<number> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
WorkStream::run (dof.begin_active(),
static_cast<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
- &MatrixCreator::internal::mass_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>,
+ &MatrixCreator::internal::mass_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<number>, Vector<double> >,
+ copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
std_cxx11::_1, &matrix, &rhs_vector),
assembler_data,
copy_data);
const hp::QCollection<dim> &q,
SparseMatrix<number> &matrix,
const Function<spacedim> &rhs,
- Vector<double> &rhs_vector,
+ Vector<number> &rhs_vector,
const Function<spacedim> *const coefficient,
const ConstraintMatrix &constraints)
{
(coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
coefficient, /*rhs_function=*/0,
q_collection, mapping_collection);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
static_cast<typename DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
&MatrixCreator::internal::laplace_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<double>, Vector<double> >,
+ copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std_cxx11::_1,
&matrix,
(Vector<double> *)NULL),
update_JxW_values | update_quadrature_points,
coefficient, &rhs,
q_collection, mapping_collection);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
static_cast<typename DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
&MatrixCreator::internal::laplace_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<double>, Vector<double> >,
+ copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std_cxx11::_1,
&matrix,
&rhs_vector),
(coefficient != 0 ? update_quadrature_points : UpdateFlags(0)),
coefficient, /*rhs_function=*/0,
q, mapping);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
static_cast<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
&MatrixCreator::internal::laplace_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<double>, Vector<double> >,
+ copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std_cxx11::_1,
&matrix,
(Vector<double> *)0),
update_JxW_values | update_quadrature_points,
coefficient, &rhs,
q, mapping);
- MatrixCreator::internal::AssemblerData::CopyData copy_data;
+ MatrixCreator::internal::AssemblerData::CopyData<double> copy_data;
copy_data.cell_matrix.reinit (assembler_data.fe_collection.max_dofs_per_cell(),
assembler_data.fe_collection.max_dofs_per_cell());
copy_data.cell_rhs.reinit (assembler_data.fe_collection.max_dofs_per_cell());
static_cast<typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
&MatrixCreator::internal::laplace_assembler<dim, spacedim, typename hp::DoFHandler<dim,spacedim>::active_cell_iterator>,
std_cxx11::bind (&MatrixCreator::internal::
- copy_local_to_global<SparseMatrix<double>, Vector<double> >,
+ copy_local_to_global<double,SparseMatrix<double>, Vector<double> >,
std_cxx11::_1,
&matrix,
&rhs_vector),
// ---------------------------------------------------------------------
//
-// Copyright (C) 2010 - 2014 by the deal.II authors
+// Copyright (C) 2010 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
const Function<deal_II_space_dimension> * const,
std::vector<unsigned int>);
+// same for float
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const Mapping<deal_II_dimension,deal_II_space_dimension> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const Mapping<deal_II_dimension,deal_II_space_dimension> &mapping,
+ const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> &rhs,
+ Vector<float> &rhs_vector,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const Quadrature<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> &rhs,
+ Vector<float> &rhs_vector,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+
#endif
}
// where applicable and move to codimension cases above also when applicable
for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
-#if deal_II_dimension <= deal_II_space_dimension
// hp versions of functions
+#if deal_II_dimension <= deal_II_space_dimension
template
void MatrixCreator::create_mass_matrix<deal_II_dimension,double,deal_II_space_dimension>
(const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension> &mapping,
const Function<deal_II_dimension> * const coefficient,
const ConstraintMatrix &constraints);
+#endif
+
+// same for float
+#if deal_II_dimension <= deal_II_space_dimension
+
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension,float,deal_II_space_dimension>
+ (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension> &mapping,
+ const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> &rhs,
+ Vector<float> &rhs_vector,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
#endif
+
+#if deal_II_dimension == deal_II_space_dimension
+
+
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+
+ template
+ void MatrixCreator::create_mass_matrix<deal_II_dimension>
+ (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<float> &matrix,
+ const Function<deal_II_space_dimension> &rhs,
+ Vector<float> &rhs_vector,
+ const Function<deal_II_space_dimension> * const coefficient,
+ const ConstraintMatrix &constraints);
+
+#endif
+
}