Simulation¶
- class pyccx.analysis.Simulation(meshModel)¶
Bases:
objectProvides the class for running a Calculix Simulation
Attributes Summary
The calculix solver directory path used for Windows platforms.
The total number of Threads used by the Calculix Solver
When enabled, the output during the analysis is redirected to the console
List of
Connectorused in the analysisUser-defined
ElementSetmanually added to the analysisA list of
LoadCasethat have been attached to the analysisMaterial Assignment applied to a set of elements
User defined
Materialused in the analysisUser-defined
NodeSetmanually added to the analysisUser-defined
pyccx.core.SurfaceSetmanually added to the analysisMethods Summary
Routine checks that the analysis has been correctly generated
checkLine(line)clearAnalysis([includeResults])Clears any previous files generated from the analysis
Returns all* the
pyccx.core.Amplitudesused and generated in the analysisCollects all unique
BoundaryConditionwhich are attached to eachLoadCasein the analysisReturns all the
ElementSetused and generated in the analysisReturns all the
NodeSetused and generated in the analysisReturns the number of threads used by Calculix and GMSH
Returns all the
SurfaceSetused and generated in the analysisinit()Returns
Trueif the analysis was completed successfullymonitor(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()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
- elementSets¶
User-defined
ElementSetmanually added to the analysis
- materialAssignments¶
Material Assignment applied to a set of elements
- mpcSets¶
- name¶
- surfaceSets¶
User-defined
pyccx.core.SurfaceSetmanually 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.Amplitudesused and generated in the analysis- Return type:
List[Amplitude]
- getBoundaryConditions()¶
Collects all unique
BoundaryConditionwhich are attached to eachLoadCasein the analysis- Return type:
List[BoundaryCondition]- Returns:
All the boundary conditions in the analysis
- getElementSets()¶
Returns all the
ElementSetused and generated in the analysis- Return type:
List[ElementSet]
- getNodeSets()¶
Returns all the
NodeSetused 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
SurfaceSetused and generated in the analysis- Return type:
List[SurfaceSet]
- init()¶
- isAnalysisCompleted()¶
Returns
Trueif the analysis was completed successfully- Return type:
bool
- monitor(filename)¶
- results()¶
The results obtained after running an analysis
- Return type:
- 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
-
CALCULIX_PATH: