Exemplo n.º 1
0
    def __init__(self, name=None):
        Script.__init__(self, name)
        DynamicComponentHarness.__init__(self)

        self.client = ''

        return
Exemplo n.º 2
0
    def __init__(self, name="slip_invert"):
        Application.__init__(self, name)

        self.dataCoords = None
        self.dataVals = None
        self.dataCov = None
        self.dataNames = []
        self.numDataPoints = 0
        self.numDesignRows = 0

        self.numFaultVerts = 0
        self.numFaultCells = 0
        self.faultVertCoords = None
        self.faultCells = None

        self.numImpulses = 0
        self.impulseInds = None
        self.impulseCoords = None

        self.summaryHead = 'Penalty-weight\tData-residual\t' + \
                           'Weighted-data-residual\tPenalty-residual\t' + \
                           'Weighted-penalty-residual\tTotal-residual\t' + \
                           'Total-weighted-residual'
        self.numSummaryCols = 7

        self.design = None

        return
Exemplo n.º 3
0
    def _configure(self):
        """Setup members using inventory.
    """
        Application._configure(self)
        # import pdb
        # pdb.set_trace()

        # File info.
        self.vtkInputFile = self.inventory.vtkInputFile
        self.vtkOutputFile = self.inventory.vtkOutputFile

        # Index information
        self.vtkTensorIndex = self.inventory.vtkTensorIndex
        self.vtkTensorComponentsOrder = self.inventory.vtkTensorComponentsOrder

        # Regional field
        s1 = float(self.inventory.regionalSigma1[0])
        s2 = float(self.inventory.regionalSigma1[0])
        s3 = float(self.inventory.regionalSigma1[0])
        sVec = numpy.array([s1, s2, s3], dtype=numpy.float64)
        self.regionalSigma = numpy.diag(sVec)
        self.regionalAxes = numpy.zeros((3, 3), dtype=numpy.float64)
        for i in range(3):
            self.regionalAxes[0,
                              i] = float(self.inventory.regionalSigma1[i + 1])
            self.regionalAxes[1,
                              i] = float(self.inventory.regionalSigma2[i + 1])
            self.regionalAxes[2,
                              i] = float(self.inventory.regionalSigma3[i + 1])

        return
Exemplo n.º 4
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        self.snapshots = list(map(float, self.snapshots))

        return
Exemplo n.º 5
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        self.dataDim = self.inventory.dataDim
        self.pointsFile = self.inventory.pointsFile
        self.segsFile = self.inventory.segsFile
        self.slipScale = self.inventory.slipScale
        self.spaceDim = 3
        self.pointsSpatialDB = self.inventory.pointsSpatialDB
        self.upDir = self.inventory.upDir
        self.normalDir = self.inventory.normalDir
        self.dipSlip = self.inventory.dipSlip
        self.dipCutoff = self.inventory.dipCutoff
        self.xMinVal = self.inventory.xMin.value
        self.xMaxVal = self.inventory.xMax.value
        self.yMinVal = self.inventory.yMin.value
        self.yMaxVal = self.inventory.yMax.value
        self.zMinVal = self.inventory.zMin.value
        self.zMaxVal = self.inventory.zMax.value
        self.defaultValues = self.inventory.defaultValues

        self.upVec = numpy.array([float(self.upDir[0]), float(self.upDir[1]),
                                  float(self.upDir[2])], dtype=numpy.float64)

        self.normalVec = numpy.array([float(self.normalDir[0]),
                                      float(self.normalDir[1]),
                                      float(self.normalDir[2])], dtype=numpy.float64)

        self.dipCutoffProj = abs(math.sin(self.dipCutoff.value))

        return
Exemplo n.º 6
0
 def __init__(self, name="transform"):
     Application.__init__(self, name)
     self.numPoints = 0
     self.numSegs = 0
     self.segInfo = None
     self.pointsUTM = []
     self.normals = []
     return
Exemplo n.º 7
0
    def __init__(self, name, asCGI=None):
        Script.__init__(self, name)
        self.stream = None

        if asCGI is None:
            asCGI = True
        self.asCGIScript(asCGI)

        return
Exemplo n.º 8
0
 def _configure(self):
     """Setup members using inventory.
     """
     Application._configure(self)
     self.polesInputFile = self.inventory.polesInputFile
     self.polesOutputFile = self.inventory.polesOutputFile
     self.geogToCart = self.inventory.geogToCart
     self.spaceDim = 3
     return
Exemplo n.º 9
0
 def __init__(self, name="euler"):
     Application.__init__(self, name)
     self.numPoints = 0
     self.pointsUTM = []
     self.normals = []
     self.eulerPole = numpy.array([0.0, 0.0, 0.0], dtype=numpy.float64)
     # Note that we use a mean radius since we are doing rotations on a
     # spherical Earth.
     self.earthRad = 6372795.477598
     return
Exemplo n.º 10
0
    def __init__(self, name="generate_slowslip"):
        Application.__init__(self, name)

        self.lon = None
        self.lat = None
        self.z = None
        self.grid = None
        self.faultSlip = None

        return
Exemplo n.º 11
0
 def _configure(self):
     Application._configure(self)
     self.modeler = self.inventory.modeler
     self.contours = self.inventory.contours
     self.extender = self.inventory.extender
     self.slabTopFilename = self.inventory.slabTopFilename
     self.slabBotFilename = self.inventory.slabBotFilename
     self.splayFilename = self.inventory.splayFilename
     self.slabThickness = self.inventory.slabThickness
     self.slabNormalDir = self.inventory.slabNormalDir
Exemplo n.º 12
0
 def _configure(self):
     """Setup members using inventory.
     """
     Application._configure(self)
     self.ucdFaceFile = self.inventory.ucdFaceFile
     self.faultIDNum = self.inventory.faultIDNum
     self.pointOutputFile = self.inventory.pointOutputFile
     self.nodeValuesList = self.inventory.nodeValuesList
     self.excludeZeroNormals = self.inventory.excludeZeroNormals
     return
Exemplo n.º 13
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        self.srcCoordSys = self.inventory.srcCoordSys
        self.destCoordSys = self.inventory.destCoordSys
        self.dataDim = self.inventory.dataDim
        self.bcType = self.inventory.bcType
        self.pointsFile = self.inventory.pointsFile
        self.pointsSpatialDB = self.inventory.pointsSpatialDB
        self.bcScale = self.inventory.bcScale
        self.upDir = self.inventory.upDir
        self.normalDir = self.inventory.normalDir
        self.eulerLat = self.inventory.eulerLat
        self.eulerLon = self.inventory.eulerLon
        self.eulerRot = self.inventory.eulerRot
        self.spaceDim = self.srcCoordSys.spaceDim
        self.dipSlip = self.inventory.dipSlip
        self.dipCutoff = self.inventory.dipCutoff
        self.xMinVal = self.inventory.xMin.value
        self.xMaxVal = self.inventory.xMax.value
        self.yMinVal = self.inventory.yMin.value
        self.yMaxVal = self.inventory.yMax.value
        self.zMinVal = self.inventory.zMin.value
        self.zMaxVal = self.inventory.zMax.value
        self.defaultValues = self.inventory.defaultValues

        lat = self.eulerLat.value
        lon = self.eulerLon.value
        rot = self.eulerRot.value
        clat = math.cos(lat)
        slat = math.sin(lat)
        clon = math.cos(lon)
        slon = math.sin(lon)
        # Note that the Euler pole already includes the earth radius term.
        self.eulerPole[0] = self.earthRad * rot * clat * clon
        self.eulerPole[1] = self.earthRad * rot * clat * slon
        self.eulerPole[2] = self.earthRad * rot * slat

        self.upVec = numpy.array(
            [float(self.upDir[0]),
             float(self.upDir[1]),
             float(self.upDir[2])],
            dtype=numpy.float64)

        self.normalVec = numpy.array([
            float(self.normalDir[0]),
            float(self.normalDir[1]),
            float(self.normalDir[2])
        ],
                                     dtype=numpy.float64)

        self.dipCutoffProj = abs(math.sin(self.dipCutoff.value))

        return
Exemplo n.º 14
0
 def _configure(self):
     """Setup members using inventory.
     """
     Application._configure(self)
     self.psetFile = self.inventory.psetFile
     self.ucdFile = self.inventory.ucdFile
     self.pointOutputFile = self.inventory.pointOutputFile
     self.valuesList = self.inventory.valuesList
     self.outputIndex = self.inventory.outputIndex
     self.excludeZeroNormals = self.inventory.excludeZeroNormals
     return
Exemplo n.º 15
0
  def __init__(self, name="make_synthetic_gpsdisp"):
    Application.__init__(self, name)

    self.coords = None
    self.stations = None
    self.dispRaw = None
    self.dispNoise = None

    self.numStations = 0

    return
Exemplo n.º 16
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        self.penaltyWeights = numpy.array(self.penaltyWeightVals, dtype=numpy.float64)
        self.numPenaltyWeights = self.penaltyWeights.shape[0]

        # Left-lateral and updip components from assumed rake.
        self.llComp = math.cos(self.rake.value)
        self.udComp = math.sin(self.rake.value)

        return
Exemplo n.º 17
0
    def __init__(self, name="vtkdiff"):
        Application.__init__(self, name)
        self.vtkInputList = []
        self.numVtkInputFiles = 0
        self.vtkInputTimes = []
        self.timeStampWidth = 0

        self.numVertsPerCell = 0
        self.numCells = 0
        self.numVerts = 0
        self.spaceDim = 0
        self.cellType = None
        self.readMesh = False
        return
Exemplo n.º 18
0
    def __init__(self, name="dem2lines"):
        Application.__init__(self, name)
        self.numXIn = 0
        self.numYIn = 0
        self.numZIn = 0
        self.numXOut = 0
        self.numYOut = 0
        self.numZOut = 0
        self.xIn = None
        self.yIn = None
        self.zIn = None
        self.xOut = None
        self.yOut = None
        self.zOut = None

        return
Exemplo n.º 19
0
    def _configure(self):
        """Setup members using inventory.
    """
        Application._configure(self)

        # Filenames
        self.faultInfoFile = self.inventory.faultInfoFile
        self.faultResultsFile = self.inventory.faultResultsFile
        self.faultOutputFile = self.inventory.faultOutputFile

        # Parameters
        self.frictionCoeff = self.inventory.frictionCoeff
        self.stressScaleFactor = self.inventory.stressScaleFactor
        self.slipScaleFactor = self.inventory.slipScaleFactor
        self.shearDirection = self.inventory.shearDirection

        return
Exemplo n.º 20
0
    def __init__(self, name="faultinfo"):
        Application.__init__(self, name)

        self.numVertsPerCell = 0
        self.numCells = 0
        self.cellsArray = numpy.array([0])
        self.verticesArray = numpy.array([0])
        self.normalVec = numpy.array([0])
        self.strikeVec = numpy.array([0])
        self.dipVec = numpy.array([0])
        self.stressVec = numpy.array([0])
        self.slipVec = numpy.array([0])
        self.numVerts = 0
        self.spaceDim = 0
        self.cellType = ""
        self.readMesh = False

        return
Exemplo n.º 21
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        import os
        import re

        # Set up info for input files
        totalInputPath = os.path.normpath(os.path.join(os.getcwd(),
                                                       self.inventory.vtkInputRoot))
        self.vtkInputDir = os.path.dirname(totalInputPath)
        baseInputName = os.path.basename(totalInputPath)
        baseInputNameLen = len(baseInputName)
        if baseInputName.endswith(".vtk"):
            baseInputNameStripped = baseInputName[0:baseInputNameLen - 4]
        else:
            baseInputNameStripped = baseInputName
        testFind = re.search('_t[0-9]*$', baseInputNameStripped)
        if testFind != None:
            timeInd = baseInputNameStripped.rfind(testFind.group(0))
            self.vtkInputRoot = baseInputNameStripped[0:timeInd]
        else:
            self.vtkInputRoot = baseInputNameStripped

        # Set up info for output files
        totalOutputPath = os.path.normpath(os.path.join(
            os.getcwd(), self.inventory.vtkOutputRoot))
        self.vtkOutputDir = os.path.dirname(totalOutputPath)
        baseOutputName = os.path.basename(totalOutputPath)
        baseOutputNameLen = len(baseOutputName)
        if baseOutputName.endswith(".vtk"):
            baseOutputNameStripped = baseOutputName[0:baseOutputNameLen - 4]
        else:
            baseOutputNameStripped = baseOutputName
        testFind = re.search('_t[0-9]*$', baseOutputNameStripped)
        if testFind != None:
            timeInd = baseOutputNameStripped.rfind(testFind.group(0))
            self.vtkOutputRoot = baseOutputNameStripped[0:timeInd]
        else:
            self.vtkOutputRoot = baseOutputNameStripped

        self.scaleFactor = self.inventory.scaleFactor

        return
Exemplo n.º 22
0
    def __init__(self, name="vtkcff"):
        Application.__init__(self, name)
        self.vtkInputList = []
        self.numVtkInputFiles = 0
        self.vtkInputTimes = []
        self.timeStampWidth = 0
        self.refFileIndex = 0

        self.numVertsPerCell = 0
        self.numCells = 0
        self.cellsArray = numpy.array([0])
        self.verticesArray = numpy.array([0])
        self.numVerts = 0
        self.spaceDim = 0
        self.cellType = ""
        self.readMesh = False

        self.numStressPoints = 0
        return
Exemplo n.º 23
0
    def __init__(self, name="princaxes"):
        Application.__init__(self, name)

        self.cells = None
        self.vertArray = None
        self.spaceDim = 0
        self.cellType = ""

        self.numTensorPoints = 0
        self.tensorSorted = None

        self.minPrincAxis = None
        self.intPrincAxis = None
        self.maxPrincAxis = None
        self.minEigenvalue = None
        self.intEigenvalue = None
        self.maxEigenvalue = None

        self.regionalField = numpy.zeros((3, 3), dtype=numpy.float64)
        return
Exemplo n.º 24
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)

        # Filenames
        self.inputDem = self.inventory.inputDem
        self.vtkOutputFile = self.inventory.vtkOutputFile
        self.masterJournal = self.inventory.masterJournal
        self.uLinePrefix = self.inventory.uLinePrefix
        self.uLineJournal = self.inventory.uLineJournal
        self.vLinePrefix = self.inventory.vLinePrefix
        self.vLineJournal = self.inventory.vLineJournal
        self.acisFilename = self.inventory.acisFilename

        # Parameters
        self.xMin = self.inventory.xMin
        self.xMax = self.inventory.xMax
        self.yMin = self.inventory.yMin
        self.yMax = self.inventory.yMax
        self.skipInterval = self.inventory.skipInterval

        return
Exemplo n.º 25
0
 def __init__(self, name="geo2cart"):
     Application.__init__(self, name)
     self.numPoles = 0
     self.polesSource = []
     return
Exemplo n.º 26
0
 def __init__(self, name="surfaceapp"):
     """Constructor.
     """
     Application.__init__(self, name)
     return
Exemplo n.º 27
0
    def _configure(self):
        """Setup members using inventory.
        """
        Application._configure(self)
        import pdb
        pdb.set_trace()

        # Set up info for input files
        totalInputPath = os.path.normpath(
            os.path.join(os.getcwd(), self.inventory.vtkInputRoot))
        self.vtkInputDir = os.path.dirname(totalInputPath)
        baseInputName = os.path.basename(totalInputPath)
        baseInputNameLen = len(baseInputName)
        if baseInputName.endswith(".vtk"):
            baseInputNameStripped = baseInputName[0:baseInputNameLen - 4]
        else:
            baseInputNameStripped = baseInputName
        testFind = re.search('_t[0-9]*$', baseInputNameStripped)
        if testFind != None:
            timeInd = baseInputNameStripped.rfind(testFind.group(0))
            self.vtkInputRoot = baseInputNameStripped[0:timeInd]
        else:
            self.vtkInputRoot = baseInputNameStripped

        # Solution mode info
        self.stressRefMode = self.inventory.stressRefMode
        self.orientationMode = self.inventory.orientationMode
        self.initialStateIndex = self.inventory.initialStateIndex
        self.constantStateValues = self.inventory.constantStateValues
        self.isotropicPoroelastic = self.inventory.isotropicPoroelastic

        # Index information
        self.vtkStressIndex = self.inventory.vtkStressIndex
        self.vtkStressComponentsOrder = self.inventory.vtkStressComponentsOrder

        # Parameters
        self.frictionCoeff = self.inventory.frictionCoeff
        self.skemptonCoeff = self.inventory.skemptonCoeff
        self.cffPlaneNormal = numpy.array([
            float(self.inventory.cffPlaneNormal[0]),
            float(self.inventory.cffPlaneNormal[1]),
            float(self.inventory.cffPlaneNormal[2]),
        ],
                                          dtype=numpy.float64)

        # Set up info for output files
        totalOutputPath = os.path.normpath(
            os.path.join(os.getcwd(), self.inventory.vtkOutputRoot))
        self.vtkOutputDir = os.path.dirname(totalOutputPath)
        baseOutputName = os.path.basename(totalOutputPath)
        baseOutputNameLen = len(baseOutputName)
        if baseOutputName.endswith(".vtk"):
            baseOutputNameStripped = baseOutputName[0:baseOutputNameLen - 4]
        else:
            baseOutputNameStripped = baseOutputName
        testFind = re.search('_t[0-9]*$', baseOutputNameStripped)
        if testFind != None:
            timeInd = baseOutputNameStripped.rfind(testFind.group(0))
            self.vtkOutputRoot = baseOutputNameStripped[0:timeInd]
        else:
            self.vtkOutputRoot = baseOutputNameStripped

        return
Exemplo n.º 28
0
 def _configure(self):
     """Setup members using inventory.
     """
     Application._configure(self)
Exemplo n.º 29
0
 def __init__(self, name="grabpoints"):
     Application.__init__(self, name)
     self.numPoints = 0
     self.indices = []
     self.pointCoords = []
     return
Exemplo n.º 30
0
 def __init__(self, name="grabfaces"):
     Application.__init__(self, name)
     return