Introduction#

Programming examples#

The following sections show code pieces which are actually from the Z-mat and Z-set source code. We present these programming examples as they are in order to form a base for simple copy-paste starting for user-programming. All class names have been changed with an added _DEMO suffix in order that their generated symbols will not be overrriden by the symbols in the standard Z-set libraries. The keyworks are however the same, and these models will override what exists in the standard distribution.

These source files can be added to the $Z7PATH/User-project project directory (if they are not already there, use the material subdirectory for Z-mat extensions, and the finite_element subdirectory for Z-set add-ons) and the “user project” recompiled to make the plug-ins. To update the makefile adding new files, either run Zsetup on unix or double click the proj.zpr file on windows. In unix then simply type Zmake, or on windows open up the zfem_user.dsw Visual Studio project file to build.

Example compilation#

The following is a typical output when compiling the user project. The plug-in object files libZmat_ut_Linux.so and libZfem_ut_Linux.so are copied into the $Z7PATH/PUBLIC/lib-$Z7MACHINE directory where they are automatically serarched for when running Zrun or Zmat.

/home/tmpcalcul/M8.2/User-project
foerch.vache[305]% Zsetup
  =========================================
    ZeBuLoN 8.2.1  automatic configuration
    Zsetup      version 8/18/96

    * use the file: library_files to select
      debug files and personal libraries
  =========================================
  ....


Making new o_Linux directory
Making new og_Linux directory
foerch.vache[306]% Zmake
/home/tmpcalcul/M8.2/bin/Zmake: cd: z*: No such file or directory
Doing a 'make -f makefile.mak' in directory z*
make: makefile.mak: No such file or directory
make: *** No rule to make target `makefile.mak'.  Stop.

=======================================================
    ZeBuLoN C++  8.2.1         Mode optimize
    Making executable
-------------------------------------------------------
    Objects in directory  :     o_Linux
    Objects in directory  :     o_Linux
=======================================================

*** file compilation is listed here ***

g++ -c -Wall -O6 -fPIC -I/usr/Motif/include -I/usr/X11R6/include
-I/usr/local/include -DLinux -D_REENTRANT -D__ZverMaj=8 -D__ZverMin=2
-I/home/tmpcalcul/M8.2/include -Imaterial  -o o_Linux/User_flow_law.o
material/User_flow_law.c
echo o_Linux/Crystal_kinematic_recovery.o  o_Linux/DruckerKinematic.o
o_Linux/Empty.o  o_Linux/Partially_saturated_soil.o o_Linux/Plastic.o
o_Linux/Time_hardening_flow.o  o_Linux/User_flow_law.o    > files; Zlink
-inst  -o libZmat_ut_Linux.so  -ZL Zmat_base Linker compiler : g++
In link_gcc
Linking with dynamic blas
mv libZmat_ut_Linux.so /home/tmpcalcul/M8.2/PUBLIC/lib-Linux
g++ -c -Wall -O6 -fPIC -I/usr/Motif/include -I/usr/X11R6/include
-I/usr/local/include -DLinux -D_REENTRANT -D__ZverMaj=8 -D__ZverMin=2
-I/home/tmpcalcul/M8.2/include -Ifinite_element  -o o_Linux/Empty_calcul.o
finite_element/Empty_calcul.c
echo o_Linux/Empty_calcul.o    > files; Zlink -inst  -o libZfem_ut_Linux.so
-ZL Zmat_base -ZL Zfem_base
Linker compiler : g++
In link_gcc
Linking with dynamic blas
mv libZfem_ut_Linux.so /home/tmpcalcul/M8.2/PUBLIC/lib-Linux
foerch.vache[307]%