Multigrid extension for NeuroFEM 
  last change: 04.03.2008  

Integration - ParExPDE library

ParExPDE is a template based C++ library for using finite elements, which is used for the FMG solver of this project. To integrate this library into the NeuroFEM package some steps have to be done:
  • Source code has to be included
  • Package has to be build
  • Library has to be included
Those steps will be described very briefly.


Source code inclusion

To include the source code of ParExPDE the directory structure of NeuroFEM was extended. There was created a new directory which contains all files of ParExPDE in an already existing library path.
neurofem/lib/ParExPDE/*


Building and Linking of the library

The ParExPDE library is build with the scons tool. Since the NeuroFEM package uses only Makefiles for building, and the requirements for installing the extended package should not be extended, an alternative for an installed version of scons is used. This alternative is a python script which allows the same functionality as scons, but requires no installation (except for python). The corresponding python script is also included in the directory of the ParExPDE source code. Finally for building an linking only a small change of the Makefiles remains.
In the first file there a two changes where the additional libraries are added to library variables:
Code from file "uif/Makefile_linux_opt"
CFLAGS = -Wno-deprecated \
-I$(SimBioHome) -I$(SimBioHome)/analysis -I$(SimBioHome)/utilities \
-I$(SimBioHome)/vista -ansi $(UIFCFLAGS) -Drestrict=__restrict -DPAREXPDE_CONFIG_H -I../neurofem/lib/ParExPDE -I../neurofem/lib/ParExPDE/src -I../neurofem/lib/ParExPDE/src/common -I../neurofem/lib/ParExPDE/src/geometry -I../neurofem/lib/ParExPDE/src/mesh -I../neurofem/lib/ParExPDE/src/storage -I../neurofem/lib/ParExPDE/src/partition -I../neurofem/lib/ParExPDE/src/io -I../neurofem/lib/ParExPDE/src/mpi -I../neurofem/lib/ParExPDE/src/exprtemp
Code from file "uif/Makefile_linux_opt"
LIBS = $(UIFLIBS) -lneurofem$(SUFFIX) -linverse$(SUFFIX) -lnewinverse$(SUFFIX)\
$(SOLVERLIBS) $(SOLVERLIBS) $(PILUTSLIBS) -L$(SimBioHome)/neurofem/lib \
-lsolver$(SUFFIX) -lfofu$(SUFFIX) -lime$(SUFFIX) \
$(LAPACK) $(EXTRA_LIBS) \
-L../neurofem/lib/ParExPDE/lib -lparexpde
In the second file there are added also the additional libraries to use and the ParExPDE library is build during the creation of the FMG object file:
Code from file "neurofem/Makefile"
CFLAGS = -I$(SimBioHome) -I$(SimBioHome)/analysis -I$(SimBioHome)/utilities -I $(SimBioHome)/vista -ansi $(UIFCFLAGS) -Drestrict=__restrict -DPAREXPDE_CONFIG_H -Ilib/ParExPDE -Ilib/ParExPDE/src -Ilib/ParExPDE/src/common -Ilib/ParExPDE/src/geometry -Ilib/ParExPDE/src/mesh -Ilib/ParExPDE/src/storage -Ilib/ParExPDE/src/partition -Ilib/ParExPDE/src/io -Ilib/ParExPDE/src/mpi -Ilib/ParExPDE/src/exprtemp
Code from file "neurofem/Makefile"
fmgsolver.o : $(SimBioHome)/neurofem/fmg/fmgsolver.cpp
(cd $(SimBioHome)/neurofem/lib/ParExPDE; python scons/scons.py)
$(CCCompiler) $(OPT) -c -o fmgsolver.o $(SimBioHome)/neurofem/fmg/fmgsolver.cpp $(CFLAGS)