Topic: Compiling Rev 520 with MS Visual C++ Express 2008

I downloaded the latest revision (rev 520) and compiled it with MS Visual C++ Express 2008. Overall it was pretty smooth.

The procedure described in the wiki (http://www.oofem.org/wiki/doku.php?id=w … ompilation) covers most of what needs to be done.

I had to make a few other changes as follows:

concretedpm.C, add #include mathfem.h to the list of includes
--------------
Define _MSC_VER in the preprocessor to avoid errors with clock.c functions
--------------
trabbonenl3d.C, line 388
   if (sqrt(totalStress.at(i)*totalStress.at(i))< pow(10,-8))
change to
   if (sqrt(totalStress.at(i)*totalStress.at(i))< pow(10.,-8.))
--------------
trabbone3d.C, line 533
   if (sqrt(totalStress.at(i)*totalStress.at(i))< pow(10,-16))
change to
   if (sqrt(totalStress.at(i)*totalStress.at(i))< pow(10.,-16.))
--------------
b3solidmat.C, line 326
   while ( 0.5 * this->endOfTimeOfInterest >= Tau1 * pow10(j-1) ) {
change to
   while ( 0.5 * this->endOfTimeOfInterest >= Tau1 * pow(10. ,j-1) ) {
--------------
b3solidmat.C, line 335
   charTimes.at(mu) = Tau1 * __OOFEM_POW( 10, mu-1 );
change to
   charTimes.at(mu) = Tau1 * __OOFEM_POW( 10., mu-1 );
--------------
b3solidmat.C, line 358
   tau0 = __OOFEM_POW( 2*this->giveCharTime(1)/sqrt(10), 0.1);
change to
  tau0 = __OOFEM_POW( 2*this->giveCharTime(1)/sqrt(10.), 0.1);
--------------
b3solidmat.C, line 366
   ...  / ( log(10)*q2*tauMu*(0.9+tauMu));
change to
   ... / ( log(10.)*q2*tauMu*(0.9+tauMu));
--------------
clock.c, copy line 59
   namespace oofem
to line 105
   namespace oofem
--------------
clock.c, line 125
   :: getUtime(utime);
change to
   getUtime(utime);
--------------
clock.c, line 126
   :: getRelativeUtime(answer, from, utime);
change to
   getRelativeUtime(answer, from, utime);
--------------
HangingNode.c, line 302
   const FloatArray *masterCoords [ countOfMasterNodes ];

VC++ does not implement the full standard allowing declaration of viable length arrays like this, so I changed to
   const FloatArray **masterCoords = new(const FloatArray* [ countOfMasterNodes ]);

and added line 335 at end of routine
  delete [] masterCoords;

I have not tested that this last change works correctly, but it will allow the code to compile (so... use at your own risk!)


-Erik

Re: Compiling Rev 520 with MS Visual C++ Express 2008

Oops, I did not put the two .h files I downloaded from the wiki in the right place.

With these files included in the project, I did not have to define _MSC_VER in the preprocessor.

-Erik

3

Re: Compiling Rev 520 with MS Visual C++ Express 2008

Dear Erik,

I have just committed the new revision (526) containing proposed modifications. Thank you.
Borek