XNS Shape Optimization
XNS shape optimization variant XNS-SOPT is a fusion of XNS with the optimization driver opti_mizer and the geometry kernel shade. The XNS component, including EWD, has its own branch in the version control system.
There is a old xns-sopt version, if you want this look here:
For the new XNS-SOPT version you can also take a look at the (internal) developer documentation in the shape optimization wiki .
getting xns-sopt
You need XNS, ewd, opti_mizer and shade.
Therefore do this:
svn checkout svn://hydra/xns svn checkout svn://hydra/opti_mizer svn checkout svn://hydra/shade svn checkout svn://hydra/ewd
Remark
On hydra please use #define SENDRECV 1 in the file ewdcomm.F, otherwise the mpi gets into a deadlock. Do not forget
to comment the other two variants.
Validation Cases
Please find the cases here:
svn checkout svn://hydra/validate-sopt
Documentation
The basic behaviour is the same as "normal" xns. For the shape changes we updated the mixd format. Please look here:
svn checkout svn://hydra/tn-mixd-2.0
Guidelines to keep the code AD-friendly
There are some simple implementation "rules" that should be followed to ease the transformation of the code:
- Include either ewd.h or ewdcray.h whenever using cray pointers in other header files
or Fortran routines and declare them correctly as
integer (crayptr) :: myptr. - Add an empty line at the end of each file.
- Check your declaration for unused variables and get rid of them.
- Avoid Fortran 90/95 statement
action="write"in the open command. - Adress arrays with their correct dimension, i.e., fill the rows of the array
real*8 :: a(m,n)usinga(i,0) = data(i)ora(:,0) = data(:)ora(1:m,0) = data(1:m)instead ofa=data(i). Another example is usingsum(array(:))instead ofsum(array). - Do not label loops, i.e.,
myloop: do... - Use parameter attribute instead of preprocessor defines. Example: replace
# define JUST_FUNCTION 1byinteger, parameter :: JUST_FUNCTION = 1. - Be consistent with data types (even if the compiler usually does not mind when you pass a logical to a subroutine that expects an integer; the other way around you might be in trouble anyway).




