Programming
FEAP is designed to allow users to modify the code for their owm purposes. If at all possible, users should always use the user hooks provided in the user directory. These allow users to make custom elements, material models, new FEAP commands, et cetera. The programmers manual provides an introduction to programming in FEAP.
To use the user hooks, it is recommended to make a copy of the relevant stub file in a separate project directory. Then add the full path name to this edited copy to main/makefile on the OBJECTS line so that it will be built into FEAP the next time you compile it. If you are using windows, add the copy to your executable project. Even though there is a version of the stub file in your FEAP archive file, the compiler should use your edited copy instead of the one in the archive.
It is also recommended that you obtain a good Fortran reference book, e.g. Modern Fortran Explained by Metcalf, Reid, and Cohen.
Programmers Manual
The programmers manual can be found on the FEAP project site http://projects.ce.berkeley.edu/feap.
User Elements
AceGen and Mathematica
A template has been developed for generating user elements in an automated manner using AceGen and Mathematica. The Mathematica files, the generated user elements, examples, and benchmark examples can be found on the FEAP-AceGen GitHub repository. Detailed documentation about the template can be found in the SEMM report (UCB/SEMM-20211/01).
Enforce local constraints
User elements have the ability to implement local constraints. This examples shows how to implement a point constraint that forces a node to move in a radial direction by an amount controlled by a proportional load via Element Lagrange Multipliers.
Viscoelastic element in C
Elements can be programmed in C also. Here is an example viscoelastic element written in C (using old style conventions).
User Interface Elements
User Memory Allocation
Users have the ability to directly use FEAPs built in memory allocation/management system. See the UALLOC page for details. Note it is of course also possible to call malloc( ) directly, but FEAP's system will allow for seamless garbage collection upon exit.
User Block Generation
User Body Forces
User Materials
History Initialization
In FEAP, if your materials have history and you wish to initialize it to a non-zero value, then you must do so under isw.eq.14.
User materials in Python
It is possible to write your user material models in Python and then call them from FEAP using socket connections; see the Python material page.
Cubic Saint Venant Material Model
Example of a cubic St. Venant material model.
Miehe Microsphere model
Miehe microsphere model example.
User Debugging File Outputs
User Transient Algorithms
User Export of Tangent and Residual for Code Coupling
Set User Data for Element Plotting
Assembling User Contributions to the Tangent and RHS
Calling MATLAB functions from FEAP
FEAP can be coupled to MATLAB using the MATLAB Engine. This permits the two way exchange of data between FEAP and routines written in MATLAB. A big advantage of this is that one can leverage the vast array of MATLAB utilities (albeit while paying MATLAB's performance penalty).
User Functions
User Load Curve: Haversine Function
Haversine example.
Global User Parameters
Set User Boundary Codes
User Mesh Command: Torsional Boundary Conditions
User mesh commands can be used to implement complex boundary conditions. Here is an example that implements a torsional boundary condition.
User Displacement Imports
User Utility for Sparse Arrays
User Macro Commands
User Macro to reset material data
If one would like to change material properties in a computation from the command line, this is possible using a user macro customized to change material data.
User Macro to change boundary codes dynamically during a computation
If one would like to flip boundary conditions from say displacement conditions to force conditions based on a dynamically computed criteria on can achieve this with a user macro to flip the boundary codes.
User Macro to switch between big- and little-endian in binary restart files
When moving binary restart files, the binary order can be reversed if necessary. Here is an example of a user macro to convert binary restart files.
User Macro in C
User macros can be written in C. Here is an old style example.
User Macro for Broyden Quasi-Newton Method
This user macro implements a Broyden Quasi-Newton Method into FEAP.
User Mesh Manipulation Commands
User Mesh Generation Commands
User Plotting Commands
User Plot Command: Heat Transfer Flux Vectors
An example of a user plot command.
User Mass Allocation
User Problem Inputs
When reading user inputs from the input file it is recommended that one use a Polling Input programing style.
Setting User Additions to the Profile
User Proportional Load
User Rotational Updates
Custom User Banner Messages
User Solvers
Memory
FEAP's memory management system is based on a fixed location in the user memory space and offsets from that location to memory blocks obtained from the operating system via calls to malloc.