[cig-commits] [commit] master: Merge branch 'refinement' of https://github.com/jdannberg/aspect (a871ef4)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue May 20 07:34:53 PDT 2014


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

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/426fbfcad3568313f61490f77127c5e1c97a005d...a871ef437febf4fd67ce6f1ff7349b8a57987c8a

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

commit a871ef437febf4fd67ce6f1ff7349b8a57987c8a
Merge: 426fbfc 1f3ccaa
Author: Timo Heister <timo.heister at gmail.com>
Date:   Tue May 20 10:34:27 2014 -0400

    Merge branch 'refinement' of https://github.com/jdannberg/aspect
    
    Conflicts:
    	doc/modules/changes.h



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

a871ef437febf4fd67ce6f1ff7349b8a57987c8a
 doc/modules/changes.h                              |   3 +
 .../compositional_initial_conditions/interface.h   |   1 -
 include/aspect/mesh_refinement/interface.h         |  23 ++-
 .../minimum_refinement_function.h}                 |  51 +++--
 include/aspect/simulator.h                         |   6 +
 source/mesh_refinement/interface.cc                |  82 ++++++++
 .../mesh_refinement/minimum_refinement_function.cc | 117 ++++++++++++
 source/simulator/core.cc                           |   3 +
 tests/minimum_refinement_function.prm              | 211 +++++++++++++++++++++
 tests/minimum_refinement_function/screen-output    | 143 ++++++++++++++
 .../solution-00003.0000.vtu                        |  39 ++++
 .../solution-00003.0001.vtu                        |  39 ++++
 tests/minimum_refinement_function/statistics       |  23 +++
 13 files changed, 712 insertions(+), 29 deletions(-)

diff --cc doc/modules/changes.h
index bd89154,0a54570..472da0a
--- a/doc/modules/changes.h
+++ b/doc/modules/changes.h
@@@ -5,30 -5,11 +5,33 @@@
   * 1.0. All entries are signed with the names of the author. </p>
   *
   * <ol>
+  * <li>New: There is now a mesh refinement criterium that checks the mesh
+  * always has a minimum refinement level determined by a function given in the
+  * input file.
 + *
 + * <li> New: Input files can now contain lines ending in backslashes
 + * to concatenate subsequent lines.
 + * <br>
 + * (Menno Fraters, 2014/05/19)
 + *
 + * <li> New: There is a new material model called multicomponent for 
 + * having an arbitrary number of compositional fields with different
 + * material properties, where each compositional field represents a rock
 + * type. Within each rock type the material properties are assumed to
 + * be constant.  When more than one rock type is present, the material
 + * model averages their properties with a weighted arithmetic average. 
 + * An exception is viscosity, where the user may specify a harmonic,
 + * geometric, or arithmetic averaging, or selecting the viscosity of
 + * the maximum composition.
 + * <br>
 + * (Ian Rose, 2014/05/19)
 + *
 + * <li>New: The dynamic topography postprocessors now take into account
 + * (i) the dynamic pressure, (ii) effects due to compressibility, (iii)
 + * they now have the option to subtract the mean topography to ensure that
 + * the topography is, on average, zero.
   * <br>
 - * (Juliane Dannberg, 2014/05/19)
 + * (Jacqueline Austermann, 2014/05/19)
   *
   * <li>New: There is a new plugin architecture for heating models that
   * allows for plugins defining the radiogenic heating rate in dependency
diff --cc include/aspect/mesh_refinement/minimum_refinement_function.h
index 5bd66e1,963c603..c8c90c2
--- a/include/aspect/mesh_refinement/minimum_refinement_function.h
+++ b/include/aspect/mesh_refinement/minimum_refinement_function.h
@@@ -17,12 -17,16 +17,16 @@@
    along with ASPECT; see the file doc/COPYING.  If not see
    <http://www.gnu.org/licenses/>.
  */
 -/*  $Id: composition.h 1880 2013-09-11 14:55:19Z dannberg $  */
 +
  
- #ifndef __aspect__heating_model_constant_heating_h
- #define __aspect__heating_model_constant_heating_h
  
- #include <aspect/heating_model/interface.h>
+ #ifndef __aspect__mesh_refinement_minimum_refinement_function_h
+ #define __aspect__mesh_refinement_minimum_refinement_function_h
+ 
+ #include <aspect/mesh_refinement/interface.h>
+ #include <aspect/simulator_access.h>
+ 
+ #include <deal.II/base/parsed_function.h>
  
  namespace aspect
  {
diff --cc source/mesh_refinement/minimum_refinement_function.cc
index 0000000,532e279..8c2d27d
mode 000000,100644..100644
--- a/source/mesh_refinement/minimum_refinement_function.cc
+++ b/source/mesh_refinement/minimum_refinement_function.cc
@@@ -1,0 -1,117 +1,117 @@@
+ /*
+   Copyright (C) 2014 by the authors of the ASPECT code.
+ 
+   This file is part of ASPECT.
+ 
+   ASPECT is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+ 
+   ASPECT is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+ 
+   You should have received a copy of the GNU General Public License
+   along with ASPECT; see the file doc/COPYING.  If not see
+   <http://www.gnu.org/licenses/>.
+ */
 -/*  $Id: composition.cc 1880 2013-09-11 14:55:19Z dannberg $  */
++
+ 
+ 
+ #include <aspect/mesh_refinement/minimum_refinement_function.h>
+ 
+ #include <deal.II/base/quadrature_lib.h>
+ #include <deal.II/fe/fe_values.h>
+ 
+ namespace aspect
+ {
+   namespace MeshRefinement
+   {
+     template <int dim>
+     void
+     MinimumRefinementFunction<dim>::tag_additional_cells () const
+     {
+       // evaluate a single point per cell
+       const QMidpoint<dim> quadrature_formula;
+       const unsigned int n_q_points = quadrature_formula.size();
+ 
+       FEValues<dim> fe_values (this->get_mapping(),
+         		               this->get_fe(),
+                                quadrature_formula,
+                                update_values   |
+                                update_quadrature_points );
+ 
+       // ensure minimum refinement level
+       for (typename Triangulation<dim>::active_cell_iterator
+            cell = this->get_triangulation().begin_active();
+            cell != this->get_triangulation().end(); ++cell)
+         {
+           if (cell->is_locally_owned())
+           {
+         	fe_values.reinit(cell);
+         	const double depth = this->get_geometry_model().depth(fe_values.quadrature_point(0));
+         	const Point<1> point(depth);
+           	if (cell->level() <= std::rint(min_refinement_level.value(point)))
+               cell->clear_coarsen_flag ();
+           	if (cell->level() <  std::rint(min_refinement_level.value(point)))
+               cell->set_refine_flag ();
+           }
+         }
+     }
+ 
+     template <int dim>
+     void
+     MinimumRefinementFunction<dim>::
+     declare_parameters (ParameterHandler &prm)
+     {
+       prm.enter_subsection("Mesh refinement");
+       {
+ 
+         prm.enter_subsection("Minimum refinement function");
+         {
+           /**
+            * Let the function that describes the minimal level of refinement
+            * as a function of depth declare its parameters.
+            * This defines the minimum refinement level each cell should have,
+            * and that can not be exceeded by coarsening.
+            */
+           Functions::ParsedFunction<1>::declare_parameters (prm, 1);
+         }
+         prm.leave_subsection();
+       }
+       prm.leave_subsection();
+     }
+ 
+     template <int dim>
+     void
+     MinimumRefinementFunction<dim>::parse_parameters (ParameterHandler &prm)
+     {
+       prm.enter_subsection("Mesh refinement");
+       {
+         prm.enter_subsection("Minimum refinement function");
+         {
+         	min_refinement_level.parse_parameters (prm);
+         }
+         prm.leave_subsection();
+       }
+       prm.leave_subsection();
+     }
+   }
+ }
+ 
+ // explicit instantiations
+ namespace aspect
+ {
+   namespace MeshRefinement
+   {
+     ASPECT_REGISTER_MESH_REFINEMENT_CRITERION(MinimumRefinementFunction,
+                                               "minimum refinement function",
+                                               "A mesh refinement criterion that ensures a "
+                                               "minimum refinement level described by an "
+                                               "explicit formula with the depth as argument. "
+                                               "After reading in the function, its values are "
+                                               "rounded to the nearest integer. ")
+   }
+ }



More information about the CIG-COMMITS mailing list