{"id":18356571,"url":"https://github.com/drlukeparry/pyccx","last_synced_at":"2025-04-06T12:32:19.771Z","repository":{"id":164968373,"uuid":"254341339","full_name":"drlukeparry/pyccx","owner":"drlukeparry","description":" A library for creating and running 3D FEA simulations using the opensource Calculix FEA Package.","archived":false,"fork":false,"pushed_at":"2023-09-11T22:20:16.000Z","size":243,"stargazers_count":28,"open_issues_count":9,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-12-16T15:19:06.611Z","etag":null,"topics":["calculix","fea","gmsh","gmsh-api","gmsh-sdk","meshing","python","simulation","simulation-framework","structural-analysis"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drlukeparry.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-04-09T10:31:58.000Z","updated_at":"2023-11-29T11:02:41.000Z","dependencies_parsed_at":"2023-08-22T19:02:31.648Z","dependency_job_id":null,"html_url":"https://github.com/drlukeparry/pyccx","commit_stats":{"total_commits":97,"total_committers":3,"mean_commits":"32.333333333333336","dds":0.04123711340206182,"last_synced_commit":"f77197c0570e6134422234f03fb2140087566524"},"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyccx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyccx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyccx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drlukeparry%2Fpyccx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drlukeparry","download_url":"https://codeload.github.com/drlukeparry/pyccx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247484480,"owners_count":20946388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["calculix","fea","gmsh","gmsh-api","gmsh-sdk","meshing","python","simulation","simulation-framework","structural-analysis"],"created_at":"2024-11-05T22:10:47.404Z","updated_at":"2025-04-06T12:32:18.408Z","avatar_url":"https://github.com/drlukeparry.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PyCCX - Python Library for Calculix\n=======================================\n\n.. image:: https://github.com/drlukeparry/pyccx/workflows/Python%20application/badge.svg\n    :target: https://github.com/drlukeparry/pyccx/actions\n.. image:: https://readthedocs.org/projects/pyccx/badge/?version=latest\n    :target: https://pyccx.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n.. image:: https://badge.fury.io/py/PyCCX.svg\n    :target: https://badge.fury.io\n.. image:: https://badges.gitter.im/pyccx/community.svg\n    :target: https://gitter.im/pyccx/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\n    :alt: Chat on Gitter\n\nProvides a library for creating and running 3D FEA simulations using the opensource Calculix FEA Package.\n\nThe aims of this project was to provide a simple framework for implemented 3D FEA Analysis using the opensource `Calculix \u003chttp://www.calculix.de\u003e`_ solver.\nThe analysis is complimented by use of the recent introduction of the\n`GMSH-SDK \u003chttp://https://gitlab.onelab.info/gmsh/gmsh/api\u003e`_ , an extension to `GMSH \u003chttp://gmsh.info/\u003e`_  to provide API bindings for different programming languages\nby the project authors to provide sophisticated 3D FEA mesh generation outside of the GUI implementation. This project aims to provide an integrated approach for generating full 3D FEA analysis\nfor use in research, development and prototyping in a Python environment. Along with setting up and processing the analysis,\nconvenience functions are included.\n\nThe inception of this project was a result of finding no native Python/Matlab package available to perfom full non-linear FEA analysis\nof 3D CAD models in order to prototype a concept related to 3D printing. The project aims to compliment the work of\nthe `PyCalculix project \u003chttps://github.com/spacether/pycalculix\u003e`_, which currently is limited to providing capabilities\nto generate 2D Meshes and FEA analysis for 2D planar structures. The potential in the future is to provide\na more generic extensible framework compatible with different opensource and commercial FEA solvers (e.g. Abaqus, Marc, Z88, Elmer).\n\nAn interface that built upon GMSH was required to avoid the use of the GUI, and the domain specific .geo scripts.\n`Learn more \u003chttp://lukeparry.uk/\u003e`_.\n\nStructure\n##############\n\nPyCCX framework consists of classes for specifying common components on the pre-processing phase, including the following\ncommon operations:\n\n* Mesh generation\n* Creating and applying boundary conditions\n* Creating load cases\n* Creating and assigning material models\n* Performing the simulation\n\nIn addition, a meshing class provides an interface with GMSH for performing the meshing routines and for associating\nboundary conditions with the elements/faces generated from geometrical CAD entities. The Simulation class assembles the\nanalysis and performs the execution to the Calculix Solver. Results obtained upon completion of the analysis can be processed.\nCurrently the analysis is unit-less, therefore the user should ensure that all constant, material paramters, and geometric\nlengths are consistent - by default GMSH assumes 'mm' units.\n\nCurrent Features\n******************\n\n**Meshing:**\n\n* Integration with GMSH for generation 3D FEA Meshes (Tet4, Tet10 currently supported)\n* Merging CAD assemblies using GMSH\n* Attaching boundary conditions to Geometrical CAD entities\n\n**FEA Capabilities:**\n\n* **Boundary Conditions** (Acceleration, Convection, Fixed Displacements, Forces, Fluxes, Pressure, Radiation)\n* **Loadcase Types** (Structural Static, Thermal, Coupled Thermo-Mechanical)\n* **Materials** (Non-linear Elasto-Plastic Material)\n\n**Results Processing:**\n\n* Element and Nodal Results can be obtained across timesteps\n\n\nInstallation\n*************\nInstallation is currently supported on Windows, all this further support will be added for\nLinux environments. PyCCX can be installed along with dependencies for GMSH automatically using.\n\n.. code:: bash\n\n    pip install pyccx\n\n\nDepending on your environment, you will need to install the latest version of Calculix. This can be done through\nthe conda-forge `calculix package \u003chttps://anaconda.org/conda-forge/calculix\u003e`_ in the Anaconda distribution,\n\n.. code:: bash\n\n    conda install -c conda-forge calculix\n\n\nor alternatively downloading the package directly. On Windows platforms the path of the executable needs to be initialised before use.\n\n.. code:: python\n\n    from pyccx.core import Simulation\n\n    # Set the path for Calculix in Windows\n    Simulation.setCalculixPath('Path')\n\n\nUsage\n******\n\nThe following code excerpt shows an example for creating and running a steady state thermal analysis of model using PyCCX\nof an existing mesh generated using the pyccx.mesh.mesher class.\n\n.. code:: python\n\n    from pyccx.core import DOF, ElementSet, NodeSet, SurfaceSet, Simulation\n    from pyccx.results import ElementResult, NodalResult, ResultProcessor\n    from pyccx.loadcase import  LoadCase, LoadCaseType\n    from pyccx.material import ElastoPlasticMaterial\n\n    # Set the path for Calculix in Windows\n    Simulation.setCalculixPath('Path')\n\n    # Create a thermal load case and set the timesettings\n    thermalLoadCase = LoadCase('Thermal Load Case')\n\n    # Set the loadcase type to thermal - eventually this will be individual analysis classes with defaults\n    thermalLoadCase.setLoadCaseType(LoadCaseType.THERMAL)\n\n    # Set the thermal analysis to be a steady state simulation\n    thermalLoadCase.isSteadyState = True\n\n    # Attach the nodal and element result options to each loadcase\n    # Set the nodal and element variables to record in the results (.frd) file\n    nodeThermalPostResult = NodalResult('VolumeNodeSet')\n    nodeThermalPostResult.useNodalTemperatures = True\n\n    elThermalPostResult = ElementResult('Volume1')\n    elThermalPostResult.useHeatFlux = True\n\n    # Add the result configurations to the loadcase\n    thermalLoadCase.resultSet = [nodeThermalPostResult, elThermalPostResult]\n\n    # Set thermal boundary conditions for the loadcase using specific NodeSets\n    thermalLoadCase.boundaryConditions.append(\n        {'type': 'fixed', 'nodes': 'surface6Nodes', 'dof': [DOF.T], 'value': [60]})\n\n    thermalLoadCase.boundaryConditions.append(\n        {'type': 'fixed', 'nodes': 'surface1Nodes', 'dof': [DOF.T], 'value': [20]})\n\n    # Material\n    # Add a elastic material and assign it to the volume.\n    # Note ensure that the units correctly correspond with the geometry length scales\n    steelMat = ElastoPlasticMaterial('Steel')\n    steelMat.density = 1.0    # Density\n    steelMat.cp =  1.0        # Specific Heat\n    steelMat.k = 1.0          # Thermal Conductivity\n\n    analysis.materials.append(steelMat)\n\n    # Assign the material the volume (use the part name set for geometry)\n    analysis.materialAssignments = [('PartA', 'Steel')]\n\n    # Set the loadcases used in sequential order\n    analysis.loadCases = [thermalLoadCase]\n\n    # Analysis Run #\n    # Run the analysis\n    analysis.run()\n\n    # Open the results  file ('input') is currently the file that is generated by PyCCX\n    results = analysis.results()\n    results.load()\n\n\nThe basic usage is split between the meshing facilities provided by GMSH and analysing a problem using the Calculix Solver. Documented\nexamples are provided in `examples \u003chttps://github.com/drlukeparry/pyccx/tree/master/examples\u003e`_ .\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrlukeparry%2Fpyccx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrlukeparry%2Fpyccx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrlukeparry%2Fpyccx/lists"}