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

This processing module calculates the Q Criterion and adds it as an extra-field to the output file. More...

#include <ProcessC0Projection.h>

Inheritance diagram for Nektar::Utilities::ProcessC0Projection:
Inheritance graph
[legend]
Collaboration diagram for Nektar::Utilities::ProcessC0Projection:
Collaboration graph
[legend]

Public Member Functions

 ProcessC0Projection (FieldSharedPtr f)
virtual ~ProcessC0Projection ()
virtual void Process (po::variables_map &vm)
 Write mesh to output file.
- Public Member Functions inherited from Nektar::Utilities::ProcessModule
 ProcessModule (FieldSharedPtr p_f)
 ProcessModule (MeshSharedPtr p_m)
- Public Member Functions inherited from Nektar::Utilities::Module
 Module (FieldSharedPtr p_f)
void RegisterConfig (string key, string value)
 Register a configuration option with a module.
void PrintConfig ()
 Print out all configuration options for a module.
void SetDefaults ()
 Sets default configuration options for those which have not been set.
bool GetRequireEquiSpaced (void)
void SetRequireEquiSpaced (bool pVal)
 Module (MeshSharedPtr p_m)
virtual void Process ()=0
void RegisterConfig (string key, string value)
void PrintConfig ()
void SetDefaults ()
MeshSharedPtr GetMesh ()
virtual void ProcessVertices ()
 Extract element vertices.

Static Public Member Functions

static boost::shared_ptr< Modulecreate (FieldSharedPtr f)
 Creates an instance of this class.

Static Public Attributes

static ModuleKey className

Private Attributes

MultiRegions::ExpListSharedPtr m_c0ProjectExp

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Utilities::Module
virtual void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges.
virtual void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces.
virtual void ProcessElements ()
 Generate element IDs.
virtual void ProcessComposites ()
 Generate composites.
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly.
void PrismLines (int prism, PerMap &perFaces, set< int > &prismsDone, vector< ElementSharedPtr > &line)
- Protected Attributes inherited from Nektar::Utilities::Module
FieldSharedPtr m_f
 Field object.
map< string, ConfigOptionm_config
 List of configuration values.
bool m_requireEquiSpaced
MeshSharedPtr m_mesh
 Mesh object.

Detailed Description

This processing module calculates the Q Criterion and adds it as an extra-field to the output file.

Definition at line 49 of file ProcessC0Projection.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessC0Projection::ProcessC0Projection ( FieldSharedPtr  f)

Definition at line 55 of file ProcessC0Projection.cpp.

References Nektar::Utilities::Module::m_config.

{
m_config["fields"] = ConfigOption(false,"All","Start field to project");
}
Nektar::Utilities::ProcessC0Projection::~ProcessC0Projection ( )
virtual

Definition at line 60 of file ProcessC0Projection.cpp.

{
}

Member Function Documentation

static boost::shared_ptr<Module> Nektar::Utilities::ProcessC0Projection::create ( FieldSharedPtr  f)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file ProcessC0Projection.h.

void Nektar::Utilities::ProcessC0Projection::Process ( po::variables_map &  vm)
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 64 of file ProcessC0Projection.cpp.

References ASSERTL0, Nektar::ParseUtils::GenerateOrderedVector(), m_c0ProjectExp, Nektar::Utilities::Module::m_config, and Nektar::Utilities::Module::m_f.

{
if (m_f->m_verbose)
{
cout << "ProcessC0Projection: Projecting field into C0 space..."
<< endl;
}
// generate an C0 expansion field with no boundary conditions.
bool savedef = m_f->m_declareExpansionAsContField;
m_f->m_declareExpansionAsContField = true;
m_c0ProjectExp = m_f->AppendExpList(m_f->m_fielddef[0]->m_numHomogeneousDir,
"DefaultVar",true);
m_f->m_declareExpansionAsContField = savedef;
int nfields = m_f->m_exp.size();
string fields = m_config["fields"].as<string>();
vector<unsigned int> processFields;
if(fields.compare("All") == 0)
{
for(int i = 0; i < nfields; ++i)
{
processFields.push_back(i);
}
}
else
{
processFields),
"Failed to interpret field string in C0Projection");
}
for (int i = 0; i < processFields.size(); ++i)
{
ASSERTL0(processFields[i] < nfields,
"Attempt to process field that is larger than then number of "
"fields available");
if (m_f->m_verbose)
{
cout << "\t Processing field: " << processFields[i] << endl;
}
m_c0ProjectExp->BwdTrans(m_f->m_exp[processFields[i]]->GetCoeffs(),
m_f->m_exp[processFields[i]]->UpdatePhys());
m_c0ProjectExp->FwdTrans(m_f->m_exp[processFields[i]]->GetPhys(),
m_f->m_exp[processFields[i]]->UpdateCoeffs());
}
// reset FieldDef in case of serial input and parallel output
std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
= m_f->m_exp[0]->GetFieldDefinitions();
// reset up FieldData with new values before projecting
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
for(int i = 0; i < nfields; ++i)
{
for (int j = 0; j < FieldDef.size(); ++j)
{
FieldDef[j]->m_fields.push_back(m_f->m_fielddef[0]->m_fields[i]);
m_f->m_exp[i]->AppendFieldData(FieldDef[j], FieldData[j]);
}
}
m_f->m_fielddef = FieldDef;
m_f->m_data = FieldData;
}

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessC0Projection::className
static
Initial value:

Definition at line 57 of file ProcessC0Projection.h.

MultiRegions::ExpListSharedPtr Nektar::Utilities::ProcessC0Projection::m_c0ProjectExp
private

Definition at line 66 of file ProcessC0Projection.h.

Referenced by Process().