本文整理汇总了Python中FluentCase.FluentCase.getMeshList方法的典型用法代码示例。如果您正苦于以下问题:Python FluentCase.getMeshList方法的具体用法?Python FluentCase.getMeshList怎么用?Python FluentCase.getMeshList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FluentCase.FluentCase
的用法示例。
在下文中一共展示了FluentCase.getMeshList方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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: FluentCase
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
fileBase = sys.argv[1]
filename = fileBase+"fvm_coupling_hexa10x4x4_80x32x32.cas"
#filename = fileBase+"fvm_coupling_hexa10x4x4_120x48x48.cas"
#filename = fileBase+"fvm_coupling_hexa10x4x4_160x64x64.cas"
reader = FluentCase(filename)
print "reading %s", filename
#import debug
reader.read();
meshes = reader.getMeshList()
mesh0 = meshes[0]
import time
t0 = time.time()
geomFields = fvm.models.GeomFields('geom')
metricsCalculator = fvm.models.MeshMetricsCalculatorA(geomFields,meshes)
metricsCalculator.init()
flowFields = fvm.models.FlowFields('flow')
fmodel = fvm.models.FlowModelA(geomFields,flowFields,meshes)
示例4: open
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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,
pd.fluidMeshes)
pd.solidBoundaryMetricsCalculator = models.MeshMetricsCalculatorA(pd.geomFields,
pd.solidBoundaryMeshes)
pd.solidMetricsCalculator.init()
pd.fluidMetricsCalculator.init()
示例5: OptionParser
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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()
#partMesh constructor and setTypes
示例6: range
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
##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()
#solidMeshes = part_mesh.meshList()
solidMeshes = beamReader.getMeshList()
geomFields = models.GeomFields('geom')
solidMetricsCalculator = models.MeshMetricsCalculatorA(geomFields,solidMeshes)
solidMetricsCalculator.init()
#extruding
solidBoundaryMeshes = [m.extrude(1, beam_thickness, True) for m in solidMeshes]
solidBoundaryMetricsCalculator = models.MeshMetricsCalculatorA(geomFields,solidBoundaryMeshes)
solidBoundaryMetricsCalculator.init()
### find device center
cells = solidMeshes[0].getCells()
xc = geomFields.coordinate[cells].asNumPyArray()
small = 100
probeIndex = 0
for c in range(0, cells.getCount()):
示例7: OptionParser
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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]
nmesh = 2
mesh0.findCommonNodes(mesh1)
meshes = []
meshes.append(mesh0)
meshes.append(mesh1)
示例8: FluentCase
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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()
示例9: OptionParser
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
'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()
示例10: OptionParser
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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()
nmesh = 1
fileBase0 = 'plate_creep_deformation_'
reader0 = FluentCase(sys.argv[1])
#import debug
reader0.read();
meshes0 = reader0.getMeshList()
mesh0 = meshes0[0]
nmesh = 1
meshes = []
meshes.append(mesh0)
import time
t0 = time.time()
geomFields = models.GeomFields('geom')
metricsCalculator0 = models.MeshMetricsCalculatorA(geomFields,meshes0)
metricsCalculator0.init()
示例11: FluentCase
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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()]
print "options.typeFluid = ", options.type
etypeFluid = [etype[options.type]]
#partMesh constructor and setTypes
part_mesh_fluid = fvmparallel.MeshPartitioner( fluidMeshes0, npart, etypeFluid );
part_mesh_fluid.setWeightType(0);
part_mesh_fluid.setNumFlag(0);
示例12: str
# 需要导入模块: from FluentCase import FluentCase [as 别名]
# 或者: from FluentCase.FluentCase import getMeshList [as 别名]
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()
fluidMeshes = part_mesh_fluid.meshList()
if not MPI.COMM_WORLD.Get_rank():