def calcPressures(self): ''' Foundation pressures over the soil. Calculates pressures and forces in the free nodes of the springs (those that belongs to both the spring and the foundation) and stores these values as properties of those nodes: property 'soilPressure:' [xStress,yStress,zStress] property 'soilReaction:' [xForce,yForce,zForce]''' self.svdReac = geom.SVD3d() f3d = geom.Vector3d(0.0, 0.0, 0.0) m3d = geom.Vector3d(0.0, 0.0, 0.0) for e in self.springs: n = e.getNodes[1] rf = e.getResistingForce() a = n.getTributaryArea() if (len(rf) == 6): f3d = geom.Vector3d(rf[0], rf[1], 0.0) m3d = geom.Vector3d(0.0, 0.0, rf[2]) else: #len(rf)==12 f3d = geom.Vector3d(rf[0], rf[1], rf[2]) m3d = geom.Vector3d(rf[3], rf[4], rf[5]) pos = n.getInitialPos3d self.svdReac += geom.SVD3d(pos, f3d, m3d) #print "dispZ= ", n.getDisp[2]*1e3, "mm" n.setProp('soilPressure', [f3d.x / a, f3d.y / a, f3d.z / a]) n.setProp('soilReaction', [f3d.x, f3d.y, f3d.z]) return self.svdReac.reduceTo(self.getCentroid())
def __init__(self,preprocessor,supportNodes): self.forces= dict() self.moments= dict() self.positions= dict() self.svdReac= geom.SVD3d() meshNodes= preprocessor.getNodeLoader meshNodes.calculateNodalReactions(True) f3d= geom.Vector3d(0.0,0.0,0.0) m3d= geom.Vector3d(0.0,0.0,0.0) for n in supportNodes: tag= n.tag tmp= n.getReaction if(meshNodes.numDOFs==3): force= geom.Vector2d(tmp[0],tmp[1]) f3d= geom.Vector3d(tmp[0],tmp[1],0.0) moment= geom.Vector3d(0.0,0.0,tmp[2]) m3d= moment else: force= geom.Vector3d(tmp[0],tmp[1],tmp[2]) f3d= force moment= geom.Vector3d(tmp[3],tmp[4],tmp[5]) m3d= moment self.forces[tag]= force self.moments[tag]= moment pos= n.getInitialPos3d self.positions[tag]= pos self.svdReac+= geom.SVD3d(pos,f3d,m3d)
def getSVDfromVDesliz(DOFs, coo, v): # Returns a SVD which represents vector. if (DOFs == "UV"): return geom.SVD2d(geom.Pos2d(coo[0], coo[1]), geom.Vector2d(v[0], v[1])) elif (DOFs == "UVR"): return geom.SVD2d(geom.Pos2d(coo[0], coo[1]), geom.Vector2d(v[0], v[1]), v[2]) elif (DOFs == "UVW"): return geom.SVD3d(geom.Pos3d(coo[0], coo[1], coo[2]), geom.Vector3d(v[0], v[1], v[2])) elif (DOFs == "UVWRxRyRz"): return geom.SVD3d(geom.Pos3d(coo[0], coo[1], coo[2]), geom.Vector3d(v[0], v[1], v[2]), geom.Vector3d(v[3], v[4], v[5]))
def getSVDfromVDesliz(DOFs,coo,v): '''Returns a sliding vector system that represents the vector. Parameters: :param DOFs: degrees of freedom. :param coo: coordinates of a point in the vector line of action. :param v: vector. ''' if(DOFs=="UV"): return geom.SVD2d(geom.Pos2d(coo[0],coo[1]),geom.Vector2d(v[0],v[1])) elif(DOFs=="UVR"): return geom.SVD2d(geom.Pos2d(coo[0],coo[1]),geom.Vector2d(v[0],v[1]),v[2]) elif(DOFs=="UVW"): return geom.SVD3d(geom.Pos3d(coo[0],coo[1],coo[2]),geom.Vector3d(v[0],v[1],v[2])) elif(DOFs=="UVWRxRyRz"): return geom.SVD3d(geom.Pos3d(coo[0],coo[1],coo[2]),geom.Vector3d(v[0],v[1],v[2]),geom.Vector3d(v[3],v[4],v[5]))
def getReactionFromNodes(modelNodes, DOFs, nodeTags): retval = geom.SVD3d() for tag in nodeTags: n = modelNodes.getNode(tag) retval += getSVDfromVDesliz(DOFs, n.get3dCoo, n.getReaction) return retval
def getReactionFromSetOfNodes(DOFs, nodeSet): nodes = nodeSet.getNodes retval = geom.SVD3d() for n in nodes: retval += getSVDfromVDesliz(DOFs, n.get3dCoo, n.getReaction) return retval