Mid-level-like library (cgnslib.py)

CGNS.PAT.cgnslib.newCGNSTree(version=3.2)

Top CGNS/Python tree node creation, not a CGNS/SIDS type:

T=newCGNSTree()
Parameters:

version (float32) – force the CGNSLibraryVersion

Returns:

a new CGNSTree_t node

Remarks :
  • You should keep the returned node in a variable or reference to it in any other way, this tree root is a Python object that would be garbagged if its reference count reaches zero.
  • The CGNSTree node is a CGNS/Python node which has no existence in a disk HDF5 file.
  • Default version is taken from CGNS.PAT.cgnskeywords
Children :
CGNS.PAT.cgnslib.newCGNSBase(tree, name, ncell, nphys)

CGNSBase node creation, the top node for topological contents:

# The base is put in the `T` children list
T=newCGNSTree()
newBase(T,'Box-1',3,3)

# No parent, you should fetch the new node using a variable
B=newCGNSBase(None,'Box-2',3,3)

# using tuple de-ref
dims=(3,3)
B=newCGNSBase(None,'Box-3',*dims)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – base name
  • cdim (int) – cell dimensions
  • pdim (int) – physical dimensions
Returns:

a new CGNSBase_t node

Children :
See :
CGNS.PAT.cgnslib.newZone(parent, name, zsize=None, ztype='Structured', family='')

Zone node creation, the sub-tree defining a topological domain:

s=NPY.array([[10],[2],[0]],dtype='i')

T=newCGNSTree()
B=newBase(T,'Box-1',3,3)
Z=newZone(B,name,s,CK.Unstructured_s,'Wing')
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – zone name
  • size (ndarray) – array of zone dimensions
  • zonetype (str) – type of the zone
  • family (str) – main FamilyName of the zone
Returns:

a new Zone_t node

Children :
Remarks :
  • The zone size has dimensions [IndexDimensions][3]
See :
CGNS.PAT.cgnslib.newGridCoordinates(parent, name)

GridCoordinates node creation, container for coordinates:

newGridCoordinates(zone,CK.GridCoordinates_s)
newDataArray(gc,CK.CoordinateX_s)
newDataArray(gc,CK.CoordinateY_s)
newDataArray(gc,CK.CoordinateZ_s)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
Returns:

a new GridCoordinates_t node

Remarks :
  • Creates only the grid node, you have to use newDataArray() to add the actual coordinates as children arrays. You can also use the newCoordinates() function, it creates this GridCoordinates node if missing, at the first coordinate add.
See :
CGNS.PAT.cgnslib.newCoordinates(parent, name='GridCoordinates', value=None)

GridCoordinates_t and DataArray_t nodes creation:

cx=newCoordinates(zone,CK.CoordinateX_s,x_array)
cy=newCoordinates(zone,CK.CoordinateY_s,y_array)
cz=newCoordinates(zone,CK.CoordinateZ_s,z_array)

# the following function sequence performs the same action   
gc=newGridCoordinates(zone,CK.GridCoordinates_s)
newDataArray(gc,CK.CoordinateX_s,x_array)
newDataArray(gc,CK.CoordinateY_s,y_array)
newDataArray(gc,CK.CoordinateZ_s,z_array)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
  • value (ndarray) – the coordinates array to set
Returns:

The returned node always is the DataArray_t node.

Remarks :
  • Creates a new <node> representing a GridCoordinates_t sub-tree with the coordinate DataArray given as argument. This creates both the GridCoordinates_t with GridCoordinates name and DataArray_t with the argument name. Usually used to create the default grid. If the GridCoordinates_t with name GridCoordinates already exists then only the DataArray is created.
  • Array dims are not checked, should be consistent with zone dims
See :
CGNS.PAT.cgnslib.newDataArray(parent, name, value=None)

DataArray node creation, the all purpose array node:

import numpy as NPY

da=newDataArray(dd,'{DataArray}',value=NPY.array(((1,3),(5,7)),dtype='d'))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – array name
Returns:

a new DataArray_t node

See :
CGNS.PAT.cgnslib.newDataClass(parent, value='UserDefined')

DataClass node creation, sets the class of a data array:

import CGNS.PAT.cgnskeywords as CK
import numpy as NPY

# N is an already existing CGNS/Python node
dd=newDiscreteData(N,'{DiscreteData}')
dc=newDataClass(dd,CK.DimensionalUnits_s)
da=newDataArray(dd,'{DataArray}',value=NPY.array((1,),dtype='d'))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (str) – DataClass type to set
Returns:

a new DataClass_t node

Remarks :
See :
CGNS.PAT.cgnslib.newDimensionalUnits(parent, value=['Kilogram', 'Meter', 'Second', 'Kelvin', 'Radian'])

DimensionalUnits node creation, sets the units of a data array:

import CGNS.PAT.cgnskeywords as CK
import numpy as NPY

# N is an already existing CGNS/Python node
dd=newDiscreteData(N,'{DiscreteData}')
dc=newDataClass(dd,CK.DimensionalUnits_s)
units=(CK.Gram_s,CK.Foot_s,CK.UserDefined_s,CK.Celcius_s,CK.Degree_s)
du=newDimensionalUnits(dd,units)
da=newDataArray(dd,'{DataArray}',value=NPY.array((1,),dtype='d'))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (list(str)) – list of 5 units, order is significant
Returns:

a new DimensionalUnits_t node

Remarks :
  • order is MassUnit,LengthUnit,TimeUnit, TemperatureUnit,AngleUnit
See :
CGNS.PAT.cgnslib.newDimensionalExponents(parent, MassExponent=0, LengthExponent=0, TimeExponent=0, TemperatureExponent=0, AngleExponent=0)

DimensionalExponents node creation, sets the units exponents of an array:

import CGNS.PAT.cgnskeywords as CK
import numpy as NPY

# N is an already existing CGNS/Python node
dd=newDiscreteData(N,'{DiscreteData}')
dc=newDataClass(dd,CK.DimensionalUnits_s)
units=(CK.Gram_s,CK.Foot_s,CK.UserDefined_s,CK.Celcius_s,CK.Degree_s)
du=newDimensionalUnits(dd,units)
exps=(1,-1,-2,0,0)
du=newDimensionalExponents(dd,exps)
da=newDataArray(dd,'{DataArray}',value=NPY.array((1,),dtype='d'))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (list(float)) – list of 5 exponents, order is significant
Returns:

a new DimensionalExponents_t node

Remarks :
  • order is MassExponent,LengthExponent,TimeExponent, TemperatureExponent,AngleExponent
  • values are forced to be double floats
See :
CGNS.PAT.cgnslib.newDataConversion(parent, ConversionScale=1.0, ConversionOffset=1.0)

DataConversion node creation, sets the conversion factors for an array:

import CGNS.PAT.cgnskeywords as CK
import numpy as NPY

# N is an already existing CGNS/Python node
dd=newDiscreteData(N,'{DiscreteData}')
dc=newDataClass(dd,CK.DimensionalUnits_s)
units=(CK.Gram_s,CK.Foot_s,CK.UserDefined_s,CK.Celcius_s,CK.Degree_s)
du=newDimensionalUnits(dd,units)
exps=(1,-1,-2,0,0)
du=newDimensionalExponents(dd,exps)
ds=newDataConversion(dd,2.0,0.0)
da=newDataArray(dd,'{DataArray}',value=NPY.array((1,),dtype='d'))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • scale (float) – scale of the conversion to apply
  • offset (float) – offset of the conversion to apply
Returns:

a new DataConversion_t node

Remarks :
  • values are forced to be double floats
See :
CGNS.PAT.cgnslib.newDescriptor(parent, name, value='')

Descriptor node creation, to contain user-defined textual contents:

txt=newDescriptor(parent,'CommandLine','python -c import elsA.CGNS')
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
  • value (str) – text to enter (python string)
Returns:

a new Descriptor_t node

See :
CGNS.PAT.cgnslib.newGridLocation(parent, value='CellCenter')

GridLocation node creation, set location of data value wrt grid:

n=newGridLocation(parent,CK.Vertex_s)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (str) – GridLocation to set
Returns:

a new GridLocation_t node

Remarks :
  • Allowed values are in CK.GridLocation_l
See :
CGNS.PAT.cgnslib.newIndexArray(parent, name, value=None)

IndexArray node creation, integer array for indexing purpose:

import numpy as NPY

ix=newIndexArray(parent,'GlobalIndex',NPY.array((3,4,5)))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
  • value (ndarray) – array to set
Returns:

a new IndexArray_t node

Remarks :
  • Values are not forced of any type, user has to use I4 or I8
  • Array dims are not checked
See :
CGNS.PAT.cgnslib.newPointList(parent, name='PointList', value=None)

PointList node creation, integer array for indexing purpose:

import numpy as NPY

ix=newPointList(parent,'FacesList',NPY.array((3,4,5,9,15)))
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
  • value (ndarray) – array to set
Returns:

a new XPointList_t node

Remarks :
  • Values are not forced of any type, user has to use I4 or I8
  • Array dims are not checked
  • Not a SIDS type
See :
CGNS.PAT.cgnslib.newPointRange(parent, name='PointRange', value=[])

PointRange node creation, integer array for Structured indexing purpose:

import numpy as NPY

minmax=NPY.array([[1,13],[1,6],[1,1]],order='F')
ix=newPointRange(parent,value=minmax)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
  • value (ndarray) – array to set
Returns:

a new XPointRange_t node

Remarks :
  • Values are not forced of any type, user has to use I4 or I8
  • Array dims are not checked
  • Array index has to be in Fortran order
  • not a SIDS type
See :
CGNS.PAT.cgnslib.newRind(parent, value)

Rind node creation, indicates extra ghost cells around the grid:

rind=NPY.array([[1,13],[1,6],[1,1]],order='F')
newRind(solution,rind)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (ndarray) – array to set
Returns:

a new Rind_t node

Remarks :
  • For structured grids, order is imin,imax,jmin,jmax,kmin,kmax
  • For unstructured grids, order is number of rind points before and after
  • Values are not forced of any type, user has to use I4 or I8
  • Array dims are not checked
  • Array index has to be in Fortran order
See :
CGNS.PAT.cgnslib.newSimulationType(parent, stype='NonTimeAccurate')

SimulationType node creation, set the TimeAccurate type:

newSimulationType(base,CK.TimeAccurate_s)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • stype (str) – enumerate from CK.SimulationType_l
Returns:

a new SimulationType_t node

See :
CGNS.PAT.cgnslib.newOrdinal(parent, value=0)

Ordinal node creation, an informative integer value:

newOrdinal(node,4)
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • value (int) – arbtrary integer
Returns:

a new Ordinal_t node

See :
CGNS.PAT.cgnslib.newDiscreteData(parent, name)

DiscreteData node creation, structural node for data:

newDiscreteData(node,'Parameters')
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
Returns:

a new DiscreteData_t node

See :
CGNS.PAT.cgnslib.newIntegralData(parent, name)

IntegralData node creation, structural node for data:

newIntegralData(node,'Parameters')
Parameters:
  • node (CGNS/Python) – the parent node (<node> or None)
  • name (str) – new node name
Returns:

a new IntegralData_t node

See :
CGNS.PAT.cgnslib.newElements(parent, name, etype='UserDefined', econnectivity=None, erange=None, eboundary=0)

Elements_t node creation, indexing unstructured meshes:

quads=newElements(None,'QUADS',CGK.QUAD_4,quad_array,NPY.array([start,end]))'
  • Args:
  • parent: the parent node (<node> or None)
  • name: element node name (string)
  • etype: the type of element (string or ‘int’)
  • econnectivity: actual array of point connectivities (numpy.ndarray)
  • erange: the first and last index of the connectivity (numpy.ndarray)
  • eboundary: number of boundary elements (int)
  • Return:
  • Remarks:
  • If a parent is given, the new node is added to the parent children list.
  • The elementsrange should insure a unique and continuous index for all elements nodes in the same parent zone.
  • Element type can be set as int such as CGK.QUAD_4 or 7, or as string such as CGK.QUAD_4_s or “QUAD_4”
  • Children:
CGNS.PAT.cgnslib.newBoundary(parent, bname, brange, btype='Null', family=None, pttype='PointRange')

-BC node creation -BC

‘newNode:N=’newBoundary‘(parent:N,bname:S,brange:[*i],btype:S)’

Returns a new <node> representing a BC_t sub-tree. If a parent is given, the new <node> is added to the parent children list. Parent should be Zone_t, returned node is parent. If the parent has already a child name ZoneBC then only the BC_t,IndexRange_t are created. chapter 9.3 Add IndexRange_t required

CGNS.PAT.cgnslib.newBCDataSet(parent, name, valueType='Null')

-BCDataSet node creation -BCDataSet

‘newNode:N=’newBCDataSet‘(parent:N,name:S,valueType:CK.BCTypeSimple)’

If a parent is given, the new <node> is added to the parent children list. Returns a new <node> representing a BCDataSet_t sub-tree. chapter 9.4 Add node BCTypeSimple is required
CGNS.PAT.cgnslib.newBCData(parent, name)

-BCData node creation -BCData

‘newNode:N=’newBCData‘(parent:N,name:S)’

Returns a new <node> representing a BCData_t sub-tree. chapter 9.5
CGNS.PAT.cgnslib.newBCProperty(parent, wallfunction='Null', area='Null')

-BCProperty node creation -BCProperty

‘newNode:N=’newBCProperty‘(parent:N)’

Returns a new <node> representing a BCProperty_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 9.6
CGNS.PAT.cgnslib.newAxisymmetry(parent, refpoint=array([ 0., 0., 0.]), axisvector=array([ 0., 0., 0.]))

-Axisymmetry node creation -Axisymmetry

‘newNode:N=’newAxisymmetry‘(parent:N,refpoint:A,axisvector:A)’

refpoint,axisvector should be a real array. Returns a new <node> representing a CK.Axisymmetry_t sub-tree. chapter 7.5 Add DataArray AxisymmetryAxisVector,AxisymmetryReferencePoint are required

CGNS.PAT.cgnslib.newRotatingCoordinates(parent, rotcenter=array([ 0., 0., 0.]), ratev=array([ 0., 0., 0.]))

-RotatingCoordinates node creation -RotatingCoordinates

‘newNode:N=’newRotatingCoordinates‘(parent:N,rotcenter=A,ratev=A)’

Returns a new <node> representing a RotatingCoordinates_t sub-tree. If a parent is given, the new <node> is added to the parent children list. rotcenter,ratev should be a real array. chapter 7.6 Add DataArray RotationRateVector,RotationCenter are required
CGNS.PAT.cgnslib.newFlowSolution(parent, name='{FlowSolution}', gridlocation=None)

-Solution node creation -Solution

‘newNode:N=’newSolution‘(parent:N,name:S,gridlocation:None)’

Returns a new <node> representing a FlowSolution_t sub-tree. chapter 7.7

CGNS.PAT.cgnslib.newZoneGridConnectivity(parent, name='ZoneGridConnectivity')

-GridConnectivity node creation -Grid

‘newNode:N=’newZoneGridConnectivity‘(parent:N,name:S)’

Creates a ZoneGridConnectivity_t sub-tree This sub-node is returned. If a parent is given, the new <node> is added to the parent children list, the parent should be a Zone_t. chapter 8.1

CGNS.PAT.cgnslib.newGridConnectivity1to1(parent, name, dname, window, dwindow, trans)

-GridConnectivity1to1 node creation -Grid

‘newNode:N=’newGridConnectivity1to1‘(parent:N,name:S,dname:S,window:[i*],dwindow:[i*],trans:[i*])’

Creates a GridConnectivity1to1_t sub-tree. If a parent is given, the new <node> is added to the parent children list, the parent should be a Zone_t. The returned node is the GridConnectivity1to1_t chapter 8.2

CGNS.PAT.cgnslib.newGridConnectivity(parent, name, dname, ctype='Overset')

-GridConnectivity node creation -Grid

‘newNode:N=’newGridConnectivity‘(parent:N,name:S,dname:S,ctype:S)’

Creates a GridConnectivity sub-tree. If a parent is given, the new <node> is added to the parent children list, the parent should be a ZoneGridConnectivity_t. The returned node is the GridConnectivity_t chapter 8.4

CGNS.PAT.cgnslib.newGridConnectivityType(parent, ctype='Overset')

-GridConnectivityType node creation -Grid

‘newNode:N=’newGridConnectivityType‘(parent:N,ctype:S)’

Creates a GridConnectivityType sub-tree. If a parent is given, the new <node> is added to the parent children list, the parent should be a GridConnectivity_t. The returned node is the GridConnectivityType_t chapter 8

CGNS.PAT.cgnslib.newGridConnectivityProperty(parent)

-GridConnectivityProperty node creation -GridConnectivityProperty

‘newNode:N=’newGridConnectivityProperty‘(parent:N)’

Returns a new <node> representing a GridConnectivityProperty_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 8.5
CGNS.PAT.cgnslib.newPeriodic(parent, rotcenter=array([ 0., 0., 0.]), ratev=array([ 0., 0., 0.]), trans=array([ 0., 0., 0.]))

-Periodic node creation -Periodic

‘newNode:N=’newPeriodic‘(parent:N,rotcenter=A,ratev=A,trans=A)’

Returns a new <node> representing a Periodic_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name Periodic then only the RotationCenter,RotationAngle,Translation are created. rotcenter,ratev,trans should be a real array. chapter 8.5.1 Add DataArray RotationCenter,RotationAngle,Translation are required
CGNS.PAT.cgnslib.newAverageInterface(parent, valueType='Null')

-AverageInterface node creation -AverageInterface

‘newNode:N=’newAverageInterface‘(parent:N,valueType:CK.AverageInterfaceType)’

Returns a new <node> representing a AverageInterface_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name AverageInterface then only the AverageInterfaceType is created. chapter 8.5.2
CGNS.PAT.cgnslib.newOversetHoles(parent, name, hrange)

-OversetHoles node creation -OversetHoles

‘node:N=’newOversetHoles‘(parent:N,name:S,hrange:list)’

Creates a OversetHoles_t sub-tree. the parent should be a Zone_t. If a parent is given, the new <node> is added to the parent children list. chapter 8.6 Add PointList or List( PointRange ) are required

CGNS.PAT.cgnslib.newFlowEquationSet(parent)

-FlowEquationSet node creation -FlowEquationSet

‘newNode:N=’newFlowEquationSet‘(parent:N)’

If a parent is given, the new <node> is added to the parent children list.
Returns a new <node> representing a CK.FlowEquationSet_t sub-tree. chapter 10.1
CGNS.PAT.cgnslib.newGoverningEquations(parent, valueType='Euler')

-GoverningEquations node creation -GoverningEquations

‘newNode:N=’newGoverningEquations‘(parent:N,valueType:CK.GoverningEquationsType)’

Returns a new <node> representing a CK.GoverningEquations_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name GoverningEquations then only the GoverningEquationsType is created. chapter 10.2 Add node GoverningEquationsType is required
CGNS.PAT.cgnslib.newGasModel(parent, valueType='Ideal')

-GasModel node creation -GasModel

‘newNode:N=’newGasModel‘(parent:N,valueType:CK.GasModelType)’

Returns a new <node> representing a CK.GasModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name GasModel then only the GasModelType is created. chapter 10.3 Add node GasModelType is required
CGNS.PAT.cgnslib.newThermalConductivityModel(parent, valueType='SutherlandLaw')

-ThermalConductivityModel node creation -ThermalConductivityModel

‘newNode:N=’newThermalConductivityModel‘(parent:N,valueType:CK.ThermalConductivityModelType)’

Returns a new <node> representing a CK.ThermalConductivityModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name ThermalConductivityModel then only the ThermalConductivityModelType is created. chapter 10.5 Add node ThermalConductivityModelType is required
CGNS.PAT.cgnslib.newViscosityModel(parent, valueType='SutherlandLaw')

-ViscosityModel node creation -ViscosityModel

‘newNode:N=’newViscosityModel‘(parent:N,valueType:CK.ViscosityModelType)’

Returns a new <node> representing a CK.ViscosityModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name ViscosityModel then only the ViscosityModelType is created. chapter 10.4 Add node ViscosityModelType is (r)
CGNS.PAT.cgnslib.newTurbulenceClosure(parent, valueType='Null')

-TurbulenceClosure node creation -TurbulenceClosure

‘newNode:N=’newTurbulenceClosure‘(parent:N,valueType:CK.TurbulenceClosureType)’
Returns a new <node> representing a CK.TurbulenceClosure_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name TurbulenceClosure then only the ViscosityModelType is created. chapter 10.5 Add node TurbulenceClosureType is (r)
CGNS.PAT.cgnslib.newTurbulenceModel(parent, valueType='OneEquation_SpalartAllmaras')

-TurbulenceModel node creation -TurbulenceModel

‘newNode:N=’newTurbulenceModel‘(parent:N,valueType:CK.TurbulenceModelType)’

Returns a new <node> representing a CK.TurbulenceModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name TurbulenceModel then only the TurbulenceModelType is created. chapter 10.6.2 Add node TurbulenceModelType is (r)
CGNS.PAT.cgnslib.newThermalRelaxationModel(parent, valueType='Null')

-ThermalRelaxationModel node creation -ThermalRelaxationModel

‘newNode:N=’newThermalRelaxationModel‘(parent:N,valueType:CK.ThermalRelaxationModelType)’

Returns a new <node> representing a CK.ThermalRelaxationModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name ThermalRelaxationModel then only the ThermalRelaxationModelType is created. chapter 10.7 Add node ThermalRelaxationModelType is (r)
CGNS.PAT.cgnslib.newChemicalKineticsModel(parent, valueType='Null')

-ChemicalKineticsModel node creation -ChemicalKineticsModel

‘newNode:N=’newChemicalKineticsModel‘(parent:N,valueType:CK.ChemicalKineticsModelType)’

Returns a new <node> representing a CK.ChemicalKineticsModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name ChemicalKineticsModel then only the ChemicalKineticsModelType is created. chapter 10.8 Add node ChemicalKineticsModelType is (r)
CGNS.PAT.cgnslib.newEMElectricFieldModel(parent, valueType='Null')

-EMElectricFieldModel node creation -EMElectricFieldModel

‘newNode:N=’newEMElectricFieldModel‘(parent:N,valueType:CK.EMElectricFieldModelType)’

Returns a new <node> representing a CK.EMElectricFieldModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list.

If the parent has already a child name EMElectricFieldModel then

only the EMElectricFieldModelType is created. chapter 10.9 Add node EMElectricFieldModelType is (r)

CGNS.PAT.cgnslib.newEMMagneticFieldModel(parent, valueType='Null')

-EMMagneticFieldModel node creation -EMMagneticFieldModel

‘newNode:N=’newEMMagneticFieldModel‘(parent:N,valueType:CK.EMMagneticFieldModelType)’

Returns a new <node> representing a CK.EMMagneticFieldModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name EMMagneticFieldModel_s then only the EMMagneticFieldModelType is created. chapter 10.9.2 Add node EMMagneticFieldModelType is (r)
CGNS.PAT.cgnslib.newEMConductivityModel(parent, valueType='Null')

-EMConductivityModel node creation -EMConductivityModel

‘newNode:N=’newEMConductivityModel‘(parent:N,valueType:CK.EMConductivityModelType)’

Returns a new <node> representing a CK.EMConductivityModel_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name EMConductivityModel then only the EMConductivityModelType is created. chapter 10.9.3 Add node EMConductivityModelType is (r)
CGNS.PAT.cgnslib.newBaseIterativeData(parent, name, nsteps=0, itype='IterationValues')

-BaseIterativeData node creation -BaseIterativeData

‘newNode:N=’newBaseIterativeData‘(parent:N,name:S,nsteps:I,itype:E)’

Returns a new <node> representing a BaseIterativeData_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 11.1.1 NumberOfSteps is required, TimeValues or IterationValues are required

CGNS.PAT.cgnslib.newZoneIterativeData(parent, name)

-ZoneIterativeData node creation -ZoneIterativeData

‘newNode:N=’newZoneIterativeData‘(parent:N,name:S)’

Returns a new <node> representing a ZoneIterativeData_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 11.1.2
CGNS.PAT.cgnslib.newRigidGridMotion(parent, name, valueType='Null', vector=array([ 0., 0., 0.]))

-RigidGridMotion node creation -RigidGridMotion

‘newNode:N=’newRigidGridMotion‘(parent:N,name:S,valueType:CK.RigidGridMotionType,vector:A)’

If a parent is given, the new <node> is added to the parent children list.
Returns a new <node> representing a CK.RigidGridMotion_t sub-tree. If the parent has already a child name RigidGridMotion then only the RigidGridMotionType is created and OriginLocation is created chapter 11.2 Add Node RigidGridMotionType and add DataArray OriginLocation are the only required
CGNS.PAT.cgnslib.newReferenceState(parent, name='ReferenceState')

-ReferenceState node creation -ReferenceState

‘newNode:N=’newReferenceState‘(parent:N,name:S)’

Returns a new <node> representing a ReferenceState_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 12.1
CGNS.PAT.cgnslib.newConvergenceHistory(parent, name='GlobalConvergenceHistory', iterations=0)

-ConvergenceHistory node creation -ConvergenceHistory

‘newNode:N=’newConvergenceHistory‘(parent:N,name:S,iterations:i)’

Returns a new <node> representing a ConvergenceHistory_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 12.3
CGNS.PAT.cgnslib.newFamily(parent, name)

-Family node creation -Family

‘newNode:N=’newFamily‘(parent:N,name:S)’

Returns a new <node> representing a Family_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 12.6
CGNS.PAT.cgnslib.newGeometryReference(parent, name='{GeometryReference}', valueType='UserDefined')

-GeometryReference node creation -GeometryReference

‘newNode:N=’newGeometryReference‘(parent:N,name:S,valueType:CK.GeometryFormat)’

Returns a new <node> representing a CK.GeometryFormat_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name CK.GeometryReference then only the .GeometryFormat is created chapter 12.7 Add node CK.GeometryFormat_t is (r) and GeometryFile_t definition not find but is required (CAD file)
CGNS.PAT.cgnslib.newFamilyBC(parent, valueType='UserDefined')

-FamilyBC node creation -FamilyBC

‘newNode:N=’newFamilyBC‘(parent:N,valueType:CK.BCTypeSimple/CK.BCTypeCompound)’

Returns a new <node> representing a CK.FamilyBC_t sub-tree. If a parent is given, the new <node> is added to the parent children list. If the parent has already a child name FamilyBC then only the BCType is created chapter 12.8 Add node BCType is required
CGNS.PAT.cgnslib.newArbitraryGridMotion(parent, name, valuetype='Null')

Returns a new node representing a ArbitraryGridMotionType_t

Parameters:
  • parent – CGNS/Python node
  • name – String
  • valuetype – String (CGNS.PAT.cgnskeywords.ArbitraryGridMotionType)

If a parent is not None, the new node is added to the parent children list. If the parent has already a child with name RigidGridMotion then only the RigidGridMotionType is created.

CGNS.PAT.cgnslib.newUserDefinedData(parent, name)

-UserDefinedData node creation -UserDefinedData

‘newNode:N=’newUserDefinedData‘(parent:N,name:S)’

Returns a new <node> representing a UserDefinedData_t sub-tree. If a parent is given, the new <node> is added to the parent children list. chapter 12.9
CGNS.PAT.cgnslib.newGravity(parent, gvector=array([ 0., 0., 0.]))

-Gravity node creation -Gravity

‘newNode:N=’newGravity‘(parent:N,gvector:A)’

Returns a new <node> representing a Gravity_t sub-tree. If a parent is given, the new <node> is added to the parent children list. gvector should be a real array chapter 12.10 Add DataArray GravityVector is required