/**
* Internal helper function for distribute_local_to_global function.
*/
- template <typename LocalType>
- LocalType
+ template <typename MatrixScalar, typename VectorScalar>
+ typename ProductType<VectorScalar,MatrixScalar>::type
resolve_vector_entry (const size_type i,
const internals::GlobalRowsFromLocal &global_rows,
- const Vector<LocalType> &local_vector,
+ const Vector<VectorScalar> &local_vector,
const std::vector<size_type> &local_dof_indices,
- const FullMatrix<LocalType> &local_matrix) const;
+ const FullMatrix<MatrixScalar> &local_matrix) const;
};
* Access to the scratch data is only through the accessor class which
* handles the access as well as marking the data as used.
*/
- template <typename Number>
+ template <typename MatrixScalar, typename VectorScalar = MatrixScalar>
class ConstraintMatrixData
{
public:
/**
* Temporary array for column values
*/
- std::vector<Number> values;
+ std::vector<MatrixScalar> values;
/**
* Temporary array for block start indices
/**
* Temporary array for vector values
*/
- std::vector<Number> vector_values;
+ std::vector<VectorScalar> vector_values;
/**
* Data array for reorder row/column indices.
// Resolve the constraints from the vector and apply inhomogeneities.
-template < typename LocalType>
+template <typename MatrixScalar, typename VectorScalar>
inline
-LocalType
+typename ProductType<VectorScalar,MatrixScalar>::type
ConstraintMatrix::
resolve_vector_entry (const size_type i,
const internals::GlobalRowsFromLocal &global_rows,
- const Vector<LocalType> &local_vector,
+ const Vector<VectorScalar> &local_vector,
const std::vector<size_type> &local_dof_indices,
- const FullMatrix<LocalType> &local_matrix) const
+ const FullMatrix<MatrixScalar> &local_matrix) const
{
const size_type loc_row = global_rows.local_row(i);
const size_type n_inhomogeneous_rows = global_rows.n_inhomogeneities();
- LocalType val = 0;
+ typename ProductType<VectorScalar,MatrixScalar>::type val = 0;
// has a direct contribution from some local entry. If we have inhomogeneous
// constraints, compute the contribution of the inhomogeneity in the current
// row.
for (size_type q=0; q<global_rows.size(i); ++q)
{
const size_type loc_row_q = global_rows.local_row(i,q);
- LocalType add_this = local_vector (loc_row_q);
+ typename ProductType<VectorScalar,MatrixScalar>::type add_this = local_vector (loc_row_q);
for (size_type k=0; k<n_inhomogeneous_rows; ++k)
add_this -= (local_matrix(loc_row_q,global_rows.constraint_origin(k)) *
lines[lines_cache[calculate_line_index
const size_type n_local_dofs = local_dof_indices.size();
- typename internals::ConstraintMatrixData<number>::ScratchDataAccessor
+ typename internals::ConstraintMatrixData<typename MatrixType::value_type,typename VectorType::value_type>::ScratchDataAccessor
scratch_data;
internals::GlobalRowsFromLocal &global_rows = scratch_data->global_rows;
std::vector<number> &vals = scratch_data->values;
// create arrays for writing into the vector as well
std::vector<size_type> &vector_indices = scratch_data->vector_indices;
- std::vector<number> &vector_values = scratch_data->vector_values;
+ std::vector<typename VectorType::value_type> &vector_values = scratch_data->vector_values;
vector_indices.resize(n_actual_dofs);
vector_values.resize(n_actual_dofs);
SparseMatrix<number> *sparse_matrix
// hand side.
if (use_vectors == true)
{
- const number val = resolve_vector_entry (i, global_rows,
- local_vector,
- local_dof_indices,
- local_matrix);
+ const typename VectorType::value_type
+ val = resolve_vector_entry (i, global_rows,
+ local_vector,
+ local_dof_indices,
+ local_matrix);
AssertIsFinite(val);
- if (val != number ())
+ if (val != typename VectorType::value_type ())
{
vector_indices[local_row_n] = row;
vector_values[local_row_n] = val;
}
Assert (sorted == true, ExcMatrixNotClosed());
- typename internals::ConstraintMatrixData<number>::ScratchDataAccessor
+ typename internals::ConstraintMatrixData<typename MatrixType::value_type,typename VectorType::value_type>::ScratchDataAccessor
scratch_data;
const size_type n_local_dofs = local_dof_indices.size();
const size_type n_local_row_dofs = row_indices.size();
const size_type n_local_col_dofs = col_indices.size();
- typename internals::ConstraintMatrixData<number>::ScratchDataAccessor
+ typename internals::ConstraintMatrixData<typename MatrixType::value_type>::ScratchDataAccessor
scratch_data;
internals::GlobalRowsFromLocal &global_rows = scratch_data->global_rows;
global_rows.reinit(n_local_row_dofs);
{
Scratch (const ::dealii::hp::FECollection<dim,spacedim> &fe,
const UpdateFlags update_flags,
- const Function<spacedim,number> *coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *coefficient,
const Function<spacedim,number> *rhs_function,
const ::dealii::hp::QCollection<dim> &quadrature,
const ::dealii::hp::MappingCollection<dim,spacedim> &mapping)
update_flags),
coefficient_values(quadrature_collection.max_n_quadrature_points()),
coefficient_vector_values (quadrature_collection.max_n_quadrature_points(),
- dealii::Vector<number> (fe_collection.n_components())),
+ dealii::Vector<typename numbers::NumberTraits<number>::real_type> (fe_collection.n_components())),
rhs_values(quadrature_collection.max_n_quadrature_points()),
rhs_vector_values(quadrature_collection.max_n_quadrature_points(),
dealii::Vector<number> (fe_collection.n_components())),
::dealii::hp::FEValues<dim,spacedim> x_fe_values;
- std::vector<number> coefficient_values;
- std::vector<dealii::Vector<number> > coefficient_vector_values;
- std::vector<number> rhs_values;
- std::vector<dealii::Vector<number> > rhs_vector_values;
+ std::vector<typename numbers::NumberTraits<number>::real_type> coefficient_values;
+ std::vector<dealii::Vector<typename numbers::NumberTraits<number>::real_type> > coefficient_vector_values;
+ std::vector<number> rhs_values;
+ std::vector<dealii::Vector<number> > rhs_vector_values;
- const Function<spacedim,number> *coefficient;
- const Function<spacedim,number> *rhs_function;
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *coefficient;
+ const Function<spacedim,number> *rhs_function;
const UpdateFlags update_flags;
};
template <typename number>
struct CopyData
{
- std::vector<types::global_dof_index> dof_indices;
- FullMatrix<number> cell_matrix;
- dealii::Vector<number> cell_rhs;
- const ConstraintMatrix *constraints;
+ std::vector<types::global_dof_index> dof_indices;
+ FullMatrix<typename numbers::NumberTraits<number>::real_type> cell_matrix;
+ dealii::Vector<number> cell_rhs;
+ const ConstraintMatrix *constraints;
};
}
typename number>
void mass_assembler (const CellIterator &cell,
MatrixCreator::internal::AssemblerData::Scratch<dim,spacedim,number> &data,
- MatrixCreator::internal::AssemblerData::CopyData<number> ©_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 ();
else
{
data.coefficient_vector_values.resize (n_q_points,
- dealii::Vector<number>(n_components));
+ dealii::Vector<typename numbers::NumberTraits<number>::real_type>(n_components));
data.coefficient->vector_value_list (fe_values.get_quadrature_points(),
data.coefficient_vector_values);
}
}
- number add_data;
const std::vector<double> &JxW = fe_values.get_JxW_values();
for (unsigned int i=0; i<dofs_per_cell; ++i)
if (fe.is_primitive ())
const unsigned int component_i =
fe.system_to_component_index(i).first;
const double *phi_i = &fe_values.shape_value(i,0);
- add_data = 0;
// use symmetry in the mass matrix here:
// just need to calculate the diagonal
component_i))
{
const double *phi_j = &fe_values.shape_value(j,0);
- add_data = 0;
+ typename numbers::NumberTraits<number>::real_type add_data = 0;
if (use_coefficient)
{
if (data.coefficient->n_components==1)
if (use_rhs_function)
{
- add_data = 0;
+ number add_data = 0;
if (data.rhs_function->n_components==1)
for (unsigned int point=0; point<n_q_points; ++point)
add_data += data.rhs_values[point] *
// symmetry again
for (unsigned int j=i; j<dofs_per_cell; ++j)
{
- add_data = 0;
+ typename numbers::NumberTraits<number>::real_type add_data = 0;
for (unsigned int comp_i = 0; comp_i < n_components; ++comp_i)
if (fe.get_nonzero_components(i)[comp_i] &&
fe.get_nonzero_components(j)[comp_i])
if (use_rhs_function)
{
- add_data = 0;
+ number add_data = 0;
for (unsigned int comp_i = 0; comp_i < n_components; ++comp_i)
if (fe.get_nonzero_components(i)[comp_i])
{
typename CellIterator>
void laplace_assembler (const CellIterator &cell,
MatrixCreator::internal::AssemblerData::Scratch<dim,spacedim,double> &data,
- MatrixCreator::internal::AssemblerData::CopyData<double> ©_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 ();
CopyData(CopyData const &data);
- unsigned int dofs_per_cell;
- std::vector<types::global_dof_index> dofs;
- std::vector<std::vector<bool> > dof_is_on_face;
- typename DoFHandlerType::active_cell_iterator cell;
- std::vector<FullMatrix<number> > cell_matrix;
- std::vector<Vector<number> > cell_vector;
+ unsigned int dofs_per_cell;
+ std::vector<types::global_dof_index> dofs;
+ std::vector<std::vector<bool> > dof_is_on_face;
+ typename DoFHandlerType::active_cell_iterator cell;
+ std::vector<FullMatrix<typename numbers::NumberTraits<number>::real_type> > cell_matrix;
+ std::vector<Vector<number> > cell_vector;
};
void create_mass_matrix (const Mapping<dim,spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
const ConstraintMatrix &constraints)
{
Assert (matrix.m() == dof.n_dofs(),
static_cast<typename DoFHandler<dim,spacedim>::active_cell_iterator>(dof.end()),
&MatrixCreator::internal::mass_assembler<dim, spacedim, typename DoFHandler<dim,spacedim>::active_cell_iterator,number>,
std::bind(&MatrixCreator::internal::
- copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
+ copy_local_to_global<number,SparseMatrix<typename numbers::NumberTraits<number>::real_type>, Vector<number> >,
std::placeholders::_1, &matrix, &rhs_vector),
assembler_data,
copy_data);
template <int dim, int spacedim, typename number>
void create_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
const ConstraintMatrix &constraints)
{
create_mass_matrix(StaticMappingQ1<dim,spacedim>::mapping,
void create_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
const ConstraintMatrix &constraints)
{
Assert (matrix.m() == dof.n_dofs(),
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,number>,
std::bind (&MatrixCreator::internal::
- copy_local_to_global<number,SparseMatrix<number>, Vector<number> >,
+ copy_local_to_global<number,SparseMatrix<typename numbers::NumberTraits<number>::real_type>, Vector<number> >,
std::placeholders::_1, &matrix, &rhs_vector),
assembler_data,
copy_data);
template <int dim, int spacedim, typename number>
void create_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
const ConstraintMatrix &constraints)
{
create_mass_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
create_boundary_mass_matrix_1 (typename DoFHandler<dim,spacedim>::active_cell_iterator const &cell,
MatrixCreator::internal::AssemblerBoundary::Scratch const &,
MatrixCreator::internal::AssemblerBoundary::CopyData<DoFHandler<dim,
- spacedim>,number > ©_data,
+ spacedim>,number> ©_data,
Mapping<dim, spacedim> const &mapping,
FiniteElement<dim,spacedim> const &fe,
Quadrature<dim-1> const &q,
std::map<types::boundary_id, const Function<spacedim,number>*> const &boundary_functions,
- Function<spacedim,number> const *const coefficient,
+ Function<spacedim,typename numbers::NumberTraits<number>::real_type> const *const coefficient,
std::vector<unsigned int> const &component_mapping)
{
// two variables for the coefficient, one for the two cases
// indicated in the name
- std::vector<number> coefficient_values (fe_values.n_quadrature_points, 1.);
- std::vector<Vector<number> > coefficient_vector_values (fe_values.n_quadrature_points,
- Vector<number>(n_components));
+ std::vector<typename numbers::NumberTraits<number>::real_type> coefficient_values (fe_values.n_quadrature_points, 1.);
+ std::vector<Vector<typename numbers::NumberTraits<number>::real_type> > coefficient_vector_values (fe_values.n_quadrature_points,
+ Vector<typename numbers::NumberTraits<number>::real_type>(n_components));
const bool coefficient_is_vector = (coefficient != nullptr && coefficient->n_components != 1);
std::vector<number> rhs_values_scalar (fe_values.n_quadrature_points);
spacedim>,number > const ©_data,
std::map<types::boundary_id, const Function<spacedim,number>*> const &boundary_functions,
std::vector<types::global_dof_index> const &dof_to_boundary_mapping,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
Vector<number> &rhs_vector)
{
// now transfer cell matrix and vector to the whole boundary matrix
create_boundary_mass_matrix (const Mapping<dim, spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
std::vector<unsigned int> component_mapping)
{
// what would that be in 1d? the
hp::FECollection<dim,spacedim> const &fe_collection,
hp::QCollection<dim-1> const &q,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
- Function<spacedim,number> const *const coefficient,
+ Function<spacedim,typename numbers::NumberTraits<number>::real_type> const *const coefficient,
std::vector<unsigned int> const &component_mapping)
{
const unsigned int n_components = fe_collection.n_components();
// two variables for the coefficient,
// one for the two cases indicated in
// the name
- std::vector<number> coefficient_values;
- std::vector<Vector<number> > coefficient_vector_values;
+ std::vector<typename numbers::NumberTraits<number>::real_type> coefficient_values;
+ std::vector<Vector<typename numbers::NumberTraits<number>::real_type> > coefficient_vector_values;
const bool coefficient_is_vector = (coefficient != nullptr && coefficient->n_components != 1);
// FE has several components
{
coefficient_vector_values.resize (fe_values.n_quadrature_points,
- Vector<number>(n_components));
+ Vector<typename numbers::NumberTraits<number>::real_type>(n_components));
coefficient_values.resize (fe_values.n_quadrature_points, 1.);
rhs_values_system.resize (fe_values.n_quadrature_points,
::CopyData<hp::DoFHandler<dim,spacedim>,number > const ©_data,
std::map<types::boundary_id, const Function<spacedim,number>*> const &boundary_functions,
std::vector<types::global_dof_index> const &dof_to_boundary_mapping,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
Vector<number> &rhs_vector)
{
// now transfer cell matrix and vector to the whole boundary matrix
template <int dim, int spacedim, typename number>
void create_boundary_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &rhs,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const a,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a,
std::vector<unsigned int> component_mapping)
{
create_boundary_mass_matrix(StaticMappingQ1<dim,spacedim>::mapping, dof, q,
create_boundary_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const coefficient,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const coefficient,
std::vector<unsigned int> component_mapping)
{
// what would that be in 1d? the
template <int dim, int spacedim, typename number>
void create_boundary_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &rhs,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const a,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a,
std::vector<unsigned int> component_mapping)
{
create_boundary_mass_matrix(hp::StaticMappingQ1<dim,spacedim>::mapping_collection, dof, q,
void create_mass_matrix (const Mapping<dim, spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
template <int dim, int spacedim, typename number>
void create_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
void create_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
/**
template <int dim, int spacedim, typename number>
void create_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const Function<spacedim,number> &rhs,
Vector<number> &rhs_vector,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
const ConstraintMatrix &constraints = ConstraintMatrix());
void create_boundary_mass_matrix (const Mapping<dim, spacedim> &mapping,
const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const weight = 0,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const weight = 0,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
template <int dim, int spacedim, typename number>
void create_boundary_mass_matrix (const DoFHandler<dim,spacedim> &dof,
const Quadrature<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
/**
void create_boundary_mass_matrix (const hp::MappingCollection<dim,spacedim> &mapping,
const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
/**
template <int dim, int spacedim, typename number>
void create_boundary_mass_matrix (const hp::DoFHandler<dim,spacedim> &dof,
const hp::QCollection<dim-1> &q,
- SparseMatrix<number> &matrix,
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> &matrix,
const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_functions,
Vector<number> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<spacedim,number> *const a = nullptr,
+ const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *const a = nullptr,
std::vector<unsigned int> component_mapping = std::vector<unsigned int>());
/**
#include <deal.II/base/polynomials_piecewise.h>
#include <deal.II/base/qprojector.h>
#include <deal.II/base/quadrature.h>
+#include <deal.II/base/numbers.h>
#include <deal.II/distributed/tria_base.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_cg.h>
+#include <deal.II/lac/solver_gmres.h>
#include <deal.II/lac/vector_memory.h>
#include <deal.II/lac/filtered_matrix.h>
#include <deal.II/lac/constraint_matrix.h>
}
template <typename number>
- void invert_mass_matrix(const SparseMatrix<std::complex<number> > &/*mass_matrix*/,
+ void invert_mass_matrix(const SparseMatrix<number> &/*mass_matrix*/,
const Vector<std::complex<number> > &/*rhs*/,
Vector<std::complex<number> > &/*solution*/)
{
return a > b;
}
+ template <typename number1, typename number2>
+ bool real_part_bigger_than(const number1 a,
+ const std::complex<number2> b)
+ {
+ Assert(std::abs(b.imag()) <= 1e-15*std::abs(b), ExcInternalError());
+ return a > b.real();
+ }
+
+ template <typename number1, typename number2>
+ bool real_part_bigger_than(const std::complex<number1> a,
+ const number2 b)
+ {
+ Assert(std::abs(a.imag()) <= 1e-15*std::abs(a), ExcInternalError());
+ return a.real() > b;
+ }
+
template <typename number1, typename number2>
bool real_part_bigger_than(const std::complex<number1> a,
- const std::complex<number2> &b)
+ const std::complex<number2> b)
{
Assert(std::abs(a.imag()) <= 1e-15*std::abs(a), ExcInternalError());
Assert(std::abs(b.imag()) <= 1e-15*std::abs(b), ExcInternalError());
template <typename number>
void invert_mass_matrix
- (const SparseMatrix<std::complex<number> > &/*mass_matrix*/,
- const FilteredMatrix<Vector<std::complex<number> > > &/*filtered_mass_matrix*/,
- FilteredMatrix<Vector<std::complex<number> > > &/*filtered_preconditioner*/,
- const Vector<std::complex<number> > &/*rhs*/,
- Vector<std::complex<number> > &/*boundary_projection*/)
+ (const SparseMatrix<number> &mass_matrix,
+ const FilteredMatrix<Vector<std::complex<number> > > &filtered_mass_matrix,
+ FilteredMatrix<Vector<std::complex<number> > > &filtered_preconditioner,
+ const Vector<std::complex<number> > &rhs,
+ Vector<std::complex<number> > &boundary_projection)
{
- Assert(false, ExcNotImplemented());
+ Assert (false, ExcInternalError());
}
// make mass matrix and right hand side
- SparseMatrix<number> mass_matrix(sparsity);
+ SparseMatrix<typename numbers::NumberTraits<number>::real_type> mass_matrix(sparsity);
Vector<number> rhs(sparsity.n_rows());
MatrixCreator::create_boundary_mass_matrix (mapping, dof, q,
mass_matrix, boundary_functions,
rhs, dof_to_boundary_mapping,
- (const Function<spacedim,number> *) nullptr,
+ (const Function<spacedim,typename numbers::NumberTraits<number>::real_type> *) nullptr,
component_mapping);
// For certain weird elements,
VectorType &, \
bool , \
std::integral_constant<bool, false>) const
-#define MATRIX_FUNCTIONS(MatrixType) \
+#define MATRIX_FUNCTIONS(MatrixType,VectorScalar) \
template void ConstraintMatrix:: \
- distribute_local_to_global<MatrixType,Vector<MatrixType::value_type> > (const FullMatrix<MatrixType::value_type> &, \
- const Vector<MatrixType::value_type> &, \
+ distribute_local_to_global<MatrixType,Vector<VectorScalar> > (const FullMatrix<MatrixType::value_type> &, \
+ const Vector<VectorScalar> &, \
const std::vector<ConstraintMatrix::size_type> &, \
MatrixType &, \
- Vector<MatrixType::value_type> &, \
+ Vector<VectorScalar> &, \
bool , \
std::integral_constant<bool, false>) const
#define BLOCK_MATRIX_VECTOR_FUNCTIONS(MatrixType, VectorType) \
bool , \
std::integral_constant<bool, true>) const
-MATRIX_FUNCTIONS(SparseMatrix<double>);
-MATRIX_FUNCTIONS(SparseMatrix<float>);
-MATRIX_FUNCTIONS(FullMatrix<double>);
-MATRIX_FUNCTIONS(FullMatrix<float>);
-MATRIX_FUNCTIONS(FullMatrix<std::complex<double> >);
-MATRIX_FUNCTIONS(SparseMatrix<std::complex<double> >);
-MATRIX_FUNCTIONS(SparseMatrix<std::complex<float> >);
+MATRIX_FUNCTIONS(FullMatrix<double>,double);
+MATRIX_FUNCTIONS(FullMatrix<float>,float);
+MATRIX_FUNCTIONS(FullMatrix<double>,std::complex<double>);
+MATRIX_FUNCTIONS(FullMatrix<std::complex<double> >,std::complex<double>);
+
+MATRIX_FUNCTIONS(SparseMatrix<double>,double);
+MATRIX_FUNCTIONS(SparseMatrix<float>,float);
+MATRIX_FUNCTIONS(SparseMatrix<double>,std::complex<double>);
+MATRIX_FUNCTIONS(SparseMatrix<float>,std::complex<float>);
+MATRIX_FUNCTIONS(SparseMatrix<std::complex<double> >,std::complex<double>);
+MATRIX_FUNCTIONS(SparseMatrix<std::complex<float> >,std::complex<float>);
+
+MATRIX_FUNCTIONS(SparseMatrixEZ<double>,double);
+MATRIX_FUNCTIONS(SparseMatrixEZ<float>,float);
+MATRIX_FUNCTIONS(ChunkSparseMatrix<double>,double);
+MATRIX_FUNCTIONS(ChunkSparseMatrix<float>,float);
+
BLOCK_MATRIX_FUNCTIONS(BlockSparseMatrix<double>);
BLOCK_MATRIX_FUNCTIONS(BlockSparseMatrix<float>);
BLOCK_MATRIX_VECTOR_FUNCTIONS(BlockSparseMatrix<double>, BlockVector<double>);
BLOCK_MATRIX_VECTOR_FUNCTIONS(BlockSparseMatrix<float>, BlockVector<float>);
-MATRIX_FUNCTIONS(SparseMatrixEZ<double>);
-MATRIX_FUNCTIONS(SparseMatrixEZ<float>);
-MATRIX_FUNCTIONS(ChunkSparseMatrix<double>);
-MATRIX_FUNCTIONS(ChunkSparseMatrix<float>);
-
// BLOCK_MATRIX_FUNCTIONS(BlockSparseMatrixEZ<double>);
// BLOCK_MATRIX_VECTOR_FUNCTIONS(BlockSparseMatrixEZ<float>, Vector<float>);
#ifdef DEAL_II_WITH_PETSC
-MATRIX_FUNCTIONS(PETScWrappers::SparseMatrix);
-MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix);
+MATRIX_FUNCTIONS(PETScWrappers::SparseMatrix,PetscScalar);
+MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix,PetscScalar);
BLOCK_MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix);
MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::SparseMatrix, PETScWrappers::MPI::Vector);
BLOCK_MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix,PETScWrappers::MPI::BlockVector);
#endif
#ifdef DEAL_II_WITH_TRILINOS
-MATRIX_FUNCTIONS(TrilinosWrappers::SparseMatrix);
+MATRIX_FUNCTIONS(TrilinosWrappers::SparseMatrix,double);
BLOCK_MATRIX_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix);
MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::SparseMatrix, TrilinosWrappers::MPI::Vector);
BLOCK_MATRIX_VECTOR_FUNCTIONS(TrilinosWrappers::BlockSparseMatrix, TrilinosWrappers::MPI::BlockVector);
// constructor of scratch_data (it won't allow one to be constructed in place).
namespace internals
{
-#define SCRATCH_INITIALIZER(Number,Name) \
- ConstraintMatrixData<Number>::ScratchData scratch_data_initializer_##Name; \
- template <> Threads::ThreadLocalStorage<ConstraintMatrixData<Number>::ScratchData> \
- ConstraintMatrixData<Number>::scratch_data(scratch_data_initializer_##Name)
-
- SCRATCH_INITIALIZER(double,double);
- SCRATCH_INITIALIZER(float,float);
- SCRATCH_INITIALIZER(std::complex<double>,cdouble);
- SCRATCH_INITIALIZER(std::complex<float>,cfloat);
+#define SCRATCH_INITIALIZER(MatrixScalar,VectorScalar,Name) \
+ ConstraintMatrixData<MatrixScalar,VectorScalar>::ScratchData scratch_data_initializer_##Name; \
+ template <> Threads::ThreadLocalStorage<ConstraintMatrixData<MatrixScalar,VectorScalar>::ScratchData> \
+ ConstraintMatrixData<MatrixScalar,VectorScalar>::scratch_data(scratch_data_initializer_##Name)
+
+ SCRATCH_INITIALIZER(double,double,dd);
+ SCRATCH_INITIALIZER(float,float,ff);
+ SCRATCH_INITIALIZER(std::complex<double>,std::complex<double>,zz);
+ SCRATCH_INITIALIZER(std::complex<float>,std::complex<float>,cc);
+ SCRATCH_INITIALIZER(double,std::complex<double>,dz);
+ SCRATCH_INITIALIZER(float,std::complex<float>,fc);
#undef SCRATCH_INITIALIZER
}
{
template void ConstraintMatrix::condense<LinearAlgebra::distributed::T<S> >(const LinearAlgebra::distributed::T<S> &, LinearAlgebra::distributed::T<S> &) const;
template void ConstraintMatrix::condense<LinearAlgebra::distributed::T<S> >(LinearAlgebra::distributed::T<S> &vec) const;
- template void ConstraintMatrix::distribute_local_to_global<LinearAlgebra::distributed::T<S> > (
- const Vector<S>&, const std::vector<types::global_dof_index> &, LinearAlgebra::distributed::T<S> &, const FullMatrix<S>&) const;
- template void ConstraintMatrix::distribute_local_to_global<LinearAlgebra::distributed::T<S> > (
- const Vector<S>&, const std::vector<types::global_dof_index> &, const std::vector<types::global_dof_index> &, LinearAlgebra::distributed::T<S> &, const FullMatrix<S>&, bool) const;
- template void ConstraintMatrix::set_zero<LinearAlgebra::distributed::T<S> >(LinearAlgebra::distributed::T<S> &) const;
- template void ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> > > (
- const FullMatrix<S> &, const std::vector< size_type > &, DiagonalMatrix<LinearAlgebra::distributed::T<S> > &) const;
- template void ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> >, LinearAlgebra::distributed::T<S> > (
- const FullMatrix<S> &, const Vector<S>&, const std::vector< size_type > &,
- DiagonalMatrix<LinearAlgebra::distributed::T<S> > &, LinearAlgebra::distributed::T<S>&,
- bool, std::integral_constant<bool, false>) const;
- template void ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> >, T<S> > (
- const FullMatrix<S> &, const Vector<S>&, const std::vector< size_type > &,
- DiagonalMatrix<LinearAlgebra::distributed::T<S> > &, T<S>&,
- bool, std::integral_constant<bool, false>) const;
+
+ template
+ void
+ ConstraintMatrix::distribute_local_to_global<LinearAlgebra::distributed::T<S> >
+ (const Vector<S>&,
+ const std::vector<types::global_dof_index> &,
+ LinearAlgebra::distributed::T<S> &,
+ const FullMatrix<S>&) const;
+
+ template
+ void
+ ConstraintMatrix::distribute_local_to_global<LinearAlgebra::distributed::T<S> >
+ (const Vector<S>&,
+ const std::vector<types::global_dof_index> &,
+ const std::vector<types::global_dof_index> &,
+ LinearAlgebra::distributed::T<S> &,
+ const FullMatrix<S>&,
+ bool) const;
+
+ template
+ void
+ ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> > >
+ (const FullMatrix<S> &,
+ const std::vector< size_type > &,
+ DiagonalMatrix<LinearAlgebra::distributed::T<S> > &) const;
+
+ template
+ void
+ ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> >, LinearAlgebra::distributed::T<S> >
+ (const FullMatrix<S> &,
+ const Vector<S>&,
+ const std::vector< size_type > &,
+ DiagonalMatrix<LinearAlgebra::distributed::T<S> > &,
+ LinearAlgebra::distributed::T<S>&,
+ bool,
+ std::integral_constant<bool, false>) const;
+
+ template
+ void
+ ConstraintMatrix::distribute_local_to_global<DiagonalMatrix<LinearAlgebra::distributed::T<S> >, T<S> >
+ (const FullMatrix<S> &,
+ const Vector<S>&,
+ const std::vector< size_type > &,
+ DiagonalMatrix<LinearAlgebra::distributed::T<S> > &,
+ T<S>&,
+ bool,
+ std::integral_constant<bool, false>) const;
+
+ template
+ void
+ ConstraintMatrix::set_zero<LinearAlgebra::distributed::T<S> >(LinearAlgebra::distributed::T<S> &) const;
}
Tvmult_add (V1<S2> &, const V2<S3> &) const;
}
+for (S1 : REAL_SCALARS; S2, S3 : COMPLEX_SCALARS;
+ V1, V2 : DEAL_II_VEC_TEMPLATES)
+{
+ template void SparseMatrix<S1>::
+ vmult (V1<S2> &, const V2<S3> &) const;
+ template void SparseMatrix<S1>::
+ Tvmult (V1<S2> &, const V2<S3> &) const;
+ template void SparseMatrix<S1>::
+ vmult_add (V1<S2> &, const V2<S3> &) const;
+ template void SparseMatrix<S1>::
+ Tvmult_add (V1<S2> &, const V2<S3> &) const;
+}
+
for (S1 : REAL_SCALARS)
{
template void SparseMatrix<S1>::
// ---------------------------------------------------------------------
+
+// MatrixCreator::create_mass_matrix for the matrix only --> only real-valued scalars
for (scalar: REAL_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
SparseMatrix<scalar> &matrix,
const Function<deal_II_space_dimension,scalar> * const coefficient,
const ConstraintMatrix &constraints);
+
+ // hp versions of functions
template
void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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,
+ (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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
const Function<deal_II_space_dimension,scalar> * const coefficient,
const ConstraintMatrix &constraints);
+
template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
+ void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
+ (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
const Function<deal_II_space_dimension,scalar> * const coefficient,
const ConstraintMatrix &constraints);
#endif
}
-for (scalar: COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+
+// MatrixCreator::create_mass_matrix for matrix + rhs --> real- and complex-valued scalars
+for (scalar: REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
// non-hp version of create_mass_matrix
(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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type> &matrix,
+ const Function<deal_II_space_dimension,scalar> &rhs,
+ Vector<scalar> &rhs_vector,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const coefficient,
const ConstraintMatrix &constraints);
template
void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
(const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
const Quadrature<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type> &matrix,
+ const Function<deal_II_space_dimension,scalar> &rhs,
+ Vector<scalar> &rhs_vector,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const coefficient,
const ConstraintMatrix &constraints);
+
+ // hp version
template
void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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<scalar> &matrix,
+ (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<numbers::NumberTraits<scalar>::real_type> &matrix,
const Function<deal_II_space_dimension,scalar> &rhs,
Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const coefficient,
const ConstraintMatrix &constraints);
+
template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const Quadrature<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
+ void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
+ (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
+ const hp::QCollection<deal_II_dimension> &q,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type> &matrix,
const Function<deal_II_space_dimension,scalar> &rhs,
Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const coefficient,
const ConstraintMatrix &constraints);
#endif
}
-for (scalar: REAL_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
-{
-#if deal_II_dimension <= deal_II_space_dimension
- template
- void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<scalar> &matrix,
- const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*> &rhs,
- Vector<scalar> &rhs_vector,
- std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<deal_II_space_dimension,scalar> * const a,
- std::vector<unsigned int>);
-
- template
- void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension, scalar>
- (const Mapping<deal_II_dimension,deal_II_space_dimension> &,
- const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<scalar> &matrix,
- const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*> &rhs,
- Vector<scalar> &rhs_vector,
- std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<deal_II_space_dimension,scalar> * const a,
- std::vector<unsigned int>);
-
- template
- void
- MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>&,
- const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
- const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<scalar>&,
- const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*>&,
- Vector<scalar>&,
- std::vector<types::global_dof_index>&,
- const Function<deal_II_space_dimension,scalar> * const,
- std::vector<unsigned int>);
-
- template
- void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
- const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<scalar>&,
- const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*>&,
- Vector<scalar>&,
- std::vector<types::global_dof_index>&,
- const Function<deal_II_space_dimension,scalar> * const,
- std::vector<unsigned int>);
-#endif
-}
-
-for (scalar: COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+for (scalar: REAL_AND_COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#if deal_II_dimension <= deal_II_space_dimension
template
void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
(const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<scalar> &matrix,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type> &matrix,
const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*> &rhs,
Vector<scalar> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<deal_II_space_dimension,scalar> * const a,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const a,
std::vector<unsigned int>);
template
(const Mapping<deal_II_dimension,deal_II_space_dimension> &,
const DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
const Quadrature<deal_II_dimension-1> &q,
- SparseMatrix<scalar> &matrix,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type> &matrix,
const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*> &rhs,
Vector<scalar> &rhs_vector,
std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- const Function<deal_II_space_dimension,scalar> * const a,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const a,
std::vector<unsigned int>);
template
(const hp::MappingCollection<deal_II_dimension,deal_II_space_dimension>&,
const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<scalar>&,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type>&,
const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*>&,
Vector<scalar>&,
std::vector<types::global_dof_index>&,
- const Function<deal_II_space_dimension,scalar> * const,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const,
std::vector<unsigned int>);
template
void MatrixCreator::create_boundary_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
(const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension>&,
const hp::QCollection<deal_II_dimension-1>&,
- SparseMatrix<scalar>&,
+ SparseMatrix<numbers::NumberTraits<scalar>::real_type>&,
const std::map<types::boundary_id, const Function<deal_II_space_dimension,scalar>*>&,
Vector<scalar>&,
std::vector<types::global_dof_index>&,
- const Function<deal_II_space_dimension,scalar> * const,
+ const Function<deal_II_space_dimension,numbers::NumberTraits<scalar>::real_type> * const,
std::vector<unsigned int>);
#endif
}
-//TODO[SP]: replace <deal_II_dimension> by <deal_II_dimension, deal_II_space_dimension>
-// where applicable and move to codimension cases above also when applicable
-for (scalar : REAL_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
-{
-// hp versions of functions
-#if deal_II_dimension <= deal_II_space_dimension
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
-#endif
-
-#if deal_II_dimension == deal_II_space_dimension
-
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
-#endif
-}
-
-for (scalar : COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
-{
-// hp versions of functions
-#if deal_II_dimension <= deal_II_space_dimension
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension,deal_II_space_dimension,scalar>
- (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<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
-#endif
-#if deal_II_dimension == deal_II_space_dimension
-
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
- template
- void MatrixCreator::create_mass_matrix<deal_II_dimension, deal_II_space_dimension, scalar>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &dof,
- const hp::QCollection<deal_II_dimension> &q,
- SparseMatrix<scalar> &matrix,
- const Function<deal_II_space_dimension,scalar> &rhs,
- Vector<scalar> &rhs_vector,
- const Function<deal_II_space_dimension,scalar> * const coefficient,
- const ConstraintMatrix &constraints);
-
-#endif
-}
for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
#endif
}
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS; number : REAL_AND_COMPLEX_SCALARS)
{
- namespace VectorTools \{
#if deal_II_dimension == deal_II_space_dimension
+ namespace VectorTools \{
template
void project_boundary_values<deal_II_dimension>
(const Mapping<deal_II_dimension> &,
const DoFHandler<deal_II_dimension> &,
- const std::map<types::boundary_id, const Function<deal_II_dimension,double>*> &,
+ const std::map<types::boundary_id, const Function<deal_II_dimension,number>*> &,
const Quadrature<deal_II_dimension-1>&,
- std::map<types::global_dof_index,double>&, std::vector<unsigned int>);
+ std::map<types::global_dof_index,number>&,
+ std::vector<unsigned int>);
template
void project_boundary_values<deal_II_dimension>
(const DoFHandler<deal_II_dimension> &,
- const std::map<types::boundary_id, const Function<deal_II_dimension,double>*> &,
+ const std::map<types::boundary_id, const Function<deal_II_dimension,number>*> &,
const Quadrature<deal_II_dimension-1>&,
- std::map<types::global_dof_index,double>&,
+ std::map<types::global_dof_index,number>&,
std::vector<unsigned int>);
+ template
+ void project_boundary_values<deal_II_dimension,deal_II_space_dimension>
+ (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &,
+ const std::map<types::boundary_id, const Function<deal_II_dimension,number>*> &,
+ const hp::QCollection<deal_II_dimension-1> &,
+ std::map<types::global_dof_index,number> &,
+ std::vector<unsigned int>);
+
+ \}
+#endif
+}
+
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+{
+ namespace VectorTools \{
+#if deal_II_dimension == deal_II_space_dimension
+
+
template
void project_boundary_values<deal_II_dimension>
(const Mapping<deal_II_dimension> &,
ConstraintMatrix&,
std::vector<unsigned int>);
- template
- void project_boundary_values<deal_II_dimension,deal_II_space_dimension>
- (const hp::DoFHandler<deal_II_dimension,deal_II_space_dimension> &,
- const std::map<types::boundary_id, const Function<deal_II_dimension,double>*> &,
- const hp::QCollection<deal_II_dimension-1> &,
- std::map<types::global_dof_index,double> &,
- std::vector<unsigned int>);
-
-
-
#if deal_II_dimension != 1
template
void project_boundary_values_curl_conforming<deal_II_dimension>