/*@{*/
-// parametric version of P1 Nonconforming FE
-class FE_P1NCParametric : public FiniteElement<2,2>
-{
-private:
-
-
- static
- std::vector<ComponentMask>
- get_nonzero_component();
-
-
- /**
- * Return the vector consists of the numbers of degrees of freedom per objects.
- */
- static
- std::vector<unsigned int>
- get_dpo_vector ();
-
-
- class InternalData : public FiniteElement<2,2>::InternalDataBase
- {
- public:
-
- Table<2,double > shape_values;
- Table<2,Tensor<1,2> > shape_gradients;
- mutable std::vector<Tensor<1,2> > transformed_shape_gradients ;
- Table<2,Tensor<2,2> > shape_hessians;
- };
-
- /**
- * Compute the data on the reference domain.
- */
-virtual FiniteElement<2,2>::InternalDataBase *
- get_data (const UpdateFlags update_flags,
- const Mapping<2,2> &,
- const Quadrature<2> &,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const ;
-
-
-
-
-/**
- * Compute the data on the current cell.
- */
- virtual
- void
- fill_fe_values (const Triangulation<2,2>::cell_iterator &cell,
- const CellSimilarity::Similarity ,
- const Quadrature<2> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &,
- const internal::FEValues::MappingRelatedData<2,2> &mapping_data,
- const FiniteElement<2,2>::InternalDataBase &fe_internal,
- internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const;
-
-
-
-
- /**
- * Compute the data on the face of the current cell.
- */
- virtual
- void
- fill_fe_face_values (const Triangulation<2,2>::cell_iterator &cell,
- const unsigned int face_no,
- const Quadrature<1> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &mapping_internal,
- const dealii::internal::FEValues::MappingRelatedData<2,2> &mapping_data,
- const InternalDataBase &fe_internal,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const;
-
-
-
-
- /**
- * Compute the data on the subface of the current cell.
- */
- virtual
- void
- fill_fe_subface_values (const Triangulation<2,2>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int sub_no,
- const Quadrature<1> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &mapping_internal,
- const dealii::internal::FEValues::MappingRelatedData<2,2> &mapping_data,
- const InternalDataBase &fe_internal,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const;
-
-
-
-public:
- /**
- * Constructor for parametric version of P1 nonconforming element.
- */
- FE_P1NCParametric() ;
-
-
- /**
- * Return the name of the class for the element.
- */
- virtual std::string get_name () const ;
-
- /**
- * Return the update flags which are needed.
- */
- virtual UpdateFlags requires_update_flags (const UpdateFlags flags) const ;
-
- /**
- * Return the unit face support points.
- */
- const std::vector<Point<1> > &get_unit_face_support_points () const ;
-
- /**
- * Return the unit face support point with given index.
- */
- Point<1> unit_face_support_point (const unsigned index) const ;
-
- bool has_face_support_points () const ;
-
- /**
- * Copy constructor.
- */
- virtual FiniteElement<2,2> *clone () const ;
-
- /**
- * Destructor.
- */
- virtual ~FE_P1NCParametric ();
-
-
-
-
- /**
- * The value of the basis function with index i at given point.
- */
- virtual double shape_value (const unsigned int i,
- const Point<2> &p) const ;
-
- /**
- * The gradient of the basis function with index i at given point.
- */
- virtual Tensor<1,2> shape_grad (const unsigned int i,
- const Point<2> &p) const ;
-
- /**
- * The Hessian matrix of the basis function with index i at given point.
- * Notice that it always returns the trivial matrix because the element space contains polynomials upto the degree 1.
- */
- virtual Tensor<2,2> shape_grad_grad (const unsigned int i,
- const Point<2> &p) const ;
-
-
-protected:
-
- /**
- * Create the constraints matrix for hanging edges.
- */
- void initialize_constraints () ;
-
-};
-
-
-
-
-
-
-
-
-
-
-// Nonparametric version of P1 Nonconforming FE
-class FE_P1NCNonparametric : public FiniteElement<2,2>
+class FE_P1NC : public FiniteElement<2,2>
{
private:
/**
* Constructor for nonparametric version of P1 nonconforming element.
*/
- FE_P1NCNonparametric() ;
+ FE_P1NC() ;
/**
* Return the name of the class for the element.
/**
* Destructor.
*/
- virtual ~FE_P1NCNonparametric ();
+ virtual ~FE_P1NC ();
protected:
DEAL_II_NAMESPACE_OPEN
-// FE_P1NCParametric
-
-std::vector<ComponentMask>
-FE_P1NCParametric::get_nonzero_component()
-{
- const unsigned int dofs_per_cell = 4;
- std::vector<ComponentMask> masks (dofs_per_cell);
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- masks[i] = ComponentMask(1,true);
- return masks;
-}
-
-
-std::vector<unsigned int>
-FE_P1NCParametric::get_dpo_vector ()
-{
- std::vector<unsigned int> dpo(3);
- dpo[0] = 1; // dofs per object: vertex
- dpo[1] = 0; // line
- dpo[2] = 0; // quad
- return dpo;
-}
-
-
-FiniteElement<2,2>::InternalDataBase *
-FE_P1NCParametric::get_data (const UpdateFlags update_flags,
- const Mapping<2,2> &,
- const Quadrature<2> &quadrature,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &) const
-{
-
- InternalData *data = new InternalData;
-
-
- data->update_each = requires_update_flags(update_flags);
-
- const UpdateFlags flags(data->update_each);
- const unsigned int n_q_points = quadrature.size();
-
-
- // initialize shape value
- if (flags & update_values)
- data->shape_values.reinit (this->dofs_per_cell,
- n_q_points);
-
- // initialize shape gradient
- if (flags & update_gradients)
- {
- data->shape_gradients.reinit (this->dofs_per_cell,
- n_q_points);
- data->transformed_shape_gradients.resize (n_q_points);
- }
-
-
- // update
- if (flags & (update_values | update_gradients))
- for (unsigned int i=0; i<n_q_points; ++i)
- {
- if (flags & update_values)
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- data->shape_values[k][i] = shape_value(k,quadrature.point(i));
- }
-
-
- if (flags & update_gradients)
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- data->shape_gradients[k][i] = shape_grad(k,quadrature.point(i));
- }
-
- }
-
-
- // initialize shape hessian
- if (flags & update_hessians)
- data->shape_hessians.reinit (this->dofs_per_cell,
- n_q_points);
- // update
- if (flags & update_hessians)
- for (unsigned int i=0; i<n_q_points; ++i)
- {
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- data->shape_hessians[k][i] = shape_grad_grad(k,quadrature.point(i));
- }
- }
-
-
- return data;
-
-}
-
-
-void
-FE_P1NCParametric::fill_fe_values (const Triangulation<2,2>::cell_iterator &,
- const CellSimilarity::Similarity cell_similarity,
- const Quadrature<2> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &mapping_internal,
- const internal::FEValues::MappingRelatedData<2,2> &mapping_data,
- const FiniteElement<2,2>::InternalDataBase &fe_internal,
- internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const
-
-{
-
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
- const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
-
- const UpdateFlags flags(fe_data.update_each);
-
- // std::cout<<" ? Flag ? "
- // << (flags)
- // <<std::endl;
-
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- // shape value
- if (flags & update_values)
- for (unsigned int i=0; i<quadrature.size(); ++i)
- output_data.shape_values(k,i) = fe_data.shape_values[k][i];
-
-
- // shape gradient
- if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
- mapping.transform(make_array_view(fe_data.shape_gradients, k),
- mapping_covariant,
- mapping_internal,
- make_array_view(output_data.shape_gradients, k));
-
- }
-
-
- // shape hessian
- if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
- {
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- mapping.transform (make_array_view(fe_data.shape_hessians, k),
- mapping_covariant_gradient,
- mapping_internal,
- make_array_view(output_data.shape_hessians, k));
-
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- for (unsigned int i=0; i<quadrature.size(); ++i)
- for (unsigned int j=0; j<2; ++j)
- output_data.shape_hessians[k][i] -=
- mapping_data.jacobian_pushed_forward_grads[i][j]
- * output_data.shape_gradients[k][i][j];
- }
-
-}
-
-
-void
-FE_P1NCParametric::fill_fe_face_values (const Triangulation<2,2>::cell_iterator &cell,
- const unsigned int face_no,
- const Quadrature<1> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &mapping_internal,
- const dealii::internal::FEValues::MappingRelatedData<2,2> &,
- const InternalDataBase &fe_internal,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const
-
-
-{
-
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
- const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
-
-
- const QProjector<2>::DataSetDescriptor offset
- = QProjector<2>::DataSetDescriptor::face (face_no,
- cell->face_orientation(face_no),
- cell->face_flip(face_no),
- cell->face_rotation(face_no),
- quadrature.size());
-
- const UpdateFlags flags(fe_data.update_each);
-
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- if (flags & update_values)
- for (unsigned int i=0; i<quadrature.size(); ++i)
- output_data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
-
- if (flags & update_gradients)
- {
- const ArrayView<Tensor<1,2> > transformed_shape_gradients
- = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
-
- mapping.transform(make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
- mapping_covariant,
- mapping_internal,
- transformed_shape_gradients);
-
- for (unsigned int i=0; i<quadrature.size(); ++i)
- output_data.shape_gradients(k,i) = transformed_shape_gradients[i] ;
- }
- }
-
-
-}
-
-
-
-
-
-
-void
-FE_P1NCParametric::fill_fe_subface_values (const Triangulation<2,2>::cell_iterator &cell,
- const unsigned int face_no,
- const unsigned int sub_no,
- const Quadrature<1> &quadrature,
- const Mapping<2,2> &mapping,
- const Mapping<2,2>::InternalDataBase &mapping_internal,
- const dealii::internal::FEValues::MappingRelatedData<2,2> &,
- const InternalDataBase &fe_internal,
- dealii::internal::FEValues::FiniteElementRelatedData<2,2> &output_data) const
-
-{
-
- Assert (dynamic_cast<const InternalData *> (&fe_internal) != 0, ExcInternalError());
- const InternalData &fe_data = static_cast<const InternalData &> (fe_internal);
-
-
-
- const QProjector<2>::DataSetDescriptor offset
- = QProjector<2>::DataSetDescriptor::subface (face_no, sub_no,
- cell->face_orientation(face_no),
- cell->face_flip(face_no),
- cell->face_rotation(face_no),
- quadrature.size(),
- cell->subface_case(face_no));
-
- const UpdateFlags flags(fe_data.update_each);
-
- for (unsigned int k=0; k<this->dofs_per_cell; ++k)
- {
- if (flags & update_values)
- for (unsigned int i=0; i<quadrature.size(); ++i)
- output_data.shape_values(k,i) = fe_data.shape_values[k][i+offset];
-
- if (flags & update_gradients)
- {
- const ArrayView<Tensor<1,2> > transformed_shape_gradients
- = make_array_view(fe_data.transformed_shape_gradients, offset, quadrature.size());
-
- mapping.transform(make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
- mapping_covariant,
- mapping_internal,
- transformed_shape_gradients);
-
- for (unsigned int i=0; i<quadrature.size(); ++i)
- output_data.shape_gradients(k,i) = transformed_shape_gradients[i] ;
- }
-
- }
-
-}
-
-
-FE_P1NCParametric::FE_P1NCParametric()
- :
- FiniteElement<2,2>(FiniteElementData<2>(get_dpo_vector(),
- 1,
- 1,
- FiniteElementData<2>::L2),
- std::vector<bool> (1, false),
- get_nonzero_component())
-{
-
- // support points: 4 vertices
- unit_support_points.resize(4) ;
- unit_support_points[0][0] = 0.0 ;
- unit_support_points[0][1] = 0.0 ;
- unit_support_points[1][0] = 1.0 ;
- unit_support_points[1][1] = 0.0 ;
- unit_support_points[2][0] = 0.0 ;
- unit_support_points[2][1] = 1.0 ;
- unit_support_points[3][0] = 1.0 ;
- unit_support_points[3][1] = 1.0 ;
-
- // face support points: 2 end vertices
- unit_face_support_points.resize(2);
- unit_face_support_points[0][0] = 0.0 ;
- unit_face_support_points[1][0] = 1.0 ;
-
-
- // constraints matrix initialization
- initialize_constraints () ;
-}
-
-
-
-std::string FE_P1NCParametric::get_name () const
-{
- return "FE_P1NCParametric";
-}
-
-
-
-UpdateFlags FE_P1NCParametric::requires_update_flags (const UpdateFlags flags) const
-{
- UpdateFlags out = update_default;
-
- if (flags & update_values)
- out |= update_values;
- if (flags & update_gradients)
- out |= update_gradients | update_covariant_transformation;
- if (flags & update_cell_normal_vectors)
- out |= update_cell_normal_vectors | update_JxW_values;
- if (flags & update_hessians)
- out |= update_hessians | update_gradients | update_covariant_transformation | update_jacobian_pushed_forward_grads;
-
- return out;
-}
-
-
-const std::vector<Point<1> > &FE_P1NCParametric::get_unit_face_support_points () const
-{
-
- Assert ((unit_face_support_points.size() == 0) ||
- (unit_face_support_points.size() == this->dofs_per_face),
- ExcInternalError());
- return unit_face_support_points;
-}
-
-Point<1> FE_P1NCParametric::unit_face_support_point (const unsigned index) const
-{
- Assert (index < this->dofs_per_face,
- ExcIndexRange (index, 0, this->dofs_per_face));
- Assert (unit_face_support_points.size() == this->dofs_per_face,
- ExcFEHasNoSupportPoints ());
- return unit_face_support_points[index];
-}
-
-bool FE_P1NCParametric::has_face_support_points () const
-{
- return (unit_face_support_points.size() != 0);
-}
-
-FiniteElement<2,2> *FE_P1NCParametric::clone () const
-{
- return new FE_P1NCParametric(*this);
-}
-
-FE_P1NCParametric::~FE_P1NCParametric () {}
-
-// Define the exact value of the shape function for the P1NC scalar
-// function in the unit cell = (0,1)^2.
-//
-// 2-----------------|------------------3
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// - -
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// | |
-// 0-----------------|------------------1
-//
-
-
-double FE_P1NCParametric::shape_value (const unsigned int i,
- const Point<2> &p) const
-{
-
-
- double value = 0.0 ;
-
- // P1NC with a half value
- switch (i)
- {
- case 0:
- value = -p[0]-p[1]+1.5 ;
- break ;
- case 1:
- value = p[0]-p[1]+0.5 ;
- break ;
- case 2:
- value = -p[0]+p[1]+0.5 ;
- break ;
- case 3:
- value = p[0]+p[1]-0.5 ;
- break ;
- default:
- value = 0.0 ;
- };
-
- return value*0.5 ;
-
-}
-
-
-
-
-Tensor<1,2> FE_P1NCParametric::shape_grad (const unsigned int i,
- const Point<2> &p) const
-{
- Tensor<1,2> grad ;
-
-
- // P1NC with a half value
- switch (i)
- {
- case 0:
- grad[0] = -1.0 ;
- grad[1] = -1.0 ;
- break ;
- case 1:
- grad[0] = 1.0 ;
- grad[1] = -1.0 ;
- break ;
- case 2:
- grad[0] = -1.0 ;
- grad[1] = 1.0 ;
- break ;
- case 3:
- grad[0] = 1.0 ;
- grad[1] = 1.0 ;
- break ;
- default:
- grad = 0.0 ;
- };
-
- return grad*0.5 ;
-
-}
-
-
-Tensor<2,2> FE_P1NCParametric::shape_grad_grad (const unsigned int i,
- const Point<2> &p) const
-{
- Tensor<2,2> grad_grad ;
-
-
- switch (i)
- {
- case 0:
- grad_grad[0][0] = 0.0 ;
- grad_grad[0][1] = 0.0 ;
- grad_grad[1][0] = 0.0 ;
- grad_grad[1][1] = 0.0 ;
- return grad_grad ;
- case 1:
- grad_grad[0][0] = 0.0 ;
- grad_grad[0][1] = 0.0 ;
- grad_grad[1][0] = 0.0 ;
- grad_grad[1][1] = 0.0 ;
- return grad_grad ;
- case 2:
- grad_grad[0][0] = 0.0 ;
- grad_grad[0][1] = 0.0 ;
- grad_grad[1][0] = 0.0 ;
- grad_grad[1][1] = 0.0 ;
- return grad_grad ;
- case 3:
- grad_grad[0][0] = 0.0 ;
- grad_grad[0][1] = 0.0 ;
- grad_grad[1][0] = 0.0 ;
- grad_grad[1][1] = 0.0 ;
- return grad_grad ;
- default:
- return grad_grad ;
- };
-
-}
-
-
-void FE_P1NCParametric::initialize_constraints ()
-{
-
- std::vector<Point<1> > constraint_points;
- // Add midpoint
- constraint_points.push_back (Point<1> (0.5));
-
- interface_constraints
- .TableBase<2,double>::reinit (interface_constraints_size());
-
-
- interface_constraints(0,0) = 0.5 ;
- interface_constraints(0,1) = 0.5 ;
-
-}
-
-
-
-
-
-
-
-
-// FE_P1NCNonparametric
-
std::vector<ComponentMask>
-FE_P1NCNonparametric::get_nonzero_component()
+FE_P1NC::get_nonzero_component()
{
const unsigned int dofs_per_cell = 4;
std::vector<ComponentMask> masks (dofs_per_cell);
std::vector<unsigned int>
-FE_P1NCNonparametric::get_dpo_vector ()
+FE_P1NC::get_dpo_vector ()
{
std::vector<unsigned int> dpo(3);
dpo[0] = 1; // dofs per object: vertex
FiniteElement<2,2>::InternalDataBase *
-FE_P1NCNonparametric::get_data (const UpdateFlags update_flags,
+FE_P1NC::get_data (const UpdateFlags update_flags,
const Mapping<2,2> &,
const Quadrature<2> &,
dealii::internal::FEValues::FiniteElementRelatedData<2,2> &) const
void
-FE_P1NCNonparametric::fill_fe_values (const Triangulation<2,2>::cell_iterator &cell,
+FE_P1NC::fill_fe_values (const Triangulation<2,2>::cell_iterator &cell,
const CellSimilarity::Similarity ,
const Quadrature<2> &quadrature,
const Mapping<2,2> &mapping,
void
-FE_P1NCNonparametric::fill_fe_face_values (const Triangulation<2,2>::cell_iterator &cell,
+FE_P1NC::fill_fe_face_values (const Triangulation<2,2>::cell_iterator &cell,
const unsigned int face_no,
const Quadrature<1> &quadrature,
const Mapping<2,2> &mapping,
void
-FE_P1NCNonparametric::fill_fe_subface_values (const Triangulation<2,2>::cell_iterator &cell,
+FE_P1NC::fill_fe_subface_values (const Triangulation<2,2>::cell_iterator &cell,
const unsigned int face_no,
const unsigned int sub_no,
const Quadrature<1> &quadrature,
-FE_P1NCNonparametric::FE_P1NCNonparametric()
+FE_P1NC::FE_P1NC()
:
FiniteElement<2,2>(FiniteElementData<2>(get_dpo_vector(),
1,
unit_face_support_points[1][0] = 1.0 ;
- // CONSTRAINTS MATRIX INITIALIZATION
+ // initialize constraints matrix
initialize_constraints () ;
}
-std::string FE_P1NCNonparametric::get_name () const
+std::string FE_P1NC::get_name () const
{
- return "FE_P1NCNonparametric";
+ return "FE_P1NC";
}
-UpdateFlags FE_P1NCNonparametric::requires_update_flags (const UpdateFlags flags) const
+UpdateFlags FE_P1NC::requires_update_flags (const UpdateFlags flags) const
{
UpdateFlags out = update_default;
}
-FiniteElement<2,2> *FE_P1NCNonparametric::clone () const
+FiniteElement<2,2> *FE_P1NC::clone () const
{
- return new FE_P1NCNonparametric(*this);
+ return new FE_P1NC(*this);
}
-FE_P1NCNonparametric::~FE_P1NCNonparametric () {}
+FE_P1NC::~FE_P1NC () {}
-void FE_P1NCNonparametric::initialize_constraints ()
+void FE_P1NC::initialize_constraints ()
{
std::vector<Point<1> > constraint_points;
Triangulation<dim> triangulation;
GridGenerator::hyper_cube (triangulation, 0, 5);
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 5.);
GridTools::transform (&stretch<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 1.);
GridTools::transform (&affine<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 1.);
GridTools::transform (&bilinear<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
Triangulation<dim> triangulation;
GridGenerator::hyper_cube (triangulation, 0, 5);
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 5.);
GridTools::transform (&stretch<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 1.);
GridTools::transform (&affine<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
GridGenerator::hyper_cube (triangulation, 0., 1.);
GridTools::transform (&bilinear<dim>, triangulation) ;
- FE_P1NCNonparametric fe;
+ FE_P1NC fe;
DoFHandler<dim> dof_handler (triangulation);
dof_handler.distribute_dofs(fe);
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element on a square
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0, 5);
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_values | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << fe_values.shape_value(i,q) << ' ';
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.56351 0.56351 values=0.63730 0.25000 0.25000 -0.13730
-DEAL::index=1 position=2.50000 0.56351 values=0.44365 0.44365 0.05635 0.05635
-DEAL::index=2 position=4.43649 0.56351 values=0.25000 0.63730 -0.13730 0.25000
-DEAL::index=3 position=0.56351 2.50000 values=0.44365 0.05635 0.44365 0.05635
-DEAL::index=4 position=2.50000 2.50000 values=0.25000 0.25000 0.25000 0.25000
-DEAL::index=5 position=4.43649 2.50000 values=0.05635 0.44365 0.05635 0.44365
-DEAL::index=6 position=0.56351 4.43649 values=0.25000 -0.13730 0.63730 0.25000
-DEAL::index=7 position=2.50000 4.43649 values=0.05635 0.05635 0.44365 0.44365
-DEAL::index=8 position=4.43649 4.43649 values=-0.13730 0.25000 0.25000 0.63730
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element on a rectangle
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_tools.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-template<int dim>
-Point<dim> stretch (const Point<dim> &p)
-{
- Point<dim> q = p ;
- q(dim-1) *= 2. ;
-
- return q ;
-}
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0., 5.);
- GridTools::transform (&stretch<dim>, triangulation) ;
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_values | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << fe_values.shape_value(i,q) << ' ';
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.56351 1.12702 values=0.63730 0.25000 0.25000 -0.13730
-DEAL::index=1 position=2.50000 1.12702 values=0.44365 0.44365 0.05635 0.05635
-DEAL::index=2 position=4.43649 1.12702 values=0.25000 0.63730 -0.13730 0.25000
-DEAL::index=3 position=0.56351 5.00000 values=0.44365 0.05635 0.44365 0.05635
-DEAL::index=4 position=2.50000 5.00000 values=0.25000 0.25000 0.25000 0.25000
-DEAL::index=5 position=4.43649 5.00000 values=0.05635 0.44365 0.05635 0.44365
-DEAL::index=6 position=0.56351 8.87298 values=0.25000 -0.13730 0.63730 0.25000
-DEAL::index=7 position=2.50000 8.87298 values=0.05635 0.05635 0.44365 0.44365
-DEAL::index=8 position=4.43649 8.87298 values=-0.13730 0.25000 0.25000 0.63730
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element on a parallelogram
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_tools.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-template<int dim>
-Point<dim> affine (const Point<dim> &p)
-{
- Point<dim> q = p ;
- if (dim>=2)
- {
- q(0) = 2.*p(0) + p(1) ;
- q(1) = p(0) + 3.*p(1) ;
- }
-
- return q ;
-}
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0., 1.);
- GridTools::transform (&affine<dim>, triangulation) ;
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_values | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << fe_values.shape_value(i,q) << ' ';
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.33810 0.45081 values=0.63730 0.25000 0.25000 -0.13730
-DEAL::index=1 position=1.11270 0.83810 values=0.44365 0.44365 0.05635 0.05635
-DEAL::index=2 position=1.88730 1.22540 values=0.25000 0.63730 -0.13730 0.25000
-DEAL::index=3 position=0.72540 1.61270 values=0.44365 0.05635 0.44365 0.05635
-DEAL::index=4 position=1.50000 2.00000 values=0.25000 0.25000 0.25000 0.25000
-DEAL::index=5 position=2.27460 2.38730 values=0.05635 0.44365 0.05635 0.44365
-DEAL::index=6 position=1.11270 2.77460 values=0.25000 -0.13730 0.63730 0.25000
-DEAL::index=7 position=1.88730 3.16190 values=0.05635 0.05635 0.44365 0.44365
-DEAL::index=8 position=2.66190 3.54919 values=-0.13730 0.25000 0.25000 0.63730
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element's gradient on a square
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0, 5);
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_gradients | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << '[' << fe_values.shape_grad(i,q) << "] ";
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.56351 0.56351 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=1 position=2.50000 0.56351 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=2 position=4.43649 0.56351 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=3 position=0.56351 2.50000 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=4 position=2.50000 2.50000 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=5 position=4.43649 2.50000 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=6 position=0.56351 4.43649 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=7 position=2.50000 4.43649 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
-DEAL::index=8 position=4.43649 4.43649 values=[-0.10000 -0.10000] [0.10000 -0.10000] [-0.10000 0.10000] [0.10000 0.10000]
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element's gradient on a rectangle
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_tools.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-template<int dim>
-Point<dim> stretch (const Point<dim> &p)
-{
- Point<dim> q = p ;
- q(dim-1) *= 2. ;
-
- return q ;
-}
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0., 5.);
- GridTools::transform (&stretch<dim>, triangulation) ;
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_gradients | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << '[' << fe_values.shape_grad(i,q) << "] ";
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.56351 1.12702 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=1 position=2.50000 1.12702 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=2 position=4.43649 1.12702 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=3 position=0.56351 5.00000 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=4 position=2.50000 5.00000 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=5 position=4.43649 5.00000 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=6 position=0.56351 8.87298 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=7 position=2.50000 8.87298 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
-DEAL::index=8 position=4.43649 8.87298 values=[-0.10000 -0.05000] [0.10000 -0.05000] [-0.10000 0.05000] [0.10000 0.05000]
+++ /dev/null
-// ---------------------------------------------------------------------
-//
-// Copyright (C) 2015 by the deal.II authors
-//
-// This file is part of the deal.II library.
-//
-// The deal.II library is free software; you can use it, redistribute
-// it, and/or modify it under the terms of the GNU Lesser General
-// Public License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-// The full text of the license can be found in the file LICENSE at
-// the top level of the deal.II distribution.
-//
-// ---------------------------------------------------------------------
-
-
-
-// check the P1NC parametric element's gradient on a parallelogram
-
-#include "../tests.h"
-#include <deal.II/base/logstream.h>
-#include <deal.II/base/quadrature_lib.h>
-#include <deal.II/grid/tria.h>
-#include <deal.II/grid/grid_generator.h>
-#include <deal.II/grid/grid_tools.h>
-#include <deal.II/dofs/dof_handler.h>
-#include <deal.II/fe/fe_values.h>
-
-#include <deal.II/fe/fe_p1nc.h>
-
-#include <fstream>
-#include <string>
-
-#define PRECISION 5
-
-
-template<int dim>
-Point<dim> affine (const Point<dim> &p)
-{
- Point<dim> q = p ;
- if (dim>=2)
- {
- q(0) = 2.*p(0) + p(1) ;
- q(1) = p(0) + 3.*p(1) ;
- }
-
- return q ;
-}
-
-
-
-template<int dim>
-void
-check()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, 0., 1.);
- GridTools::transform (&affine<dim>, triangulation) ;
-
- FE_P1NCParametric fe;
- DoFHandler<dim> dof_handler (triangulation);
- dof_handler.distribute_dofs(fe);
-
- QGauss<dim> quadrature(3);
- FEValues<dim> fe_values (fe, quadrature, update_gradients | update_q_points);
- fe_values.reinit (dof_handler.begin_active());
-
- for (unsigned int q=0; q<quadrature.size(); ++q)
- {
- deallog << "index=" << q
- << " position=" << fe_values.quadrature_point(q)
- << " values=";
- for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
- deallog << '[' << fe_values.shape_grad(i,q) << "] ";
- deallog << std::endl;
- }
-}
-
-int
-main()
-{
- std::ofstream logfile ("output");
- deallog << std::setprecision(PRECISION);
- deallog << std::fixed;
- deallog.attach(logfile);
- deallog.depth_console(0);
- deallog.threshold_double(1.e-10);
-
- check<2>();
-}
-
-
-
+++ /dev/null
-
-DEAL::index=0 position=0.33810 0.45081 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=1 position=1.11270 0.83810 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=2 position=1.88730 1.22540 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=3 position=0.72540 1.61270 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=4 position=1.50000 2.00000 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=5 position=2.27460 2.38730 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=6 position=1.11270 2.77460 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=7 position=1.88730 3.16190 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]
-DEAL::index=8 position=2.66190 3.54919 values=[-0.20000 -0.10000] [0.40000 -0.30000] [-0.40000 0.30000] [0.20000 0.10000]