General topics

Basic entities

Basic entities for data exchange.

class import_export.basic_entities.ComponentSupportRecord(typ='Rigid', k=0.0)

Bases: object

Constraints for x,y,z,rx,ry,rz displacements of a node/kPoint.

getTypeCode()
class import_export.basic_entities.SupportRecord(id, xComp=<import_export.basic_entities.ComponentSupportRecord object>, yComp=<import_export.basic_entities.ComponentSupportRecord object>, zComp=<import_export.basic_entities.ComponentSupportRecord object>, rxComp=<import_export.basic_entities.ComponentSupportRecord object>, ryComp=<import_export.basic_entities.ComponentSupportRecord object>, rzComp=<import_export.basic_entities.ComponentSupportRecord object>)

Bases: object

Constraints for displacements

getStrConstraints()
setupFromComponentLabels(componentLabels)

Block topology entities

class import_export.block_topology_entities.BlockData(verbosity=1)

Bases: object

Block topology entities container: points, lines, faces, solids,…

Variables:
  • name – container name.
  • materials – materials dictionary.
  • points – point container.
  • blocks – block (line, surface, volumen) container.
  • pointSupports – constrained points.
  • verbosity – verbosity level.
appendBlock(block)
Append a block (line, surface, volume) to the
block data.
Parameters:block – block to append.
appendPoint(id, x, y, z, pointProperties=None)

Append a point to the block data.

Parameters:
  • id – point identifier (-1 == auto).
  • x – x coordinate of the point.
  • y – y coordinate of the point.
  • z – z coordinate of the point.
  • pointProperties – labels and attributes for the point.
blockFromPoints(points, blockProperties, thickness=0.0, matId=None)
Create a block with the points and append it
to the container.
Parameters:
  • points – points to build the new block.
  • blockProperties – labels and attributes for the new block.
  • thickness – thickness of the new block.
  • matId – material of the new block.
extend(other)

Append a the data from the argument to this container.

Parameters:other – container to append here.
getBlockTags()

Return the identifiers of the blocks.

getHoles()

Return the holes defined in this container.

getNearest(pos3d)

Return the block nearest to the point argument.

Parameters:pos3d – position of the point.
getPointTags()

Return the identifiers of the points.

hasHoles()

Return true if one or more of the surfaces has holes in it.

readFromDxfFile(fName, preprocessor, dxfLayers)

Read block topology from a DXF file.

Parameters:
  • fName – name of the DXF file to write.
  • preprocessor – XC preprocessor
  • dxfLayers – layers to import objects from.
readFromXCSet(xcSet)

Read points and surfaces from an XC set.

writeDxf(drawing)
Write the blocks (point, lines, surfaces, volumes,…)
in a DXF file.
Parameters:drawing – ezdxf drawing object.
writeDxfFile(fileName, silent=True)

Write block topology in a DXF file.

Parameters:
  • fileName – name of the DXF file to write.
  • silent – if true instruct ezdxf not to write regular info messages (only warning or error messages).
writeToXCFile(xcImportExportData)

Write a Python file with XC commands.

class import_export.block_topology_entities.BlockDict

Bases: dict

Block container.

append(cell)
getTags()

Return the identifiers of the objects.

readFromXCSet(xcSet)

Read blocks from XC set.

writeDxf(name, pointDict, drawing)

Write the cells in dxf file.

writeToXCFile(f, xcImportExportData)

Write the XC commands that define the cells (elements).

class import_export.block_topology_entities.BlockProperties(labels=None, attributes=None)

Bases: object

Labels and attributes of the block.

Variables:
  • labels – string list that helps to identify the role of the block in the model.
  • attributes – block attributes stored in a dictionary.
appendAttribute(key, value)

Append the label argument to the container.

appendLabel(label)

Append the label argument to the container.

static copyFrom(blockProperties)
If the argument is not None creates a new BlockProperties
object with the arguments contents, otherwise return an empty BlockProperties object.
Parameters:blockProperties – object to copy contents from.
extend(blockProperties)

Append the argument labels and attributes to the container.

extendAttributes(attributes)

Append the labels argument to the container.

extendLabels(labels)

Append the labels argument to the container.

getAttribute(key)

Return the attribute corresponding to the key argument in the dictionary.

getStrXCCommand(strId)

Return the XC command that stores the properties.

Parameters:strId – identifier of the object.
hasAttribute(key)

Return true if the key argument is the attribute dictionary.

hasLabel(label)

Return true if the label argument is the label container.

class import_export.block_topology_entities.BlockRecord(id, typ, kPoints, blockProperties=None, thk=0.0, matId=None)

Bases: import_export.mesh_entities.CellRecord

Block type entities: line, face, body,…

Variables:blockProperties – labels and attributes of the block.
getAttribute(key)

Return the attribute corresponding to the key argument in the dictionary.

getGeomObject(pointDict)

Return the geometric object that represents this line, surface or volume.

getHoles()

Return the blocks defining the holes of the block.

getKPointIds()

Return the key points identifiers of the block.

getStrKeyPointsIds()
getStrXCCommand(xcImportExportData)

Return the XC Python string defining the object.

getType()

Return the type of the block.

getVertices(pointDict)

Return the positions of the k-points defining this block.

hasAttribute(key)

Return true if the key argument is the attribute dictionary.

hasHoles()

Return true if the block has holes in it.

hasLabel(label)

Return true if the label argument is the label container.

class import_export.block_topology_entities.PointDict

Bases: import_export.mesh_entities.NodeDict

Point container.

append(id, x, y, z)
getName()
readFromXCSet(xcSet)
writeToXCFile(f, xcImportExportData)

Write the XC commands that define nodes.

class import_export.block_topology_entities.PointRecord(id, coords, blockProperties=None)

Bases: import_export.mesh_entities.NodeRecord

kPoint type entity

getAttribute(key)

Return the attribute corresponding to the key argument in the dictionary.

getStrXCCommand(pointHandlerName: str)

Return the XC command that creates the point.

Parameters:pointHandlerName – name of the point handler
hasAttribute(key)

Return true if the key argument is the attribute dictionary.

hasLabel(label)

Return true if the label argument is the label container.

class import_export.block_topology_entities.PointSupportDict

Bases: dict

Point to put constraints on.

append(ps)
readFromXCSet(xcSet, points)

Read supports from an XC set.

class import_export.block_topology_entities.PointSupportRecord(id, pointId, nsr)

Bases: import_export.basic_entities.SupportRecord

Constraints for node displacements.

Neutral mesh description

class import_export.neutral_mesh_description.GroupRecord

Bases: object

empty()
readFromDATFile(fName)
setUp(name, points, lines)
writeDxfFile(dummy)

groups have not representation in dxf files.

Parameters:dummy – dummy argument (not used).
writeToXCFile(xcImportExportData)

writes the XC commands to define the group in a file.

class import_export.neutral_mesh_description.MEDMeshData(umesh)

Bases: import_export.mesh_entities.MeshData

meshDimension = None
spaceDimension = None
class import_export.neutral_mesh_description.XCImportExportData

Bases: object

Data used when importing and/or exporting XC
models.
Variables:
  • outputFileName – name to use for the output file.
  • problemName – name for the XC problem object.
  • nodeHandlerName – name for the XC node handler.
  • cellHandlerName – name for the XC element handler.
  • setHandlerName – name for the XC group handler.
  • pointHandlerName – name for the XC point handler.
  • lineHandlerName – name for the XC line handler.
  • surfaceHandlerName – name for the XC surface handler.

:ivar cellConversion= dictionary for cell conversion. :ivar outputFile= Python file object used for output. :ivar meshDesc= string describing the mesh :ivar blockData= block data (points, lines, surfaces, bodies).

convertCellType(tp)
getBlockHandlerName(blockType)
getDxfFileName()
getXCFileName()
readDATFiles()
readDxfFile(fName, preprocessor)
writeDxfFile(fileName)
writeToXCFile()

Write the model to a XC file.

import_export.neutral_mesh_description.dumpMeshes(meshes, fName)
import_export.neutral_mesh_description.loadMeshes(fName)

Mesh entities

class import_export.mesh_entities.CellDict

Bases: dict

Cell container.

append(cell)
getTags()
readFromDATFile(lines, begin, end)
readFromUMesh(umesh)
readFromXCSet(xcSet)
writeDxf(nodeDict, drawing)

Write the cells in dxf file.

writeToXCFile(f, xcImportExportData)

Write the XC commands that define the cells (elements).

class import_export.mesh_entities.CellRecord(id, typ, nodes, thk=0.0)

Bases: object

Cell object

Variables:
  • id – identifier for the cell.
  • typ – cell type.
  • nodes – nodes that define block geometry and topology.
  • thk – cell thickness.
getStrThicknessCommand(strId)
Return a string defining the thickness
property of the cell.
Parameters:strId – object identifier.
getStrXCCommand(xcImportExportData)
getStrXCNodes()
writeDxf(nodeDict, drawing, layerName)
class import_export.mesh_entities.MaterialDict

Bases: dict

append(mat)
class import_export.mesh_entities.MaterialRecord(name, typo, thermalExp, rho, E, nu, G, logDec, specHeat, thermalCond)

Bases: object

class import_export.mesh_entities.MeshData

Bases: object

readFromDATFile(fName)
readFromXCSet(xcSet)

Read nodes and elements from an XC set.

writeDxf(drawing)

Write mesh in a DXF file.

writeDxfFile(fileName, silent=True)

Write mesh in a DXF file.

Parameters:
  • fileName – name of the DXF file to write.
  • silent – if true instruct ezdxf not to write regular info messages (only warning or error messages).
writeToXCFile(xcImportExportData)

Write the XC commands that define the mesh.

class import_export.mesh_entities.NodeDict

Bases: dict

Node container.

append(id, x, y, z)
getName()
getTags()
readFromDATFile(lines, begin, end)
readFromUMesh(umesh)
readFromXCSet(xcSet)
writeDxf(drawing)

Write the node positions in dxf file.

writeToXCFile(f, xcImportExportData)

Write the XC commands that define nodes.

class import_export.mesh_entities.NodeRecord(id, coords)

Bases: object

Node of a finite element mesh

getStrXCCommand(nodeHandlerName)
getX()
getY()
getZ()
writeDxf(drawing, layerName)
class import_export.mesh_entities.NodeSupportDict

Bases: dict

append(ns)
getNodeTags()

Return dictionary keys in a list.

readFromXCDomain(domain)

Read SP constraints from an XC domain.

class import_export.mesh_entities.NodeSupportRecord(id, nodeId, xComp=<import_export.basic_entities.ComponentSupportRecord object>, yComp=<import_export.basic_entities.ComponentSupportRecord object>, zComp=<import_export.basic_entities.ComponentSupportRecord object>, rxComp=<import_export.basic_entities.ComponentSupportRecord object>, ryComp=<import_export.basic_entities.ComponentSupportRecord object>, rzComp=<import_export.basic_entities.ComponentSupportRecord object>)

Bases: import_export.basic_entities.SupportRecord

Constraints for node displacements.

import_export.mesh_entities.getConstraintsByNode(domain)

Neutral load description

class import_export.neutral_load_description.ElementLoadRecord(loadCase, bName='nil', v=1.0, mode='nil')

Bases: import_export.neutral_load_description.LoadRecord

class import_export.neutral_load_description.LoadCase(id, name, desc, lg, ltyp)

Bases: object

Load case.

class import_export.neutral_load_description.LoadComb(id, name, desc, typ, descomp)

Bases: object

Load combination.

class import_export.neutral_load_description.LoadCombComponent(id, loadCase, coef)

Bases: object

class import_export.neutral_load_description.LoadContainer(n)

Bases: object

empty()
getNumberOfLoads()
searchLoadedElements(elementSet)

Get load distribution over elements taken from the set.

class import_export.neutral_load_description.LoadData

Bases: object

Container for load groups, cases and combinations.

readLoadCombsFromXC(combContainer, mapLoadCases)
class import_export.neutral_load_description.LoadGroup(id, desc, permanent=False)

Bases: object

Loads wich share some property (origin,…).

class import_export.neutral_load_description.LoadRecord(loadCase, bName='nil', v=1.0)

Bases: object

class import_export.neutral_load_description.NodalLoadRecord(loadCase, bName, pos, v)

Bases: import_export.neutral_load_description.PointForceRecord

Load over a node.

searchLoadedElement(elemSet)
searchLoadedNode(elemSet)
class import_export.neutral_load_description.PointForceRecord(loadCase, bName, pos, v)

Bases: import_export.neutral_load_description.LoadRecord

Force applied in a point.

class import_export.neutral_load_description.SurfaceLoadRecord(loadCase, bName='nil', plg=None, v=1.0, mode='nil')

Bases: import_export.neutral_load_description.ElementLoadRecord

get2DPolygon()
searchLoadedElements(elemSet)

Returns elements which have his center inside the polygon

setPolygon(points)
import_export.neutral_load_description.getComponentsFromStr(descompStr, mapLoadCases)

DXF reader

Read block topology data from DXF files.

class import_export.dxf_reader.DXFImport(dxfFileName, layerNamesToImport, getRelativeCoo, threshold=0.01, importLines=True, importSurfaces=True, polylinesAsSurfaces=False, tolerance=0.01)

Bases: import_export.reader_base.ReaderBase

Import DXF entities.

Variables:
  • layerNamesToImport – list of regular expressions to be tested.
  • polylinesAsSurfaces – if true import polylines as surfaces.
  • tolerance – tolerance for polyface and polyline decomposition
extractPoints()

Extract the points from the entities argument.

getLayersToImport(namesToImport)

Return the layers names that will be imported according to the regular expressions contained in the second argument.

Parameters:namesToImport – list of regular expressions to be tested.
getNamesToImport()

Return the layer names to import.

importFaces()

Import 3D faces from DXF.

importGroups()

Import the DXF groups on the file.

importLines()

Import lines from DXF.

importPoints()

Import points from DXF.

class import_export.dxf_reader.FloatList(tol=0.01)

Bases: list

List of floats that are more than “tol” apart.

append(num)

Append object to the end of the list.

class import_export.dxf_reader.OldDxfReader(tol=0.001)

Bases: object

Reading of DXF entities for further processing.

newKeyPoint(pt)
newLine(l)
read(dxf_file_name, xc_preprocessor, layers)
read_lines(entities, layerName)
read_points(entities, layerName)
import_export.dxf_reader.decompose_polyface(polyface, tol=0.01)

Return the quadrilateral surfaces that compose the polyface.

import_export.dxf_reader.decompose_polyline(polyline, tol=0.01)

Return the quadrilateral surfaces that compose the polyline.

import_export.dxf_reader.get_candidate_2Dquads(sisRef, points, tol)

Return candidate quads in 2D.

import_export.dxf_reader.get_extended_data(obj, appName='XC')

Extract dxf object extended data.

import_export.dxf_reader.get_polyface_points_axis(polyface_points)

Return the axis for the polyface.

import_export.dxf_reader.get_polygon_axis(points, tol)

Compute the polygon axis on the assumption that they all the sides are orthogonal.

import_export.dxf_reader.quads2d_to_global_coordinates(sisRef, selected_quads)

Convert the quads from 2D to 3D.