--- /dev/null
+Fixed: The MeshWorker framework can also be used in case dim != spacedim.
+<br>
+(Daniel Arndt, 2017/04/16)
const DHFaceIterator &f,
const unsigned int face_no)
{
- face = static_cast<typename Triangulation<dim>::face_iterator> (f);
+ face = static_cast<typename Triangulation<dim, spacedim>::face_iterator> (f);
face_number = face_no;
sub_number = numbers::invalid_unsigned_int;
}
const unsigned int face_no)
{
if ((cell.state() != IteratorState::valid)
- || cell != typename Triangulation<dim>::cell_iterator(*c))
+ || cell != typename Triangulation<dim, spacedim>::cell_iterator(*c))
get_indices(c);
level_cell = c->is_level_cell();
- cell = typename Triangulation<dim>::cell_iterator(*c);
+ cell = typename Triangulation<dim, spacedim>::cell_iterator(*c);
set_face(f,face_no);
if (block_info)
const unsigned int face_no,
const unsigned int subface_no)
{
- face = static_cast<typename Triangulation<dim>::face_iterator> (f);
+ face = static_cast<typename Triangulation<dim, spacedim>::face_iterator> (f);
face_number = face_no;
sub_number = subface_no;
}
const unsigned int subface_no)
{
if (cell.state() != IteratorState::valid
- || cell != static_cast<typename Triangulation<dim>::cell_iterator> (c))
+ || cell != static_cast<typename Triangulation<dim, spacedim>::cell_iterator> (c))
get_indices(c);
level_cell = c->is_level_cell();
- cell = static_cast<typename Triangulation<dim>::cell_iterator> (c);
+ cell = static_cast<typename Triangulation<dim, spacedim>::cell_iterator> (c);
set_subface(f, face_no, subface_no);
if (block_info)
* one vector for each component, containing vectors with values for each
* quadrature point.
*/
- std::vector<std::vector<std::vector<Tensor<1,dim> > > > gradients;
+ std::vector<std::vector<std::vector<Tensor<1,spacedim> > > > gradients;
/**
* The vector containing the second derivatives of finite element
* one vector for each component, containing vectors with values for each
* quadrature point.
*/
- std::vector<std::vector<std::vector<Tensor<2,dim> > > > hessians;
+ std::vector<std::vector<std::vector<Tensor<2,spacedim> > > > hessians;
/**
* Reinitialize internal data structures for use on a cell.
if (info.sub_number != numbers::invalid_unsigned_int)
{
// This is a subface
- FESubfaceValues<dim> &fe = dynamic_cast<FESubfaceValues<dim>&> (febase);
+ FESubfaceValues<dim,spacedim> &fe = dynamic_cast<FESubfaceValues<dim,spacedim>&> (febase);
fe.reinit(info.cell, info.face_number, info.sub_number);
}
else if (info.face_number != numbers::invalid_unsigned_int)
{
// This is a face
- FEFaceValues<dim> &fe = dynamic_cast<FEFaceValues<dim>&> (febase);
+ FEFaceValues<dim,spacedim> &fe = dynamic_cast<FEFaceValues<dim,spacedim>&> (febase);
fe.reinit(info.cell, info.face_number);
}
else
ASSEMBLER &assembler,
const LoopControl &lctrl = LoopControl())
{
- std::function<void (DoFInfo<dim>&, IntegrationInfo<dim, spacedim>&)> cell_worker;
- std::function<void (DoFInfo<dim>&, IntegrationInfo<dim, spacedim>&)> boundary_worker;
- std::function<void (DoFInfo<dim> &, DoFInfo<dim> &,
+ std::function<void (DoFInfo<dim, spacedim>&, IntegrationInfo<dim, spacedim>&)> cell_worker;
+ std::function<void (DoFInfo<dim, spacedim>&, IntegrationInfo<dim, spacedim>&)> boundary_worker;
+ std::function<void (DoFInfo<dim, spacedim>&, DoFInfo<dim, spacedim> &,
IntegrationInfo<dim, spacedim> &,
IntegrationInfo<dim, spacedim> &)> face_worker;
if (integrator.use_cell)
*/
virtual void fill(
std::vector<std::vector<std::vector<Number> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,Number> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,Number> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,Number> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,Number> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const std::vector<types::global_dof_index> &index,
const unsigned int component,
*/
virtual void mg_fill(
std::vector<std::vector<std::vector<Number> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,Number> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,Number> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,Number> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,Number> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const unsigned int level,
const std::vector<types::global_dof_index> &index,
virtual void fill(
std::vector<std::vector<std::vector<typename VectorType::value_type> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const std::vector<types::global_dof_index> &index,
const unsigned int component,
virtual void mg_fill(
std::vector<std::vector<std::vector<typename VectorType::value_type> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const unsigned int level,
const std::vector<types::global_dof_index> &index,
void
VectorDataBase<dim, spacedim, Number>::fill(
std::vector<std::vector<std::vector<Number> > > &,
- std::vector<std::vector<std::vector<Tensor<1,dim,Number> > > > &,
- std::vector<std::vector<std::vector<Tensor<2,dim,Number> > > > &,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,Number> > > > &,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,Number> > > > &,
const FEValuesBase<dim,spacedim> &,
const std::vector<types::global_dof_index> &,
const unsigned int,
void
VectorDataBase<dim, spacedim, Number>::mg_fill(
std::vector<std::vector<std::vector<Number> > > &,
- std::vector<std::vector<std::vector<Tensor<1,dim,Number> > > > &,
- std::vector<std::vector<std::vector<Tensor<2,dim,Number> > > > &,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,Number> > > > &,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,Number> > > > &,
const FEValuesBase<dim,spacedim> &,
const unsigned int,
const std::vector<types::global_dof_index> &,
void
VectorData<VectorType, dim, spacedim>::fill(
std::vector<std::vector<std::vector<typename VectorType::value_type> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const std::vector<types::global_dof_index> &index,
const unsigned int component,
for (unsigned int i=0; i<this->n_gradients(); ++i)
{
const VectorType *src = data.read_ptr<VectorType>(this->gradient_index(i));
- VectorSlice<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > dst(gradients[i], component, n_comp);
+ VectorSlice<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > dst(gradients[i], component, n_comp);
fe.get_function_gradients(*src, make_slice(index, start, size), dst, true);
}
for (unsigned int i=0; i<this->n_hessians(); ++i)
{
const VectorType *src = data.read_ptr<VectorType>(this->hessian_index(i));
- VectorSlice<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > dst(hessians[i], component, n_comp);
+ VectorSlice<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > dst(hessians[i], component, n_comp);
fe.get_function_hessians(*src, make_slice(index, start, size), dst, true);
}
}
void
VectorData<VectorType, dim, spacedim>::mg_fill
(std::vector<std::vector<std::vector<typename VectorType::value_type> > > &values,
- std::vector<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > &gradients,
- std::vector<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > &hessians,
+ std::vector<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > &gradients,
+ std::vector<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > &hessians,
const FEValuesBase<dim,spacedim> &fe,
const unsigned int level,
const std::vector<types::global_dof_index> &index,
for (unsigned int i=0; i<this->n_gradients(); ++i)
{
const MGLevelObject<VectorType> *src = data.read_ptr<MGLevelObject<VectorType> >(this->value_index(i));
- VectorSlice<std::vector<std::vector<Tensor<1,dim,typename VectorType::value_type> > > > dst(gradients[i], component, n_comp);
+ VectorSlice<std::vector<std::vector<Tensor<1,spacedim,typename VectorType::value_type> > > > dst(gradients[i], component, n_comp);
fe.get_function_gradients((*src)[level], make_slice(index, start, size), dst, true);
}
for (unsigned int i=0; i<this->n_hessians(); ++i)
{
const MGLevelObject<VectorType> *src = data.read_ptr<MGLevelObject<VectorType> >(this->value_index(i));
- VectorSlice<std::vector<std::vector<Tensor<2,dim,typename VectorType::value_type> > > > dst(hessians[i], component, n_comp);
+ VectorSlice<std::vector<std::vector<Tensor<2,spacedim,typename VectorType::value_type> > > > dst(hessians[i], component, n_comp);
fe.get_function_hessians((*src)[level], make_slice(index, start, size), dst, true);
}
}
// ---------------------------------------------------------------------
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
namespace MeshWorker
\{
- template class IntegrationInfo<deal_II_dimension, deal_II_dimension>;
- template class IntegrationInfoBox<deal_II_dimension, deal_II_dimension>;
+#if deal_II_dimension <= deal_II_space_dimension
+ template class IntegrationInfo<deal_II_dimension, deal_II_space_dimension>;
+ template class IntegrationInfoBox<deal_II_dimension, deal_II_space_dimension>;
- template class DoFInfo<deal_II_dimension,deal_II_dimension,float>;
+ template class DoFInfo<deal_II_dimension, deal_II_space_dimension,float>;
template class DoFInfoBox<deal_II_dimension,
- DoFInfo<deal_II_dimension,deal_II_dimension,float> >;
+ DoFInfo<deal_II_dimension, deal_II_space_dimension,float> >;
- template void IntegrationInfo<deal_II_dimension>::fill_local_data(
- const DoFInfo<deal_II_dimension, deal_II_dimension, float>&, bool);
+ template void IntegrationInfo<deal_II_dimension, deal_II_space_dimension>::fill_local_data(
+ const DoFInfo<deal_II_dimension, deal_II_space_dimension, float>&, bool);
- template class DoFInfo<deal_II_dimension,deal_II_dimension,double>;
+ template class DoFInfo<deal_II_dimension, deal_II_space_dimension,double>;
template class DoFInfoBox<deal_II_dimension,
- DoFInfo<deal_II_dimension,deal_II_dimension,double> >;
+ DoFInfo<deal_II_dimension, deal_II_space_dimension,double> >;
- template void IntegrationInfo<deal_II_dimension>::fill_local_data(
- const DoFInfo<deal_II_dimension, deal_II_dimension, double>&, bool);
-
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FEValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FEValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FEFaceValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FEFaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
-// template void IntegrationInfo<deal_II_dimension>
-// ::initialize<FESubfaceValues<deal_II_dimension> >(
-// const FiniteElement<deal_II_dimension>&, const Mapping<deal_II_dimension>&,
-// const Quadrature<FESubfaceValues<deal_II_dimension>::integral_dimension>&, const UpdateFlags, const BlockInfo*);
+ template void IntegrationInfo<deal_II_dimension, deal_II_space_dimension>::fill_local_data(
+ const DoFInfo<deal_II_dimension, deal_II_space_dimension, double>&, bool);
+#endif
\}
}
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
namespace MeshWorker
\{
- template class VectorDataBase<deal_II_dimension>;
+#if deal_II_dimension <= deal_II_space_dimension
+ template class VectorDataBase<deal_II_dimension, deal_II_space_dimension>;
+#endif
\}
}
-for (VECTOR : SERIAL_VECTORS ; deal_II_dimension : DIMENSIONS)
+for (VECTOR : SERIAL_VECTORS; deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
{
namespace MeshWorker
\{
- template class VectorData<VECTOR,deal_II_dimension>;
- template class VectorData<const VECTOR,deal_II_dimension>;
- template class MGVectorData<VECTOR,deal_II_dimension>;
- template class MGVectorData<const VECTOR,deal_II_dimension>;
+#if deal_II_dimension <= deal_II_space_dimension
+ template class VectorData<VECTOR, deal_II_dimension, deal_II_space_dimension>;
+ template class VectorData<const VECTOR, deal_II_dimension, deal_II_space_dimension>;
+ template class MGVectorData<VECTOR, deal_II_dimension, deal_II_space_dimension>;
+ template class MGVectorData<const VECTOR, deal_II_dimension, deal_II_space_dimension>;
+#endif
\}
}