Exemplo n.º 1
0
description="""
Clears all empty boundaries (those with zero faces) from a
polyMesh/boundaries file
"""

from PyFoam.Basics.FoamOptionParser import FoamOptionParser
from os import path
import sys

from PyFoam.RunDictionary.BoundaryDict import BoundaryDict
from PyFoam.RunDictionary.MeshInformation import MeshInformation

parse=FoamOptionParser(description=description,usage="%prog <caseDirectory>")
parse.parse(nr=1)

fName=parse.getArgs()[0]

boundary=BoundaryDict(fName)

cleared=[]

for b in boundary.patches():
    if boundary[b]["nFaces"]==0:
        cleared.append(b)
        del  boundary[b]

if len(cleared)>0:
    print "Cleared boundaries",", ".join(cleared)
    boundary.writeFile()
else:
    print "No empty boundaries"
Exemplo n.º 2
0
#! /usr/bin/env  python

description = """\
Analyzes a Log written by foamJob.  Needs the name of the Logfile to
be analyzed the data is being written to a directory that has the same
name with _analyzed appended
"""

from PyFoam.Basics.FoamOptionParser import FoamOptionParser

parse = FoamOptionParser(description=description,
                         usage="%prog [options] <logfile>",
                         interspersed=True)

parse.parse(nr=1)

from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication

analyze = LogAnalyzerApplication(BoundingLogAnalyzer())

analyze.run(pfad=parse.getArgs()[0])
Exemplo n.º 3
0
"""

from PyFoam.Basics.FoamOptionParser import FoamOptionParser
from os import path
import sys

from PyFoam.RunDictionary.BoundaryDict import BoundaryDict
from PyFoam.RunDictionary.MeshInformation import MeshInformation

from PyFoam.ThirdParty.six import print_

parse = FoamOptionParser(description=description,
                         usage="%prog <caseDirectory> <boundaryName>")
parse.parse(nr=2)

fName = parse.getArgs()[0]
bName = parse.getArgs()[1]

boundary = BoundaryDict(fName)

lastFace = MeshInformation(fName).nrOfFaces()

if bName in boundary.patches():
    print_("Patch", bName, "already exists in file")
    sys.exit(-1)

val = {}
val["type"] = "wall"
val["nFaces"] = "0"
val["startFace"] = str(lastFace)
#!/usr/bin/python 

description="""\
Analyzes a Log written by foamJob.  Needs the name of the Logfile to
be analyzed the data is being written to a directory that has the same
name with _analyzed appended
"""

from PyFoam.Basics.FoamOptionParser import FoamOptionParser

parse=FoamOptionParser(description=description,usage="%prog [options] <logfile>",interspersed=True)

parse.parse(nr=1)

from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
from PyFoam.LogAnalysis.LogAnalyzerApplication import LogAnalyzerApplication

analyze=LogAnalyzerApplication(BoundingLogAnalyzer())

analyze.run(pfad=parse.getArgs()[0])
Exemplo n.º 5
0
parse=FoamOptionParser(description=description,usage="%prog [options] <datadir>",interspersed=True)

try:
    import PyFoam.ThirdParty.Gnuplot as Gnuplot
except ImportError,e:
    parse.error("Gnuplot module missing. Can't plot")
    
parse.parse(nr=1)

import sys,os
from os import path

from PyFoam.Basics.Helpers import getLinearNames
    
data=parse.getArgs()[0]
dDir=path.basename(data)

names=getLinearNames(data)

if sys.stdout.isatty():
    g=Gnuplot.Gnuplot(persist=1)
else:
    g=Gnuplot.Gnuplot()
    

plots=[]

for n in names:
    plots.append(Gnuplot.File(path.join(data,"linear_"+n),using="1:2",with='steps',title=n))
Exemplo n.º 6
0
parse=FoamOptionParser(description=description,usage="%prog [options] <datadir>",interspersed=True)

try:
    import PyFoam.ThirdParty.Gnuplot as Gnuplot
except ImportError,e:
    parse.error("Gnuplot module missing. Can't plot")
    
parse.parse(nr=1)

import sys,os
from os import path

from PyFoam.Basics.Helpers import getLinearNames
    
data=parse.getArgs()[0]
dDir=path.basename(data)

names=getLinearNames(data)

if sys.stdout.isatty():
    g=Gnuplot.Gnuplot(persist=1)
else:
    g=Gnuplot.Gnuplot()
    

plots=[]

for n in names:
    plots.append(Gnuplot.File(path.join(data,"linear_"+n),using="1:2",with='steps',title=n))