Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Nektar::Utilities::Field Struct Reference

#include <Field.hpp>

Collaboration diagram for Nektar::Utilities::Field:
Collaboration graph
[legend]

Public Member Functions

 Field ()
 ~Field ()
MultiRegions::ExpListSharedPtr SetUpFirstExpList (int NumHomogeneousDir, bool fldfilegiven=false)
MultiRegions::ExpListSharedPtr AppendExpList (int NumHomogeneousDir, string var="DefaultVar", bool NewField=false)

Public Attributes

bool m_verbose
vector
< LibUtilities::FieldDefinitionsSharedPtr
m_fielddef
vector< vector< double > > m_data
vector
< MultiRegions::ExpListSharedPtr
m_exp
bool m_declareExpansionAsContField
bool m_declareExpansionAsDisContField
LibUtilities::CommSharedPtr m_comm
LibUtilities::SessionReaderSharedPtr m_session
SpatialDomains::MeshGraphSharedPtr m_graph
LibUtilities::FieldIOSharedPtr m_fld
map< string, vector< string > > m_inputfiles
bool m_writeBndFld
vector< unsigned int > m_bndRegionsToWrite
bool m_fldToBnd
FieldPtsSharedPtr m_fieldPts
bool m_setUpEquiSpacedFields

Detailed Description

Definition at line 172 of file Field.hpp.

Constructor & Destructor Documentation

Nektar::Utilities::Field::Field ( )
inline
Nektar::Utilities::Field::~Field ( )
inline

Definition at line 179 of file Field.hpp.

{
if (m_session)
{
m_session->Finalise();
}
}

Member Function Documentation

MultiRegions::ExpListSharedPtr Nektar::Utilities::Field::AppendExpList ( int  NumHomogeneousDir,
string  var = "DefaultVar",
bool  NewField = false 
)
inline

Definition at line 485 of file Field.hpp.

References ASSERTL0.

{
switch (m_graph->GetMeshDimension())
{
case 1:
{
if (NumHomogeneousDir == 1)
{
"ContField2DHomogeneous1D or "
"DisContField2DHomogenenous1D has not been "
"implemented");
boost::dynamic_pointer_cast<MultiRegions::
AllocateSharedPtr(*tmp2);
}
else if (NumHomogeneousDir == 2)
{
{
boost::dynamic_pointer_cast<MultiRegions::
AllocateSharedPtr(*tmp2);
}
{
boost::dynamic_pointer_cast<MultiRegions::
AllocateSharedPtr(*tmp2);
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
AllocateSharedPtr(*tmp2);
}
}
else
{
{
boost::dynamic_pointer_cast<MultiRegions::
}
{
boost::dynamic_pointer_cast<MultiRegions::
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
}
break;
case 2:
{
if (NumHomogeneousDir == 1)
{
{
if(NewField)
{
bool useFFT = false;
bool dealiasing = false;
ContField3DHomogeneous1D>::AllocateSharedPtr(
m_exp[0]->GetHomogeneousBasis()
->GetBasisKey(),
m_exp[0]->GetHomoLen(),
useFFT, dealiasing, m_graph, var);
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
ASSERTL0(tmp2,"Failed to type cast m_exp[0]");
AllocateSharedPtr(*tmp2);
}
}
{
if(NewField)
{
bool useFFT = false;
bool dealiasing = false;
DisContField3DHomogeneous1D>::AllocateSharedPtr(
m_exp[0]->GetHomogeneousBasis()
->GetBasisKey(),
m_exp[0]->GetHomoLen(),
useFFT, dealiasing, m_graph,var);
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
ASSERTL0(tmp2,"Failed to type cast m_exp[0]");
AllocateSharedPtr(*tmp2);
}
}
else
{
if(NewField)
{
bool useFFT = false;
bool dealiasing = false;
ExpList3DHomogeneous1D>::AllocateSharedPtr(
m_exp[0]->GetHomogeneousBasis()
->GetBasisKey(),
m_exp[0]->GetHomoLen(),
useFFT, dealiasing, m_graph);
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
ASSERTL0(tmp2,"Failed to type cast m_exp[0]");
AllocateSharedPtr(*tmp2);
}
}
}
else
{
{
if(NewField)
{
}
else // call copy constructor
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
{
if(NewField)
{
}
else // call copy constructor
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
}
break;
case 3:
{
{
if(NewField)
{
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
{
if(NewField)
{
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
else
{
boost::dynamic_pointer_cast<MultiRegions::
}
}
break;
default:
ASSERTL0(false, "Expansion dimension not recognised");
break;
}
return tmp;
}
MultiRegions::ExpListSharedPtr Nektar::Utilities::Field::SetUpFirstExpList ( int  NumHomogeneousDir,
bool  fldfilegiven = false 
)
inline

Definition at line 208 of file Field.hpp.

References ASSERTL0, Nektar::LibUtilities::eFourier, and Nektar::LibUtilities::ePolyEvenlySpaced.

{
// Set up expansion list
int expdim = m_graph->GetMeshDimension();
bool useFFT = false;
bool dealiasing = false;
switch (expdim)
{
case 1:
{
ASSERTL0(NumHomogeneousDir <= 2,
"Quasi-3D approach is only set up for 1 or 2 "
"homogeneous directions");
if (NumHomogeneousDir == 1)
{
// Define Homogeneous expansion
int nplanes;
if(fldfilegiven)
{
nplanes = m_fielddef[0]->m_numModes[1];
ly = m_fielddef[0]->m_homogeneousLengths[0];
btype = m_fielddef[0]->m_basis[1];
}
else
{
m_session->LoadParameter("HomModesZ", nplanes);
m_session->LoadParameter("LY",ly);
}
// Choose points to be at evenly spaced points at
// nplanes points
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
{
ASSERTL0(false,"ContField2DHomogeneous1D or "
"DisContField2DHomogenenous1D has "
"not been implemented");
}
AllocateSharedPtr(m_session, Bkey, ly,
useFFT, dealiasing,
exp = Exp2DH1;
}
else if (NumHomogeneousDir == 2)
{
int nylines,nzlines;
NekDouble ly,lz;
LibUtilities::BasisType btype1,btype2;
if(fldfilegiven)
{
nylines = m_fielddef[0]->m_numModes[1];
nzlines = m_fielddef[0]->m_numModes[2];
ly = m_fielddef[0]->m_homogeneousLengths[0];
lz = m_fielddef[0]->m_homogeneousLengths[1];
btype1 = m_fielddef[0]->m_basis[1];
btype2 = m_fielddef[0]->m_basis[2];
}
else
{
m_session->LoadParameter("HomModesY", nylines);
m_session->LoadParameter("HomModesZ", nzlines);
m_session->LoadParameter("LY",ly);
m_session->LoadParameter("LZ",lz);
}
// Choose points to be at evenly spaced points at
// nplanes points
const LibUtilities::BasisKey BkeyY(btype1, nylines, PkeyY);
const LibUtilities::BasisKey BkeyZ(btype2, nzlines, PkeyZ);
{
AllocateSharedPtr(m_session, BkeyY, BkeyZ,
ly, lz, useFFT, dealiasing,
m_session->GetVariable(0));
}
{
AllocateSharedPtr(m_session, BkeyY, BkeyZ,
ly, lz, useFFT, dealiasing,
m_session->GetVariable(0));
}
else
{
AllocateSharedPtr(m_session, BkeyY, BkeyZ,
ly, lz, useFFT, dealiasing,
}
exp = Exp3DH2;
}
else
{
{
m_session->GetVariable(0));
}
{
m_session->GetVariable(0));
}
else
{
}
exp = Exp1D;
}
}
break;
case 2:
{
ASSERTL0(NumHomogeneousDir <= 1,
"NumHomogeneousDir is only set up for 1");
if (NumHomogeneousDir == 1)
{
// Define Homogeneous expansion
int nplanes;
if(fldfilegiven)
{
nplanes = m_fielddef[0]->m_numModes[2];
lz = m_fielddef[0]->m_homogeneousLengths[0];
btype = m_fielddef[0]->m_basis[2];
}
else
{
m_session->LoadParameter("HomModesZ", nplanes);
m_session->LoadParameter("LZ",lz);
}
// Choose points to be at evenly spaced points at
// nplanes points
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
{
AllocateSharedPtr(m_session, Bkey, lz, useFFT,
dealiasing, m_graph,
m_session->GetVariable(0));
}
{
AllocateSharedPtr(m_session,
Bkey, lz, useFFT,
dealiasing, m_graph,
m_session->GetVariable(0));
}
else
{
AllocateSharedPtr(m_session, Bkey, lz, useFFT,
dealiasing, m_graph);
}
exp = Exp3DH1;
}
else
{
{
m_session->GetVariable(0));
}
{
m_session->GetVariable(0));
}
else
{
}
exp = Exp2D;
}
}
break;
case 3:
{
{
m_session->GetVariable(0));
}
{
m_session->GetVariable(0));
}
else
{
}
exp = Exp3D;
}
break;
default:
ASSERTL0(false, "Expansion dimension not recognised");
break;
}
return exp;
};

Member Data Documentation

vector<unsigned int> Nektar::Utilities::Field::m_bndRegionsToWrite

Definition at line 201 of file Field.hpp.

LibUtilities::CommSharedPtr Nektar::Utilities::Field::m_comm

Definition at line 194 of file Field.hpp.

vector<vector<double> > Nektar::Utilities::Field::m_data

Definition at line 188 of file Field.hpp.

bool Nektar::Utilities::Field::m_declareExpansionAsContField

Definition at line 191 of file Field.hpp.

bool Nektar::Utilities::Field::m_declareExpansionAsDisContField

Definition at line 192 of file Field.hpp.

vector<MultiRegions::ExpListSharedPtr> Nektar::Utilities::Field::m_exp

Definition at line 189 of file Field.hpp.

vector<LibUtilities::FieldDefinitionsSharedPtr> Nektar::Utilities::Field::m_fielddef

Definition at line 187 of file Field.hpp.

FieldPtsSharedPtr Nektar::Utilities::Field::m_fieldPts

Definition at line 204 of file Field.hpp.

LibUtilities::FieldIOSharedPtr Nektar::Utilities::Field::m_fld

Definition at line 197 of file Field.hpp.

bool Nektar::Utilities::Field::m_fldToBnd

Definition at line 202 of file Field.hpp.

SpatialDomains::MeshGraphSharedPtr Nektar::Utilities::Field::m_graph

Definition at line 196 of file Field.hpp.

map<string, vector<string> > Nektar::Utilities::Field::m_inputfiles

Definition at line 198 of file Field.hpp.

LibUtilities::SessionReaderSharedPtr Nektar::Utilities::Field::m_session

Definition at line 195 of file Field.hpp.

bool Nektar::Utilities::Field::m_setUpEquiSpacedFields

Definition at line 205 of file Field.hpp.

bool Nektar::Utilities::Field::m_verbose

Definition at line 186 of file Field.hpp.

bool Nektar::Utilities::Field::m_writeBndFld

Definition at line 200 of file Field.hpp.