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::ProcessLinear Class Reference

This processing module removes all the high-order information from the mesh leaving just the linear elements. More...

#include <ProcessLinear.h>

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

Public Member Functions

 ProcessLinear (MeshSharedPtr m)
 
virtual ~ProcessLinear ()
 
virtual void Process ()
 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)
 
virtual void Process (po::variables_map &vm)=0
 
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)
 
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 (MeshSharedPtr m)
 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 removes all the high-order information from the mesh leaving just the linear elements.

Definition at line 49 of file ProcessLinear.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessLinear::ProcessLinear ( MeshSharedPtr  m)

Definition at line 50 of file ProcessLinear.cpp.

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

50  : ProcessModule(m)
51 {
52  m_config["all"] =
53  ConfigOption(true, "0", "remove curve nodes for all elements.");
54  m_config["invalid"] =
55  ConfigOption(true, "0", "remove curve nodes if element is invalid.");
56 }
map< string, ConfigOption > m_config
List of configuration values.
Nektar::Utilities::ProcessLinear::~ProcessLinear ( )
virtual

Definition at line 58 of file ProcessLinear.cpp.

59 {
60 }

Member Function Documentation

static boost::shared_ptr<Module> Nektar::Utilities::ProcessLinear::create ( MeshSharedPtr  m)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file ProcessLinear.h.

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

54  {
56  }
static boost::shared_ptr< DataType > AllocateSharedPtr()
Allocate a shared pointer from the memory pool.
void Nektar::Utilities::ProcessLinear::Process ( )
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 62 of file ProcessLinear.cpp.

References ASSERTL0, Nektar::iterator, Nektar::Utilities::Module::m_config, and Nektar::Utilities::Module::m_mesh.

63 {
64  if (m_mesh->m_verbose)
65  {
66  cout << "ProcessLinear: Linearising mesh... " << endl;
67  }
68 
69  bool all = m_config["all"].as<bool>();
70  bool invalid = m_config["invalid"].as<bool>();
71 
72  ASSERTL0(all || invalid, "must specify option all or invalid");
73 
74  if (all)
75  {
77  for (eit = m_mesh->m_edgeSet.begin(); eit != m_mesh->m_edgeSet.end();
78  eit++)
79  {
80  (*eit)->m_edgeNodes.clear();
81  }
82 
84  for (fit = m_mesh->m_faceSet.begin(); fit != m_mesh->m_faceSet.end();
85  fit++)
86  {
87  (*fit)->m_faceNodes.clear();
88  }
89 
90  for (int i = 0; i < m_mesh->m_element[m_mesh->m_expDim].size(); i++)
91  {
92  vector<NodeSharedPtr> empty;
93  m_mesh->m_element[m_mesh->m_expDim][i]->SetVolumeNodes(empty);
94  }
95  }
96  else if (invalid)
97  {
98  if (m_mesh->m_expDim == 3)
99  {
100  FaceSet::iterator fit;
101  for (fit = m_mesh->m_faceSet.begin();
102  fit != m_mesh->m_faceSet.end();
103  fit++)
104  {
105  ASSERTL0((*fit)->m_faceNodes.size() == 0,
106  "has not be setup to handle face curvature yet");
107  }
108  }
109 
110  vector<ElementSharedPtr> el = m_mesh->m_element[m_mesh->m_expDim];
111  // Iterate over list of elements of expansion dimension.
112  for (int i = 0; i < el.size(); ++i)
113  {
114  // Create elemental geometry.
116  el[i]->GetGeom(m_mesh->m_spaceDim);
117 
118  // Generate geometric factors.
119  SpatialDomains::GeomFactorsSharedPtr gfac = geom->GetGeomFactors();
120 
121  // Get the Jacobian and, if it is negative, print a warning
122  // message.
123  if (!gfac->IsValid())
124  {
125 
126  vector<FaceSharedPtr> f = el[i]->GetFaceList();
127  for (int j = 0; j < f.size(); j++)
128  {
129  vector<EdgeSharedPtr> e = f[j]->m_edgeList;
130  for (int k = 0; k < e.size(); k++)
131  {
132  if (e[k]->m_edgeNodes.size())
133  {
134  vector<NodeSharedPtr> zeroNodes;
135  e[k]->m_edgeNodes = zeroNodes;
136  }
137  }
138  }
139  }
140  }
141  }
142 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
StandardMatrixTag boost::call_traits< LhsDataType >::const_reference rhs typedef NekMatrix< LhsDataType, StandardMatrixTag >::iterator iterator
boost::shared_ptr< GeomFactors > GeomFactorsSharedPtr
Pointer to a GeomFactors object.
Definition: GeomFactors.h:62
boost::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:53

Member Data Documentation

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

Definition at line 57 of file ProcessLinear.h.