]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust error messages in the SolutionTransfer class.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 15 Mar 2015 06:38:43 +0000 (01:38 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 17 Mar 2015 23:27:45 +0000 (18:27 -0500)
include/deal.II/numerics/solution_transfer.h
source/numerics/solution_transfer.cc

index b2cb8946d597c9cecaa0872f78f6a1ba1229f45a..24326c7db3961cc3b2e766c587e8c16212eecc6e 100644 (file)
@@ -373,37 +373,30 @@ public:
   /**
    * Exception
    */
-  DeclException0(ExcNotPrepared);
+  DeclExceptionMsg(ExcNotPrepared,
+                   "You are attempting an operation for which this object is "
+                   "not prepared. This may be because you either did not call "
+                   "one of the prepare_*() functions at all, or because you "
+                   "called the wrong one for the operation you are currently "
+                   "attempting.");
 
   /**
    * Exception
    */
-  DeclException0(ExcAlreadyPrepForRef);
+  DeclExceptionMsg(ExcAlreadyPrepForRef,
+                   "You are attempting to call one of the prepare_*() functions "
+                   "of this object to prepare it for an operation for which it "
+                   "is already prepared. Specifically, the object was "
+                   "previously prepared for pure refinement.");
 
   /**
    * Exception
    */
-  DeclException0(ExcAlreadyPrepForCoarseAndRef);
-
-  /**
-   * Exception
-   */
-  DeclException0(ExcTriaPrepCoarseningNotCalledBefore);
-
-  /**
-   * Exception
-   */
-  DeclException0(ExcNoInVectorsGiven);
-
-  /**
-   * Exception
-   */
-  DeclException0(ExcVectorsDifferFromInVectors);
-
-  /**
-   * Exception
-   */
-  DeclException0(ExcNumberOfDoFsPerCellHasChanged);
+  DeclExceptionMsg(ExcAlreadyPrepForCoarseAndRef,
+                   "You are attempting to call one of the prepare_*() functions "
+                   "of this object to prepare it for an operation for which it "
+                   "is already prepared. Specifically, the object was "
+                   "previously prepared for both coarsening and refinement.");
 
 private:
 
index 1d3a05c1ca972a7d4db7f8814d8f74b785466636..f0b1cdfc4e66db9d4b42c7ae67ae6649690ab971 100644 (file)
@@ -139,15 +139,11 @@ SolutionTransfer<dim, VECTOR, DH>::refine_interpolate(const VECTOR &in,
           const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[this_fe_index].dofs_per_cell;
           local_values.reinit(dofs_per_cell, true);
 
-          // make sure that the size of the
-          // stored indices is the same as
-          // dofs_per_cell. this is kind of a
-          // test if we use the same fe in the
-          // hp case. to really do that test we
-          // would have to store the fe_index
-          // of all cells
+          // make sure that the size of the stored indices is the same as
+          // dofs_per_cell. since we store the desired fe_index, we know
+          // what this size should be
           Assert(dofs_per_cell==(*pointerstruct->second.indices_ptr).size(),
-                 ExcNumberOfDoFsPerCellHasChanged());
+                 ExcInternalError());
           for (unsigned int i=0; i<dofs_per_cell; ++i)
             local_values(i)=in((*pointerstruct->second.indices_ptr)[i]);
           cell->set_dof_values_by_interpolation(local_values, out,
@@ -240,7 +236,9 @@ prepare_for_coarsening_and_refinement(const std::vector<VECTOR> &all_in)
           ExcAlreadyPrepForCoarseAndRef());
 
   const unsigned int in_size=all_in.size();
-  Assert(in_size!=0, ExcNoInVectorsGiven());
+  Assert(in_size!=0,
+         ExcMessage("The array of input vectors you pass to this "
+                    "function has no elements. This is not useful."));
 
   clear();
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.