def getBND(self): ''' Returns the grid boundary''' retval= geom.BND3d() points= self.uGrid.GetPoints() if(points.GetNumberOfPoints()>0): bounds= points.GetBounds() retval= geom.BND3d(geom.Pos3d(bounds[0],bounds[2],bounds[4]),geom.Pos3d(bounds[1],bounds[3],bounds[5])) else: warnMsg= 'there are no points in the grid: ' warnMsg+= self.uGrid.name warnMsg+= '. Maybe you must call fillDownwards on the set to display.' lmsg.warning('Warning; '+warnMsg) return retval
def getLoadBoundary(self): '''Return the boundary of the vehicle loads.''' retval= geom.BND3d() tmp= self.getLoadPositions() for p in tmp: retval.update(p) return retval
elements= preprocessor.getElementHandler elements.defaultTransformation= "lin" # Coord. transformation. elements.defaultMaterial= "section" ele0= elements.newElement("ElasticBeam3d",xc.ID([nod0.tag,nod1.tag])) ele1= elements.newElement("ElasticBeam3d",xc.ID([nod2.tag,nod3.tag])) points= preprocessor.getMultiBlockTopology.getPoints pt0= points.newPntFromPos3d(geom.Pos3d(0.0,0.0,0.0)) pt1= points.newPntFromPos3d(geom.Pos3d(0.5,0.5,0.5)) pt2= points.newPntFromPos3d(geom.Pos3d(3.0,3.0,3.0)) pt3= points.newPntFromPos3d(geom.Pos3d(4.0,4.0,4.0)) l1= preprocessor.getMultiBlockTopology.getLines.newLine(pt0.tag,pt1.tag) l2= preprocessor.getMultiBlockTopology.getLines.newLine(pt2.tag,pt3.tag) geomObj= geom.BND3d(geom.Pos3d(-1.0,-1.0,-1.0),geom.Pos3d(1.0,1.0,1.0)) xcTotalSet= preprocessor.getSets.getSet('total') setIn= preprocessor.getSets.defSet('setIn') setIn.nodes= xcTotalSet.nodes.pickNodesInside(geomObj,0.0) setIn.elements= xcTotalSet.elements.pickElemsInside(geomObj,0.0) setIn.points= xcTotalSet.points.pickPointsInside(geomObj,0.0) setIn.lines= xcTotalSet.lines.pickLinesInside(geomObj,0.0) nNodes= len(setIn.nodes) nElements= len(setIn.elements) nPoints= len(setIn.points) nLines= len(setIn.lines) ratio= (nNodes-2)**2+(nElements-1)**2+(nPoints-2)**2+(nLines-1)**2
def getBND(self): ''' Returns the grid boundary''' bounds = self.uGrid.GetPoints().GetBounds() retval = geom.BND3d(geom.Pos3d(bounds[0], bounds[2], bounds[4]), geom.Pos3d(bounds[1], bounds[3], bounds[5])) return retval
ratio3 = allButWall.getNumElements - (floor1_nel + floor2_nel + columns_nel) onlyColumns = allButWall - (floor1 + floor2) ratio4 = onlyColumns.getNumElements - columns_nel # Intersection int1 = overallSet * onlyColumns int2 = overallSet * allButWall * onlyColumns ratio5 = int1.getNumElements - int2.getNumElements int4 = (floor1 + floor2) * onlyColumns ratio6 = int4.getNumElements # **** Subsets pxmax = 5 pymax = 13 hexaedr = geom.BND3d(geom.Pos3d(0, 0, 0), geom.Pos3d(xList[pxmax], yList[pymax], zList[5])) wallInHex = sets.get_subset_inside(geomObj=hexaedr, fromSet=wall, toSetName='wallInHex', tol=0.0) wallInHex_nel_targ = (pxmax - wall_rg.getIMin()) * (wall_rg.getKMax() - wall_rg.getKMin()) floor1InHex = sets.get_subset_inside(geomObj=hexaedr, fromSet=floor1, toSetName='floor1InHex', tol=0.0) floor1InHex_nel_targ = (pxmax - floor1_rg.getIMin()) * (pymax - floor1_rg.getJMin())