def makeBasis(userNumber, interpolationName, collapsed): """ Helper function for creating a basis of the given interpolation type and collapsed state """ cmissInterpolations = { 'cubic_hermite': iron.BasisInterpolationSpecifications.CUBIC_HERMITE, 'quadratic': iron.BasisInterpolationSpecifications.QUADRATIC_LAGRANGE, 'linear': iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE, } interpolation = cmissInterpolations[interpolationName] basis = iron.Basis() basis.CreateStart(basisUserNumber) basis.TypeSet(iron.BasisTypes.LAGRANGE_HERMITE_TP) basis.NumberOfXiSet(3) basis.InterpolationXiSet([interpolation] * 3) basis.QuadratureNumberOfGaussXiSet([numberOfGaussXi] * 3) # Have to enable face basis evaluation so we can # use pressure boundary conditions basis.QuadratureLocalFaceGaussEvaluateSet(True) if collapsed: basis.CollapsedXiSet([ iron.BasisXiCollapse.XI_COLLAPSED, iron.BasisXiCollapse.COLLAPSED_AT_XI0, iron.BasisXiCollapse.NOT_COLLAPSED, ]) basis.CreateFinish() # Save basis into a dictionary for easy # retrieval later self.bases[interpolationName, collapsed] = basis
def createBasis(interpolationType, basisUserNumber): basis = iron.Basis() basis.CreateStart(basisUserNumber) basis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP basis.numberOfXi = numberOfXi basis.interpolationXi = [interpolationType] * numberOfXi basis.quadratureNumberOfGaussXi = [numGauss] * numberOfXi basis.CreateFinish() return basis
# Create a 3D rectangular cartesian coordinate system coordinateSystem = iron.CoordinateSystem() coordinateSystem.CreateStart(coordinateSystemUserNumber) coordinateSystem.DimensionSet(3) coordinateSystem.CreateFinish() # Create a region and assign the coordinate system to the region region = iron.Region() region.CreateStart(regionUserNumber, iron.WorldRegion) region.LabelSet("Region") region.coordinateSystem = coordinateSystem region.CreateFinish() # Define basis basis = iron.Basis() basis.CreateStart(basisUserNumber) basis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP basis.numberOfXi = numberOfXi basis.interpolationXi = [ iron.BasisInterpolationSpecifications.QUADRATIC_LAGRANGE ] * numberOfXi if (NumberOfGaussXi > 0): basis.quadratureNumberOfGaussXi = [NumberOfGaussXi] * numberOfXi basis.CreateFinish() if (UsePressureBasis): # Define pressure basis pressureBasis = iron.Basis() pressureBasis.CreateStart(pressureBasisUserNumber) pressureBasis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP
coordinateSystem = iron.CoordinateSystem() coordinateSystem.CreateStart(coordinateSystemUserNumber) coordinateSystem.DimensionSet(1) coordinateSystem.CreateFinish() # Create a region and assign the coordinate system to the region region = iron.Region() region.CreateStart(regionUserNumber, iron.WorldRegion) region.LabelSet("Region") region.coordinateSystem = coordinateSystem region.CreateFinish() #DOC-END initialisation #DOC-START basis # Define a bilinear Lagrange basis basis = iron.Basis() basis.CreateStart(basisUserNumber) basis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP basis.numberOfXi = 1 basis.interpolationXi = [iron.BasisInterpolationSpecifications.LINEAR_LAGRANGE] basis.CreateFinish() #DOC-END basis #DOC-START generated mesh # Create a generated mesh generatedMesh = iron.GeneratedMesh() generatedMesh.CreateStart(generatedMeshUserNumber, region) generatedMesh.type = iron.GeneratedMeshTypes.REGULAR generatedMesh.basis = [basis] generatedMesh.extent = [width] generatedMesh.numberOfElements = [numberOfXElements]
# Creation a RC coordinate system coordinateSystem = iron.CoordinateSystem() coordinateSystem.CreateStart(coordinateSystemUserNumber) coordinateSystem.dimension = 2 coordinateSystem.CreateFinish() # Create a region region = iron.Region() region.CreateStart(regionUserNumber, iron.WorldRegion) region.label = "Cavity" region.coordinateSystem = coordinateSystem region.CreateFinish() # Create a biquadratic lagrange basis quadraticBasis = iron.Basis() quadraticBasis.CreateStart(quadraticBasisUserNumber) quadraticBasis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP quadraticBasis.numberOfXi = 2 quadraticBasis.interpolationXi = [ iron.BasisInterpolationSpecifications.QUADRATIC_LAGRANGE ] * 2 quadraticBasis.quadratureNumberOfGaussXi = [3] * 2 quadraticBasis.CreateFinish() # Create a bilinear lagrange basis linearBasis = iron.Basis() linearBasis.CreateStart(linearBasisUserNumber) linearBasis.type = iron.BasisTypes.LAGRANGE_HERMITE_TP linearBasis.numberOfXi = 2 linearBasis.interpolationXi = [