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

#include <Module.h>

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

Public Member Functions

 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.
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)
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 (string key, string value)
void PrintConfig ()
void SetDefaults ()
MeshSharedPtr GetMesh ()
virtual void ProcessVertices ()
 Extract element vertices.

Protected Member Functions

 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

FieldSharedPtr m_f
 Field object.
map< string, ConfigOptionm_config
 List of configuration values.
bool m_requireEquiSpaced
MeshSharedPtr m_mesh
 Mesh object.

Detailed Description

Abstract base class for mesh converter modules. Each subclass implements the Process() function, which in some way alters the mesh #m.

Definition at line 134 of file PostProcessing/FieldConvert/Module.h.

Constructor & Destructor Documentation

Nektar::Utilities::Module::Module ( FieldSharedPtr  p_f)
inline

Definition at line 137 of file PostProcessing/FieldConvert/Module.h.

: m_f(p_f), m_requireEquiSpaced(false) {}
Nektar::Utilities::Module::Module ( )
inlineprotected

Definition at line 160 of file PostProcessing/FieldConvert/Module.h.

{};
Nektar::Utilities::Module::Module ( MeshSharedPtr  p_m)
inline

Definition at line 148 of file PreProcessing/MeshConvert/Module.h.

: m_mesh(p_m) {}

Member Function Documentation

void Nektar::Utilities::Module::EvaluateTriFieldAtEquiSpacedPts ( LocalRegions::ExpansionSharedPtr exp,
const Array< OneD, const NekDouble > &  infield,
Array< OneD, NekDouble > &  outfield 
)
MeshSharedPtr Nektar::Utilities::Module::GetMesh ( )
inline

Definition at line 154 of file PreProcessing/MeshConvert/Module.h.

References m_mesh.

{
return m_mesh;
}
bool Nektar::Utilities::Module::GetRequireEquiSpaced ( void  )
inline

Definition at line 144 of file PostProcessing/FieldConvert/Module.h.

{
}
void Nektar::Utilities::Module::PrintConfig ( )

Print out all configuration options for a module.

Definition at line 127 of file PostProcessing/FieldConvert/Module.cpp.

References Nektar::iterator, and m_config.

{
if (m_config.size() == 0)
{
cerr << "No configuration options for this module." << endl;
return;
}
for (it = m_config.begin(); it != m_config.end(); ++it)
{
cerr << setw(10) << it->first << ": " << it->second.m_desc
<< endl;
}
}
void Nektar::Utilities::Module::PrintConfig ( )
void Nektar::Utilities::Module::PrismLines ( int  prism,
PerMap perFaces,
set< int > &  prismsDone,
vector< ElementSharedPtr > &  line 
)
protected

Definition at line 644 of file PreProcessing/MeshConvert/Module.cpp.

References Nektar::iterator, and m_mesh.

Referenced by ReorderPrisms().

{
int i;
set<int>::iterator it = prismsDone.find(prism);
if (it == prismsDone.end())
{
return;
}
// Remove this prism from the list.
prismsDone.erase(it);
line.push_back(m_mesh->m_element[3][prism]);
// Now find prisms connected to this one through a triangular face.
for (i = 1; i <= 3; i += 2)
{
FaceSharedPtr f = m_mesh->m_element[3][prism]->GetFace(i);
int nextId;
// See if this face is periodic.
it2 = perFaces.find(f->m_id);
if (it2 != perFaces.end())
{
int id2 = it2->second.first->m_id;
nextId = it2->second.first->m_elLink[0].first->GetId();
perFaces.erase(it2);
perFaces.erase(id2);
PrismLines(nextId, perFaces, prismsDone, line);
}
// Nothing else connected to this face.
if (f->m_elLink.size() == 1)
{
continue;
}
nextId = f->m_elLink[0].first->GetId();
if (nextId == m_mesh->m_element[3][prism]->GetId())
{
nextId = f->m_elLink[1].first->GetId();
}
PrismLines(nextId, perFaces, prismsDone, line);
}
}
virtual void Nektar::Utilities::Module::Process ( po::variables_map &  vm)
pure virtual
virtual void Nektar::Utilities::Module::Process ( )
pure virtual
void Nektar::Utilities::Module::ProcessComposites ( )
protectedvirtual

Generate composites.

Generate a list of composites (groups of elements) from tag IDs stored in mesh vertices/edges/faces/elements.

Each element is assigned to a composite ID by an input module. First we scan the element list and generate a list of composite IDs. We then generate the composite objects and populate them with a second scan through the element list.

Definition at line 330 of file PreProcessing/MeshConvert/Module.cpp.

References Nektar::iterator, and m_mesh.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputTec::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessJac::Process(), and Nektar::Utilities::InputNek::Process().

{
m_mesh->m_composite.clear();
// For each element, check to see if a composite has been
// created. If not, create a new composite. Otherwise, add the
// element to the composite.
for (int d = 0; d <= m_mesh->m_expDim; ++d)
{
vector<ElementSharedPtr> &elmt = m_mesh->m_element[d];
for (int i = 0; i < elmt.size(); ++i)
{
unsigned int tagid = elmt[i]->GetTagList()[0];
it = m_mesh->m_composite.find(tagid);
if (it == m_mesh->m_composite.end())
{
CompositeSharedPtr tmp = boost::shared_ptr<Composite>(
new Composite());
pair<CompositeMap::iterator, bool> testIns;
tmp->m_id = tagid;
tmp->m_tag = elmt[i]->GetTag();
testIns = m_mesh->m_composite.insert(
pair<unsigned int, CompositeSharedPtr>(tagid,tmp));
it = testIns.first;
}
if (elmt[i]->GetTag() != it->second->m_tag)
{
cout << "Different types of elements in same composite!" << endl;
cout << " -> Composite uses " << it->second->m_tag << endl;
cout << " -> Element uses " << elmt[i]->GetTag() << endl;
cout << "Have you specified physical volumes and surfaces?" << endl;
}
it->second->m_items.push_back(elmt[i]);
}
}
}
void Nektar::Utilities::Module::ProcessEdges ( bool  ReprocessEdges = true)
protectedvirtual

Extract element edges.

Create a unique set of mesh edges from elements stored in Mesh::element.

All elements are first scanned and a list of unique, enumerated edges produced in #m_edgeSet. Since each element generated its edges independently, we must now ensure that each element only uses edge objects from the #m_edgeSet set This ensures there are no duplicate edge objects. Finally, we scan the list of elements for 1-D boundary elements which correspond to an edge in #m_edgeSet. For such elements, we set its edgeLink to reference the corresponding edge in #m_edgeSet.

This routine only proceeds if the expansion dimension is 2 or 3.

Definition at line 150 of file PreProcessing/MeshConvert/Module.cpp.

References ASSERTL0, Nektar::iterator, and m_mesh.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputTec::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::InputNek::Process(), and ReorderPrisms().

{
if (m_mesh->m_expDim < 2) return;
if(ReprocessEdges)
{
vector<ElementSharedPtr> &elmt = m_mesh->m_element[m_mesh->m_expDim];
m_mesh->m_edgeSet.clear();
// Scan all elements and generate list of unique edges
for (int i = 0, eid = 0; i < elmt.size(); ++i)
{
for (int j = 0; j < elmt[i]->GetEdgeCount(); ++j)
{
pair<EdgeSet::iterator,bool> testIns;
EdgeSharedPtr ed = elmt[i]->GetEdge(j);
testIns = m_mesh->m_edgeSet.insert(ed);
if (testIns.second)
{
(*(testIns.first))->m_id = eid++;
}
else
{
EdgeSharedPtr e2 = *(testIns.first);
elmt[i]->SetEdge(j, e2);
if (e2->m_edgeNodes.size() == 0 &&
ed->m_edgeNodes.size() > 0)
{
e2->m_curveType = ed->m_curveType;
e2->m_edgeNodes = ed->m_edgeNodes;
// Reverse nodes if appropriate.
if (e2->m_n1->m_id != ed->m_n1->m_id)
{
reverse(e2->m_edgeNodes.begin(),
e2->m_edgeNodes.end());
}
}
// Update edge to element map.
(*(testIns.first))->m_elLink.push_back(
pair<ElementSharedPtr,int>(elmt[i],j));
}
}
}
}
// Create links for 1D elements
for (int i = 0; i < m_mesh->m_element[1].size(); ++i)
{
NodeSharedPtr v0 = m_mesh->m_element[1][i]->GetVertex(0);
NodeSharedPtr v1 = m_mesh->m_element[1][i]->GetVertex(1);
vector<NodeSharedPtr> edgeNodes;
EdgeSharedPtr E = boost::shared_ptr<Edge>(
new Edge(v0, v1, edgeNodes,
m_mesh->m_element[1][i]->GetConf().m_edgeCurveType));
EdgeSet::iterator it = m_mesh->m_edgeSet.find(E);
if (it == m_mesh->m_edgeSet.end())
{
cerr << "Cannot find corresponding element edge for "
<< "1D element " << i << endl;
abort();
}
m_mesh->m_element[1][i]->SetEdgeLink(*it);
// Update 2D element boundary map.
ASSERTL0((*it)->m_elLink.size() != 0,
"Empty boundary map!");
ASSERTL0((*it)->m_elLink.size() == 1,
"Too many elements in boundary map!");
pair<ElementSharedPtr, int> eMap = (*it)->m_elLink.at(0);
eMap.first->SetBoundaryLink(eMap.second, i);
}
}
void Nektar::Utilities::Module::ProcessElements ( )
protectedvirtual

Generate element IDs.

Enumerate elements stored in Mesh::element.

For all elements of equal dimension to the mesh dimension, we enumerate sequentially. All other elements in the list should be of lower dimension and have ID set by a corresponding edgeLink or faceLink (as set in ProcessEdges or ProcessFaces).

Definition at line 312 of file PreProcessing/MeshConvert/Module.cpp.

References m_mesh.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::InputTec::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::InputNek::Process(), and ReorderPrisms().

{
int cnt = 0;
for (int i = 0; i < m_mesh->m_element[m_mesh->m_expDim].size(); ++i)
{
m_mesh->m_element[m_mesh->m_expDim][i]->SetId(cnt++);
}
}
void Nektar::Utilities::Module::ProcessFaces ( bool  ReprocessFaces = true)
protectedvirtual

Extract element faces.

Create a unique set of mesh faces from elements stored in Mesh::element.

All elements are scanned and a unique list of enumerated faces is produced in #m_faceSet. Since elements created their own faces independently, we examine each element only uses face objects from #m_faceSet. Duplicate faces of those in #m_face are replaced with the corresponding entry in #m_faceSet. Finally, we scan the list of elements for 2-D boundary faces which correspond to faces in #m_faceSet. For such elements, we set its faceLink to reference the corresponding face in #m_faceSet.

This routine only proceeds if the expansion dimension is 3.

Definition at line 243 of file PreProcessing/MeshConvert/Module.cpp.

References ASSERTL0, Nektar::iterator, and m_mesh.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputTec::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::InputNek::Process(), and ReorderPrisms().

{
if (m_mesh->m_expDim < 3) return;
if(ReprocessFaces)
{
vector<ElementSharedPtr> &elmt = m_mesh->m_element[m_mesh->m_expDim];
m_mesh->m_faceSet.clear();
// Scan all elements and generate list of unique faces
for (int i = 0, fid = 0; i < elmt.size(); ++i)
{
for (int j = 0; j < elmt[i]->GetFaceCount(); ++j)
{
pair<FaceSet::iterator,bool> testIns;
testIns = m_mesh->m_faceSet.insert(elmt[i]->GetFace(j));
if (testIns.second)
{
(*(testIns.first))->m_id = fid++;
}
else
{
elmt[i]->SetFace(j,*testIns.first);
// Update face to element map.
(*(testIns.first))->m_elLink.push_back(
pair<ElementSharedPtr,int>(elmt[i],j));
}
}
}
}
// Create links for 2D elements
for (int i = 0; i < m_mesh->m_element[2].size(); ++i)
{
vector<NodeSharedPtr> vertices = m_mesh->m_element[2][i]->GetVertexList();
vector<NodeSharedPtr> faceNodes;
vector<EdgeSharedPtr> edgeList = m_mesh->m_element[2][i]->GetEdgeList();
FaceSharedPtr F = boost::shared_ptr<Face>(
new Face(vertices, faceNodes, edgeList,
m_mesh->m_element[2][i]->GetConf().m_faceCurveType));
FaceSet::iterator it = m_mesh->m_faceSet.find(F);
if (it == m_mesh->m_faceSet.end())
{
cout << "Cannot find corresponding element face for 2D "
<< "element " << i << endl;
abort();
}
m_mesh->m_element[2][i]->SetFaceLink(*it);
// Update 3D element boundary map.
ASSERTL0((*it)->m_elLink.size() != 0,
"Empty element link map!");
ASSERTL0((*it)->m_elLink.size() == 1,
"Too many elements in element link map!");
pair<ElementSharedPtr, int> eMap = (*it)->m_elLink.at(0);
eMap.first->SetBoundaryLink(eMap.second, i);
}
}
void Nektar::Utilities::Module::ProcessVertices ( )
virtual

Extract element vertices.

Create a unique set of mesh vertices from elements stored in Mesh::element.

Each element is processed in turn and the vertices extracted and inserted into #m_vertexSet, which at the end of the routine contains all unique vertices in the mesh.

Definition at line 110 of file PreProcessing/MeshConvert/Module.cpp.

References m_mesh.

Referenced by Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputPly::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::ProcessTetSplit::Process(), and Nektar::Utilities::InputTec::ReadZone().

{
vector<ElementSharedPtr> &elmt = m_mesh->m_element[m_mesh->m_expDim];
m_mesh->m_vertexSet.clear();
for (int i = 0, vid = 0; i < elmt.size(); ++i)
{
for (int j = 0; j < elmt[i]->GetVertexCount(); ++j)
{
pair<NodeSet::iterator,bool> testIns =
m_mesh->m_vertexSet.insert(elmt[i]->GetVertex(j));
if (testIns.second)
{
(*(testIns.first))->m_id = vid++;
}
else
{
elmt[i]->SetVertex(j,*testIns.first);
}
}
}
}
void Nektar::Utilities::Module::RegisterConfig ( string  key,
string  value 
)

Register a configuration option with a module.

Definition at line 103 of file PostProcessing/FieldConvert/Module.cpp.

References Nektar::iterator, and m_config.

{
if (it == m_config.end())
{
cerr << "WARNING: Unrecognised config option " << key
<< ", proceeding anyway." << endl;
}
it->second.m_beenSet = true;
if (it->second.m_isBool)
{
it->second.m_value = "1";
}
else
{
it->second.m_value = val;
}
}
void Nektar::Utilities::Module::RegisterConfig ( string  key,
string  value 
)
void Nektar::Utilities::Module::ReorderPrisms ( PerMap perFaces)
protected

Reorder node IDs so that prisms and tetrahedra are aligned correctly.

Orientation of prism lines (i.e. a large prism which has been split into subprisms) cannot be guaranteed when elements are created one-by-one, or when periodic boundary conditions are used. This routine uses the following strategy:

  • Destroy the existing node numbering.
  • Detect a line of prisms using the PrismLines routine.
  • For each line, renumber node IDs consistently so that highest ID per-element corresponds to the line of collapsed coordinate points.
  • Recreate each prism in the line using the new ordering, and apply the existing OrientPrism routine to orient nodes accordingly.
  • When all prism lines are processed, recreate all tetrahedra using the existing orientation code.
  • Finally renumber any other nodes (i.e. those belonging to hexahedra).

The last step is to eliminate duplicate edges/faces and reenumerate.

NOTE: This routine does not copy high-order information yet!

Definition at line 397 of file PreProcessing/MeshConvert/Module.cpp.

References ASSERTL0, ASSERTL1, Nektar::LibUtilities::NekFactory< tKey, tBase, >::CreateInstance(), Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eTetrahedron, Nektar::Utilities::GetElementFactory(), Nektar::iterator, m_mesh, PrismLines(), ProcessEdges(), ProcessElements(), and ProcessFaces().

Referenced by Nektar::Utilities::ProcessPerAlign::Process().

{
// Loop over elements and extract any that are prisms.
int i, j, k;
if (m_mesh->m_expDim < 3)
{
return;
}
map<int, int> lines;
set<int> prismsDone, tetsDone;
// Compile list of prisms and tets.
for (i = 0; i < m_mesh->m_element[3].size(); ++i)
{
ElementSharedPtr el = m_mesh->m_element[3][i];
if (el->GetConf().m_e == LibUtilities::ePrism)
{
prismsDone.insert(i);
}
else if (el->GetConf().m_e == LibUtilities::eTetrahedron)
{
tetsDone.insert(i);
}
}
// Destroy existing node numbering.
for (it = m_mesh->m_vertexSet.begin(); it != m_mesh->m_vertexSet.end(); ++it)
{
(*it)->m_id = -1;
}
// Counter for new node IDs.
int nodeId = 0;
int prismTris[2][3] = {{0,1,4}, {3,2,5}};
// facesDone tracks face IDs inside prisms which have already been
// aligned.
boost::unordered_set<int> facesDone;
// Loop over prisms until we've found all lines of prisms.
while (prismsDone.size() > 0)
{
vector<ElementSharedPtr> line;
// Call PrismLines to identify all prisms connected to
// prismDone.begin() and place them in line[].
PrismLines(*prismsDone.begin(), perFaces, prismsDone, line);
// Loop over each prism, figure out which line of vertices
// contains the vertex with highest ID.
for (i = 0; i < line.size(); ++i)
{
// Copy tags and nodes from existing element.
vector<int> tags = line[i]->GetTagList();
vector<NodeSharedPtr> nodes = line[i]->GetVertexList();
// See if either face of this prism has been renumbered
// already.
FaceSharedPtr f[2] = {
line[i]->GetFace(1), line[i]->GetFace(3)
};
fIt[0] = facesDone.find(f[0]->m_id);
fIt[1] = facesDone.find(f[1]->m_id);
// See if either of these faces is periodic. If it is, then
// assign ids accordingly.
for (j = 0; j < 2; ++j)
{
pIt = perFaces.find(f[j]->m_id);
if (pIt == perFaces.end())
{
continue;
}
fIt2 = facesDone.find(pIt->second.first->m_id);
if (fIt[j] == facesDone.end() &&
fIt2 != facesDone.end())
{
fIt[j] = fIt2;
}
}
if (fIt[0] != facesDone.end() &&
fIt[1] != facesDone.end())
{
// Should not be the case that both faces have already
// been renumbered.
ASSERTL0(false, "Renumbering error!");
}
else if (fIt[0] == facesDone.end() &&
fIt[1] == facesDone.end())
{
// Renumber both faces.
for (j = 0; j < 2; ++j)
{
for (k = 0; k < 3; ++k)
{
NodeSharedPtr n = nodes[prismTris[j][k]];
if (n->m_id == -1)
{
n->m_id = nodeId++;
}
}
}
facesDone.insert(f[0]->m_id);
facesDone.insert(f[1]->m_id);
}
else
{
// Renumber face. t identifies the face not yet
// numbered, o identifies the other face.
int t = fIt[0] == facesDone.end() ? 0 : 1;
int o = (t+1) % 2;
ASSERTL1(fIt[o] != facesDone.end(),"Renumbering error");
// Determine which of the three vertices on the 'other'
// face corresponds to the highest ID - this signifies
// the singular point of the line of prisms.
int tmp1[3] = {
nodes[prismTris[o][0]]->m_id,
nodes[prismTris[o][1]]->m_id,
nodes[prismTris[o][2]]->m_id
};
int tmp2[3] = {0,1,2};
if (tmp1[0] > tmp1[1])
{
swap(tmp1[0], tmp1[1]);
swap(tmp2[0], tmp2[1]);
}
if (tmp1[1] > tmp1[2])
{
swap(tmp1[1], tmp1[2]);
swap(tmp2[1], tmp2[2]);
}
if (tmp1[0] > tmp1[2])
{
swap(tmp1[0], tmp1[2]);
swap(tmp2[0], tmp2[2]);
}
// Renumber this face so that highest ID matches.
for (j = 0; j < 3; ++j)
{
NodeSharedPtr n = nodes[prismTris[t][tmp2[j]]];
if (n->m_id == -1)
{
n->m_id = nodeId++;
}
}
facesDone.insert(f[t]->m_id);
}
for (j = 0; j < 6; ++j)
{
ASSERTL1(nodes[j]->m_id != -1, "Renumbering error");
}
// Recreate prism with the new ordering.
ElmtConfig conf(LibUtilities::ePrism, 1, false, false, true);
LibUtilities::ePrism, conf, nodes, tags);
// Replace old prism.
m_mesh->m_element[3][line[i]->GetId()] = el;
}
}
// Loop over periodic faces, enumerate vertices.
for (pIt = perFaces.begin(); pIt != perFaces.end(); ++pIt)
{
FaceSharedPtr f2 = pIt->second.first;
FaceSharedPtr f1 = perFaces[f2->m_id].first;
vector<int> perVerts = pIt->second.second;
int nVerts = perVerts.size();
// Number periodic vertices first.
for (j = 0; j < nVerts; ++j)
{
NodeSharedPtr n1 = f1->m_vertexList[j];
NodeSharedPtr n2 = f2->m_vertexList[perVerts[j]];
if (n1->m_id == -1 && n2->m_id == -1)
{
n1->m_id = nodeId++;
n2->m_id = nodeId++;
}
else if (n1->m_id != -1 && n2->m_id != -1)
{
continue;
}
else
{
ASSERTL0(false, "Periodic face renumbering error");
}
}
}
// Recreate tets.
for (it2 = tetsDone.begin(); it2 != tetsDone.end(); ++it2)
{
ElementSharedPtr el = m_mesh->m_element[3][*it2];
vector<NodeSharedPtr> nodes = el->GetVertexList();
vector<int> tags = el->GetTagList();
for (i = 0; i < 4; ++i)
{
if (nodes[i]->m_id == -1)
{
nodes[i]->m_id = nodeId++;
}
}
// Recreate tet.
ElmtConfig conf(LibUtilities::eTetrahedron, 1, false, false, true);
m_mesh->m_element[3][*it2] = GetElementFactory().CreateInstance(
LibUtilities::eTetrahedron, conf, nodes, tags);
}
// Enumerate rest of vertices.
for (it = m_mesh->m_vertexSet.begin(); it != m_mesh->m_vertexSet.end(); ++it)
{
if ((*it)->m_id == -1)
{
(*it)->m_id = nodeId++;
}
}
}
void Nektar::Utilities::Module::SetDefaults ( )

Sets default configuration options for those which have not been set.

Definition at line 148 of file PostProcessing/FieldConvert/Module.cpp.

References Nektar::iterator, and m_config.

{
for (it = m_config.begin(); it != m_config.end(); ++it)
{
if (!it->second.m_beenSet)
{
it->second.m_value = it->second.m_defValue;
}
}
}
void Nektar::Utilities::Module::SetDefaults ( )
void Nektar::Utilities::Module::SetRequireEquiSpaced ( bool  pVal)
inline

Definition at line 149 of file PostProcessing/FieldConvert/Module.h.

{
}

Member Data Documentation

map< string, ConfigOption > Nektar::Utilities::Module::m_config
protected

List of configuration values.

Definition at line 165 of file PostProcessing/FieldConvert/Module.h.

Referenced by Nektar::Utilities::ProcessCyl::GenerateEdgeNodes(), Nektar::Utilities::InputModule::InputModule(), Nektar::Utilities::InputModule::OpenStream(), Nektar::Utilities::OutputModule::OpenStream(), Nektar::Utilities::OutputModule::OutputModule(), Nektar::Utilities::OutputNekpp::OutputNekpp(), PrintConfig(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::ProcessPerAlign::Process(), Nektar::Utilities::ProcessCyl::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::OutputVtk::Process(), Nektar::Utilities::ProcessBoundaryExtract::Process(), Nektar::Utilities::OutputFld::Process(), Nektar::Utilities::OutputInfo::Process(), Nektar::Utilities::OutputNekpp::Process(), Nektar::Utilities::ProcessInterpPoints::Process(), Nektar::Utilities::ProcessSpherigon::Process(), Nektar::Utilities::ProcessInterpField::Process(), Nektar::Utilities::ProcessInterpPointDataToFld::Process(), Nektar::Utilities::ProcessC0Projection::Process(), Nektar::Utilities::ProcessScaleInFld::Process(), Nektar::Utilities::ProcessExtractSurf::Process(), Nektar::Utilities::ProcessAddFld::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::ProcessScalar::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessDetectSurf::Process(), Nektar::Utilities::OutputTecplot::Process(), Nektar::Utilities::ProcessIsoContour::Process(), Nektar::Utilities::ProcessAddFld::ProcessAddFld(), Nektar::Utilities::ProcessBL::ProcessBL(), Nektar::Utilities::ProcessBoundaryExtract::ProcessBoundaryExtract(), Nektar::Utilities::ProcessC0Projection::ProcessC0Projection(), Nektar::Utilities::ProcessCyl::ProcessCyl(), Nektar::Utilities::ProcessDetectSurf::ProcessDetectSurf(), Nektar::Utilities::ProcessEquiSpacedOutput::ProcessEquiSpacedOutput(), Nektar::Utilities::ProcessExtractSurf::ProcessExtractSurf(), Nektar::Utilities::ProcessInterpField::ProcessInterpField(), Nektar::Utilities::ProcessInterpPointDataToFld::ProcessInterpPointDataToFld(), Nektar::Utilities::ProcessInterpPoints::ProcessInterpPoints(), Nektar::Utilities::ProcessIsoContour::ProcessIsoContour(), Nektar::Utilities::ProcessJac::ProcessJac(), Nektar::Utilities::ProcessJacobianEnergy::ProcessJacobianEnergy(), Nektar::Utilities::ProcessPerAlign::ProcessPerAlign(), Nektar::Utilities::ProcessScalar::ProcessScalar(), Nektar::Utilities::ProcessScaleInFld::ProcessScaleInFld(), Nektar::Utilities::ProcessSpherigon::ProcessSpherigon(), Nektar::Utilities::ProcessTetSplit::ProcessTetSplit(), RegisterConfig(), SetDefaults(), and Nektar::Utilities::ProcessEquiSpacedOutput::SetupEquiSpacedField().

FieldSharedPtr Nektar::Utilities::Module::m_f
protected

Field object.

Definition at line 160 of file PostProcessing/FieldConvert/Module.h.

Referenced by Nektar::Utilities::InputModule::AddFile(), Nektar::Utilities::ProcessIsoContour::ExtractContour(), Nektar::Utilities::OutputTecplot::GetNumTecplotBlocks(), Nektar::Utilities::ProcessInterpPoints::InterpolateFieldToPts(), Nektar::Utilities::InputModule::PrintSummary(), Nektar::Utilities::InputDat::Process(), Nektar::Utilities::InputXml::Process(), Nektar::Utilities::InputFld::Process(), Nektar::Utilities::InputPts::Process(), Nektar::Utilities::OutputFld::Process(), Nektar::Utilities::OutputVtk::Process(), Nektar::Utilities::OutputInfo::Process(), Nektar::Utilities::ProcessBoundaryExtract::Process(), Nektar::Utilities::ProcessConcatenateFld::Process(), Nektar::Utilities::ProcessInterpPoints::Process(), Nektar::Utilities::ProcessJacobianEnergy::Process(), Nektar::Utilities::ProcessVorticity::Process(), Nektar::Utilities::ProcessInterpPointDataToFld::Process(), Nektar::Utilities::ProcessInterpField::Process(), Nektar::Utilities::ProcessQCriterion::Process(), Nektar::Utilities::ProcessC0Projection::Process(), Nektar::Utilities::ProcessScaleInFld::Process(), Nektar::Utilities::ProcessAddFld::Process(), Nektar::Utilities::OutputTecplot::Process(), Nektar::Utilities::ProcessIsoContour::Process(), Nektar::Utilities::InputDat::ReadTecplotFEBlockZone(), Nektar::Utilities::ProcessIsoContour::ResetFieldPts(), Nektar::Utilities::ProcessEquiSpacedOutput::SetupEquiSpacedField(), Nektar::Utilities::OutputTecplot::WriteTecplotConnectivity(), Nektar::Utilities::OutputTecplot::WriteTecplotField(), Nektar::Utilities::OutputTecplot::WriteTecplotHeader(), and Nektar::Utilities::OutputTecplot::WriteTecplotZone().

MeshSharedPtr Nektar::Utilities::Module::m_mesh
protected

Mesh object.

Definition at line 164 of file PreProcessing/MeshConvert/Module.h.

Referenced by Nektar::Utilities::InputTec::GenElement2D(), Nektar::Utilities::InputTec::GenElement3D(), GetMesh(), Nektar::Utilities::InputSem::insertEdge(), Nektar::Utilities::InputNek::LoadHOSurfaces(), PrismLines(), Nektar::Utilities::InputNekpp::Process(), Nektar::Utilities::InputSem::Process(), Nektar::Utilities::InputGmsh::Process(), Nektar::Utilities::ProcessCyl::Process(), Nektar::Utilities::ProcessPerAlign::Process(), Nektar::Utilities::InputSwan::Process(), Nektar::Utilities::InputVtk::Process(), Nektar::Utilities::InputTec::Process(), Nektar::Utilities::OutputVtk::Process(), Nektar::Utilities::OutputNekpp::Process(), Nektar::Utilities::ProcessSpherigon::Process(), Nektar::Utilities::ProcessExtractSurf::Process(), Nektar::Utilities::ProcessDetectSurf::Process(), Nektar::Utilities::ProcessScalar::Process(), Nektar::Utilities::ProcessTetSplit::Process(), Nektar::Utilities::ProcessJac::Process(), Nektar::Utilities::ProcessBL::Process(), Nektar::Utilities::OutputGmsh::Process(), Nektar::Utilities::InputNek::Process(), ProcessComposites(), ProcessEdges(), ProcessElements(), ProcessFaces(), ProcessVertices(), Nektar::Utilities::InputPly::ReadPly(), Nektar::Utilities::InputTec::ReadZone(), ReorderPrisms(), Nektar::Utilities::OutputNekpp::WriteXmlComposites(), Nektar::Utilities::OutputNekpp::WriteXmlConditions(), Nektar::Utilities::OutputNekpp::WriteXmlCurves(), Nektar::Utilities::OutputNekpp::WriteXmlDomain(), Nektar::Utilities::OutputNekpp::WriteXmlEdges(), Nektar::Utilities::OutputNekpp::WriteXmlElements(), Nektar::Utilities::OutputNekpp::WriteXmlExpansions(), Nektar::Utilities::OutputNekpp::WriteXmlFaces(), and Nektar::Utilities::OutputNekpp::WriteXmlNodes().

bool Nektar::Utilities::Module::m_requireEquiSpaced
protected