Simulation

class pyccx.analysis.Simulation(meshModel)

Bases: object

Provides the class for running a Calculix Simulation

Attributes Summary

CALCULIX_PATH

The calculix solver directory path used for Windows platforms.

NUMTHREADS

The total number of Threads used by the Calculix Solver

VERBOSE_OUTPUT

When enabled, the output during the analysis is redirected to the console

connectors

List of Connector used in the analysis

elementSets

User-defined ElementSet manually added to the analysis

loadCases

A list of LoadCase that have been attached to the analysis

materialAssignments

Material Assignment applied to a set of elements

materials

User defined Material used in the analysis

mpcSets

name

nodeSets

User-defined NodeSet manually added to the analysis

surfaceSets

User-defined pyccx.core.SurfaceSet manually added to the analysis

Methods Summary

checkAnalysis()

Routine checks that the analysis has been correctly generated

checkLine(line)

clearAnalysis([includeResults])

Clears any previous files generated from the analysis

getAmplitudes()

Returns all* the pyccx.core.Amplitudes used and generated in the analysis

getBoundaryConditions()

Collects all unique BoundaryCondition which are attached to each LoadCase in the analysis

getElementSets()

Returns all the ElementSet used and generated in the analysis

getNodeSets()

Returns all the NodeSet used and generated in the analysis

getNumThreads()

Returns the number of threads used by Calculix and GMSH

getSurfaceSets()

Returns all the SurfaceSet used and generated in the analysis

init()

isAnalysisCompleted()

Returns True if the analysis was completed successfully

monitor(filename)

results()

The results obtained after running an analysis

run()

Performs pre-analysis checks on the model and submits the job for Calculix to perform.

setCalculixPath(calculixPath)

Sets the path for the Calculix executable.

setNumThreads(numThreads)

Sets the number of simulation threads to use in Calculix

setVerboseOuput(state)

Sets if the output from Calculix should be verbose i.e. printed to the console.

setWorkingDirectory(workDir)

Sets the working directory used during the analysis.

version()

writeInput()

Writes the input deck for the simulation

Attributes Documentation

CALCULIX_PATH: str = ''

The calculix solver directory path used for Windows platforms. Within the solver directory the executable (ccx.exe) must exist and have execution permissions.

Note

On Mac OS X, this is the complete path of the executable

NUMTHREADS: int = 1

The total number of Threads used by the Calculix Solver

VERBOSE_OUTPUT: bool = True

When enabled, the output during the analysis is redirected to the console

connectors

List of Connector used in the analysis

elementSets

User-defined ElementSet manually added to the analysis

loadCases

A list of LoadCase that have been attached to the analysis

materialAssignments

Material Assignment applied to a set of elements

materials

User defined Material used in the analysis

mpcSets
name
nodeSets

User-defined NodeSet manually added to the analysis

surfaceSets

User-defined pyccx.core.SurfaceSet manually added to the analysis

Methods Documentation

checkAnalysis()

Routine checks that the analysis has been correctly generated

Return type:

bool

Returns:

bool: True if no analysis error occur

Raise:

AnalysisError: Analysis error that occurred

checkLine(line)
clearAnalysis(includeResults=False)

Clears any previous files generated from the analysis

Parameters:

includeResults (Optional[bool]) – If set True will also delete the result files generated from the analysis

Return type:

None

getAmplitudes()

Returns all* the pyccx.core.Amplitudes used and generated in the analysis

Return type:

List[Amplitude]

getBoundaryConditions()

Collects all unique BoundaryCondition which are attached to each LoadCase in the analysis

Return type:

List[BoundaryCondition]

Returns:

All the boundary conditions in the analysis

getElementSets()

Returns all the ElementSet used and generated in the analysis

Return type:

List[ElementSet]

getNodeSets()

Returns all the NodeSet used and generated in the analysis

Return type:

List[NodeSet]

classmethod getNumThreads()

Returns the number of threads used by Calculix and GMSH

Return type:

int

Returns:

int:

getSurfaceSets()

Returns all the SurfaceSet used and generated in the analysis

Return type:

List[SurfaceSet]

init()
isAnalysisCompleted()

Returns True if the analysis was completed successfully

Return type:

bool

monitor(filename)
results()

The results obtained after running an analysis

Return type:

ResultProcessor

run()

Performs pre-analysis checks on the model and submits the job for Calculix to perform.

classmethod setCalculixPath(calculixPath)

Sets the path for the Calculix executable. Necessary when using Windows where there is not a default installation procedure for Calculix

Parameters:

calculixPath (str) – Directory containing the Calculix Executable

Return type:

None

classmethod setNumThreads(numThreads)

Sets the number of simulation threads to use in Calculix

Parameters:

numThreads (int)

Return type:

None

Returns:

classmethod setVerboseOuput(state)

Sets if the output from Calculix should be verbose i.e. printed to the console

Parameters:

state (bool) – True if the output should be printed to the console

Return type:

None

setWorkingDirectory(workDir)

Sets the working directory used during the analysis.

Parameters:

workDir (str) – An accessible working directory path

Return type:

None

static version()
writeInput()

Writes the input deck for the simulation

Return type:

str