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

This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...

#include <ProcessJac.h>

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

Public Member Functions

 ProcessJac (MeshSharedPtr m)
virtual ~ProcessJac ()
virtual void Process ()
 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)
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)
 Module (MeshSharedPtr p_m)
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 (MeshSharedPtr m)
 Creates an instance of this class.

Static Public Attributes

static ModuleKey className

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 Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian.

Definition at line 51 of file ProcessJac.h.

Constructor & Destructor Documentation

Nektar::Utilities::ProcessJac::ProcessJac ( MeshSharedPtr  m)

Definition at line 54 of file ProcessJac.cpp.

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

{
m_config["extract"] = ConfigOption(
true, "0", "Extract non-valid elements from mesh.");
m_config["list"] = ConfigOption(
true, "0", "Print list of elements having negative Jacobian.");
}
Nektar::Utilities::ProcessJac::~ProcessJac ( )
virtual

Definition at line 62 of file ProcessJac.cpp.

{
}

Member Function Documentation

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

Creates an instance of this class.

Definition at line 55 of file ProcessJac.h.

{
return MemoryManager<ProcessJac>::AllocateSharedPtr(m);
}
void Nektar::Utilities::ProcessJac::Process ( )
virtual

Write mesh to output file.

Implements Nektar::Utilities::Module.

Definition at line 67 of file ProcessJac.cpp.

References Nektar::StdRegions::ElementTypeMap, Nektar::Utilities::Module::m_config, Nektar::Utilities::Module::m_mesh, Nektar::Utilities::Module::ProcessComposites(), Nektar::Utilities::Module::ProcessEdges(), Nektar::Utilities::Module::ProcessElements(), Nektar::Utilities::Module::ProcessFaces(), and Nektar::Utilities::Module::ProcessVertices().

{
if (m_mesh->m_verbose)
{
cout << "ProcessJac: Calculating Jacobians... " << endl;
}
bool extract = m_config["extract"].as<bool>();
bool printList = m_config["list"].as<bool>();
vector<ElementSharedPtr> el = m_mesh->m_element[m_mesh->m_expDim];
if (extract)
{
m_mesh->m_element[m_mesh->m_expDim].clear();
}
if (printList)
{
cout << "Elements with negative Jacobian:" << endl;
}
int nNeg = 0;
// Iterate over list of elements of expansion dimension.
for (int i = 0; i < el.size(); ++i)
{
// Create elemental geometry.
el[i]->GetGeom(m_mesh->m_spaceDim);
// Generate geometric factors.
geom->GetGeomFactors();
// Get the Jacobian and, if it is negative, print a warning
// message.
if (!gfac->IsValid())
{
nNeg++;
if (printList)
{
cout << " - " << el[i]->GetId() << " ("
<< StdRegions::ElementTypeMap[el[i]->GetConf().m_e]
<< ")" << endl;
}
if (extract)
{
m_mesh->m_element[m_mesh->m_expDim].push_back(el[i]);
}
}
}
if (extract)
{
m_mesh->m_element[m_mesh->m_expDim-1].clear();
}
if (printList || m_mesh->m_verbose)
{
cout << "Total negative Jacobians: " << nNeg << endl;
}
else if (nNeg > 0)
{
cout << "WARNING: Detected " << nNeg << " element"
<< (nNeg == 1 ? "" : "s") << " with negative Jacobian."
<< endl;
}
}

Member Data Documentation

ModuleKey Nektar::Utilities::ProcessJac::className
static
Initial value:
"Process elements based on values of Jacobian.")

Definition at line 58 of file ProcessJac.h.