[cig-commits] r16045 - in short/3D/PyLith/branches/pylith-friction: libsrc/faults playpen/friction pylith/faults pylith/meshio
brad at geodynamics.org
brad at geodynamics.org
Thu Nov 26 11:40:19 PST 2009
Author: brad
Date: 2009-11-26 11:40:19 -0800 (Thu, 26 Nov 2009)
New Revision: 16045
Removed:
short/3D/PyLith/branches/pylith-friction/playpen/friction/twohex8-axialdisp.spatialdb
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4.cfg
Modified:
short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc
short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-axial.cfg
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-opening.cfg
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg
short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear.cfg
short/3D/PyLith/branches/pylith-friction/pylith/faults/FaultCohesiveDynL.py
short/3D/PyLith/branches/pylith-friction/pylith/meshio/OutputFaultDyn.py
Log:
Enabled output of fault information for dynamic fault.
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.cc 2009-11-26 19:40:19 UTC (rev 16045)
@@ -1116,19 +1116,19 @@
buffer.scale(1.0);
return buffer;
- } else if (0 == strncasecmp("final_slip_X", name, slipStrLen)) {
- const std::string value = std::string(name).substr(slipStrLen+1);
+ } else if (0 == strncasecmp("initial_traction", name, slipStrLen)) {
+ assert(0 != _dbInitial);
+ const topology::Field<topology::SubMesh>& initialTraction =
+ _fields->get("initial traction");
+ return initialTraction;
- } else if (0 == strncasecmp("slip_time_X", name, timeStrLen)) {
- const std::string value = std::string(name).substr(timeStrLen+1);
-
- } else if (0 == strcasecmp("traction_change", name)) {
+ } else if (0 == strcasecmp("traction", name)) {
assert(0 != fields);
const topology::Field<topology::Mesh>& dispT = fields->get("disp(t)");
_allocateBufferVertexVectorField();
topology::Field<topology::SubMesh>& buffer =
_fields->get("buffer (vector)");
- _calcTractionsChange(&buffer, dispT);
+ _calcTractions(&buffer, dispT);
return buffer;
} else {
@@ -1454,7 +1454,7 @@
// Compute change in tractions on fault surface using solution.
// NOTE: We must convert vertex labels to fault vertex labels
void
-pylith::faults::FaultCohesiveDynL::_calcTractionsChange(
+pylith::faults::FaultCohesiveDynL::_calcTractions(
topology::Field<topology::SubMesh>* tractions,
const topology::Field<topology::Mesh>& dispT)
{ // _calcTractionsChange
@@ -1463,9 +1463,6 @@
assert(0 != _fields);
assert(0 != _normalizer);
- tractions->label("traction_change");
- tractions->scale(_normalizer->pressureScale());
-
// Get vertices from mesh of domain.
const ALE::Obj<SieveMesh>& sieveMesh = dispT.mesh().sieveMesh();
assert(!sieveMesh.isNull());
@@ -1490,6 +1487,43 @@
const ALE::Obj<RealSection>& dispTSection = dispT.section();
assert(!dispTSection.isNull());
+ // Fiber dimension of tractions matches spatial dimension.
+ const int fiberDim = _quadrature->spaceDim();
+ double_array tractionsVertex(fiberDim);
+
+ // Allocate buffer for tractions field (if nec.).
+ const ALE::Obj<RealSection>& tractionsSection = tractions->section();
+ if (tractionsSection.isNull()) {
+ ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
+ //logger.stagePush("Fault");
+
+ const topology::Field<topology::SubMesh>& slip =_fields->get("slip");
+ tractions->newSection(slip, fiberDim);
+ tractions->allocate();
+
+ //logger.stagePop();
+ } // if
+ assert(!tractionsSection.isNull());
+ const double pressureScale = _normalizer->pressureScale();
+ tractions->label("traction");
+ tractions->scale(pressureScale);
+ tractions->zero();
+
+ // Set tractions to initial tractions if they exist
+ if (0 != _dbInitial) {
+ const ALE::Obj<RealSection>& initialTractionSection =
+ _fields->get("initial traction").section();
+ assert(!initialTractionSection.isNull());
+ for (SubMesh::label_sequence::iterator v_iter = fverticesBegin;
+ v_iter != fverticesEnd;
+ ++v_iter) {
+ initialTractionSection->restrictPoint(*v_iter, &tractionsVertex[0],
+ tractionsVertex.size());
+ assert(fiberDim == tractionsSection->getFiberDimension(*v_iter));
+ tractionsSection->updatePoint(*v_iter, &tractionsVertex[0]);
+ } // for
+ } // if
+
const int numFaultVertices = fvertices->size();
Mesh::renumbering_type& renumbering = faultSieveMesh->getRenumbering();
const SieveSubMesh::renumbering_type::const_iterator renumberingEnd =
@@ -1519,26 +1553,6 @@
}
#endif
- // Fiber dimension of tractions matches spatial dimension.
- const int fiberDim = _quadrature->spaceDim();
- double_array tractionsVertex(fiberDim);
-
- // Allocate buffer for tractions field (if nec.).
- const ALE::Obj<RealSection>& tractionsSection = tractions->section();
- if (tractionsSection.isNull()) {
- ALE::MemoryLogger& logger = ALE::MemoryLogger::singleton();
- //logger.stagePush("Fault");
-
- const topology::Field<topology::SubMesh>& slip =_fields->get("slip");
- tractions->newSection(slip, fiberDim);
- tractions->allocate();
-
- //logger.stagePop();
- } // if
- assert(!tractionsSection.isNull());
- tractions->zero();
-
- const double pressureScale = tractions->scale();
for (SieveMesh::label_sequence::iterator v_iter = verticesBegin;
v_iter != verticesEnd;
++v_iter)
@@ -1557,7 +1571,7 @@
for (int i=0; i < fiberDim; ++i)
tractionsVertex[i] = dispTVertex[i] / areaVertex[0];
- tractionsSection->updatePoint(vertexFault, &tractionsVertex[0]);
+ tractionsSection->updatePointAllAdd(vertexFault, &tractionsVertex[0]);
} // if
PetscLogFlops(numFaultVertices * (1 + fiberDim) );
@@ -1565,7 +1579,7 @@
#if 0 // DEBUGGING
tractions->view("TRACTIONS");
#endif
-} // _calcTractionsChange
+} // _calcTractions
// ----------------------------------------------------------------------
void
Modified: short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh
===================================================================
--- short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/libsrc/faults/FaultCohesiveDynL.hh 2009-11-26 19:40:19 UTC (rev 16045)
@@ -263,11 +263,10 @@
/** Compute change in tractions on fault surface using solution.
*
* @param tractions Field for tractions.
- * @param mesh Finite-element mesh for domain
* @param solution Solution over domain
*/
- void _calcTractionsChange(topology::Field<topology::SubMesh>* tractions,
- const topology::Field<topology::Mesh>& solution);
+ void _calcTractions(topology::Field<topology::SubMesh>* tractions,
+ const topology::Field<topology::Mesh>& solution);
/// Allocate buffer for vector field.
void _allocateBufferVertexVectorField(void);
Deleted: short/3D/PyLith/branches/pylith-friction/playpen/friction/twohex8-axialdisp.spatialdb
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twohex8-axialdisp.spatialdb 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twohex8-axialdisp.spatialdb 2009-11-26 19:40:19 UTC (rev 16045)
@@ -1,44 +0,0 @@
-#SPATIAL.ascii 1
-
-// This database is used to specify the boundary conditions for the axial
-// displacement example.
-
-// This follows the format for a Simple DB.
-SimpleDB {
-
- // There are 3 values specified in the database, corresponding to the
- // constraint values for the x, y, and z degrees of freedom.
- num-values = 3
- value-names = displacement-x displacement-y displacement-z
-
- // The constraint values (displacements) have units of meters.
- value-units = m m m
-
- // The values are specified at 2 spatial locations.
- num-locs = 2
-
- // The dimension of the spatial distribution is 1, since data is being
- // specified at points.
- data-dim = 1
-
- // The spatial dimension of the database is 3.
- space-dim = 3
-
- // We are specifying the data in a Cartesian coordinate system.
- cs-data = cartesian {
-
- // Our units are already in meters, so we can just multiply by one.
- to-meters = 1.0
-
- // We are using a 3D Cartesian coordinate system.
- space-dim = 3
- }
-}
-
-// This is where the data is specified.
-// As described in axialdisp.cfg, this database will be used to specify
-// data along edges.
-// The entries are:
-// X-coord, Y-coord, Z-coord, disp-x disp-y disp-z
--1.0 0.0 0.0 -0.01 0.0 0.0
- 1.0 0.0 0.0 0.01 0.0 0.0
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-axial.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-axial.cfg 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-axial.cfg 2009-11-26 19:40:19 UTC (rev 16045)
@@ -184,8 +184,7 @@
# Give basename for VTK fault output.
[pylithapp.timedependent.interfaces.fault.output]
writer.filename = twoquad4-axial-fault.vtk
-vertex_info_fields = []
-vertex_data_fields = []
+vertex_info_fields = [strike_dir,normal_dir,initial_traction]
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-opening.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-opening.cfg 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-opening.cfg 2009-11-26 19:40:19 UTC (rev 16045)
@@ -198,8 +198,7 @@
# Give basename for VTK fault output.
[pylithapp.timedependent.interfaces.fault.output]
writer.filename = twoquad4-opening-fault.vtk
-vertex_info_fields = []
-vertex_data_fields = []
+vertex_info_fields = [strike_dir,normal_dir,initial_traction]
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear-dirichletBC.cfg 2009-11-26 19:40:19 UTC (rev 16045)
@@ -199,8 +199,7 @@
# Give basename for VTK fault output.
[pylithapp.timedependent.interfaces.fault.output]
writer.filename = twoquad4-shear-dirichletBC-fault.vtk
-vertex_info_fields = []
-vertex_data_fields = []
+vertex_info_fields = [strike_dir,normal_dir,initial_traction]
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
Modified: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear.cfg 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4-shear.cfg 2009-11-26 19:40:19 UTC (rev 16045)
@@ -209,8 +209,7 @@
# Give basename for VTK fault output.
[pylithapp.timedependent.interfaces.fault.output]
writer.filename = twoquad4-shear-fault.vtk
-vertex_info_fields = []
-vertex_data_fields = []
+vertex_info_fields = [strike_dir,normal_dir,initial_traction]
# Give basename for VTK output of state variables.
[pylithapp.timedependent.materials.material.output]
Deleted: short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4.cfg
===================================================================
--- short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4.cfg 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/playpen/friction/twoquad4.cfg 2009-11-26 19:40:19 UTC (rev 16045)
@@ -1,211 +0,0 @@
-# -*- Python -*-
-
-# The settings in this file (pylithapp.cfg) will be read automatically
-# by pylith, as long as the file is placed in the run directory.
-
-# The settings in this file will override any settings in:
-# PREFIX/etc/pylithapp.cfg
-# $HOME/.pyre/pylithapp/pylithapp.cfg
-
-# The settings in this file will be overridden by any .cfg file given
-# on the command line or by any command line settings.
-
-[pylithapp]
-
-# ----------------------------------------------------------------------
-# journal
-# ----------------------------------------------------------------------
-# The settings below turn on journal info for the specified components.
-# If you want less output to stdout, you can turn these off.
-[pylithapp.journal.info]
-timedependent = 1
-implicit = 1
-petsc = 1
-solverlinear = 1
-meshioascii = 1
-homogeneous = 1
-elasticityimplicit = 1
-fiatlagrange = 1
-quadrature1d = 1
-faultcohesivedyn = 1
-
-# ----------------------------------------------------------------------
-# mesh_generator
-# ----------------------------------------------------------------------
-# The settings below control the mesh generation (importing mesh info).
-# Turn on debugging output for mesh generation.
-[pylithapp.mesh_generator]
-debug = 0
-
-# This component specification means we are using PyLith ASCII format,
-# and we then specify the filename and number of space dimensions for
-# the mesh.
-[pylithapp.mesh_generator.reader]
-filename = twoquad4.mesh
-coordsys.space_dim = 2
-
-# ----------------------------------------------------------------------
-# problem
-# ----------------------------------------------------------------------
-# Specify the problem settings.
-# This is a time-dependent problem, so we select this as our problem type.
-# We select a total time of 0 sec, and a time step size of 1 sec, so we
-# are performing a single time step.
-# The spatial dimension for this problem is 2.
-# For an implicit formulation (using implicit.cfg), we will perform 1
-# implicit time step from t = -1.0 to t = 0.0 (elastic solution step).
-[pylithapp.timedependent]
-dimension = 2
-normalizer.length_scale = 1.0*m
-formulation = pylith.problems.Implicit
-formulation.solver = pylith.problems.SolverNonlinear
-
-# Set bc to an array with 2 boundary conditions: 'x_neg' and 'x_pos'.
-bc = [x_neg,x_pos]
-
-# Set interfaces to an array with 1 fault: 'fault'.
-interfaces = [fault]
-
-
-[pylithapp.timedependent.formulation.time_step]
-total_time = 0.0*s
-dt = 1.0*s
-
-
-# ----------------------------------------------------------------------
-# materials
-# ----------------------------------------------------------------------
-# Specify the material information for the problem.
-# The material type is isotropic elastic formulated for plane strain.
-[pylithapp.timedependent.materials]
-material = pylith.materials.ElasticPlaneStrain
-
-[pylithapp.timedependent.materials.material]
-
-# We give a label of 'elastic material' to this material.
-label = elastic material
-
-# The cells associated with this material are given a material ID of 0
-# in the mesh file.
-id = 0
-
-# The properties for this material are given in the spatial database file
-# 'matprops.spatialdb'.
-db_properties.iohandler.filename = matprops.spatialdb
-
-# Set cell type to quadrilateral (2-d Lagrange).
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 2
-
-# ----------------------------------------------------------------------
-# boundary conditions
-# ----------------------------------------------------------------------
-# Provide information on the boundary conditions.
-
-# Boundary conditions to be applied to the negative x-side of the mesh.
-[pylithapp.timedependent.bc.x_neg]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_neg' in the mesh file.
-label = x_neg
-
-db_initial = spatialdata.spatialdb.UniformDB
-db_initial.label = Dirichlet BC -x edge
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*m,-0.001*m]
-
-# Boundary conditions to be applied to the positive x-side of the mesh.
-[pylithapp.timedependent.bc.x_pos]
-
-# We are fixing the 0 (x) and 1 (y) degrees of freedom.
-bc_dof = [0, 1]
-
-# The nodes associated with this boundary condition have the name
-# 'x_pos' in the mesh file.
-label = x_pos
-
-db_initial = spatialdata.spatialdb.UniformDB
-db_initial.label = Dirichlet BC +x edge
-db_initial.values = [displacement-x,displacement-y]
-db_initial.data = [0.0*m,0.001*m]
-
-# ----------------------------------------------------------------------
-# faults
-# ----------------------------------------------------------------------
-# Provide information on the fault (interface).
-[pylithapp.timedependent.interfaces]
-
-fault = pylith.faults.FaultCohesiveDyn
-
-# Define fault properties.
-[pylithapp.timedependent.interfaces.fault]
-
-# The nodes associated with this fault have the name 'fault' in the mesh file.
-label = fault
-
-# NOTE: It is possible to assign an ID number to a fault (e.g.,
-# 'id = 10'). Care must be taken when doing this, however, because the
-# assigned ID will become the material ID for the cohesive element.
-# This ID must not conflict with any of the material ID numbers for
-# volume elements. The default ID for a fault is 100. If you have a
-# fault in your mesh you must:
-# 1. If you create your own fault ID, make sure it does not conflict
-# with any of you material ID's.
-# 2. If you use the default fault ID, make sure that none of your
-# material ID's are equal to 100.
-
-# The quadrature for a 2D fault is 1D with a linear shape.
-quadrature.cell = pylith.feassemble.FIATLagrange
-quadrature.cell.dimension = 1
-
-db_initial_tractions = spatialdata.spatialdb.UniformDB
-db_initial_tractions.label = "Initial fault tractions"
-db_initial_tractions.values = [traction-shear,traction-normal]
-db_initial_tractions.data = [0.0*Pa, -10000.0*MPa]
-
-# ----------------------------------------------------------------------
-# PETSc
-# ----------------------------------------------------------------------
-# We are using all of the default settings for PETSc except for
-# specifying the block Jacobi preconditioner. Additional PETSc
-# command-line arguments may be found in the PETSc documentation.
-[pylithapp.petsc]
-ksp_rtol = 1.0e-8
-pc_type = asm
-# Change the preconditioner settings (must turn off
-# shift_positive_definite and turn on shift_nonzero).
-sub_pc_factor_shift_positive_definite = 0
-sub_pc_factor_shift_nonzero =
-
-#ksp_monitor = true
-#ksp_view = true
-#log_summary = true
-ksp_max_it = 100
-ksp_gmres_restart = 50
-#start_in_debugger = true
-
-snes_monitor = true
-snes_view = true
-ksp_converged_reason = true
-snes_converged_reason = true
-
-# ----------------------------------------------------------------------
-# output
-# ----------------------------------------------------------------------
-# Give basename for VTK domain output of solution over domain.
-[pylithapp.problem.formulation.output.output.writer]
-filename = twoquad4.vtk
-
-# Give basename for VTK fault output.
-[pylithapp.timedependent.interfaces.fault.output]
-writer.filename = twoquad4-fault.vtk
-cell_info_fields = []
-cell_data_fields = []
-
-# Give basename for VTK output of state variables.
-[pylithapp.timedependent.materials.material.output]
-cell_filter = pylith.meshio.CellFilterAvgMesh
-writer.filename = twoquad4-statevars.vtk
Modified: short/3D/PyLith/branches/pylith-friction/pylith/faults/FaultCohesiveDynL.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/faults/FaultCohesiveDynL.py 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/pylith/faults/FaultCohesiveDynL.py 2009-11-26 19:40:19 UTC (rev 16045)
@@ -53,9 +53,9 @@
factory=NullComponent)
db.meta['tip'] = "Spatial database for initial tractions."
- from pylith.meshio.OutputFaultKin import OutputFaultKin
+ from pylith.meshio.OutputFaultDyn import OutputFaultDyn
output = pyre.inventory.facility("output", family="output_manager",
- factory=OutputFaultKin)
+ factory=OutputFaultDyn)
output.meta['tip'] = "Output manager associated with fault data."
Modified: short/3D/PyLith/branches/pylith-friction/pylith/meshio/OutputFaultDyn.py
===================================================================
--- short/3D/PyLith/branches/pylith-friction/pylith/meshio/OutputFaultDyn.py 2009-11-26 08:14:09 UTC (rev 16044)
+++ short/3D/PyLith/branches/pylith-friction/pylith/meshio/OutputFaultDyn.py 2009-11-26 19:40:19 UTC (rev 16045)
@@ -31,8 +31,8 @@
Python object for managing OutputFaultDyn facilities and properties.
\b Properties
- @li \b cell_info_fields Names of cell info fields to output.
- @li \b cell_data_fields Names of cell data fields to output.
+ @li \b vertex_info_fields Names of vertex info fields to output.
+ @li \b vertex_data_fields Names of vertex data fields to output.
\b Facilities
@li None
@@ -44,14 +44,14 @@
import pyre.inventory
- cellInfoFields = pyre.inventory.list("cell_info_fields",
+ vertexInfoFields = pyre.inventory.list("vertex_info_fields",
default=["normal_dir"])
- cellInfoFields.meta['tip'] = "Names of cell info fields to output."
+ vertexInfoFields.meta['tip'] = "Names of vertex info fields to output."
- cellDataFields = pyre.inventory.list("cell_data_fields",
- default=["slip",
- "traction"])
- cellDataFields.meta['tip'] = "Names of cell data fields to output."
+ vertexDataFields = pyre.inventory.list("vertex_data_fields",
+ default=["slip",
+ "traction"])
+ vertexDataFields.meta['tip'] = "Names of vertex data fields to output."
# PUBLIC METHODS /////////////////////////////////////////////////////
@@ -71,8 +71,8 @@
Set members based using inventory.
"""
OutputManagerSubMesh._configure(self)
- self.cellInfoFields = self.inventory.cellInfoFields
- self.cellDataFields = self.inventory.cellDataFields
+ self.vertexInfoFields = self.inventory.vertexInfoFields
+ self.vertexDataFields = self.inventory.vertexDataFields
return
More information about the CIG-COMMITS
mailing list