[cig-commits] [commit] master: Try again to prettify the nullspace logic (2752917)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed May 21 13:03:44 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/2df080f4905a6be43fd1729ea0d6a7a956cce070...a7135c1f7697d39efff2f47a79ca1e1395cff504

>---------------------------------------------------------------

commit 2752917a30922b2c9e9a3cafb494dad36ceb0b0e
Author: ian-r-rose <ian.r.rose at gmail.com>
Date:   Wed May 21 14:59:58 2014 -0500

    Try again to prettify the nullspace logic


>---------------------------------------------------------------

2752917a30922b2c9e9a3cafb494dad36ceb0b0e
 source/simulator/nullspace.cc  | 8 ++------
 source/simulator/parameters.cc | 8 ++++++--
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/source/simulator/nullspace.cc b/source/simulator/nullspace.cc
index 5691733..9124454 100644
--- a/source/simulator/nullspace.cc
+++ b/source/simulator/nullspace.cc
@@ -100,9 +100,7 @@ namespace aspect
   template <int dim>
   void Simulator<dim>::setup_nullspace_removal()
   {
-    if (parameters.nullspace_removal & NullspaceRemoval::linear_momentum_x || 
-        parameters.nullspace_removal & NullspaceRemoval::linear_momentum_y || 
-        parameters.nullspace_removal & NullspaceRemoval::linear_momentum_z )
+    if (parameters.nullspace_removal & NullspaceRemoval::linear_momentum)
       AssertThrow(false, ExcNotImplemented());
 
     std::vector<std_cxx1x::shared_ptr<TensorFunction<1,dim> > > funcs;
@@ -158,9 +156,7 @@ namespace aspect
                                         LinearAlgebra::BlockVector &tmp_distributed_stokes)
   {
     if (parameters.nullspace_removal & NullspaceRemoval::net_rotation ||
-        parameters.nullspace_removal & NullspaceRemoval::net_translation_x || 
-        parameters.nullspace_removal & NullspaceRemoval::net_translation_y ||
-        parameters.nullspace_removal & NullspaceRemoval::net_translation_z )
+        parameters.nullspace_removal & NullspaceRemoval::net_translation )
       {
         Assert(introspection.block_indices.velocities != introspection.block_indices.pressure,
             ExcNotImplemented());
diff --git a/source/simulator/parameters.cc b/source/simulator/parameters.cc
index 0241eb3..459c152 100644
--- a/source/simulator/parameters.cc
+++ b/source/simulator/parameters.cc
@@ -766,7 +766,9 @@ namespace aspect
                                     nullspace_removal | NullspaceRemoval::angular_momentum);
             else if (nullspace_names[i]=="net translation")
               nullspace_removal = typename NullspaceRemoval::Kind(
-                                    nullspace_removal | NullspaceRemoval::net_translation);
+                                    nullspace_removal | NullspaceRemoval::net_translation_x |
+                                    NullspaceRemoval::net_translation_y | ( dim == 3 ?
+                                    NullspaceRemoval::net_translation_z : 0) );
             else if (nullspace_names[i]=="net x translation")
               nullspace_removal = typename NullspaceRemoval::Kind(
                                     nullspace_removal | NullspaceRemoval::net_translation_x);
@@ -787,7 +789,9 @@ namespace aspect
                                     nullspace_removal | NullspaceRemoval::linear_momentum_z);
             else if (nullspace_names[i]=="linear momentum")
               nullspace_removal = typename NullspaceRemoval::Kind(
-                                    nullspace_removal | NullspaceRemoval::linear_momentum);
+                                    nullspace_removal | NullspaceRemoval::linear_momentum_x |
+                                    NullspaceRemoval::linear_momentum_y | ( dim == 3 ?
+                                    NullspaceRemoval::linear_momentum_z : 0) );
             else
               AssertThrow(false, ExcInternalError());
           }



More information about the CIG-COMMITS mailing list