From: Wolfgang Bangerth Date: Thu, 23 Feb 2006 01:00:19 +0000 (+0000) Subject: Implement all these reinit() functions also for non-hp iterators. X-Git-Tag: v8.0.0~12219 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcd1b3fd4d26b074743b449c1cf31c4bb854fd17;p=dealii.git Implement all these reinit() functions also for non-hp iterators. git-svn-id: https://svn.dealii.org/trunk@12463 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/fe/hp_fe_values.cc b/deal.II/deal.II/source/fe/hp_fe_values.cc index ab967860a3..08a8d6bc0e 100644 --- a/deal.II/deal.II/source/fe/hp_fe_values.cc +++ b/deal.II/deal.II/source/fe/hp_fe_values.cc @@ -180,6 +180,126 @@ namespace hp } + + template + void + FEValues::reinit (const typename ::DoFHandler::cell_iterator &cell, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell); + } + + + + template + void + FEValues::reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell); + } + + + + template + void + FEValues::reinit (const typename Triangulation::cell_iterator &cell, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell); + } + + // -------------------------- FEFaceValues ------------------------- @@ -253,6 +373,129 @@ namespace hp } + + template + void + FEFaceValues::reinit (const typename ::DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no); + } + + + + template + void + FEFaceValues::reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no); + } + + + + template + void + FEFaceValues::reinit (const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no); + } + + // -------------------------- FESubfaceValues ------------------------- @@ -325,6 +568,132 @@ namespace hp real_mapping_index, real_q_index).reinit (cell, face_no, subface_no); } + + + + template + void + FESubfaceValues::reinit (const typename ::DoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no, subface_no); + } + + + + template + void + FESubfaceValues::reinit (const typename MGDoFHandler::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no, subface_no); + } + + + + template + void + FESubfaceValues::reinit (const typename Triangulation::cell_iterator &cell, + const unsigned int face_no, + const unsigned int subface_no, + const unsigned int q_index, + const unsigned int mapping_index, + const unsigned int fe_index) + { + // determine which indices we + // should actually use + unsigned int real_q_index = q_index, + real_mapping_index = mapping_index, + real_fe_index = fe_index; + + if (real_q_index == deal_II_numbers::invalid_unsigned_int) + real_q_index = 0; + + if (real_mapping_index == deal_II_numbers::invalid_unsigned_int) + real_mapping_index = 0; + + if (real_fe_index == deal_II_numbers::invalid_unsigned_int) + real_fe_index = 0; + + // some checks + Assert (real_q_index < this->q_collection.size(), + ExcIndexRange (real_q_index, 0, this->q_collection.size())); + Assert (real_mapping_index < this->mapping_collection->size(), + ExcIndexRange (real_mapping_index, 0, this->mapping_collection->size())); + Assert (real_fe_index < this->fe_collection->size(), + ExcIndexRange (real_fe_index, 0, this->fe_collection->size())); + + // now finally actually get the + // corresponding object and + // initialize it + this->select_fe_values (real_fe_index, + real_mapping_index, + real_q_index).reinit (cell, face_no, subface_no); + } }