40 ExcCellNotAssociatedWithBox,
41 "You are using MappingBox, but the incoming element is not associated with a"
42 "Bounding Box Cartesian.");
50template <
typename CellType>
53 const std::map<types::global_cell_index, types::global_cell_index>
56 Assert((cell->reference_cell().is_hyper_cube() ||
57 cell->reference_cell().is_simplex()),
59 Assert((translator.find(cell->active_cell_index()) != translator.cend()),
60 ExcCellNotAssociatedWithBox());
67template <
int dim,
int spacedim>
70 const std::map<types::global_cell_index, types::global_cell_index>
73 Assert(input_boxes.size() > 0,
74 ExcMessage(
"Invalid number of bounding boxes."));
77 boxes.resize(input_boxes.size());
78 for (
unsigned int i = 0; i < input_boxes.size(); ++i)
79 boxes[i] = input_boxes[i];
80 polytope_translator = global_to_polytope;
85template <
int dim,
int spacedim>
89 , inverse_cell_extents(
numbers::signaling_nan<
Tensor<1, dim>>())
90 , volume_element(
numbers::signaling_nan<double>())
91 , quadrature_points(q.get_points())
96template <
int dim,
int spacedim>
104 this->update_each = update_flags;
109template <
int dim,
int spacedim>
122template <
int dim,
int spacedim>
131template <
int dim,
int spacedim>
137 ExcMessage(
"The dimension of your mapping (" +
139 ") and the reference cell cell_type (" +
141 " ) do not agree."));
148template <
int dim,
int spacedim>
166template <
int dim,
int spacedim>
167std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
171 std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
172 std::make_unique<InternalData>();
180template <
int dim,
int spacedim>
181std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
194template <
int dim,
int spacedim>
207 const std::pair<Point<dim>,
Point<dim>> &bdary_points =
210 for (
unsigned int d = 0;
d < dim; ++
d)
212 const double cell_extent_d = current_box.
side_length(
d);
216 .5 * (bdary_points.first[
d] +
217 bdary_points.second[
d]);
219 Assert(cell_extent_d != 0.,
220 ExcMessage(
"Cell does not appear to be Cartesian!"));
232 transform_quadrature_points(
237 for (
unsigned int i = 0; i < quadrature_points.size(); ++i)
238 quadrature_points[i] = box.
unit_to_real(unit_quadrature_points[i]);
244template <
int dim,
int spacedim>
250 std::vector<
Point<dim>> &quadrature_points)
const
253 transform_quadrature_points(
255 unit_quadrature_points,
261template <
int dim,
int spacedim>
264 const unsigned int face_no,
272 std::fill(normal_vectors.begin(),
273 normal_vectors.end(),
280template <
int dim,
int spacedim>
291 for (
unsigned int i = 0; i < output_data.
jacobian_grads.size(); ++i)
295 for (
unsigned int i = 0;
301 for (
unsigned int i = 0;
308 for (
unsigned int i = 0;
315 for (
unsigned int i = 0;
322 for (
unsigned int i = 0;
332template <
int dim,
int spacedim>
340 for (
unsigned int d = 1;
d < dim; ++
d)
348template <
int dim,
int spacedim>
360 for (
unsigned int i = 0; i < output_data.
jacobians.size(); ++i)
363 for (
unsigned int j = 0; j < dim; ++j)
370template <
int dim,
int spacedim>
385 for (
unsigned int j = 0; j < dim; ++j)
393template <
int dim,
int spacedim>
425 for (
unsigned int d = 1;
d < dim; ++
d)
429 for (
unsigned int i = 0; i < output_data.
JxW_values.size(); ++i)
438 return cell_similarity;
443template <
int dim,
int spacedim>
447 const unsigned int face_no,
448 const unsigned int subface_no,
465template <
int dim,
int spacedim>
492 for (
unsigned int i = 0; i < output_data.
normal_vectors.size(); ++i)
496 for (
unsigned int i = 0; i < output_data.
JxW_values.size(); ++i)
507template <
int dim,
int spacedim>
520 switch (mapping_kind)
526 "update_covariant_transformation"));
528 for (
unsigned int i = 0; i < output.size(); ++i)
529 for (
unsigned int d = 0;
d < dim; ++
d)
538 "update_contravariant_transformation"));
540 for (
unsigned int i = 0; i < output.size(); ++i)
541 for (
unsigned int d = 0;
d < dim; ++
d)
549 "update_contravariant_transformation"));
552 "update_volume_elements"));
554 for (
unsigned int i = 0; i < output.size(); ++i)
555 for (
unsigned int d = 0;
d < dim; ++
d)
567template <
int dim,
int spacedim>
580 switch (mapping_kind)
586 "update_covariant_transformation"));
588 for (
unsigned int i = 0; i < output.size(); ++i)
589 for (
unsigned int d1 = 0; d1 < dim; ++d1)
590 for (
unsigned int d2 = 0; d2 < dim; ++d2)
600 "update_contravariant_transformation"));
602 for (
unsigned int i = 0; i < output.size(); ++i)
603 for (
unsigned int d1 = 0; d1 < dim; ++d1)
604 for (
unsigned int d2 = 0; d2 < dim; ++d2)
605 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2];
613 "update_covariant_transformation"));
615 for (
unsigned int i = 0; i < output.size(); ++i)
616 for (
unsigned int d1 = 0; d1 < dim; ++d1)
617 for (
unsigned int d2 = 0; d2 < dim; ++d2)
618 output[i][d1][d2] = input[i][d1][d2] *
628 "update_contravariant_transformation"));
630 for (
unsigned int i = 0; i < output.size(); ++i)
631 for (
unsigned int d1 = 0; d1 < dim; ++d1)
632 for (
unsigned int d2 = 0; d2 < dim; ++d2)
633 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] *
642 "update_contravariant_transformation"));
645 "update_volume_elements"));
647 for (
unsigned int i = 0; i < output.size(); ++i)
648 for (
unsigned int d1 = 0; d1 < dim; ++d1)
649 for (
unsigned int d2 = 0; d2 < dim; ++d2)
650 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] /
659 "update_contravariant_transformation"));
662 "update_volume_elements"));
664 for (
unsigned int i = 0; i < output.size(); ++i)
665 for (
unsigned int d1 = 0; d1 < dim; ++d1)
666 for (
unsigned int d2 = 0; d2 < dim; ++d2)
667 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] *
680template <
int dim,
int spacedim>
693 switch (mapping_kind)
699 "update_covariant_transformation"));
701 for (
unsigned int i = 0; i < output.size(); ++i)
702 for (
unsigned int d1 = 0; d1 < dim; ++d1)
703 for (
unsigned int d2 = 0; d2 < dim; ++d2)
713 "update_contravariant_transformation"));
715 for (
unsigned int i = 0; i < output.size(); ++i)
716 for (
unsigned int d1 = 0; d1 < dim; ++d1)
717 for (
unsigned int d2 = 0; d2 < dim; ++d2)
718 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2];
726 "update_covariant_transformation"));
728 for (
unsigned int i = 0; i < output.size(); ++i)
729 for (
unsigned int d1 = 0; d1 < dim; ++d1)
730 for (
unsigned int d2 = 0; d2 < dim; ++d2)
731 output[i][d1][d2] = input[i][d1][d2] *
741 "update_contravariant_transformation"));
743 for (
unsigned int i = 0; i < output.size(); ++i)
744 for (
unsigned int d1 = 0; d1 < dim; ++d1)
745 for (
unsigned int d2 = 0; d2 < dim; ++d2)
746 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] *
755 "update_contravariant_transformation"));
758 "update_volume_elements"));
760 for (
unsigned int i = 0; i < output.size(); ++i)
761 for (
unsigned int d1 = 0; d1 < dim; ++d1)
762 for (
unsigned int d2 = 0; d2 < dim; ++d2)
763 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] /
772 "update_contravariant_transformation"));
775 "update_volume_elements"));
777 for (
unsigned int i = 0; i < output.size(); ++i)
778 for (
unsigned int d1 = 0; d1 < dim; ++d1)
779 for (
unsigned int d2 = 0; d2 < dim; ++d2)
780 output[i][d1][d2] = input[i][d1][d2] * data.
cell_extents[d2] *
793template <
int dim,
int spacedim>
806 switch (mapping_kind)
812 "update_covariant_transformation"));
814 for (
unsigned int q = 0; q < output.size(); ++q)
815 for (
unsigned int i = 0; i < spacedim; ++i)
816 for (
unsigned int j = 0; j < spacedim; ++j)
817 for (
unsigned int k = 0; k < spacedim; ++k)
819 output[q][i][j][k] = input[q][i][j][k] *
832template <
int dim,
int spacedim>
845 switch (mapping_kind)
851 "update_covariant_transformation"));
854 "update_contravariant_transformation"));
856 for (
unsigned int q = 0; q < output.size(); ++q)
857 for (
unsigned int i = 0; i < spacedim; ++i)
858 for (
unsigned int j = 0; j < spacedim; ++j)
859 for (
unsigned int k = 0; k < spacedim; ++k)
861 output[q][i][j][k] = input[q][i][j][k] *
873 "update_covariant_transformation"));
875 for (
unsigned int q = 0; q < output.size(); ++q)
876 for (
unsigned int i = 0; i < spacedim; ++i)
877 for (
unsigned int j = 0; j < spacedim; ++j)
878 for (
unsigned int k = 0; k < spacedim; ++k)
880 output[q][i][j][k] = input[q][i][j][k] *
893 "update_covariant_transformation"));
896 "update_contravariant_transformation"));
899 "update_volume_elements"));
901 for (
unsigned int q = 0; q < output.size(); ++q)
902 for (
unsigned int i = 0; i < spacedim; ++i)
903 for (
unsigned int j = 0; j < spacedim; ++j)
904 for (
unsigned int k = 0; k < spacedim; ++k)
923template <
int dim,
int spacedim>
930 Assert(dim == spacedim, ExcNotImplemented());
938template <
int dim,
int spacedim>
945 Assert(dim == spacedim, ExcNotImplemented());
953template <
int dim,
int spacedim>
965 for (
unsigned int i = 0; i < real_points.size(); ++i)
973template <
int dim,
int spacedim>
974std::unique_ptr<Mapping<dim, spacedim>>
977 return std::make_unique<MappingBox<dim, spacedim>>(*this);
std::pair< Point< spacedim, Number >, Point< spacedim, Number > > & get_boundary_points()
Number side_length(const unsigned int direction) const
Point< spacedim, Number > unit_to_real(const Point< spacedim, Number > &point) const
const Tensor< 1, spacedim > & normal_vector(const unsigned int i) const
double weight(const unsigned int i) const
const std::vector< Point< dim > > & get_points() const
virtual std::size_t memory_consumption() const override
Tensor< 1, dim > traslation
virtual void reinit(const UpdateFlags update_flags, const Quadrature< dim > &quadrature) override
Tensor< 1, dim > cell_extents
Tensor< 1, dim > inverse_cell_extents
void maybe_update_volume_elements(const InternalData &data) const
virtual bool is_compatible_with(const ReferenceCell &reference_cell) const override
MappingBox(const std::vector< BoundingBox< dim > > &local_boxes, const std::map< types::global_cell_index, types::global_cell_index > &polytope_translator)
void maybe_update_jacobian_derivatives(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
virtual bool preserves_vertex_locations() const override
virtual CellSimilarity::Similarity fill_fe_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const Quadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
virtual Point< dim > transform_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< spacedim > &p) const override
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_data(const UpdateFlags, const Quadrature< dim > &quadrature) const override
virtual void transform_points_real_to_unit_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const ArrayView< const Point< spacedim > > &real_points, const ArrayView< Point< dim > > &unit_points) const override
void update_cell_extents(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const CellSimilarity::Similarity cell_similarity, const InternalData &data) const
virtual Point< spacedim > transform_unit_to_real_cell(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const Point< dim > &p) const override
virtual void fill_fe_immersed_surface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const NonMatching::ImmersedSurfaceQuadrature< dim > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
virtual void fill_fe_subface_values(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const unsigned int face_no, const unsigned int subface_no, const Quadrature< dim - 1 > &quadrature, const typename Mapping< dim, spacedim >::InternalDataBase &internal_data, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const override
virtual std::unique_ptr< Mapping< dim, spacedim > > clone() const override
void maybe_update_jacobians(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
std::vector< BoundingBox< dim > > boxes
virtual std::unique_ptr< typename Mapping< dim, spacedim >::InternalDataBase > get_subface_data(const UpdateFlags flags, const Quadrature< dim - 1 > &quadrature) const override
void maybe_update_cell_quadrature_points(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const InternalData &data, const ArrayView< const Point< dim > > &unit_quadrature_points, std::vector< Point< dim > > &quadrature_points) const
virtual UpdateFlags requires_update_flags(const UpdateFlags update_flags) const override
void maybe_update_inverse_jacobians(const InternalData &data, const CellSimilarity::Similarity cell_similarity, internal::FEValuesImplementation::MappingRelatedData< dim, spacedim > &output_data) const
void maybe_update_normal_vectors(const unsigned int face_no, const InternalData &data, std::vector< Tensor< 1, dim > > &normal_vectors) const
virtual void transform(const ArrayView< const Tensor< 1, dim > > &input, const MappingKind kind, const typename Mapping< dim, spacedim >::InternalDataBase &internal, const ArrayView< Tensor< 1, spacedim > > &output) const override
std::map< types::global_cell_index, types::global_cell_index > polytope_translator
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
#define AssertDimension(dim1, dim2)
update_jacobian_pushed_forward_2nd_derivatives
update_contravariant_transformation
update_jacobian_pushed_forward_grads
update_jacobian_3rd_derivatives
update_covariant_transformation
update_jacobian_pushed_forward_3rd_derivatives
update_jacobian_2nd_derivatives
mapping_covariant_gradient
mapping_contravariant_hessian
mapping_covariant_hessian
mapping_contravariant_gradient
#define DEAL_II_NOT_IMPLEMENTED()
DEAL_II_NAMESPACE_OPEN DeclExceptionMsg(ExcCellNotAssociatedWithBox, "You are using MappingBox, but the incoming element is not associated with a" "Bounding Box Cartesian.")
bool has_box(const CellType &cell, const std::map< types::global_cell_index, types::global_cell_index > &translator)
void reference_cell(Triangulation< dim, spacedim > &tria, const ReferenceCell &reference_cell)
std::enable_if_t< std::is_fundamental_v< T >, std::size_t > memory_consumption(const T &t)
SymmetricTensor< 2, dim, Number > d(const Tensor< 2, dim, Number > &F, const Tensor< 2, dim, Number > &dF_dt)
std::string to_string(const number value, const unsigned int digits=numbers::invalid_unsigned_int)