From: David Wells Date: Mon, 19 Jul 2021 20:50:50 +0000 (-0400) Subject: Add a new class member MappingFEField::reference_cell. X-Git-Tag: v9.4.0-rc1~1133^2~4 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ed7cbd626a4e0ec052a625c5c9345c96612a3ef;p=dealii.git Add a new class member MappingFEField::reference_cell. This is easier than constantly looking it up. --- diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index e8d1b8179d..d7bd161c46 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -583,6 +583,12 @@ private: * @} */ + /** + * Reference cell over which the mapping is defined. This class does not yet + * support mixed meshes. + */ + ReferenceCell reference_cell; + /** * Specifies whether we access unknowns on the active dofs (with a single * Euler vector) or on the level dofs (via a vector of Euler vectors). diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index a841e13686..5d0b581f68 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -197,7 +197,8 @@ MappingFEField::MappingFEField( const DoFHandler &euler_dof_handler, const VectorType & euler_vector, const ComponentMask & mask) - : uses_level_dofs(false) + : reference_cell(euler_dof_handler.get_fe().reference_cell()) + , uses_level_dofs(false) , euler_vector({&euler_vector}) , euler_dof_handler(&euler_dof_handler) , fe_mask(mask.size() ? @@ -207,9 +208,7 @@ MappingFEField::MappingFEField( true)) , fe_to_real(fe_mask.size(), numbers::invalid_unsigned_int) , fe_values(this->euler_dof_handler->get_fe(), - this->euler_dof_handler->get_fe() - .reference_cell() - .template get_nodal_type_quadrature(), + reference_cell.template get_nodal_type_quadrature(), update_values) { unsigned int size = 0; @@ -228,7 +227,8 @@ MappingFEField::MappingFEField( const DoFHandler &euler_dof_handler, const std::vector & euler_vector, const ComponentMask & mask) - : uses_level_dofs(true) + : reference_cell(euler_dof_handler.get_fe().reference_cell()) + , uses_level_dofs(true) , euler_dof_handler(&euler_dof_handler) , fe_mask(mask.size() ? mask : @@ -237,9 +237,7 @@ MappingFEField::MappingFEField( true)) , fe_to_real(fe_mask.size(), numbers::invalid_unsigned_int) , fe_values(this->euler_dof_handler->get_fe(), - this->euler_dof_handler->get_fe() - .reference_cell() - .template get_nodal_type_quadrature(), + reference_cell.template get_nodal_type_quadrature(), update_values) { unsigned int size = 0; @@ -269,7 +267,8 @@ MappingFEField::MappingFEField( const DoFHandler &euler_dof_handler, const MGLevelObject &euler_vector, const ComponentMask & mask) - : uses_level_dofs(true) + : reference_cell(euler_dof_handler.get_fe().reference_cell()) + , uses_level_dofs(true) , euler_dof_handler(&euler_dof_handler) , fe_mask(mask.size() ? mask : @@ -278,9 +277,7 @@ MappingFEField::MappingFEField( true)) , fe_to_real(fe_mask.size(), numbers::invalid_unsigned_int) , fe_values(this->euler_dof_handler->get_fe(), - this->euler_dof_handler->get_fe() - .reference_cell() - .template get_nodal_type_quadrature(), + reference_cell.template get_nodal_type_quadrature(), update_values) { unsigned int size = 0; @@ -310,15 +307,14 @@ MappingFEField::MappingFEField( template MappingFEField::MappingFEField( const MappingFEField &mapping) - : uses_level_dofs(mapping.uses_level_dofs) + : reference_cell(mapping.reference_cell) + , uses_level_dofs(mapping.uses_level_dofs) , euler_vector(mapping.euler_vector) , euler_dof_handler(mapping.euler_dof_handler) , fe_mask(mapping.fe_mask) , fe_to_real(mapping.fe_to_real) , fe_values(mapping.euler_dof_handler->get_fe(), - this->euler_dof_handler->get_fe() - .reference_cell() - .template get_nodal_type_quadrature(), + reference_cell.template get_nodal_type_quadrature(), update_values) {} @@ -358,7 +354,7 @@ MappingFEField::is_compatible_with( Utilities::to_string(reference_cell.get_dimension()) + " ) do not agree.")); - return euler_dof_handler->get_fe().reference_cell() == reference_cell; + return this->reference_cell == reference_cell; } @@ -589,8 +585,6 @@ MappingFEField::compute_face_data( // TODO: only a single reference cell type possible... - const auto reference_cell = - this->euler_dof_handler->get_fe().reference_cell(); const auto n_faces = reference_cell.n_faces(); // Compute tangentials to the unit cell.