68 using namespace Nektar;
 
   70 int main(
int argc, 
char *argv[])
 
   72     string fname = std::string(argv[2]);
 
   73     int fdot = fname.find_last_of(
'.');
 
   74     if (fdot != std::string::npos)
 
   76         string ending = fname.substr(fdot);
 
   81         if (ending == 
".chk" || ending == 
".fld")
 
   83             fname = fname.substr(0,fdot);
 
   87     fname = fname + 
".txt";
 
   92     Array<OneD, NekDouble> auxArray;
 
   94     int nBndEdgePts, nBndEdges, nBndRegions;
 
   99                 "Usage: ExtractSurface3DCFS meshfile fieldFile\n");
 
  101                 "Extracts a surface from a 3D fld file" 
  102                 "(only for CompressibleFlowSolver and purely 3D .fld files)\n");
 
  109     std::string                         m_ViscosityType;
 
  123     int nDimensions = m_spacedim;
 
  127     ASSERTL0(vSession->DefinesParameter(
"Gamma"),
 
  128              "Compressible flow sessions must define a Gamma parameter.");
 
  129     vSession->LoadParameter(
"Gamma", m_gamma, 1.4);
 
  132     ASSERTL0(vSession->DefinesParameter(
"pInf"),
 
  133              "Compressible flow sessions must define a pInf parameter.");
 
  134     vSession->LoadParameter(
"pInf", m_pInf, 101325);
 
  137     ASSERTL0(vSession->DefinesParameter(
"rhoInf"),
 
  138              "Compressible flow sessions must define a rhoInf parameter.");
 
  139     vSession->LoadParameter(
"rhoInf", m_rhoInf, 1.225);
 
  142     ASSERTL0(vSession->DefinesParameter(
"uInf"),
 
  143              "Compressible flow sessions must define a uInf parameter.");
 
  144     vSession->LoadParameter(
"uInf", m_uInf, 0.1);
 
  147     if (m_spacedim == 2 || m_spacedim == 3)
 
  149         ASSERTL0(vSession->DefinesParameter(
"vInf"),
 
  150                  "Compressible flow sessions must define a vInf parameter" 
  151                  "for 2D/3D problems.");
 
  152         vSession->LoadParameter(
"vInf", m_vInf, 0.0);
 
  158         ASSERTL0(vSession->DefinesParameter(
"wInf"),
 
  159                  "Compressible flow sessions must define a wInf parameter" 
  161         vSession->LoadParameter(
"wInf", m_wInf, 0.0);
 
  164     vSession->LoadParameter (
"GasConstant",   m_gasConstant,   287.058);
 
  165     vSession->LoadParameter (
"Twall",         m_Twall,         300.15);
 
  166     vSession->LoadSolverInfo(
"ViscosityType", m_ViscosityType, 
"Constant");
 
  167     vSession->LoadParameter (
"mu",            m_mu,            1.78e-05);
 
  168     vSession->LoadParameter (
"thermalConductivity",
 
  169                              m_thermalConductivity, 0.0257);
 
  173     string meshfile(argv[1]);
 
  180     string                                          fieldFile(argv[2]);
 
  181     vector<LibUtilities::FieldDefinitionsSharedPtr> fieldDef;
 
  182     vector<vector<NekDouble> >                      fieldData;
 
  189     vector< vector<LibUtilities::PointsType> > pointsType;
 
  190     for (i = 0; i < fieldDef.size(); ++i)
 
  192         vector<LibUtilities::PointsType> ptype;
 
  193         for (j = 0; j < 3; ++j)
 
  197         pointsType.push_back(ptype);
 
  199     graphShPt->SetExpansions(fieldDef, pointsType);
 
  206     int nfields = fieldDef[0]->m_fields.size();
 
  207     Array<OneD, MultiRegions::ExpListSharedPtr> Exp(nfields);
 
  208     Array<OneD, MultiRegions::ExpListSharedPtr> pFields(nfields);
 
  210     for(i = 0; i < pFields.num_elements(); i++)
 
  214                                                                         vSession->GetVariable(i));
 
  223     for (i = 1; i < nfields; ++i)
 
  231     if (pFields[0]->GetBndCondExpansions().num_elements())
 
  235         nBndRegions = pFields[0]->GetBndCondExpansions().num_elements();
 
  236         for (b = 0; b < nBndRegions; ++b)
 
  238             nBndEdges = pFields[0]->GetBndCondExpansions()[b]->GetExpSize();
 
  239             for (e = 0; e < nBndEdges; ++e)
 
  241                 nBndEdgePts = pFields[0]->
 
  242                     GetBndCondExpansions()[b]->GetExp(e)->GetTotPoints();
 
  244                 if (pFields[0]->GetBndConditions()[b]->
 
  246                     pFields[0]->GetBndConditions()[b]->
 
  249                     nSurfacePts += nBndEdgePts;
 
  256     int nSolutionPts = pFields[0]->GetNpoints();
 
  257     int nTracePts    = pFields[0]->GetTrace()->GetTotPoints();
 
  258     int nElements    = pFields[0]->GetExpSize();
 
  260     Array<OneD, NekDouble> tmp(nSolutionPts, 0.0);
 
  262     Array<OneD, NekDouble> x(nSolutionPts);
 
  263     Array<OneD, NekDouble> y(nSolutionPts);
 
  264     Array<OneD, NekDouble> z(nSolutionPts);
 
  266     Array<OneD, NekDouble> traceX(nTracePts);
 
  267     Array<OneD, NekDouble> traceY(nTracePts);
 
  268     Array<OneD, NekDouble> traceZ(nTracePts);
 
  270     Array<OneD, NekDouble> surfaceX(nSurfacePts);
 
  271     Array<OneD, NekDouble> surfaceY(nSurfacePts);
 
  272     Array<OneD, NekDouble> surfaceZ(nSurfacePts);
 
  274     pFields[0]->GetCoords(x, y, z);
 
  276     pFields[0]->ExtractTracePhys(x, traceX);
 
  277     pFields[0]->ExtractTracePhys(y, traceY);
 
  278     pFields[0]->ExtractTracePhys(z, traceZ);
 
  283     Array<OneD, Array<OneD, NekDouble> > uFields(nfields);
 
  284     Array<OneD, Array<OneD, NekDouble> > traceFields(nfields);
 
  285     Array<OneD, Array<OneD, NekDouble> > surfaceFields(nfields);
 
  288     for (j = 0; j < nfields; ++j)
 
  290         uFields[j]       = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  291         traceFields[j]   = Array<OneD, NekDouble>(nTracePts, 0.0);
 
  292         surfaceFields[j] = Array<OneD, NekDouble>(nSurfacePts, 0.0);
 
  295         for (i = 0; i < fieldData.size(); ++i)
 
  297             Exp[j]->ExtractDataToCoeffs(fieldDef[i], fieldData[i],
 
  298                                         fieldDef[i]->m_fields[j],
 
  299                                         Exp[j]->UpdateCoeffs());
 
  301         Exp[j]->BwdTrans(Exp[j]->GetCoeffs(), Exp[j]->UpdatePhys());
 
  302         Vmath::Vcopy(nSolutionPts, Exp[j]->GetPhys(), 1, uFields[j], 1);
 
  303         pFields[0]->ExtractTracePhys(uFields[j], traceFields[j]);
 
  308     int nfieldsAdded = 34;
 
  309     Array<OneD, Array<OneD, NekDouble> > traceFieldsAdded(nfieldsAdded);
 
  310     Array<OneD, Array<OneD, NekDouble> > surfaceFieldsAdded(nfieldsAdded);
 
  312     for (j = 0; j < nfieldsAdded; ++j)
 
  314         traceFieldsAdded[j] = Array<OneD, NekDouble>(nTracePts, 0.0);
 
  315         surfaceFieldsAdded[j] = Array<OneD, NekDouble>(nSurfacePts, 0.0);
 
  331     Array<OneD, Array<OneD, NekDouble> > m_traceNormals (nDimensions);
 
  332     for(i = 0; i < nDimensions; ++i)
 
  334         m_traceNormals[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
 
  336     pFields[0]->GetTrace()->GetNormals(m_traceNormals);
 
  338     Array<OneD, Array<OneD, NekDouble> > m_traceTangents (nDimensions);
 
  339     Array<OneD, Array<OneD, NekDouble> > m_traceBinormals (nDimensions);
 
  340     Array<OneD, Array<OneD, NekDouble> > h (nDimensions);
 
  341     Array<OneD, NekDouble > tmpNorm (nTracePts, 1.0);
 
  342     Array<OneD, NekDouble > NormH (nTracePts, 0.0);
 
  343     Array<OneD, NekDouble > tmpTrace (nTracePts, 0.0);
 
  346     for(i = 0; i < nDimensions; ++i)
 
  348         m_traceTangents[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
 
  349         m_traceBinormals[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
 
  350         h[i] = Array<OneD, NekDouble> (nTracePts, 0.0);
 
  357                  &m_traceNormals[0][0], 1,
 
  358                  &traceFieldsAdded[0][0], 1);
 
  362                  &m_traceNormals[1][0], 1,
 
  363                  &traceFieldsAdded[1][0], 1);
 
  367                  &m_traceNormals[2][0], 1,
 
  368                  &traceFieldsAdded[2][0], 1);
 
  374                 &m_traceNormals[0][0], 1,
 
  379                  &m_traceNormals[1][0], 1,
 
  383                  &m_traceNormals[2][0], 1,
 
  387     for (i = 0; i < m_spacedim; i++)
 
  390                       &NormH[0],1, &NormH[0],1);
 
  406                 &m_traceBinormals[0][0], 1);
 
  409                  &m_traceBinormals[0][0], 1,
 
  410                  &traceFieldsAdded[3][0], 1);
 
  431                 &m_traceBinormals[1][0], 1);
 
  434                  &m_traceBinormals[1][0], 1,
 
  435                  &traceFieldsAdded[4][0], 1);
 
  451                 &m_traceBinormals[2][0], 1);
 
  454                  &m_traceBinormals[2][0], 1,
 
  455                  &traceFieldsAdded[5][0], 1);
 
  471                 &m_traceTangents[0][0], 1);
 
  474                  &m_traceTangents[0][0], 1,
 
  475                  &traceFieldsAdded[6][0], 1);
 
  479                  &m_traceBinormals[2][0], 1,
 
  480                  &m_traceTangents[1][0], 1);
 
  483                  &m_traceTangents[1][0], 1,
 
  484                  &traceFieldsAdded[7][0], 1);
 
  505                 &m_traceTangents[2][0], 1);
 
  508                  &m_traceTangents[2][0], 1,
 
  509                  &traceFieldsAdded[8][0], 1);
 
  517     Array<OneD, NekDouble> pressure(nSolutionPts, 0.0);
 
  521     for (i = 0; i < m_spacedim; i++)
 
  524                     &uFields[i + 1][0], 1,
 
  525                     &uFields[i + 1][0], 1,
 
  545                 &uFields[nfields - 1][0], 1,
 
  554     pFields[0]->ExtractTracePhys(pressure, traceFieldsAdded[9]);
 
  561     Array<OneD, NekDouble> temperature(nSolutionPts, 0.0);
 
  568     NekDouble GasConstantInv =  1.0/m_gasConstant;
 
  574     pFields[0]->ExtractTracePhys(temperature, traceFieldsAdded[10]);
 
  580     Array<OneD, Array<OneD, NekDouble> > Dtemperature(nDimensions);
 
  581     Array<OneD, Array<OneD, NekDouble> > traceDtemperature(nDimensions);
 
  583     for (i = 0; i < nDimensions; ++ i)
 
  585         Dtemperature[i]  = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  586         traceDtemperature[i]  = Array<OneD, NekDouble>(nTracePts, 0.0);
 
  589     for (i = 0; i < nDimensions; ++ i)
 
  591         for (n = 0; n < nElements; n++)
 
  593             phys_offset = pFields[0]->GetPhys_Offset(n);
 
  595             pFields[i]->GetExp(n)->PhysDeriv(
 
  596                 i, temperature + phys_offset,
 
  597                 auxArray = Dtemperature[i] + phys_offset);
 
  600         pFields[0]->ExtractTracePhys(Dtemperature[i], traceDtemperature[i]);
 
  603     for(i = 0; i < nDimensions; ++i)
 
  606                     &m_traceNormals[i][0], 1,
 
  607                     &traceDtemperature[i][0], 1,
 
  611                     &traceFieldsAdded[11][0], 1,
 
  613                     &traceFieldsAdded[11][0], 1);
 
  624     Array<OneD, Array<OneD, NekDouble> > Dpressure(nDimensions);
 
  625     Array<OneD, Array<OneD, NekDouble> > traceDpressure(nDimensions);
 
  627     for (i = 0; i < nDimensions; ++ i)
 
  629         Dpressure[i]  = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  630         traceDpressure[i]  = Array<OneD, NekDouble>(nTracePts, 0.0);
 
  633     for (i = 0; i < nDimensions; ++ i)
 
  635         for (n = 0; n < nElements; n++)
 
  637             phys_offset = pFields[0]->GetPhys_Offset(n);
 
  639             pFields[i]->GetExp(n)->PhysDeriv(
 
  640                 i, pressure + phys_offset,
 
  641                 auxArray = Dpressure[i] + phys_offset);
 
  644         pFields[0]->ExtractTracePhys(Dpressure[i], traceDpressure[i]);
 
  648     for(i = 0; i < nDimensions; ++i)
 
  651                     &m_traceTangents[i][0], 1,
 
  652                     &traceDpressure[i][0], 1,
 
  656                     &traceFieldsAdded[12][0], 1,
 
  658                     &traceFieldsAdded[12][0], 1);
 
  662     for(i = 0; i < nDimensions; ++i)
 
  665                     &m_traceBinormals[i][0], 1,
 
  666                     &traceDpressure[i][0], 1,
 
  670                     &traceFieldsAdded[13][0], 1,
 
  672                     &traceFieldsAdded[13][0], 1);
 
  678                  &traceDpressure[0][0], 1,
 
  679                  &traceFieldsAdded[14][0], 1);
 
  683                  &traceDpressure[1][0], 1,
 
  684                  &traceFieldsAdded[15][0], 1);
 
  688                  &traceDpressure[2][0], 1,
 
  689                  &traceFieldsAdded[16][0], 1);
 
  704     Array<OneD, Array<OneD, Array<OneD, NekDouble> > > Dvelocity(nDimensions);
 
  705     Array<OneD, Array<OneD, Array<OneD, NekDouble> > > traceDvelocity(nDimensions);
 
  706     Array<OneD, Array<OneD, NekDouble> > velocity(nDimensions);
 
  708     for (i = 0; i < nDimensions; ++ i)
 
  710         Dvelocity[i]      = Array<OneD, Array<OneD, NekDouble> >(nDimensions);
 
  711         traceDvelocity[i] = Array<OneD, Array<OneD, NekDouble> >(nDimensions);
 
  712         velocity[i]       = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  714         Vmath::Vdiv(nSolutionPts, uFields[i+1], 1, uFields[0], 1,
 
  717         for (j = 0; j < nDimensions; ++j)
 
  719             Dvelocity[i][j]      = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  720             traceDvelocity[i][j] = Array<OneD, NekDouble>(nTracePts, 0.0);
 
  724     for (i = 0; i < nDimensions; ++i)
 
  726         for (j = 0; j < nDimensions; ++j)
 
  728             for (n = 0; n < nElements; n++)
 
  730                 phys_offset = pFields[0]->GetPhys_Offset(n);
 
  732                 pFields[i]->GetExp(n)->PhysDeriv(
 
  733                     j, velocity[i] + phys_offset,
 
  734                     auxArray = Dvelocity[i][j] + phys_offset);
 
  738             pFields[0]->ExtractTracePhys(Dvelocity[i][j], traceDvelocity[i][j]);
 
  743                  &traceDvelocity[0][0][0], 1,
 
  744                  &traceFieldsAdded[17][0], 1);
 
  746                  &traceDvelocity[0][1][0], 1,
 
  747                  &traceFieldsAdded[18][0], 1);
 
  749                  &traceDvelocity[0][2][0], 1,
 
  750                  &traceFieldsAdded[19][0], 1);
 
  752                  &traceDvelocity[1][0][0], 1,
 
  753                  &traceFieldsAdded[20][0], 1);
 
  755                  &traceDvelocity[1][1][0], 1,
 
  756                  &traceFieldsAdded[21][0], 1);
 
  758                  &traceDvelocity[1][2][0], 1,
 
  759                  &traceFieldsAdded[22][0], 1);
 
  761                  &traceDvelocity[2][0][0], 1,
 
  762                  &traceFieldsAdded[23][0], 1);
 
  764                  &traceDvelocity[2][1][0], 1,
 
  765                  &traceFieldsAdded[24][0], 1);
 
  767                  &traceDvelocity[2][2][0], 1,
 
  768                  &traceFieldsAdded[25][0], 1);
 
  784     Array<OneD, NekDouble > mu    (nSolutionPts, 0.0);
 
  785     Array<OneD, NekDouble > mu2   (nSolutionPts, 0.0);
 
  786     Array<OneD, NekDouble > divVel(nSolutionPts, 0.0);
 
  789     if (m_ViscosityType == 
"Variable")
 
  792         NekDouble T_star  = m_pInf / (m_rhoInf * m_gasConstant);
 
  795         for (
int i = 0; i < nSolutionPts; ++i)
 
  797             ratio = temperature[i] / T_star;
 
  798             mu[i] = mu_star * ratio * sqrt(ratio) *
 
  799                 (T_star + 110.0) / (temperature[i] + 110.0);
 
  808     Array<OneD, Array<OneD, NekDouble> > temp(m_spacedim);
 
  809     Array<OneD, Array<OneD, NekDouble> > Sgg(m_spacedim);
 
  812     Vmath::Smul(nSolutionPts, 2.0, &mu[0], 1, &mu2[0], 1);
 
  816                 &Dvelocity[0][0][0], 1, &divVel[0], 1);
 
  818                 &Dvelocity[1][1][0], 1, &divVel[0], 1);
 
  821     Vmath::Smul(nSolutionPts, lambda, &divVel[0], 1, &divVel[0], 1);
 
  822     Vmath::Vmul(nSolutionPts, &mu[0], 1, &divVel[0], 1, &divVel[0], 1);
 
  826     for (j = 0; j < m_spacedim; ++j)
 
  828         temp[j] = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  829         Sgg[j] = Array<OneD, NekDouble>(nSolutionPts, 0.0);
 
  831         Vmath::Vmul(nSolutionPts, &mu2[0], 1, &Dvelocity[j][j][0], 1,
 
  834         Vmath::Vadd(nSolutionPts, &temp[j][0], 1, &divVel[0], 1, &Sgg[j][0], 1);
 
  838     Array<OneD, NekDouble > Sxy(nSolutionPts, 0.0);
 
  839     Array<OneD, NekDouble > Sxz(nSolutionPts, 0.0);
 
  840     Array<OneD, NekDouble > Syz(nSolutionPts, 0.0);
 
  844                 &Dvelocity[1][0][0], 1, &Sxy[0], 1);
 
  848                 &Dvelocity[2][0][0], 1, &Sxz[0], 1);
 
  852                 &Dvelocity[2][1][0], 1, &Syz[0], 1);
 
  855     Vmath::Vmul(nSolutionPts, &mu[0], 1, &Sxy[0], 1, &Sxy[0], 1);
 
  858     Vmath::Vmul(nSolutionPts, &mu[0], 1, &Sxz[0], 1, &Sxz[0], 1);
 
  861     Vmath::Vmul(nSolutionPts, &mu[0], 1, &Syz[0], 1, &Syz[0], 1);
 
  865     pFields[0]->ExtractTracePhys(Sgg[0], traceFieldsAdded[26]);
 
  866     pFields[0]->ExtractTracePhys(Sgg[1], traceFieldsAdded[27]);
 
  867     pFields[0]->ExtractTracePhys(Sgg[2], traceFieldsAdded[28]);
 
  868     pFields[0]->ExtractTracePhys(Sxy, traceFieldsAdded[29]);
 
  869     pFields[0]->ExtractTracePhys(Sxz, traceFieldsAdded[30]);
 
  870     pFields[0]->ExtractTracePhys(Syz, traceFieldsAdded[31]);
 
  876     pFields[0]->ExtractTracePhys(mu, traceFieldsAdded[32]);
 
  884     Array<OneD, NekDouble> soundspeed(nSolutionPts, 0.0);
 
  886     Vmath::Vdiv (nSolutionPts, pressure, 1, uFields[0], 1, soundspeed, 1);
 
  887     Vmath::Smul (nSolutionPts, gamma, soundspeed, 1, soundspeed, 1);
 
  888     Vmath::Vsqrt(nSolutionPts, soundspeed, 1, soundspeed, 1);
 
  891     Array<OneD, NekDouble> mach(nSolutionPts, 0.0);
 
  893     for (
int i = 0; i < m_spacedim; ++i)
 
  901     Vmath::Vdiv(nSolutionPts,  mach, 1, uFields[0], 1, mach, 1);
 
  902     Vmath::Vdiv(nSolutionPts,  mach, 1, uFields[0], 1, mach, 1);
 
  904     Vmath::Vdiv(nSolutionPts,  mach, 1, soundspeed, 1, mach, 1);
 
  906     pFields[0]->ExtractTracePhys(mach, traceFieldsAdded[33]);
 
  913     if (pFields[0]->GetBndCondExpansions().num_elements())
 
  917         nBndRegions = pFields[0]->GetBndCondExpansions().num_elements();
 
  918         for (b = 0; b < nBndRegions; ++b)
 
  920             nBndEdges = pFields[0]->GetBndCondExpansions()[b]->GetExpSize();
 
  921             for (e = 0; e < nBndEdges; ++e)
 
  923                 nBndEdgePts = pFields[0]->
 
  924                     GetBndCondExpansions()[b]->GetExp(e)->GetTotPoints();
 
  926                 id2 = pFields[0]->GetTrace()->
 
  927                     GetPhys_Offset(pFields[0]->GetTraceMap()->
 
  928                                    GetBndCondTraceToGlobalTraceMap(cnt++));
 
  930                 if (pFields[0]->GetBndConditions()[b]->
 
  932                     pFields[0]->GetBndConditions()[b]->
 
  952     if (pFields[0]->GetBndCondExpansions().num_elements())
 
  955         for (j = 0; j < nfields; ++j)
 
  957             cout << 
"field " << j << endl;
 
  961             nBndRegions = pFields[j]->GetBndCondExpansions().num_elements();
 
  962             for (b = 0; b < nBndRegions; ++b)
 
  964                 nBndEdges = pFields[j]->GetBndCondExpansions()[b]->GetExpSize();
 
  965                 for (e = 0; e < nBndEdges; ++e)
 
  967                     nBndEdgePts = pFields[j]->
 
  968                         GetBndCondExpansions()[b]->GetExp(e)->GetTotPoints();
 
  970                     id2 = pFields[j]->GetTrace()->
 
  971                         GetPhys_Offset(pFields[j]->GetTraceMap()->
 
  972                                        GetBndCondTraceToGlobalTraceMap(cnt++));
 
  974                     if (pFields[j]->GetBndConditions()[b]->
 
  976                         pFields[j]->GetBndConditions()[b]->
 
  980                                      &surfaceFields[j][id1], 1);
 
  990     if (pFields[0]->GetBndCondExpansions().num_elements())
 
  992         for (j = 0; j < nfieldsAdded; ++j)
 
  994             cout << 
"field added " << j << endl;
 
  998             nBndRegions = pFields[0]->GetBndCondExpansions().num_elements();
 
  999             for (b = 0; b < nBndRegions; ++b)
 
 1001                 nBndEdges = pFields[0]->GetBndCondExpansions()[b]->GetExpSize();
 
 1002                 for (e = 0; e < nBndEdges; ++e)
 
 1004                     nBndEdgePts = pFields[0]->
 
 1005                         GetBndCondExpansions()[b]->GetExp(e)->GetTotPoints();
 
 1007                     id2 = pFields[0]->GetTrace()->
 
 1008                         GetPhys_Offset(pFields[0]->GetTraceMap()->
 
 1009                                        GetBndCondTraceToGlobalTraceMap(cnt++));
 
 1011                     if (pFields[0]->GetBndConditions()[b]->
 
 1013                         pFields[0]->GetBndConditions()[b]->
 
 1016                         Vmath::Vcopy(nBndEdgePts, &traceFieldsAdded[j][id2], 1,
 
 1017                                      &surfaceFieldsAdded[j][id1], 1);
 
 1032     outfile.open(fname.c_str());
 
 1033     outfile <<  
"%  x[m] " << 
" \t" 
 1045             << 
"rho[kg/m^3] " << 
" \t" 
 1046             << 
"rhou[kg/(m^2 s)] " << 
" \t" 
 1047             << 
"rhov[kg/(m^2 s)] " << 
" \t" 
 1048             << 
"rhow[kg/(m^2 s)] " << 
" \t" 
 1049             << 
"E[Pa] " << 
" \t" 
 1050             << 
"p[Pa] " << 
" \t" 
 1052             << 
"dT/dn[k/m]  "  << 
" \t" 
 1053             << 
"dp/dT[Pa/m]  " << 
" \t" 
 1054             << 
"dp/dB[Pa/m]  " << 
" \t" 
 1055             << 
"dp/dx[Pa/m]  " << 
" \t" 
 1056             << 
"dp/dy[Pa/m]  " << 
" \t" 
 1057             << 
"dp/dz[Pa/m]  " << 
" \t" 
 1058             << 
"du/dx[s^-1]  " << 
" \t" 
 1059             << 
"du/dy[s^-1]  " << 
" \t" 
 1060             << 
"du/dz[s^-1]  " << 
" \t" 
 1061             << 
"dv/dx[s^-1]  " << 
" \t" 
 1062             << 
"dv/dy[s^-1]  " << 
" \t" 
 1063             << 
"dv/dz[s^-1]  " << 
" \t" 
 1064             << 
"dw/dx[s^-1]  " << 
" \t" 
 1065             << 
"dw/dy[s^-1]  " << 
" \t" 
 1066             << 
"dw/dz[s^-1]  " << 
" \t" 
 1067             << 
"tau_xx[Pa]   " << 
" \t" 
 1068             << 
"tau_yy[Pa]   " << 
" \t" 
 1069             << 
"tau_zz[Pa]   " << 
" \t" 
 1070             << 
"tau_xy[Pa]   " << 
" \t" 
 1071             << 
"tau_xz[Pa]   " << 
" \t" 
 1072             << 
"tau_yz[Pa]   " << 
" \t" 
 1073             << 
"mu[Pa s]     " << 
" \t" 
 1076     for (i = 0; i < nSurfacePts; ++i)
 
 1078         outfile << scientific
 
 1081                 << surfaceX[i] << 
" \t " 
 1082                 << surfaceY[i] << 
" \t " 
 1083                 << surfaceZ[i] << 
" \t " 
 1084                 << surfaceFieldsAdded[0][i] << 
" \t " 
 1085                 << surfaceFieldsAdded[1][i] << 
" \t " 
 1086                 << surfaceFieldsAdded[2][i] << 
" \t " 
 1087                 << surfaceFieldsAdded[3][i] << 
" \t " 
 1088                 << surfaceFieldsAdded[4][i] << 
" \t " 
 1089                 << surfaceFieldsAdded[5][i] << 
" \t " 
 1090                 << surfaceFieldsAdded[6][i] << 
" \t " 
 1091                 << surfaceFieldsAdded[7][i] << 
" \t " 
 1092                 << surfaceFieldsAdded[8][i] << 
" \t " 
 1093                 << surfaceFields[0][i] << 
" \t " 
 1094                 << surfaceFields[1][i] << 
" \t " 
 1095                 << surfaceFields[2][i] << 
" \t " 
 1096                 << surfaceFields[3][i] << 
" \t " 
 1097                 << surfaceFields[4][i] << 
" \t " 
 1098                 << surfaceFieldsAdded[9][i] << 
" \t " 
 1099                 << surfaceFieldsAdded[10][i] << 
" \t " 
 1100                 << surfaceFieldsAdded[11][i] << 
" \t " 
 1101                 << surfaceFieldsAdded[12][i] << 
" \t " 
 1102                 << surfaceFieldsAdded[13][i] << 
" \t " 
 1103                 << surfaceFieldsAdded[14][i] << 
" \t " 
 1104                 << surfaceFieldsAdded[15][i] << 
" \t " 
 1105                 << surfaceFieldsAdded[16][i] << 
" \t " 
 1106                 << surfaceFieldsAdded[17][i] << 
" \t " 
 1107                 << surfaceFieldsAdded[18][i] << 
" \t " 
 1108                 << surfaceFieldsAdded[19][i] << 
" \t " 
 1109                 << surfaceFieldsAdded[20][i] << 
" \t " 
 1110                 << surfaceFieldsAdded[21][i] << 
" \t " 
 1111                 << surfaceFieldsAdded[22][i] << 
" \t " 
 1112                 << surfaceFieldsAdded[23][i] << 
" \t " 
 1113                 << surfaceFieldsAdded[24][i] << 
" \t " 
 1114                 << surfaceFieldsAdded[25][i] << 
" \t " 
 1115                 << surfaceFieldsAdded[26][i] << 
" \t " 
 1116                 << surfaceFieldsAdded[27][i] << 
" \t " 
 1117                 << surfaceFieldsAdded[28][i] << 
" \t " 
 1118                 << surfaceFieldsAdded[29][i] << 
" \t " 
 1119                 << surfaceFieldsAdded[30][i] << 
" \t " 
 1120                 << surfaceFieldsAdded[31][i] << 
" \t " 
 1121                 << surfaceFieldsAdded[32][i] << 
" \t " 
 1122                 << surfaceFieldsAdded[33][i] << 
" \t " 
 1125     outfile << endl << endl;