Welcome to the xfemm project. xfemm is a software project intended to create a direct interface to a high quality magnetics finite element code based on FEMM. The objective of xfemm is to create a cross-platform command line magnetics finite element solver written in standard C++, a set of magnetics problem definition and post-processing functions in native !Matlab/Octave code, and a mex interface to the solvers. Another future goal is to create a paralellised C++ solution algorithm.
xfemm users
If you use xfemm, particularly for industrial work, but also academic, it will be greatly appreciated if you could write an email stating this and how it has supported your work. This is a low-cost way to ensure further development and maintenance will continue! Contact the authors on the discussion forum, or you will find an email address in the source files.If you wish to cite xfemm in your, please use the following:
Crozier, R, Mueller, M., "A New MATLAB and Octave Interface to a Popular Magnetics Finite Element Code", Proceedings of the 22nd International Conference on Electric Machines (ICEM 2016), September 2016.
The cross-platform command line meshing and solution algorithms have been created, the mex interface to these functions, and most of the problem creation/definition functions have been created.
The project is divided into two subprojects ''cfemm'' and ''mfemm''. ''cfemm'' is the C++ command line meshing and solution project. ''mfemm'' is the !Matlab/Octave problem definition and post-processing project.
The project is not yet complete, but you can already do the following:
You can also compile the meshing and solution components as standalone command-line programs.
For information on installing xfemm see [Installation and Setup], for information on helping to develop xfemm see [Development].
FEMM (Finite Element Method Magnetics) is a Windows program for defining, solving, and postprocessing 2D planar and axisymmetric problems of magnetostatics, eddy currents, electrostatics and heat flow via the Finite Element Method originally developed by Dr. David Meeker.
Unfortunately FEMM is a windows only program (although it can be run on Linux via Wine) and although it has a fully developed method for communicating with Matlab, this is based either on ActiveX, which cannot be used on non-windows systems, or a much slower and less reliable file communication method. For these reasons it was decided to develop a version of the core FEMM numerical codes based only on the C and C++ standard libraries so it can be easily ported between systems. Instead of the current GUI, the primary interface is through !Matlab/Octave. However, the core code could easily be reused within a cross-platform GUI.
Two programs and a library have been created by making modifications to the original FEMM source code: ''fmesher'', ''fsolver'' and ''fpproc''. ''fmesher'' meshes a domain as specified by a normal .fem file (as used by FEMM). This is achieved by calling Triangle directly (having compiled it as a library) rather than as an external program as it is called in FEMM. ''fsolver'' loads the mesh and problem files generated by ''fmesher'' and solves the finite element problem. ''fsolver'' is effectively the original fkn program used by FEMM with all windows specific code removed or replaced by the C++ standard template libraries. ''fpproc'' is a library which provides access to the post-processing code from FEMM. As FEMM is interactive, this cannot be used directly like fsolver and fmesher, unless some custom code is used around it. fsolver and fmesher are command-line only.
In addition, however, a set of mex gateway functions are provided for accessing fmesher, fsolver and the fpproc library from Matlab or Octave. Instructions for building these functions are provided in the README file, and in the help for mfemm_setup.m, both found in the mfemm directory. The fpproc interface is not currently compatible with the release version of Octave as it requires classdef syntax, however, this is present in a branch of the development version of Octave, and has been tested and already found to work.
The licensing arrangements of xfemm are slightly complex. The C++ programs based on the original FEMM source code are licenced under the Aladdin Free Public Licence, as the original FEMM source is also provided under this licence. The !Matlab/Octave code is provided under the Apache Version 2.0 licence. Further details and the texts of these licences are provided with the source.
The xfemm project gratefully acknowledges the support of the Linz Centre of Mechatronics GMBH (LCM) in producing Version 2.0 of xfemm.