[cig-commits] r1314 - in trunk/aspect: include/aspect/material_model source/material_model

gassmoeller at dealii.org gassmoeller at dealii.org
Tue Oct 23 04:49:16 PDT 2012


Author: gassmoeller
Date: 2012-10-23 05:49:16 -0600 (Tue, 23 Oct 2012)
New Revision: 1314

Modified:
   trunk/aspect/include/aspect/material_model/interface.h
   trunk/aspect/source/material_model/interface.cc
Log:
Added an virtual initialization function in the material model interface.

Modified: trunk/aspect/include/aspect/material_model/interface.h
===================================================================
--- trunk/aspect/include/aspect/material_model/interface.h	2012-10-23 11:47:02 UTC (rev 1313)
+++ trunk/aspect/include/aspect/material_model/interface.h	2012-10-23 11:49:16 UTC (rev 1314)
@@ -75,6 +75,13 @@
         virtual ~Interface();
 
         /**
+         * Initialization function. TODO: Is there some argument that is possibly needed by some material models?
+         */
+        virtual
+        void
+        initialize ();
+
+        /**
          * Called at the beginning of each time step and allows the material model
          * to update internal data structures.
          */

Modified: trunk/aspect/source/material_model/interface.cc
===================================================================
--- trunk/aspect/source/material_model/interface.cc	2012-10-23 11:47:02 UTC (rev 1313)
+++ trunk/aspect/source/material_model/interface.cc	2012-10-23 11:49:16 UTC (rev 1314)
@@ -37,6 +37,10 @@
     Interface<dim>::~Interface ()
     {}
 
+    template <int dim>
+    void
+    Interface<dim>::initialize ()
+    {}
 
     template <int dim>
     void
@@ -168,7 +172,9 @@
       }
       prm.leave_subsection ();
 
-      return std_cxx1x::get<dim>(registered_plugins).create_plugin (model_name, prm);
+      Interface<dim> *plugin = std_cxx1x::get<dim>(registered_plugins).create_plugin (model_name, prm);
+      plugin->initialize();
+      return plugin;
     }
 
 



More information about the CIG-COMMITS mailing list