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...
 
virtual std::string GetModuleName ()
 
- 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.
virtual std::string Nektar::Utilities::ProcessJacobianEnergy::GetModuleName ( )
inlinevirtual

Implements Nektar::Utilities::Module.

Definition at line 63 of file ProcessJacobianEnergy.h.

64  {
65  return "ProcessJacobianEnergy";
66  }
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  if(m_f->m_comm->TreatAsRankZero())
72  {
73  cout << "ProcessJacobianEnergy: Processing Jacobian..." << endl;
74  }
75  }
76 
77  Array<OneD, NekDouble> phys = m_f->m_exp[0]->UpdatePhys();
78  Array<OneD, NekDouble> coeffs = m_f->m_exp[0]->UpdateCoeffs();
79  Array<OneD, NekDouble> tmp,tmp1;
80 
81  for(int i =0; i < m_f->m_exp[0]->GetExpSize(); ++i)
82  {
83  // copy Jacobian into field
84  StdRegions::StdExpansionSharedPtr Elmt = m_f->m_exp[0]->GetExp(i);
85 
86  int ncoeffs = Elmt->GetNcoeffs();
87  int nquad = Elmt->GetTotPoints();
88  int coeffoffset = m_f->m_exp[0]->GetCoeff_Offset(i);
89  Array<OneD, NekDouble> coeffs1(ncoeffs);
90  Array<OneD, const NekDouble> Jac =
91  Elmt->GetMetricInfo()->GetJac(Elmt->GetPointsKeys());
92  if(Elmt->GetMetricInfo()->GetGtype() == SpatialDomains::eRegular)
93  {
94  Vmath::Fill(nquad,Jac[0],phys,1);
95  }
96  else
97  {
98  Vmath::Vcopy(nquad,Jac,1,phys,1);
99  }
100 
101  if(Elmt->GetMetricInfo()->GetGtype() == SpatialDomains::eDeformed)
102  {
103  NekDouble jacmax = Vmath::Vmax(nquad,Jac,1);
104  NekDouble jacmin = Vmath::Vmin(nquad,Jac,1);
105 
106  NekDouble jacmeasure = jacmax/jacmin -1.0;
107  Vmath::Fill(nquad,jacmeasure,phys,1);
108  }
109  else
110  {
111  Vmath::Fill(nquad,0.0,phys,1);
112  }
113 
114  Elmt->FwdTrans(phys,tmp = coeffs + coeffoffset);
115  }
116 
117  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
118  = m_f->m_exp[0]->GetFieldDefinitions();
119  std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
120 
121  for (int i = 0; i < FieldDef.size(); ++i)
122  {
123  FieldDef[i]->m_fields.push_back("JacobianEnergy");
124  m_f->m_exp[0]->AppendFieldData(FieldDef[i], FieldData[i]);
125  }
126 
127  m_f->m_fielddef = FieldDef;
128  m_f->m_data = FieldData;
129 }
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.