zhaoweiliu / dealii_catmull_clark

Other
0 stars 1 forks source link

How Mapping, FiniteElement, and FEValues work together #2

Open zhaoweiliu opened 4 years ago

zhaoweiliu commented 4 years ago

https://www.dealii.org/developer/doxygen/deal.II/group__FE__vs__Mapping__vs__FEValues.html

FEValues: FEValues' role is to provide a user the values of shape functions, their gradients, etc, at quadrature points.

FEValues does not actually compute this information itself. It really only provides a place to store it, and then orchestrates the interaction between mapping and finite element classes to have them compute what is requested and store the result in the locations provided by FEValues.

FEValues can provide an incredible array of information, but that almost all of it is not necessary in any given context.

Mappings: Mappings are responsible for everything that has to do with the mapping from the reference (unit) cell to each of the actual cells. This is facilitated by a mapping function F_K:[0,1]↦K.

Since FEValues only ever needs to evaluate these things at quadrature points, mappings do not in general need to provide the ability to evaluate at arbitrary points. Rather, as we will see below, they will be initialized to use a set of quadrature points defined on the reference cell, will then be "re-initialized" for a particular cell, and all further operations will then only require the evaluation of F_K at these quadrature points on the real cell.

Finite elements Finite element classes are responsible for defining their shape functions, derivatives, and many other aspects on the reference cell, but also for computing the mapped values and derivatives on actual cells (obviously with the help of a mapping object). For the current discussion, only the latter role is important.

As with mappings, all that is important for us here is that the finite element classes can provide this information at given quadrature points, and that they can put the computed information into structures provided by FEValues and from which FEValues member functions can then pass it on to the user through the member functions in FEValuesBase.

zhaoweiliu commented 4 years ago

template<int dim, int spacedim> void FE_Catmull_Clark<dim,spacedim>::fill_fe_values( const typename Triangulation<dim, spacedim>::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature &quadrature, const Mapping<dim, spacedim> &mapping, const typename Mapping<dim, spacedim>::InternalDataBase &mapping_internal, const dealii::internal::FEValuesImplementation::MappingRelatedData<dim,spacedim>& mapping_data, const typename FiniteElement<dim, spacedim>::InternalDataBase &fe_internal, dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim,spacedim>& output_data) const {

}

"Create an internal data object and return a pointer to it of which the caller of this function then assumes ownership. This object will then be passed to the FiniteElement::fill_fe_values() every time the finite element shape functions and their derivatives are evaluated on a concrete cell. " template <int dim, int spacedim> std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase> FE_Catmull_Clark<dim, spacedim>:: get_data( const UpdateFlags update_flags, const Mapping<dim, spacedim> & mapping, const Quadrature & quadrature, dealii::internal::FEValuesImplementation::FiniteElementRelatedData<dim,spacedim>& output_data ) const{ }