Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
utilities/ExtractCriticalLayer.cpp File Reference
#include <cstdio>
#include <cstdlib>
#include <MultiRegions/ExpList.h>
#include <MultiRegions/ExpList2D.h>
#include "ExtractCriticalLayerFunctions.h"
Include dependency graph for utilities/ExtractCriticalLayer.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 44 of file utilities/ExtractCriticalLayer.cpp.

References Computestreakpositions(), Nektar::LibUtilities::Import(), and npts.

{
int i;
NekDouble cr = 0;
if(argc !=3)
{
fprintf(stderr,"Usage: ./ExtractCriticalLayer meshfile fieldfile \n");
exit(1);
}
//------------------------------------------------------------
// Create Session file.
= LibUtilities::SessionReader::CreateInstance(argc, argv);
//-----------------------------------------------------------
//-------------------------------------------------------------
// Read in mesh from input file
SpatialDomains::MeshGraphSharedPtr graphShPt = SpatialDomains::MeshGraph::Read(vSession);
//------------------------------------------------------------
//-------------------------------------------------------------
// Define Streak Expansion
::AllocateSharedPtr(vSession,graphShPt);
//---------------------------------------------------------------
//----------------------------------------------
// Import field file.
string fieldfile(argv[argc-1]);
vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
vector<vector<NekDouble> > fielddata;
LibUtilities::Import(fieldfile,fielddef,fielddata);
//----------------------------------------------
//----------------------------------------------
// Copy data from field file
string streak_field("w");
for(unsigned int i = 0; i < fielddata.size(); ++i)
{
streak->ExtractDataToCoeffs(fielddef [i],
fielddata[i],
streak_field,
streak->UpdateCoeffs());
}
//----------------------------------------------
int npts;
vSession->LoadParameter("NumCriticalLayerPts",npts,30);
Array<OneD, NekDouble> x_c(npts);
Array<OneD, NekDouble> y_c(npts);
NekDouble trans;
vSession->LoadParameter("WidthOfLayers",trans,0.1);
Computestreakpositions(streak,x_c, y_c,cr,trans);
cout << "# x_c y_c" << endl;
for(i = 0; i < npts; ++i)
{
fprintf(stdout,"%12.10lf %12.10lf \n",x_c[i],y_c[i]);
//cout << x_c[i] << " " << y_c[i] << endl;
}
}