*/
bool preserves_vertex_locations () const;
-
- /**
- * Exception
- */
- DeclException0 (ExcWrongNoOfComponents);
-
- /**
- * Exception.
- */
- DeclException2 (ExcWrongVectorSize,
- int, int,
- << "Vector has wrong size " << arg1
- << ", expected size " << arg2);
-
/**
* Exception.
*/
* Reference to the vector of
* shifts.
*/
- const VECTOR &euler_transform_vectors;
+ SmartPointer<const VECTOR, MappingQ1Eulerian<dim,VECTOR,spacedim> > euler_transform_vectors;
/**
* Pointer to the DoFHandler to
* which the mapping vector is
* associated.
*/
- const SmartPointer<const DoFHandler<dim,spacedim>,MappingQ1Eulerian<dim,VECTOR,spacedim> > shiftmap_dof_handler;
+ SmartPointer<const DoFHandler<dim,spacedim>,MappingQ1Eulerian<dim,VECTOR,spacedim> > shiftmap_dof_handler;
private:
* locations).
*/
bool preserves_vertex_locations () const;
-
- /**
- * Exception
- */
-
- DeclException0 (ExcWrongNoOfComponents);
-
+
/**
* Exception
*/
-
DeclException0 (ExcInactiveCell);
-
- /**
- * Exception
- */
-
- DeclException2 (ExcWrongVectorSize, int, int,
- << "Vector has wrong size " << arg1
- << "-- expected size " << arg2);
-
+
protected:
/**
* Implementation of the interface in
* shifts.
*/
- const VECTOR &euler_vector;
+ SmartPointer<const VECTOR, MappingQEulerian<dim,VECTOR,spacedim> > euler_vector;
/**
* Pointer to the DoFHandler to
* associated.
*/
- const SmartPointer<const DoFHandler<dim,spacedim>,MappingQEulerian<dim,VECTOR,spacedim> > euler_dof_handler;
+ SmartPointer<const DoFHandler<dim,spacedim>,MappingQEulerian<dim,VECTOR,spacedim> > euler_dof_handler;
private:
MappingQ1Eulerian (const EulerVectorType &euler_transform_vectors,
const DoFHandler<dim,spacedim> &shiftmap_dof_handler)
:
- euler_transform_vectors(euler_transform_vectors),
- shiftmap_dof_handler(&shiftmap_dof_handler, typeid(*this).name())
+ euler_transform_vectors(&euler_transform_vectors),
+ shiftmap_dof_handler(&shiftmap_dof_handler)
{}
// *before* the mapping object is
// constructed, which is not
// necessarily what we want.
- Assert (spacedim == shiftmap_dof_handler->get_fe().n_dofs_per_vertex(),
- ExcWrongNoOfComponents());
- Assert (shiftmap_dof_handler->get_fe().n_components() == spacedim,
- ExcWrongNoOfComponents());
- Assert (shiftmap_dof_handler->n_dofs() == euler_transform_vectors.size(),
- ExcWrongVectorSize(euler_transform_vectors.size(),
- shiftmap_dof_handler->n_dofs()));
+//TODO: Only one of these two assertions should be relevant
+ AssertDimension (spacedim, shiftmap_dof_handler->get_fe().n_dofs_per_vertex());
+ AssertDimension(shiftmap_dof_handler->get_fe().n_components(), spacedim);
+
+ AssertDimension (shiftmap_dof_handler->n_dofs(), euler_transform_vectors->size());
// cast the
// Triangulation<dim>::cell_iterator
// now get the values of the shift
// vectors at the vertices
Vector<double> mapping_values (shiftmap_dof_handler->get_fe().dofs_per_cell);
- dof_cell->get_dof_values (euler_transform_vectors, mapping_values);
+ dof_cell->get_dof_values (*euler_transform_vectors, mapping_values);
for (unsigned int i=0; i<GeometryInfo<dim>::vertices_per_cell; ++i)
// 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
const DoFHandler<dim,spacedim> &euler_dof_handler)
:
MappingQ<dim,spacedim>(degree, true),
- euler_vector(euler_vector),
- euler_dof_handler(&euler_dof_handler, typeid(*this).name()),
+ euler_vector(&euler_vector),
+ euler_dof_handler(&euler_dof_handler),
support_quadrature(degree),
fe_values(euler_dof_handler.get_fe(),
support_quadrature,
MappingQEulerian<dim, EulerVectorType, spacedim>::clone () const
{
return new MappingQEulerian<dim,EulerVectorType,spacedim>(this->get_degree(),
- euler_vector,
+ *euler_vector,
*euler_dof_handler);
}
// with respect to vector size,
const unsigned int n_dofs = euler_dof_handler->n_dofs();
- const unsigned int vector_size = euler_vector.size();
+ const unsigned int vector_size = euler_vector->size();
- Assert (n_dofs == vector_size,ExcWrongVectorSize(vector_size,n_dofs));
+ AssertDimension(vector_size,n_dofs);
// we then transform our tria iterator
// into a dof iterator so we can
const unsigned int n_support_pts = support_quadrature.n_quadrature_points;
const unsigned int n_components = euler_dof_handler->get_fe().n_components();
- Assert (n_components >= spacedim, ExcWrongNoOfComponents() );
+ Assert (n_components >= spacedim, ExcDimensionMismatch(n_components, spacedim) );
std::vector<Vector<double> > shift_vector(n_support_pts,Vector<double>(n_components));
// threads
Threads::ThreadMutex::ScopedLock lock(fe_values_mutex);
fe_values.reinit(dof_cell);
- fe_values.get_function_values(euler_vector,shift_vector);
+ fe_values.get_function_values(*euler_vector, shift_vector);
// and finally compute the positions of the
// support points in the deformed