Commit f90831df authored by Chris Cantwell's avatar Chris Cantwell

Addressed remaining comments in review.

parent e07e363d
......@@ -2033,7 +2033,12 @@ namespace Nektar
{
for(int i = 0; i < NumHomoStrip; ++i)
{
LibUtilities::FieldDefinitionsSharedPtr fdef = MemoryManager<LibUtilities::FieldDefinitions>::AllocateSharedPtr(shape, elementIDs, basis, UniOrder, numModes,fields, NumHomoDir, HomoLen, HomoZIDs, HomoYIDs);
LibUtilities::FieldDefinitionsSharedPtr fdef =
MemoryManager<LibUtilities::FieldDefinitions>::
AllocateSharedPtr(shape, elementIDs, basis,
UniOrder, numModes,fields,
NumHomoDir, HomoLen, HomoZIDs,
HomoYIDs);
fielddef.push_back(fdef);
}
}
......
......@@ -64,13 +64,13 @@ namespace Nektar
class GlobalMatrix;
enum Direction
{
eX,
eY,
eZ,
eS,
eN
};
{
eX,
eY,
eZ,
eS,
eN
};
enum ExpansionType
{
......@@ -84,11 +84,11 @@ namespace Nektar
};
MultiRegions::Direction const DirCartesianMap[] =
{
eX,
eY,
eZ
};
{
eX,
eY,
eZ
};
/// A map between global matrix keys and their associated block
/// matrices.
......
......@@ -1168,10 +1168,10 @@ namespace Nektar
}
void ExpList2D::v_WriteVtkPieceHeader(
std::ostream &outfile,
int expansion,
int istrip)
{
std::ostream &outfile,
int expansion,
int istrip)
{
int i,j;
int nquad0 = (*m_exp)[expansion]->GetNumPoints(0);
int nquad1 = (*m_exp)[expansion]->GetNumPoints(1);
......
......@@ -310,7 +310,7 @@ namespace Nektar
Lcoords[2] = 2.0*delta - 1.0;
// Set ptdist to distance to nearest vertex
for(int i = 0; i < 5; ++i)
for(int i = 0; i < 6; ++i)
{
ptdist = min(ptdist,r.dist(*m_verts[i]));
}
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: GMSH converter.
// Description: Reads a Nektar++ FLD file.
//
////////////////////////////////////////////////////////////////////////////////
......@@ -216,8 +216,7 @@ void InputFld::Process(po::variables_map &vm)
{
m_f->m_exp[s*nfields+i] =
m_f->AppendExpList(
m_f->m_fielddef[0]->m_numHomogeneousDir
);
m_f->m_fielddef[0]->m_numHomogeneousDir);
}
}
}
......
......@@ -61,7 +61,8 @@ namespace Nektar
* Denotes different types of mesh converter modules: so far only
* input, output and process modules are defined.
*/
enum ModuleType {
enum ModuleType
{
eInputModule,
eProcessModule,
eOutputModule,
......@@ -87,12 +88,12 @@ namespace Nektar
* @param defValue Default value of the option.
* @param desc Description of the option.
*/
ConfigOption(bool isBool, string defValue, string desc) :
m_isBool(isBool), m_beenSet(false), m_value(),
m_defValue(defValue), m_desc(desc) {}
ConfigOption() :
m_isBool(false), m_beenSet(false), m_value(),
m_defValue(), m_desc() {}
ConfigOption(bool isBool, string defValue, string desc) :
m_isBool(isBool), m_beenSet(false), m_value(),
m_defValue(defValue), m_desc(desc) {}
ConfigOption() :
m_isBool(false), m_beenSet(false), m_value(),
m_defValue(), m_desc() {}
/**
* @brief Re-interpret the value stored in #value as some type using
......@@ -246,9 +247,11 @@ namespace Nektar
virtual ~FieldConvertComm() {}
void v_SplitComm(int pRows, int pColumns)
{
// Compute row and column in grid.
m_commRow = boost::shared_ptr<FieldConvertComm>(new FieldConvertComm(pColumns,m_rank));
m_commColumn = boost::shared_ptr<FieldConvertComm>(new FieldConvertComm(pRows,0));
// Compute row and column in grid.
m_commRow = boost::shared_ptr<FieldConvertComm>(
new FieldConvertComm(pColumns,m_rank));
m_commColumn = boost::shared_ptr<FieldConvertComm>(
new FieldConvertComm(pRows,0));
}
protected:
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: FLD file format output.
// Description: Generates a Nektar++ info XML file.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -41,39 +41,41 @@ using namespace std;
namespace Nektar
{
namespace Utilities
{
ModuleKey OutputXml::m_className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eOutputModule, "xml"), OutputXml::create,
"Writes an XML file.");
namespace Utilities
{
OutputXml::OutputXml(FieldSharedPtr f) : OutputModule(f)
{
ModuleKey OutputXml::m_className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eOutputModule, "xml"), OutputXml::create,
"Writes an XML file.");
}
OutputXml::OutputXml(FieldSharedPtr f) : OutputModule(f)
{
OutputXml::~OutputXml()
{
}
void OutputXml::Process(po::variables_map &vm)
{
if(!m_f->m_exp.size()) // do nothing if no expansion defined
{
return;
}
}
if (m_f->m_verbose)
{
cout << "OutputXml: Writing file..." << endl;
}
OutputXml::~OutputXml()
{
}
// Extract the output filename and extension
string filename = m_config["outfile"].as<string>();
void OutputXml::Process(po::variables_map &vm)
{
if(!m_f->m_exp.size()) // do nothing if no expansion defined
{
return;
}
m_f->m_graph->WriteGeometry(filename);
cout << "Written file: " << filename << endl;
}
if (m_f->m_verbose)
{
cout << "OutputXml: Writing file..." << endl;
}
// Extract the output filename and extension
string filename = m_config["outfile"].as<string>();
m_f->m_graph->WriteGeometry(filename);
cout << "Written file: " << filename << endl;
}
}
}
......@@ -41,25 +41,25 @@
namespace Nektar
{
namespace Utilities
{
/// Converter from fld to vtk.
class OutputXml : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<OutputXml>::AllocateSharedPtr(f);
}
static ModuleKey m_className;
OutputXml(FieldSharedPtr f);
virtual ~OutputXml();
/// Write fld to output file.
virtual void Process(po::variables_map &vm);
};
namespace Utilities
{
/// Converter from fld to vtk.
class OutputXml : public OutputModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<OutputXml>::AllocateSharedPtr(f);
}
static ModuleKey m_className;
OutputXml(FieldSharedPtr f);
virtual ~OutputXml();
/// Write fld to output file.
virtual void Process(po::variables_map &vm);
};
}
}
#endif
......@@ -128,14 +128,13 @@ void ProcessAddFld::Process(po::variables_map &vm)
if(samelength == true)
{
for(int i = 0; i < m_f->m_data.size(); ++i)
{
int datalen = m_f->m_data[i].size();
Vmath::Vadd(datalen, &(m_f->m_data[i][0]), 1,
Vmath::Vadd(datalen, &(m_f->m_data[i][0]), 1,
&(fromField->m_data[i][0]), 1,
&(m_f->m_data[i][0]), 1);
&(m_f->m_data[i][0]), 1);
}
}
else
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes C0 projection.
// Description: Add a field to the input field.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes Q Criterion field.
// Description: Deforms grid.
//
////////////////////////////////////////////////////////////////////////////////
......@@ -39,11 +39,7 @@ using namespace std;
#include "ProcessDeform.h"
#include <StdRegions/StdSegExp.h>
#include <StdRegions/StdQuadExp.h>
#include <StdRegions/StdTriExp.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <MultiRegions/ExpList.h>
#include <SolverUtils/Core/Deform.h>
namespace Nektar
......
......@@ -29,39 +29,37 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes Q Criterion field.
// Description: Deforms grid
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSQCRITERION
#define UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSQCRITERION
#ifndef UTILITIES_FIELDCONVERT_PROCESSDEFORM
#define UTILITIES_FIELDCONVERT_PROCESSDEFORM
#include "../Module.h"
namespace Nektar
{
namespace Utilities
{
/**
* @brief This processing module calculates the Q Criterion and adds it
* as an extra-field to the output file.
*/
class ProcessDeform : public ProcessModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessDeform>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessDeform(FieldSharedPtr f);
virtual ~ProcessDeform();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
namespace Utilities
{
class ProcessDeform : public ProcessModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessDeform>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessDeform(FieldSharedPtr f);
virtual ~ProcessDeform();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
}
}
#endif
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes Q Criterion field.
// Description: Deforms a mesh given input field defining displacement.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -29,12 +29,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes Q Criterion field.
// Description: Deforms a mesh given input field defining displacement.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSDISPLACEMENT
#define UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSDISPLACEMENT
#ifndef UTILITIES_FIELDCONVERT_PROCESSDISPLACEMENT
#define UTILITIES_FIELDCONVERT_PROCESSDISPLACEMENT
#include "../Module.h"
......@@ -42,25 +42,23 @@ namespace Nektar
{
namespace Utilities
{
/**
* @brief This processing module calculates the Q Criterion and adds it
* as an extra-field to the output file.
*/
class ProcessDisplacement : public ProcessModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessDisplacement>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessDisplacement(FieldSharedPtr f);
virtual ~ProcessDisplacement();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
class ProcessDisplacement : public ProcessModule
{
public:
/// Creates an instance of this class
static boost::shared_ptr<Module> create(FieldSharedPtr f) {
return MemoryManager<ProcessDisplacement>::AllocateSharedPtr(f);
}
static ModuleKey className;
ProcessDisplacement(FieldSharedPtr f);
virtual ~ProcessDisplacement();
/// Write mesh to output file.
virtual void Process(po::variables_map &vm);
};
}
}
......
......@@ -209,7 +209,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np0 = e->GetBasis(0)->GetNumPoints();
int np1 = e->GetBasis(1)->GetNumPoints();
int np = max(np0,np1);
newpoints = LibUtilities::StdTriData::
newpoints = LibUtilities::StdTriData::
getNumberOfCoefficients(np,np);
}
break;
......@@ -219,7 +219,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np1 = e->GetBasis(1)->GetNumPoints();
int np = max(np0,np1);
newpoints = LibUtilities::StdQuadData::
newpoints = LibUtilities::StdQuadData::
getNumberOfCoefficients(np,np);
}
break;
......@@ -230,7 +230,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np2 = e->GetBasis(2)->GetNumPoints();
int np = max(np0,max(np1,np2));
newpoints = LibUtilities::StdTetData::
newpoints = LibUtilities::StdTetData::
getNumberOfCoefficients(np,np,np);
}
break;
......@@ -241,7 +241,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np2 = e->GetBasis(2)->GetNumPoints();
int np = max(np0,max(np1,np2));
newpoints = LibUtilities::StdPrismData::
newpoints = LibUtilities::StdPrismData::
getNumberOfCoefficients(np,np,np);
}
break;
......@@ -252,7 +252,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np2 = e->GetBasis(2)->GetNumPoints();
int np = max(np0,max(np1,np2));
newpoints = LibUtilities::StdPyrData::
newpoints = LibUtilities::StdPyrData::
getNumberOfCoefficients(np,np,np);
}
break;
......@@ -263,7 +263,7 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
int np2 = e->GetBasis(2)->GetNumPoints();
int np = max(np0,max(np1,np2));
newpoints = LibUtilities::StdPyrData::
newpoints = LibUtilities::StdPyrData::
getNumberOfCoefficients(np,np,np);
}
break;
......@@ -372,7 +372,6 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
if(m_config["modalenergy"].m_beenSet)
{
Array<OneD, const NekDouble> phys = m_f->m_exp[n]->GetPhys();
for(int i = 0; i < nel; ++i)
{
......@@ -412,16 +411,17 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
}
void ProcessEquiSpacedOutput::GenOrthoModes(int n,
const Array<OneD,const NekDouble> &phys,
Array<OneD, NekDouble> &coeffs)
void ProcessEquiSpacedOutput::GenOrthoModes(
int n,
const Array<OneD,const NekDouble> &phys,
Array<OneD, NekDouble> &coeffs)
{
LocalRegions::ExpansionSharedPtr e;
e = m_f->m_exp[0]->GetExp(n);
switch(e->DetShapeType())
switch(e->DetShapeType())
{
case LibUtilities::eTriangle:
case LibUtilities::eTriangle:
{
int np0 = e->GetBasis(0)->GetNumPoints();
int np1 = e->GetBasis(1)->GetNumPoints();
......@@ -443,9 +443,9 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
phys,Ba,Bb,tophys);
OrthoExp.FwdTrans(tophys,coeffs);
break;
}
break;
case LibUtilities::eQuadrilateral:
case LibUtilities::eQuadrilateral:
{
int np0 = e->GetBasis(0)->GetNumPoints();
int np1 = e->GetBasis(1)->GetNumPoints();
......@@ -465,12 +465,11 @@ void ProcessEquiSpacedOutput::SetupEquiSpacedField(void)
phys,Ba,Bb,tophys);
OrthoExp.FwdTrans(phys,coeffs);
break;
}
break;
default:
ASSERTL0(false,"Shape needs setting up");
break;
default:
ASSERTL0(false,"Shape needs setting up");
break;
}
}
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes vorticity field.
// Description: Set up fields as interpolation to equispaced output.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -69,13 +69,8 @@ void ProcessGrad::Process(po::variables_map &vm)
int i, j;
int expdim = m_f->m_graph->GetMeshDimension();
int spacedim = expdim;
if ((m_f->m_fielddef[0]->m_numHomogeneousDir) == 1 ||
(m_f->m_fielddef[0]->m_numHomogeneousDir) == 2)
{
spacedim = 3;
}
int nfields = m_f->m_fielddef[0]->m_fields.size();
int spacedim = m_f->m_fielddef[0]->m_numHomogeneousDir + expdim;
int nfields = m_f->m_fielddef[0]->m_fields.size();
int addfields = nfields*spacedim;
int npoints = m_f->m_exp[0]->GetNpoints();
......
......@@ -29,12 +29,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes vorticity field.
// Description: Interpolate one field to another.
//
////////////////////////////////////////////////////////////////////////////////
#ifndef UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSFIELD
#define UTILITIES_PREPROCESSING_FIELDCONVERT_PROCESSFIELD
#ifndef UTILITIES_FIELDCONVERT_PROCESSFIELD
#define UTILITIES_FIELDCONVERT_PROCESSFIELD
#include "../Module.h"
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes vorticity field.
// Description: Interpolate point data to a field.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -332,7 +332,7 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
void ProcessInterpPoints::InterpolateFieldToPts(
vector<MultiRegions::ExpListSharedPtr> &field0,
Array<OneD, Array<OneD, NekDouble> > &pts,
Array<OneD, Array<OneD, NekDouble> > &pts,
NekDouble clamp_low,
NekDouble clamp_up,
NekDouble def_value)
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Computes vorticity field.
// Description: Interp point data.
//
////////////////////////////////////////////////////////////////////////////////
......
......@@ -29,7 +29,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//
// Description: Set up fields as interpolation to equispaced output
// Description: Generate isocontours from field data.
//
////////////////////////////////////////////////////////////////////////////////
#include <string>
......@@ -51,7 +51,10 @@ ModuleKey ProcessIsoContour::className =
GetModuleFactory().RegisterCreatorFunction(
ModuleKey(eProcessModule, "isocontour"),
ProcessIsoContour::create,
"Extract an isocontour of fieldid variable and at value fieldvalue, Optionally fieldstr can be specified for a string defiition or smooth for smoothing");
"Extract an isocontour of fieldid variable and at "
"value fieldvalue, Optionally fieldstr can be "
"specified for a string defiition or smooth for "
"smoothing");
ProcessIsoContour::ProcessIsoContour(FieldSharedPtr f) :
ProcessEquiSpacedOutput(f)
......@@ -205,7 +208,8 @@ void TwoPairs (Array<OneD, NekDouble> &cx,
((cz[2]-cz[3])==0.0))
{
pr=4;
} else
}
else
{
pr=3;
}
......@@ -382,7 +386,6 @@ vector<IsoSharedPtr> ProcessIsoContour::ExtractContour(
for(j = 0; j < 3; ++j)
{
iso->set_fields