HarryvL / fcFEM-basic

5 stars 2 forks source link

fcFEM-basic

Finite Element macro for FreeCAD

Background

fcFEM is a finite element solver for performing collapse analysis of structures and soil bodies. It is based on the theory of elastoplasticity and gives insight in ductility and reserve strength beyond first yield. The theory underpinning fcFEM can be found in the document included in this repository.

Prerequisites

Installation

  1. Copy the following files fcFEM.FCMacro, femTools.py and the "name".inpfiles in a single directory on your machine, where "name" comes from the "name".FCStd` file of the freeCAD problem.
  2. Within the FreeCAD macro dialog set the macro path to the above directory.
  3. Run fcFEM.FCMacro with the FreeCAD macro editor.

Dependencies

fcFEM imports (from) the following packages: numpy, scipy, numba, matplotlib and scikit-sparse. On Linux and Mac-OS systems these can be installed with the usual package managers. On Windows this requires more effort:

  1. download Miniforge3: Miniforge3
  2. run the installer: Miniforge3-Windows-x86_64.exe
  3. find and run Miniforge on your system - this opens a Miniforge Prompt: (base) C:\"path">
  4. create a new virtual environment: (base) C:\"path"> mamba create --name fcFEM (or any other name of your choice)
  5. change into the new environment: (base) C:\"path"> mamba activate fcFEM (or the other name you chose)
  6. instal freeCAD and dependencies: (fcFEM) C:\"path"> mamba install freecad scipy numba matplotlib scikit-sparse (with spaces and no commas)
  7. check with python if the dependencies can be imported: (fcFEM) C:\"path"> python
  8. >>> import scipy.sparse
  9. >>> import sksparse.cholmod
  10. if no problems quit python and start freecad: (fcFEM) C:\"path"> freecad

Documentation

Please refer to source code for in-line comments and to the FreeCAD forum (https://forum.freecadweb.org/viewforum.php?f=18)

TODO

Licence information

Copyright (c) 2019 - Harry van Langen hvlanalysis@icloud.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License (LGPL)
as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
for detail see the LICENCE text file.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
USA