Back to index

salome-med  6.5.0
Functions | Variables
med_test2 Namespace Reference

Functions

def AnalyzeField
def print_ord

Variables

list filePath = os.environ["MED_ROOT_DIR"]
tuple medFile = os.path.join(filePath, "carre_en_quad4_seg2.med")
tuple md = MEDFILEBROWSER(medFile)
tuple nbMeshes = md.getNumberOfMeshes()
tuple nbFields = md.getNumberOfFields()
tuple mesh_name = md.getMeshName(i)
tuple field_name = md.getFieldName(i)
tuple mesh = MESH(MED_DRIVER,md.getFileName(),mesh_name)
tuple spaceDim = mesh.getSpaceDimension()
tuple meshDim = mesh.getMeshDimension()
tuple nbNodes = mesh.getNumberOfNodes()
tuple coordSyst = mesh.getCoordinatesSystem()
list coordNames = []
list coordUnits = []
tuple coordinates = mesh.getCoordinates(MED_FULL_INTERLACE)
int kp1 = 1
list coords = []
int isdp1 = 1
tuple nbTypesCell = mesh.getNumberOfTypes(MED_CELL)
tuple types = mesh.getTypes(MED_CELL)
list type = types[k]
tuple nbElemType = mesh.getNumberOfElements(MED_CELL,type)
tuple connectivity = mesh.getConnectivity(MED_NODAL,MED_CELL,type)
int nbNodesPerCell = 100
tuple ReverseConnectivity = mesh.getReverseConnectivity(MED_NODAL)
tuple ReverseConnectivityIndex = mesh.getReverseConnectivityIndex(MED_NODAL)
list begin = ReverseConnectivityIndex[j]
list end = ReverseConnectivityIndex[j+1]
tuple nbElemts = mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)
tuple Connectivity = mesh.getConnectivity(MED_DESCENDING,MED_CELL,MED_ALL_ELEMENTS)
tuple ConnectivityIndex = mesh.getConnectivityIndex(MED_DESCENDING,MED_CELL)
tuple nbFam = mesh.getNumberOfFamilies(entity)
tuple family = mesh.getFamily(entity,j+1)
tuple familyName = family.getName()
tuple familyDescription = family.getDescription()
tuple familyEntity = family.getEntity()
tuple familyBool = family.isOnAllElements()
tuple familyIdentifier = family.getIdentifier()
tuple nbOfAtt = family.getNumberOfAttributes()
tuple attributesids = family.getAttributesIdentifiers()
tuple attributesvals = family.getAttributesValues()
tuple nbOfGrp = family.getNumberOfGroups()
tuple nbOfTypes = family.getNumberOfTypes()
tuple nbOfElmtsOfType = family.getNumberOfElements(type)
tuple number = family.getNumber(type)
tuple numberFamily = family.getNumber(MED_ALL_ELEMENTS)
tuple fieldFamilyIntg = FIELDINT(family,spaceDim)
int kcomp1 = 1
string fieldCompName = "comp1"
string fieldCompDesc = "desc1"
string fieldCompUnit = "unit1"
string fieldFamilyName = "Integer Field on "
tuple type_field = fieldFamilyIntg.getValueType()
tuple nbOfComp = fieldFamilyIntg.getNumberOfComponents()
tuple compName = fieldFamilyIntg.getComponentName(kcomp1)
tuple compDesc = fieldFamilyIntg.getComponentDescription(kcomp1)
tuple compUnit = fieldFamilyIntg.getMEDComponentUnit(kcomp1)
tuple nbOf = fieldFamilyIntg.getSupport()
list valueI = []
list valInd = numberFamily[k]
tuple valueIverif = fieldFamilyIntg.getRow(valInd)
tuple fieldFamilyDble = FIELDDOUBLE(family,spaceDim)
tuple barycenterfamily = mesh.getBarycenter(family)
tuple nbVal = barycenterfamily.getSupport()
tuple nbComp = barycenterfamily.getNumberOfComponents()
tuple barycenterfamilyentity = barycenterfamily.getRow(valInd)
tuple supportCell = mesh.getSupportOnAll( MED_CELL )
tuple barycenter = mesh.getBarycenter(supportCell)
tuple barycenterCell = barycenter.getRow(j+1)
list writeMed21File = medFile[0:(len(medFile)-4)]
list writeMed22File = medFile[0:(len(medFile)-4)]
tuple fieldsMesh = barycenter.getSupport()
string fieldsMeshName = "Fields Mesh"
tuple index22Mesh = fieldsMesh.addDriver(MED_DRIVER,writeMed22File,fieldsMeshName)
tuple barycenterName = barycenter.getName()
tuple index22FieldBarycenter = barycenter.addDriver(MED_DRIVER,writeMed22File,barycenterName)
tuple volume = mesh.getVolume(supportCell)
int voltot = 0
tuple volumeCell = volume.getValueIJ(j+1,1)
tuple volumeName = volume.getName()
tuple index22FieldVolume = volume.addDriver(MED_DRIVER,writeMed22File,volumeName)
tuple supportFace = SUPPORT(mesh,"Support on all faces of the mesh",MED_FACE)
tuple nbFace = mesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS)
tuple nbTypeFace = mesh.getNumberOfTypes(MED_FACE)
tuple TypeFace = mesh.getTypes(MED_FACE)
tuple normal = mesh.getNormal(supportFace)
tuple normalFace = normal.getRow(j+1)
list value1 = normalFace[0]
list value2 = normalFace[1]
list value3 = normalFace[2]
tuple norm = (value1*value1 + value2*value2 + value3*value3)
tuple normalName = normal.getName()
tuple index22FieldNormal = normal.addDriver(MED_DRIVER,writeMed22File,normalName)
tuple area = mesh.getArea(supportCell)
int areatot = 0
tuple areaCell = area.getValueIJ(j+1,1)
tuple areaName = area.getName()
tuple index22FieldArea = area.addDriver(MED_DRIVER,writeMed22File,areaName)
tuple supportEdge = mesh.getSupportOnAll(MED_EDGE)
tuple nbEdge = mesh.getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS)
tuple nbTypeEdge = mesh.getNumberOfTypes(MED_EDGE)
tuple TypeEdge = mesh.getTypes(MED_EDGE)
tuple normalEdge = normal.getRow(j+1)

Function Documentation

def med_test2.AnalyzeField (   field)

Definition at line 37 of file med_test2.py.

00037 
00038 def AnalyzeField(field):
00039     name = field.getName()
00040     desc = field.getDescription()
00041     nbComp = field.getNumberOfComponents()
00042     itNum = field.getIterationNumber()
00043     ordNum = field.getOrderNumber()
00044     type = field.getValueType()
00045 
00046     print "Analysis of the field ",name," with the description ",desc
00047     print "iteration number ",itNum," order Number ",ordNum
00048     print "It has ",nbComp," component(s) with the type ",type
00049 
00050     fieldValue = field.getValue()
00051     fieldSupport = field.getSupport()
00052     fieldMesh = fieldSupport.getMesh()
00053     fieldEntity = fieldSupport.getEntity()
00054     bool = fieldSupport.isOnAllElements()
00055 
00056     if bool:
00057         print "The support of this field is on all entities ",fieldEntity," of the mesh ",fieldMesh.getName()
00058         if fieldEntity == MED_NODE:
00059             nbValByComp = fieldMesh.getNumberOfNodes()
00060         else:
00061             nbValByComp = fieldMesh.getNumberOfElements(fieldEntity,MED_ALL_ELEMENTS)
00062         print "and its dimension (number of values by component of the field) is ",nbValByComp
00063     else:
00064         print "The support of this field is partially on entities ",fieldEntity," of the mesh ",fieldMesh.getName()
00065         nbValByComp = fieldSupport.getNumberOfElements(MED_ALL_ELEMENTS)
00066         print "and its dimension (number of values by component of the field) is ",nbValByComp
00067 
00068     for i in range(nbComp):
00069         ip1 = i + 1
00070         compName = field.getComponentName(ip1)
00071         compDesc = field.getComponentDescription(ip1)
00072         compUnit = field.getMEDComponentUnit(ip1)
00073         print "The ",(i+1),"-th  component ",compName," with the dexription ",compDesc," and the unit ",compUnit
00074 
00075     for i in range(nbValByComp):
00076         print "  * ",fieldValue[i*nbComp:(i+1)*nbComp]
00077 
#==============================================================================
def med_test2.print_ord (   i)

Definition at line 88 of file med_test2.py.

00088 
00089 def print_ord(i):
00090     if i == 0:
00091         return 'first'
00092     elif i == 1:
00093         return 'second'
00094     elif i == 2:
00095         return 'third'
00096     else:
00097         return `i`+'th'


Variable Documentation

tuple med_test2.area = mesh.getArea(supportCell)

Definition at line 443 of file med_test2.py.

tuple med_test2.areaCell = area.getValueIJ(j+1,1)

Definition at line 446 of file med_test2.py.

tuple med_test2.areaName = area.getName()

Definition at line 456 of file med_test2.py.

Definition at line 444 of file med_test2.py.

tuple med_test2.attributesids = family.getAttributesIdentifiers()

Definition at line 219 of file med_test2.py.

tuple med_test2.attributesvals = family.getAttributesValues()

Definition at line 220 of file med_test2.py.

tuple med_test2.barycenter = mesh.getBarycenter(supportCell)

Definition at line 367 of file med_test2.py.

tuple med_test2.barycenterCell = barycenter.getRow(j+1)

Definition at line 369 of file med_test2.py.

tuple med_test2.barycenterfamily = mesh.getBarycenter(family)

Definition at line 352 of file med_test2.py.

tuple med_test2.barycenterfamilyentity = barycenterfamily.getRow(valInd)

Definition at line 359 of file med_test2.py.

tuple med_test2.barycenterName = barycenter.getName()

Definition at line 386 of file med_test2.py.

Definition at line 176 of file med_test2.py.

tuple med_test2.compDesc = fieldFamilyIntg.getComponentDescription(kcomp1)

Definition at line 275 of file med_test2.py.

tuple med_test2.compName = fieldFamilyIntg.getComponentName(kcomp1)

Definition at line 274 of file med_test2.py.

tuple med_test2.compUnit = fieldFamilyIntg.getMEDComponentUnit(kcomp1)

Definition at line 276 of file med_test2.py.

tuple med_test2.connectivity = mesh.getConnectivity(MED_NODAL,MED_CELL,type)

Definition at line 165 of file med_test2.py.

tuple med_test2.Connectivity = mesh.getConnectivity(MED_DESCENDING,MED_CELL,MED_ALL_ELEMENTS)

Definition at line 184 of file med_test2.py.

tuple med_test2.ConnectivityIndex = mesh.getConnectivityIndex(MED_DESCENDING,MED_CELL)

Definition at line 185 of file med_test2.py.

tuple med_test2.coordinates = mesh.getCoordinates(MED_FULL_INTERLACE)

Definition at line 144 of file med_test2.py.

Definition at line 135 of file med_test2.py.

list med_test2.coords = []

Definition at line 147 of file med_test2.py.

tuple med_test2.coordSyst = mesh.getCoordinatesSystem()

Definition at line 132 of file med_test2.py.

Definition at line 136 of file med_test2.py.

Definition at line 177 of file med_test2.py.

tuple med_test2.family = mesh.getFamily(entity,j+1)

Definition at line 207 of file med_test2.py.

tuple med_test2.familyBool = family.isOnAllElements()

Definition at line 211 of file med_test2.py.

tuple med_test2.familyDescription = family.getDescription()

Definition at line 209 of file med_test2.py.

tuple med_test2.familyEntity = family.getEntity()

Definition at line 210 of file med_test2.py.

tuple med_test2.familyIdentifier = family.getIdentifier()

Definition at line 215 of file med_test2.py.

tuple med_test2.familyName = family.getName()

Definition at line 208 of file med_test2.py.

tuple med_test2.field_name = md.getFieldName(i)

Definition at line 117 of file med_test2.py.

string med_test2.fieldCompDesc = "desc1"

Definition at line 251 of file med_test2.py.

string med_test2.fieldCompName = "comp1"

Definition at line 250 of file med_test2.py.

string med_test2.fieldCompUnit = "unit1"

Definition at line 252 of file med_test2.py.

Definition at line 296 of file med_test2.py.

Definition at line 243 of file med_test2.py.

string med_test2.fieldFamilyName = "Integer Field on "

Definition at line 265 of file med_test2.py.

tuple med_test2.fieldsMesh = barycenter.getSupport()

Definition at line 375 of file med_test2.py.

string med_test2.fieldsMeshName = "Fields Mesh"

Definition at line 376 of file med_test2.py.

tuple med_test2.filePath = os.environ["MED_ROOT_DIR"]

Definition at line 82 of file med_test2.py.

tuple med_test2.index22FieldArea = area.addDriver(MED_DRIVER,writeMed22File,areaName)

Definition at line 458 of file med_test2.py.

tuple med_test2.index22FieldBarycenter = barycenter.addDriver(MED_DRIVER,writeMed22File,barycenterName)

Definition at line 388 of file med_test2.py.

tuple med_test2.index22FieldNormal = normal.addDriver(MED_DRIVER,writeMed22File,normalName)

Definition at line 438 of file med_test2.py.

tuple med_test2.index22FieldVolume = volume.addDriver(MED_DRIVER,writeMed22File,volumeName)

Definition at line 409 of file med_test2.py.

tuple med_test2.index22Mesh = fieldsMesh.addDriver(MED_DRIVER,writeMed22File,fieldsMeshName)

Definition at line 379 of file med_test2.py.

int med_test2.isdp1 = 1

Definition at line 149 of file med_test2.py.

Definition at line 248 of file med_test2.py.

int med_test2.kp1 = 1

Definition at line 146 of file med_test2.py.

Definition at line 98 of file med_test2.py.

tuple med_test2.medFile = os.path.join(filePath, "carre_en_quad4_seg2.med")

Definition at line 85 of file med_test2.py.

tuple med_test2.mesh = MESH(MED_DRIVER,md.getFileName(),mesh_name)

Definition at line 126 of file med_test2.py.

Definition at line 110 of file med_test2.py.

tuple med_test2.meshDim = mesh.getMeshDimension()

Definition at line 128 of file med_test2.py.

tuple med_test2.nbComp = barycenterfamily.getNumberOfComponents()

Definition at line 355 of file med_test2.py.

tuple med_test2.nbEdge = mesh.getNumberOfElements(MED_EDGE,MED_ALL_ELEMENTS)

Definition at line 464 of file med_test2.py.

tuple med_test2.nbElemts = mesh.getNumberOfElements(MED_CELL,MED_ALL_ELEMENTS)

Definition at line 183 of file med_test2.py.

tuple med_test2.nbElemType = mesh.getNumberOfElements(MED_CELL,type)

Definition at line 163 of file med_test2.py.

tuple med_test2.nbFace = mesh.getNumberOfElements(MED_FACE,MED_ALL_ELEMENTS)

Definition at line 416 of file med_test2.py.

tuple med_test2.nbFam = mesh.getNumberOfFamilies(entity)

Definition at line 194 of file med_test2.py.

tuple med_test2.nbFields = md.getNumberOfFields()

Definition at line 102 of file med_test2.py.

tuple med_test2.nbMeshes = md.getNumberOfMeshes()

Definition at line 100 of file med_test2.py.

tuple med_test2.nbNodes = mesh.getNumberOfNodes()

Definition at line 130 of file med_test2.py.

Definition at line 166 of file med_test2.py.

tuple med_test2.nbOf = fieldFamilyIntg.getSupport()

Definition at line 282 of file med_test2.py.

tuple med_test2.nbOfAtt = family.getNumberOfAttributes()

Definition at line 216 of file med_test2.py.

tuple med_test2.nbOfComp = fieldFamilyIntg.getNumberOfComponents()

Definition at line 269 of file med_test2.py.

tuple med_test2.nbOfElmtsOfType = family.getNumberOfElements(type)

Definition at line 236 of file med_test2.py.

tuple med_test2.nbOfGrp = family.getNumberOfGroups()

Definition at line 223 of file med_test2.py.

tuple med_test2.nbOfTypes = family.getNumberOfTypes()

Definition at line 231 of file med_test2.py.

tuple med_test2.nbTypeEdge = mesh.getNumberOfTypes(MED_EDGE)

Definition at line 467 of file med_test2.py.

tuple med_test2.nbTypeFace = mesh.getNumberOfTypes(MED_FACE)

Definition at line 419 of file med_test2.py.

tuple med_test2.nbTypesCell = mesh.getNumberOfTypes(MED_CELL)

Definition at line 156 of file med_test2.py.

tuple med_test2.nbVal = barycenterfamily.getSupport()

Definition at line 354 of file med_test2.py.

Definition at line 428 of file med_test2.py.

tuple med_test2.normal = mesh.getNormal(supportFace)

Definition at line 422 of file med_test2.py.

tuple med_test2.normalEdge = normal.getRow(j+1)

Definition at line 472 of file med_test2.py.

tuple med_test2.normalFace = normal.getRow(j+1)

Definition at line 424 of file med_test2.py.

tuple med_test2.normalName = normal.getName()

Definition at line 436 of file med_test2.py.

tuple med_test2.number = family.getNumber(type)

Definition at line 237 of file med_test2.py.

tuple med_test2.numberFamily = family.getNumber(MED_ALL_ELEMENTS)

Definition at line 241 of file med_test2.py.

tuple med_test2.ReverseConnectivity = mesh.getReverseConnectivity(MED_NODAL)

Definition at line 172 of file med_test2.py.

tuple med_test2.ReverseConnectivityIndex = mesh.getReverseConnectivityIndex(MED_NODAL)

Definition at line 173 of file med_test2.py.

tuple med_test2.spaceDim = mesh.getSpaceDimension()

Definition at line 127 of file med_test2.py.

tuple med_test2.supportCell = mesh.getSupportOnAll( MED_CELL )

Definition at line 364 of file med_test2.py.

tuple med_test2.supportEdge = mesh.getSupportOnAll(MED_EDGE)

Definition at line 463 of file med_test2.py.

tuple med_test2.supportFace = SUPPORT(mesh,"Support on all faces of the mesh",MED_FACE)

Definition at line 414 of file med_test2.py.

list med_test2.type = types[k]

Definition at line 162 of file med_test2.py.

tuple med_test2.type_field = fieldFamilyIntg.getValueType()

Definition at line 268 of file med_test2.py.

tuple med_test2.TypeEdge = mesh.getTypes(MED_EDGE)

Definition at line 468 of file med_test2.py.

tuple med_test2.TypeFace = mesh.getTypes(MED_FACE)

Definition at line 420 of file med_test2.py.

tuple med_test2.types = mesh.getTypes(MED_CELL)

Definition at line 160 of file med_test2.py.

Definition at line 291 of file med_test2.py.

Definition at line 425 of file med_test2.py.

Definition at line 426 of file med_test2.py.

Definition at line 427 of file med_test2.py.

list med_test2.valueI = []

Definition at line 286 of file med_test2.py.

tuple med_test2.valueIverif = fieldFamilyIntg.getRow(valInd)

Definition at line 293 of file med_test2.py.

Definition at line 395 of file med_test2.py.

tuple med_test2.volume = mesh.getVolume(supportCell)

Definition at line 394 of file med_test2.py.

tuple med_test2.volumeCell = volume.getValueIJ(j+1,1)

Definition at line 397 of file med_test2.py.

tuple med_test2.volumeName = volume.getName()

Definition at line 407 of file med_test2.py.

Definition at line 373 of file med_test2.py.

Definition at line 374 of file med_test2.py.