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

This processing module scales the input fld file. More...

#include <ProcessJacobianEnergy.h>

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

Public Member Functions

 ProcessJacobianEnergy (FieldSharedPtr f)
 
virtual ~ProcessJacobianEnergy ()
 
virtual void Process (po::variables_map &vm)
 Write mesh to output file. More...
 
- Public Member Functions inherited from Nektar::Utilities::ProcessModule
 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. More...
 
void PrintConfig ()
 Print out all configuration options for a module. More...
 
void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
bool GetRequireEquiSpaced (void)
 
void SetRequireEquiSpaced (bool pVal)
 
void EvaluateTriFieldAtEquiSpacedPts (LocalRegions::ExpansionSharedPtr &exp, const Array< OneD, const NekDouble > &infield, Array< OneD, NekDouble > &outfield)
 
 Module (MeshSharedPtr p_m)
 
virtual void Process ()=0
 
void RegisterConfig (std::string key, std::string value)
 
void PrintConfig ()
 
void SetDefaults ()
 
MeshSharedPtr GetMesh ()
 
virtual void ProcessVertices ()
 Extract element vertices. More...
 
virtual void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges. More...
 
virtual void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces. More...
 
virtual void ProcessElements ()
 Generate element IDs. More...
 
virtual void ProcessComposites ()
 Generate composites. More...
 
virtual void ClearElementLinks ()
 

Static Public Member Functions

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

Static Public Attributes

static ModuleKey className
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::Utilities::Module
 Module ()
 
void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
void PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
 
- Protected Attributes inherited from Nektar::Utilities::Module
FieldSharedPtr m_f
 Field object. More...
 
map< string, ConfigOptionm_config
 List of configuration values. More...
 
bool m_requireEquiSpaced
 
MeshSharedPtr m_mesh
 Mesh object. More...
 
std::map< std::string,
ConfigOption
m_config
 List of configuration values. More...
 

Detailed Description

This processing module scales the input fld file.

Definition at line 47 of file ProcessJacobianEnergy.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessJacobianEnergy::ProcessJacobianEnergy ( FieldSharedPtr  f)

Definition at line 56 of file ProcessJacobianEnergy.cpp.

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

56  :
57  ProcessModule(f)
58 {
59  m_config["topmodes"] = ConfigOption(false, "1",
60  "how many top modes to keep ");
61 }
map< string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessJacobianEnergy::~ProcessJacobianEnergy ( )
virtual

Definition at line 63 of file ProcessJacobianEnergy.cpp.

64 {
65 }

Member Function Documentation

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

Creates an instance of this class.

Definition at line 51 of file ProcessJacobianEnergy.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

52  {
54  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::Utilities::ProcessJacobianEnergy::Process ( po::variables_map &  vm)
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 67 of file ProcessJacobianEnergy.cpp.

References Nektar::SpatialDomains::eDeformed, Nektar::SpatialDomains::eRegular, Vmath::Fill(), Nektar::Utilities::Module::m_f, Vmath::Vcopy(), Vmath::Vmax(), and Vmath::Vmin().

68 {
69  if (m_f->m_verbose)
70  {
71  cout << "ProcessJacobianEnergy: Process Jacobian fld" << endl;
72  }
73 
74  Array<OneD, NekDouble> phys = m_f->m_exp[0]->UpdatePhys();
75  Array<OneD, NekDouble> coeffs = m_f->m_exp[0]->UpdateCoeffs();
76  Array<OneD, NekDouble> tmp,tmp1;
77 
78  for(int i =0; i < m_f->m_exp[0]->GetExpSize(); ++i)
79  {
80  // copy Jacobian into field
81  StdRegions::StdExpansionSharedPtr Elmt = m_f->m_exp[0]->GetExp(i);
82 
83  int ncoeffs = Elmt->GetNcoeffs();
84  int nquad = Elmt->GetTotPoints();
85  int coeffoffset = m_f->m_exp[0]->GetCoeff_Offset(i);
86  Array<OneD, NekDouble> coeffs1(ncoeffs);
87  Array<OneD, const NekDouble> Jac =
88  Elmt->GetMetricInfo()->GetJac(Elmt->GetPointsKeys());
89  if(Elmt->GetMetricInfo()->GetGtype() == SpatialDomains::eRegular)
90  {
91  Vmath::Fill(nquad,Jac[0],phys,1);
92  }
93  else
94  {
95  Vmath::Vcopy(nquad,Jac,1,phys,1);
96  }
97 
98  if(Elmt->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed)
99  {
100  NekDouble jacmax = Vmath::Vmax(nquad,Jac,1);
101  NekDouble jacmin = Vmath::Vmin(nquad,Jac,1);
102 
103  NekDouble jacmeasure = jacmax/jacmin -1.0;
104  Vmath::Fill(nquad,jacmeasure,phys,1);
105  }
106  else
107  {
108  Vmath::Fill(nquad,0.0,phys,1);
109  }
110 
111  Elmt->FwdTrans(phys,tmp = coeffs + coeffoffset);
112  }
113 
114  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
115  = m_f->m_exp[0]->GetFieldDefinitions();
116  std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
117 
118  for (int i = 0; i < FieldDef.size(); ++i)
119  {
120  FieldDef[i]->m_fields.push_back("JacobianEnergy");
121  m_f->m_exp[0]->AppendFieldData(FieldDef[i], FieldData[i]);
122  }
123 
124  m_f->m_fielddef = FieldDef;
125  m_f->m_data = FieldData;
126 }
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:765
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
Definition: Vmath.cpp:857
void Fill(int n, const T alpha, T *x, const int incx)
Fill a vector with a constant value.
Definition: Vmath.cpp:46
FieldSharedPtr m_f
Field object.
double NekDouble
Geometry is straight-sided with constant geometric factors.
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
void Vcopy(int n, const T *x, const int incx, T *y, const int incy)
Definition: Vmath.cpp:1047
Geometry is curved or has non-constant factors.

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessJacobianEnergy::className
static
Initial value:
=
ModuleKey(eProcessModule, "jacobianenergy"),
"Show high frequency energy of Jacobian.")

Definition at line 55 of file ProcessJacobianEnergy.h.