コード例 #1
0
ファイル: output_handler.py プロジェクト: danicc097/xc
    def displayBlocks(self, setToDisplay= None, caption= None, fileName=None):
        '''Display the blocks (points, lines, surfaces and volumes)
           of the set.

           :param setToDisplay: set to display.
           :param caption: title of the graphic.
           :param fileName: name of the file to plot the graphic. Defaults to 
                       None, in that case an screen display is generated
        '''
        if(setToDisplay==None):
            setToDisplay= self.modelSpace.getTotalSet()
        if(caption==None):
            caption= setToDisplay.name+' set; blocks'
        displaySettings= vtk_CAD_graphic.DisplaySettingsBlockTopo()
        displaySettings.cameraParameters= self.getCameraParameters()
        displaySettings.displayBlocks(setToDisplay,caption= caption, fileName= fileName)
コード例 #2
0
CooMaxY= 1
old_stderr= sys.stderr

# Problem type
feProblem= xc.FEProblem()
preprocessor=  feProblem.getPreprocessor
nodes= preprocessor.getNodeHandler

modelSpace= predefined_spaces.SolidMechanics2D(nodes)# Model space definition

# Definition of points.
points= preprocessor.getMultiBlockTopology.getPoints
pt1= points.newPoint(geom.Pos3d(0.0,0.0,0.0))
pt2= points.newPoint(geom.Pos3d(CooMaxX/2,0.0,0.0))
pt3= points.newPoint(geom.Pos3d(CooMaxX,0.0,0.0))
pt4= points.newPoint(geom.Pos3d(0.0,CooMaxY,0.0))
pt5= points.newPoint(geom.Pos3d(CooMaxX/2,CooMaxY,0.0))
pt6= points.newPoint(geom.Pos3d(CooMaxX,CooMaxY,0.0))

# Definition of quadrilateral surfaces.
surfaces= preprocessor.getMultiBlockTopology.getSurfaces
s1= surfaces.newQuadSurfacePts(pt1.tag,pt2.tag,pt5.tag,pt4.tag)
s2= surfaces.newQuadSurfacePts(pt2.tag,pt3.tag,pt6.tag,pt5.tag)


# Display surfaces.
from postprocess.xcVtk.CAD_model import vtk_CAD_graphic
displaySettings= vtk_CAD_graphic.DisplaySettingsBlockTopo()
setDisp= feProblem.getPreprocessor.getSets['total']
displaySettings.displayBlocks(setDisp,caption= setDisp.name+' set')