本文整理汇总了Python中FluentCase.FluentCase类的典型用法代码示例。如果您正苦于以下问题:Python FluentCase类的具体用法?Python FluentCase怎么用?Python FluentCase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FluentCase类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, beamMesh, backgroundMesh, beamThickness, initialGap):
## Read in 2d Solid Mesh
self.beam_thickness = beamThickness
self.Gap = initialGap
beamReader = FluentCase(beamMesh)
beamReader.read()
print "read solid mesh"
self.solidMeshes = beamReader.getMeshList()
self.geomFields = models.GeomFields('geom')
self.solidMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.solidMeshes)
self.solidMetricsCalculator.init()
## Define plate and deformation model
self.plateFields = models.PlateFields('plate')
self.pmodel = models.PlateModelA(self.geomFields,self.plateFields,self.solidMeshes)
self.dmodel = models.PlateDeformationModelA(self.geomFields,self.plateFields,self.solidMeshes)
bcMap = self.pmodel.getBCMap()
## Apply a default Boundary Condition
#for i, bc in bcMap.iteritems():
#bc.bcType = 'SpecifiedTraction'
## Read in 3d Background Mesh
fluidReader = FluentCase(backgroundMesh)
fluidReader.read();
self.fluidMeshes = fluidReader.getMeshList()
self.fluidMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.fluidMeshes)
self.fluidMetricsCalculator.init()
## Define electric model
self.elecFields = models.ElectricFields('elec')
self.emodel = models.ElectricModelA(self.geomFields,self.elecFields,self.fluidMeshes)
bcMap = self.emodel.getBCMap()
## Apply Default boundary conditions
for i, bc in bcMap.iteritems():
bc.bcType = "Symmetry"
self.solidBoundaryMeshes = [m.extrude(1, beamThickness, True) for m in self.solidMeshes]
self.solidBoundaryMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.solidBoundaryMeshes)
self.solidBoundaryMetricsCalculator.init()
示例2: read
def read(self):
beamReader = FluentCase(self.beamCaseFile)
beamReader.read()
print 'beam mesh read in. Done!'
print '------------------------------------------------------------'
self.solidMeshes = beamReader.getMeshList()
self.geomFields = models.GeomFields('geom')
self.solidMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.solidMeshes)
self.solidMetricsCalculator.init()
fluidReader = FluentCase(self.fluidCaseFile)
fluidReader.read()
print 'fluid mesh read in. Done!'
print '------------------------------------------------------------'
self.fluidMeshes = fluidReader.getMeshList()
self.fluidMeshesNew = self.fluidMeshes
self.fluidMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.fluidMeshes)
self.fluidMetricsCalculator.init()
self.solidBoundaryMeshes = [m.extrude(1, self.beam_thickness, True) for m in self.solidMeshes]
self.solidBoundaryMetricsCalculator = models.MeshMetricsCalculatorA(self.geomFields,self.solidBoundaryMeshes)
self.solidBoundaryMetricsCalculator.init()
示例3: OptionParser
f.write("</Grid>\n")
f.close()
parser = OptionParser()
parser.set_defaults(type='tri')
parser.add_option("--type", help="'tri'[default], 'quad', 'hexa', or 'tetra'")
parser.add_option("--xdmf", action='store_true', help="Dump data in xdmf")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
if len(args) != 1:
usage()
numIterations = 10
reader = FluentCase(args[0])
reader.read()
fluent_meshes = reader.getMeshList()
nmesh = 1
npart = [MPI.COMM_WORLD.Get_size()]
etype = [etype[options.type]]
if options.time:
# time profile for partmesh
part_mesh_time = zeros(1,dtype='d')
part_mesh_start = zeros(1, dtype='d')
part_mesh_end = zeros(1, dtype='d')
part_mesh_maxtime = zeros(1,dtype='d')
part_mesh_mintime = zeros(1, dtype='d')
part_mesh_start[0] = MPI.Wtime()
示例4: str
numTimeSteps = 2
globalTime = 0
globalCount = 0
timeStep = 2e-8
saveFrequency = 1
initialTransient = False
probeIndex = 0
### ===================== mesh read ===============================================###
fileBase_input = "/home/yildirim/memosa/src/fvm/scripts/cantilever3D_coupling/"
fileBase_output = "./" + str(int(-applied_voltage)) + "/"
### 2D plate mesh
beamReader = FluentCase(fileBase_input+"beam_2D.cas")
beamReader.read()
##paritioning
#nmesh = 1
#npart = [MPI.COMM_WORLD.Get_size()]
#print "options folud.type = ", options.type
#etype = [etype[options.type]]
##partMesh constructor and setTypes
#part_mesh = fvmparallel.MeshPartitioner( fluentMeshes, npart, etype );
#part_mesh.setWeightType(0);
#part_mesh.setNumFlag(0);
##actions
#part_mesh.isDebug(0)
#part_mesh.partition()
#part_mesh.mesh()
示例5: range
for i in range(0,ncell):
nnodes_per_cell = cellNodes[n].getCount(i)
for node in range(0,nnodes_per_cell):
f.write( str(cellNodes[n](i,node)+1) + " ")
f.write("\n")
f.write("\n")
f.close()
parser = OptionParser()
parser.set_defaults(type='quad')
parser.add_option("--type", help="'quad'[default], 'tri', 'hexa', or 'tetra'")
parser.add_option("--xdmf", action='store_true', help="Dump data in xdmf")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
reader0 = FluentCase(fileBase0+".cas")
reader1 = FluentCase(fileBase1+".cas")
#import debug
reader0.read();
reader1.read();
meshes0 = reader0.getMeshList()
meshes1 = reader1.getMeshList()
#for mesh in meshes:
# mesh.getCells().clearGatherScatterMaps()
mesh0 = meshes0[0]
mesh1 = meshes1[0]
示例6: FluentCase
import sys
sys.setdlopenflags(0x100|0x2)
import fvm.fvmbaseExt as fvmbaseExt
import fvm.importers as importers
import fvm.models_atyped_double as models
import fvm.exporters_atyped_double as exporters
from FluentCase import FluentCase
#fvmbaseExt.enableDebug("cdtor")
from mpi4py import MPI
reader = FluentCase(sys.argv[1])
reader.read();
meshes_case = reader.getMeshList()
# add double shell to mesh between two materials
# When creating double shell mesh, the mesh it is created from
# is called the 'parent' mesh and the mesh that is passed as an argument
# is called the 'other' mesh
#
# The phi values at the interface between the two meshes are related as follows:
# Phi_other = A * Phi_parent + B
interfaceID = 9
shellmesh = meshes_case[1].createDoubleShell(interfaceID, meshes_case[0], interfaceID)
meshes = [meshes_case[0], meshes_case[1], shellmesh]
geomFields = models.GeomFields('geom')
metricsCalculator = models.MeshMetricsCalculatorA(geomFields,meshes)
metricsCalculator.init()
示例7: OptionParser
'quad' : 'FEQUADRILATERAL',
'tetra' : 'FETETRAHEDRON',
'hexa' : 'FEBRICK'
}
xtype = {
'tri' : 'Triangle',
'quad' : 'Quadrilateral',
'tetra' : 'Tetrahedron',
'hexa' : 'Hexahedron'
}
parser = OptionParser()
parser.set_defaults(type='tri')
parser.add_option("--type", help="'tri'[default], 'quad', 'hexa', or 'tetra'")
parser.add_option("--xdmf", action='store_true', help="Dump data in xdmf")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
if len(args) != 1:
usage()
numIterations = 10
reader = FluentCase(args[0])
reader.read()
#import ddd
meshes_fluent = reader.getMeshList()
mesh_assembler = fvmbaseExt.MeshAssembler( meshes_fluent )
mesh_assembler.debug_faceCells()
示例8: str
numTimeSteps = 2
globalTime = 0
globalCount = 0
timeStep = 2e-8
saveFrequency = 1
initialTransient = False
### ===================== mesh read ===============================================###
fileBase_input = "/home/yildirim/memosa/src/fvm/scripts/cantilever3D_coupling/"
fileBase_output = "./" + str(int(-applied_voltage)) + "/"
print fileBase_input + "fluid_3D_new.cas"
### 3D fluid mesh
fluidReader = FluentCase(fileBase_input + "fluid_3D_new.cas")
fluidReader.read()
fluent_meshes_fluid = fluidReader.getMeshList()
# paritioning
nmesh = 1
npart = [MPI.COMM_WORLD.Get_size()]
print "options.typeFluid = ", options.typeFluid
etypeFluid = [etype[options.typeFluid]]
# partMesh constructor and setTypes
part_mesh_fluid = fvmparallel.MeshPartitioner(fluent_meshes_fluid, npart, etypeFluid)
part_mesh_fluid.setWeightType(0)
part_mesh_fluid.setNumFlag(0)
# actions
part_mesh_fluid.isDebug(0)
part_mesh_fluid.partition()
part_mesh_fluid.mesh()
示例9: open
pd.timeStep = 1.e-8
pd.saveFrequency = 1
pd.fxSum = 0
pd.fySum = 0
pd.fzSum = 0
pd.initialTransient=False
pd.probeIndex = 671699
pd.probeFile = open(fileBase + "tipDisplacement-se.dat", "w")
pd.forceFile = open(fileBase + "beamForce-se.dat", "w")
pd.velocityFile = open(fileBase + "tipVelocity-se.dat", "w")
### read in meshes ###
beamFile = fileBase + 'Gen2_IBM_beam_12_1200.cas'
fluidFile = fileBase + 'Gen2_IBM_backgroundmesh_C2D2_wo_sub.cas'
fluidReader = FluentCase(sys.argv[1])
beamReader = FluentCase(sys.argv[2])
beamReader.read()
fluidReader.read()
pd.solidMeshes = beamReader.getMeshList()
pd.fluidMeshes = fluidReader.getMeshList()
pd.solidBoundaryMeshes = [m.extractBoundaryMesh() for m in pd.solidMeshes]
### geometry field ###
pd.geomFields = models.GeomFields('geom')
pd.solidMetricsCalculator = models.MeshMetricsCalculatorA(pd.geomFields,
pd.solidMeshes)
pd.fluidMetricsCalculator = models.MeshMetricsCalculatorA(pd.geomFields,
示例10: OptionParser
outfile = sys.argv[2]
if outfile == None:
outfile = fileBase+"-tecplt.dat"
#import debug
parser = OptionParser()
parser.set_defaults(type='tri')
parser.add_option("--type", help="'tri'[default], 'quad', 'hexa', or 'tetra'")
parser.add_option("--xdmf", action='store_true', help="Dump data in xdmf")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
if len(args) != 1:
usage()
reader = FluentCase(args[0])
#reader = FluentCase(fileBase+".cas")
reader.read();
t0 = time.time()
meshes_fluent = reader.getMeshList()
nmesh = 1
npart = [MPI.COMM_WORLD.Get_size()]
etype = [etype[options.type]]
if not MPI.COMM_WORLD.Get_rank():
print "parmesh is processing"
#Partitinoing of spatial mesh
#partMesh constructor and setTypes
part_mesh = fvmparallel.MeshPartitioner( meshes_fluent, npart, etype );
示例11: len
# change as needed
outfile = None
if __name__ == '__main__' and fileBase is None:
if len(sys.argv) < 2:
usage()
fileBase = sys.argv[1]
if len(sys.argv) == 3:
outfile = sys.argv[2]
if outfile == None:
outfile = fileBase+"-prism.dat"
reader = FluentCase(fileBase+".cas")
#import debug
reader.read();
import sys
fluent_meshes = reader.getMeshList()
import time
t0 = time.time()
nmesh = MPI.COMM_WORLD.Get_size()
#print "nmesh = ", nmesh
#npart = fvmparallel.IntVector(1,nmesh) #total of distributed meshes
#etype = fvmparallel.IntVector(1,1) #triangle
示例12: FluentCase
writer.finish()
timeStep = 10
numTimeSteps = 10
saveFrequency = 2
parser = optparse.OptionParser()
parser.add_option("--volt", type=float)
parser.add_option("--type", help="'tri'[default], 'quad', 'hexa', or 'tetra'")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
print args[0]
print args[1]
fluidReader = FluentCase(args[0])
solidReader = FluentCase(args[1])
fluidReader.read()
solidReader.read()
fluidMeshes0 = fluidReader.getMeshList()
solidMeshes = solidReader.getMeshList()
nodeCoord = solidMeshes[0].getNodeCoordinates().asNumPyArray()
nodeCoord[:,:] *=0.5
#paritioning
nmesh = 1
npart = [MPI.COMM_WORLD.Get_size()]
示例13: FluentCase
import sys
sys.setdlopenflags(0x100|0x2)
import fvmbaseExt
import importers
import models_atyped_double as models
import exporters_atyped_double as exporters
from FluentCase import FluentCase
#fvmbaseExt.enableDebug("cdtor")
reader = FluentCase("/home/sm/olda/data/cond.cas")
#import debug
reader.read();
meshes = reader.getMeshList()
geomFields = models.GeomFields('geom')
metricsCalculator = models.MeshMetricsCalculatorA(geomFields,meshes)
metricsCalculator.init()
thermalFields = models.ThermalFields('therm')
tmodel = models.ThermalModelA(geomFields,thermalFields,meshes)
bcmap = tmodel.getBCMap()
bc2 = bcmap[2]
reader.importThermalBCs(tmodel)
tmodel.printBCs()
示例14: FluentCase
anchors = [4, 5, 6, 7]
numTimeSteps = 1
globalTime = 0
globalCount = 0
timeStep = 5e-8
saveFrequency = 50
initialTransient = False
probeIndex = 50
### ===================== mesh read ===============================================###
fileBase = "./"
### 2D plate mesh
beamReader = FluentCase(sys.argv[2])
beamReader.read();
solidMeshes = beamReader.getMeshList()
geomFields = models.GeomFields('geom')
solidMetricsCalculator = models.MeshMetricsCalculatorA(geomFields,solidMeshes)
solidMetricsCalculator.init()
### 3D fluid mesh
fluidReader = FluentCase(sys.argv[1])
fluidReader.read();
fluidMeshes = fluidReader.getMeshList()
fluidMetricsCalculator = models.MeshMetricsCalculatorA(geomFields,fluidMeshes)
fluidMetricsCalculator.init()
nodes = fluidMeshes[0].getNodes()
xn = fluidMeshes[0].getNodeCoordinates().asNumPyArray()
示例15: OptionParser
parser = OptionParser()
parser.set_defaults(type='tri')
parser.add_option("--type", help="'tri'[default], 'quad', 'hexa', or 'tetra'")
parser.add_option("--xdmf", action='store_true', help="Dump data in xdmf")
parser.add_option("--time","-t",action='store_true',help="Print timing information.")
(options, args) = parser.parse_args()
if len(args) != 1:
usage()
pd = ProblemDefinition()
pd.fileBase = "."
reader = FluentCase(args[0])
reader.read();
pd.meshes = reader.getMeshList()
nmesh = 1
npart = [MPI.COMM_WORLD.Get_size()]
etype = [etype[options.type]]
if not MPI.COMM_WORLD.Get_rank():
print "parmesh is processing"
if options.time:
# time profile for partmesh
part_mesh_time = zeros(1,dtype='d')
part_mesh_start = zeros(1, dtype='d')