message: export modes as f5
diff: @@ -844,6 +844,12 @@ int TACSIntegrator::lapackNaturalFrequencies( int use_gyroscopic,
  TACSBVec *qddot,
  TacsScalar *freq,
  TacsScalar *modes ){
  + // TACSVec for mode
  + TACSBVec *mode = tacs->createVec();
  + mode->incref();
  + TacsScalar *mode_vals;
  + mode->getArray(&mode_vals);
  +
  if (mpiSize > 1){
  fprintf(stderr, "TACSIntegrator: Natural frequencies \
  can only be determined in serial\n");
  @@ -941,6 +947,14 @@ int TACSIntegrator::lapackNaturalFrequencies( int use_gyroscopic,
  if (modes){
  for ( int k = 0; k < n; k++ ){
  modes[index*n+k] = vr[i*n+k];
  + mode_vals[k] = vr[i*n+k];
  + }
  + // Write the mode to disk as f5
  + tacs->setVariables(mode, mode, mode);
  + if (beamf5){
  + char fname[256];
  + sprintf(fname, "mode_freq_%g.f5", freq[index]);
  + beamf5->writeToFile(fname);
  }
  }
  index++;
  @@ -996,12 +1010,21 @@ int TACSIntegrator::lapackNaturalFrequencies( int use_gyroscopic,
  for ( int i = 0; i < n; i++ ){
  if (fabs(beta[i]) > 1e-14 && alphar[i] > 0.0){
  freq[index] = sqrt(alphar[i]/beta[i]);
  +
  // Get the eigenvector corresponding to this eigenvalue. If
  // the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th
  // column of VR
  if (modes){
  for ( int k = 0; k < n; k++ ){
  modes[index*n+k] = vr[i*n+k];
  + mode_vals[k] = vr[i*n+k];
  + }
  + // Write the mode to disk as f5
  + tacs->setVariables(mode, mode, mode);
  + if (beamf5){
  + char fname[256];
  + sprintf(fname, "mode_freq_%g.f5", freq[index]);
  + beamf5->writeToFile(fname);
  }
  }
  index++;
  @@ -1017,6 +1040,7 @@ int TACSIntegrator::lapackNaturalFrequencies( int use_gyroscopic,
  delete [] work;
  }
  + mode->decref();
  DK->decref();
  DG->decref();
  DM->decref();
  