[cig-commits] r11173 - in short/3D/PyLith/trunk: . pylith/meshio pylith/problems
brad at geodynamics.org
brad at geodynamics.org
Fri Feb 15 15:34:58 PST 2008
Author: brad
Date: 2008-02-15 15:34:57 -0800 (Fri, 15 Feb 2008)
New Revision: 11173
Modified:
short/3D/PyLith/trunk/TODO
short/3D/PyLith/trunk/pylith/meshio/OutputSoln.py
short/3D/PyLith/trunk/pylith/problems/Formulation.py
Log:
Removed output accessors from Formulation. Created specialized OutputSoln w/accessors for solution.
Modified: short/3D/PyLith/trunk/TODO
===================================================================
--- short/3D/PyLith/trunk/TODO 2008-02-15 23:20:18 UTC (rev 11172)
+++ short/3D/PyLith/trunk/TODO 2008-02-15 23:34:57 UTC (rev 11173)
@@ -14,50 +14,18 @@
Use Cases
- Want to write topology + vertex and/or cell fields
-
- For visualization, we want cell fields that are averaged over
- the cell's quadrature points. There may be some cases
- (benchmarking), in which we want the cell fields at each
- quadrature point.
-
- VTK files
-
- One per time step, multiple vertex and/or cell fields
-
HDF5 files
- One per topology (volume, surface, etc)
-
Would prefer to include multiple materials
Datasets contain entire time histories (makes it possible to
slice along time or space)
- Volume information
-
- Solution field (time histories)
-
- Distribution information (proc of each cell)
-
- State variable information for each cell (different info for
- each material)
-
- Material parameters (diagnostic)
-
- State variable values (time histories)
-
Lower dimension information (surface/line mesh specified by set
of vertices)
Solution field (time histories)
- Kinematic fault rupture
-
- Slip and change in tractions (time histories)
-
- Orientation, final slip, slip time (disgnostic)
-
Spontaneous (dynamic) fault rupture
Slip and change in tractions (time histories)
@@ -82,6 +50,10 @@
1. Need to add explanation of output and output parameters to
manual (especially fault information).
+ Fault information is in fault coordinate system. Add example of
+ how to convert it to global coordinates using orientation
+ information.
+
2. Add dependency diagram to manual.
3. Fix memory imbalance associated with distribution.
Modified: short/3D/PyLith/trunk/pylith/meshio/OutputSoln.py
===================================================================
--- short/3D/PyLith/trunk/pylith/meshio/OutputSoln.py 2008-02-15 23:20:18 UTC (rev 11172)
+++ short/3D/PyLith/trunk/pylith/meshio/OutputSoln.py 2008-02-15 23:34:57 UTC (rev 11173)
@@ -39,30 +39,17 @@
## Python object for managing OutputSoln facilities and properties.
##
## \b Properties
- ## @li \b vertex_info_fields Names of vertex info fields to output.
## @li \b vertex_data_fields Names of vertex data fields to output.
- ## @li \b cell_info_fields Names of cell info fields to output.
- ## @li \b cell_data_fields Names of cell data fields to output.
##
## \b Facilities
## @li None
import pyre.inventory
- vertexInfoFields = pyre.inventory.list("vertex_info_fields", default=[])
- vertexInfoFields.meta['tip'] = "Names of vertex info fields to output."
-
vertexDataFields = pyre.inventory.list("vertex_data_fields",
default=["displacements"])
vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
- cellInfoFields = pyre.inventory.list("cell_info_fields", default=[])
- cellInfoFields.meta['tip'] = "Names of cell info fields to output."
-
- cellDataFields = pyre.inventory.list("cell_data_fields", default=[])
- cellDataFields.meta['tip'] = "Names of cell data fields to output."
-
-
# PUBLIC METHODS /////////////////////////////////////////////////////
def __init__(self, name="outputmanager"):
@@ -70,9 +57,59 @@
Constructor.
"""
OutputManager.__init__(self, name)
+ self.availableFields = \
+ {'vertex': \
+ {'info': [],
+ 'data': ["displacements"]},
+ 'cell': \
+ {'info': [],
+ 'data': []}}
return
+ def preinitialize(self, dataProvider=None):
+ """
+ Do
+ """
+ OutputManager.preinitialize(self, dataProvider=self)
+ return
+
+
+ def initialize(self, mesh):
+ """
+ Initialize output manager.
+ """
+ logEvent = "%sinit" % self._loggingPrefix
+ self._logger.eventBegin(logEvent)
+
+ self.mesh = mesh
+ OutputManager.initialize(self)
+
+ self._logger.eventEnd(logEvent)
+ return
+
+
+ def getDataMesh(self):
+ """
+ Get mesh associated with data fields.
+ """
+ return (self.mesh, None, None)
+
+
+ def getVertexField(self, name, fields):
+ """
+ Get vertex field.
+ """
+ field = None
+ fieldType = None
+ if name == "displacements":
+ field = fields.getSolution()
+ fieldType = 1 # vector field
+ else:
+ raise ValueError, "Vertex field '%s' not available." % name
+ return (field, fieldType)
+
+
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
@@ -80,10 +117,7 @@
Set members based using inventory.
"""
OutputManager._configure(self)
- self.vertexInfoFields = self.inventory.vertexInfoFields
self.vertexDataFields = self.inventory.vertexDataFields
- self.cellInfoFields = self.inventory.cellInfoFields
- self.cellDataFields = self.inventory.cellDataFields
return
Modified: short/3D/PyLith/trunk/pylith/problems/Formulation.py
===================================================================
--- short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-02-15 23:20:18 UTC (rev 11172)
+++ short/3D/PyLith/trunk/pylith/problems/Formulation.py 2008-02-15 23:34:57 UTC (rev 11173)
@@ -104,7 +104,7 @@
self._info.log("Pre-initializing output.")
for output in self.output.bin:
- output.preinitialize(self)
+ output.preinitialize()
self._logger.eventEnd(logEvent)
return
@@ -153,7 +153,7 @@
self._info.log("Setting up solution output.")
for output in self.output.bin:
- output.initialize()
+ output.initialize(self.mesh)
output.writeInfo()
output.open(totalTime, numTimeSteps)
self._debug.log(resourceUsageString())
@@ -243,27 +243,6 @@
return
- def getDataMesh(self):
- """
- Get mesh associated with data fields.
- """
- return (self.mesh, None, None)
-
-
- def getVertexField(self, name, fields):
- """
- Get vertex field.
- """
- field = None
- fieldType = None
- if name == "displacements":
- field = fields.getSolution()
- fieldType = 1 # vector field
- else:
- raise ValueError, "Vertex field '%s' not available." % name
- return (field, fieldType)
-
-
# PRIVATE METHODS ////////////////////////////////////////////////////
def _configure(self):
More information about the cig-commits
mailing list