Commit 92a9d46b authored by Dave Moxey's avatar Dave Moxey

Run new FieldUtils library through clang-format

parent 38c18f5b
...@@ -14,4 +14,3 @@ IndentCaseLabels: true ...@@ -14,4 +14,3 @@ IndentCaseLabels: true
Standard: Cpp03 Standard: Cpp03
AccessModifierOffset: -4 AccessModifierOffset: -4
BinPackParameters: false BinPackParameters: false
BinPackArguments: false
...@@ -39,25 +39,25 @@ ...@@ -39,25 +39,25 @@
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <LibUtilities/BasicUtils/NekFactory.hpp> #include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/PtsField.h> #include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/SessionReader.h> #include <LibUtilities/BasicUtils/SessionReader.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <SpatialDomains/MeshGraph.h> #include <SpatialDomains/MeshGraph.h>
#include <MultiRegions/ExpList.h>
#include <MultiRegions/ContField1D.h> #include <MultiRegions/ContField1D.h>
#include <MultiRegions/ExpList2DHomogeneous1D.h>
#include <MultiRegions/ContField3DHomogeneous1D.h>
#include <MultiRegions/ContField3DHomogeneous2D.h>
#include <MultiRegions/ContField2D.h> #include <MultiRegions/ContField2D.h>
#include <MultiRegions/ContField3D.h> #include <MultiRegions/ContField3D.h>
#include <MultiRegions/ContField3DHomogeneous1D.h>
#include <MultiRegions/ContField3DHomogeneous2D.h>
#include <MultiRegions/ExpList.h>
#include <MultiRegions/ExpList2DHomogeneous1D.h>
#include <MultiRegions/DisContField1D.h> #include <MultiRegions/DisContField1D.h>
#include <MultiRegions/DisContField3DHomogeneous1D.h>
#include <MultiRegions/DisContField3DHomogeneous2D.h>
#include <MultiRegions/DisContField2D.h> #include <MultiRegions/DisContField2D.h>
#include <MultiRegions/DisContField3D.h> #include <MultiRegions/DisContField3D.h>
#include <MultiRegions/DisContField3DHomogeneous1D.h>
#include <MultiRegions/DisContField3DHomogeneous2D.h>
#include "FieldUtilsDeclspec.h" #include "FieldUtilsDeclspec.h"
...@@ -68,16 +68,16 @@ namespace Nektar ...@@ -68,16 +68,16 @@ namespace Nektar
namespace FieldUtils namespace FieldUtils
{ {
struct Field { struct Field
FIELD_UTILS_EXPORT Field() : m_verbose(false), {
m_declareExpansionAsContField(false), FIELD_UTILS_EXPORT Field()
m_declareExpansionAsDisContField(false), : m_verbose(false), m_declareExpansionAsContField(false),
m_requireBoundaryExpansion(false), m_declareExpansionAsDisContField(false),
m_writeBndFld(false), m_requireBoundaryExpansion(false), m_writeBndFld(false),
m_fldToBnd(false), m_fldToBnd(false), m_addNormals(false),
m_addNormals(false), m_setUpEquiSpacedFields(false), m_fieldPts(LibUtilities::NullPtsField)
m_setUpEquiSpacedFields(false), {
m_fieldPts(LibUtilities::NullPtsField){} }
FIELD_UTILS_EXPORT ~Field() FIELD_UTILS_EXPORT ~Field()
{ {
...@@ -86,54 +86,53 @@ struct Field { ...@@ -86,54 +86,53 @@ struct Field {
m_comm->Finalise(); m_comm->Finalise();
} }
} }
bool m_verbose; bool m_verbose;
vector<LibUtilities::FieldDefinitionsSharedPtr> m_fielddef; vector<LibUtilities::FieldDefinitionsSharedPtr> m_fielddef;
vector<vector<double> > m_data; vector<vector<double> > m_data;
vector<MultiRegions::ExpListSharedPtr> m_exp; vector<MultiRegions::ExpListSharedPtr> m_exp;
bool m_declareExpansionAsContField; bool m_declareExpansionAsContField;
bool m_declareExpansionAsDisContField; bool m_declareExpansionAsDisContField;
bool m_requireBoundaryExpansion; bool m_requireBoundaryExpansion;
bool m_useFFT; bool m_useFFT;
LibUtilities::CommSharedPtr m_comm; LibUtilities::CommSharedPtr m_comm;
LibUtilities::SessionReaderSharedPtr m_session; LibUtilities::SessionReaderSharedPtr m_session;
SpatialDomains::MeshGraphSharedPtr m_graph; SpatialDomains::MeshGraphSharedPtr m_graph;
LibUtilities::FieldIOSharedPtr m_fld; LibUtilities::FieldIOSharedPtr m_fld;
LibUtilities::PtsIOSharedPtr m_ptsIO; LibUtilities::PtsIOSharedPtr m_ptsIO;
map<string, vector<string> > m_inputfiles; map<string, vector<string> > m_inputfiles;
bool m_writeBndFld; bool m_writeBndFld;
vector<unsigned int> m_bndRegionsToWrite; vector<unsigned int> m_bndRegionsToWrite;
bool m_fldToBnd; bool m_fldToBnd;
bool m_addNormals; bool m_addNormals;
bool m_setUpEquiSpacedFields; bool m_setUpEquiSpacedFields;
LibUtilities::PtsFieldSharedPtr m_fieldPts; LibUtilities::PtsFieldSharedPtr m_fieldPts;
MultiRegions::AssemblyMapCGSharedPtr m_locToGlobalMap; MultiRegions::AssemblyMapCGSharedPtr m_locToGlobalMap;
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap; LibUtilities::FieldMetaDataMap m_fieldMetaDataMap;
FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr SetUpFirstExpList( FIELD_UTILS_EXPORT MultiRegions::ExpListSharedPtr SetUpFirstExpList(
int NumHomogeneousDir, int NumHomogeneousDir, bool fldfilegiven = false)
bool fldfilegiven = false)
{ {
MultiRegions::ExpListSharedPtr exp; MultiRegions::ExpListSharedPtr exp;
// Set up expansion list // Set up expansion list
int expdim = m_graph->GetMeshDimension(); int expdim = m_graph->GetMeshDimension();
bool dealiasing = false; bool dealiasing = false;
m_session->MatchSolverInfo("USEFFT", "FFTW", m_useFFT, false); m_session->MatchSolverInfo("USEFFT", "FFTW", m_useFFT, false);
switch (expdim) switch (expdim)
{ {
case 1: case 1:
{ {
ASSERTL0(NumHomogeneousDir <= 2, ASSERTL0(NumHomogeneousDir <= 2,
"Quasi-3D approach is only set up for 1 or 2 " "Quasi-3D approach is only set up for 1 or 2 "
...@@ -148,7 +147,7 @@ struct Field { ...@@ -148,7 +147,7 @@ struct Field {
NekDouble ly; NekDouble ly;
LibUtilities::BasisType btype; LibUtilities::BasisType btype;
if(fldfilegiven) if (fldfilegiven)
{ {
nplanes = m_fielddef[0]->m_numModes[1]; nplanes = m_fielddef[0]->m_numModes[1];
ly = m_fielddef[0]->m_homogeneousLengths[0]; ly = m_fielddef[0]->m_homogeneousLengths[0];
...@@ -157,43 +156,40 @@ struct Field { ...@@ -157,43 +156,40 @@ struct Field {
else else
{ {
m_session->LoadParameter("HomModesZ", nplanes); m_session->LoadParameter("HomModesZ", nplanes);
m_session->LoadParameter("LY",ly); m_session->LoadParameter("LY", ly);
btype = LibUtilities::eFourier; btype = LibUtilities::eFourier;
} }
// Choose points to be at evenly spaced points at // Choose points to be at evenly spaced points at
// nplanes points // nplanes points
const LibUtilities::PointsKey const LibUtilities::PointsKey Pkey(
Pkey(nplanes, LibUtilities::eFourierEvenlySpaced); nplanes, LibUtilities::eFourierEvenlySpaced);
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey); const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
if (m_declareExpansionAsContField ||
m_declareExpansionAsDisContField)
if(m_declareExpansionAsContField||
m_declareExpansionAsDisContField)
{ {
ASSERTL0(false,"ContField2DHomogeneous1D or " ASSERTL0(false, "ContField2DHomogeneous1D or "
"DisContField2DHomogenenous1D has " "DisContField2DHomogenenous1D has "
"not been implemented"); "not been implemented");
} }
Exp2DH1 = MemoryManager<MultiRegions:: Exp2DH1 =
ExpList2DHomogeneous1D>:: MemoryManager<MultiRegions::ExpList2DHomogeneous1D>::
AllocateSharedPtr(m_session, Bkey, ly, AllocateSharedPtr(m_session, Bkey, ly, m_useFFT,
m_useFFT, dealiasing, dealiasing, m_graph);
m_graph);
exp = Exp2DH1; exp = Exp2DH1;
} }
else if (NumHomogeneousDir == 2) else if (NumHomogeneousDir == 2)
{ {
MultiRegions::ExpList3DHomogeneous2DSharedPtr Exp3DH2; MultiRegions::ExpList3DHomogeneous2DSharedPtr Exp3DH2;
int nylines,nzlines; int nylines, nzlines;
NekDouble ly,lz; NekDouble ly, lz;
LibUtilities::BasisType btype1,btype2; LibUtilities::BasisType btype1, btype2;
if(fldfilegiven) if (fldfilegiven)
{ {
nylines = m_fielddef[0]->m_numModes[1]; nylines = m_fielddef[0]->m_numModes[1];
nzlines = m_fielddef[0]->m_numModes[2]; nzlines = m_fielddef[0]->m_numModes[2];
...@@ -206,47 +202,44 @@ struct Field { ...@@ -206,47 +202,44 @@ struct Field {
{ {
m_session->LoadParameter("HomModesY", nylines); m_session->LoadParameter("HomModesY", nylines);
m_session->LoadParameter("HomModesZ", nzlines); m_session->LoadParameter("HomModesZ", nzlines);
m_session->LoadParameter("LY",ly); m_session->LoadParameter("LY", ly);
m_session->LoadParameter("LZ",lz); m_session->LoadParameter("LZ", lz);
btype1 = LibUtilities::eFourier; btype1 = LibUtilities::eFourier;
btype2 = LibUtilities::eFourier; btype2 = LibUtilities::eFourier;
} }
// Choose points to be at evenly spaced points at // Choose points to be at evenly spaced points at
// nplanes points // nplanes points
const LibUtilities::PointsKey const LibUtilities::PointsKey PkeyY(
PkeyY(nylines, LibUtilities::eFourierEvenlySpaced); nylines, LibUtilities::eFourierEvenlySpaced);
const LibUtilities::BasisKey BkeyY(btype1, nylines, PkeyY); const LibUtilities::BasisKey BkeyY(btype1, nylines, PkeyY);
const LibUtilities::PointsKey const LibUtilities::PointsKey PkeyZ(
PkeyZ(nzlines, LibUtilities::eFourierEvenlySpaced); nzlines, LibUtilities::eFourierEvenlySpaced);
const LibUtilities::BasisKey BkeyZ(btype2, nzlines, PkeyZ); const LibUtilities::BasisKey BkeyZ(btype2, nzlines, PkeyZ);
if(m_declareExpansionAsContField) if (m_declareExpansionAsContField)
{ {
Exp3DH2 = MemoryManager<MultiRegions:: Exp3DH2 = MemoryManager<
ContField3DHomogeneous2D>:: MultiRegions::ContField3DHomogeneous2D>::
AllocateSharedPtr(m_session, BkeyY, BkeyZ, AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
ly, lz, m_useFFT, dealiasing, m_useFFT, dealiasing, m_graph,
m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else if(m_declareExpansionAsDisContField) else if (m_declareExpansionAsDisContField)
{ {
Exp3DH2 = MemoryManager<MultiRegions:: Exp3DH2 = MemoryManager<
DisContField3DHomogeneous2D>:: MultiRegions::DisContField3DHomogeneous2D>::
AllocateSharedPtr(m_session, BkeyY, BkeyZ, AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
ly, lz, m_useFFT, dealiasing, m_useFFT, dealiasing, m_graph,
m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else else
{ {
Exp3DH2 = MemoryManager<MultiRegions:: Exp3DH2 = MemoryManager<
ExpList3DHomogeneous2D>:: MultiRegions::ExpList3DHomogeneous2D>::
AllocateSharedPtr(m_session, BkeyY, BkeyZ, AllocateSharedPtr(m_session, BkeyY, BkeyZ, ly, lz,
ly, lz, m_useFFT, dealiasing, m_useFFT, dealiasing, m_graph);
m_graph);
} }
exp = Exp3DH2; exp = Exp3DH2;
...@@ -255,29 +248,29 @@ struct Field { ...@@ -255,29 +248,29 @@ struct Field {
{ {
MultiRegions::ExpList1DSharedPtr Exp1D; MultiRegions::ExpList1DSharedPtr Exp1D;
if(m_declareExpansionAsContField) if (m_declareExpansionAsContField)
{ {
Exp1D = MemoryManager<MultiRegions::ContField1D> Exp1D = MemoryManager<MultiRegions::ContField1D>::
::AllocateSharedPtr(m_session, m_graph, AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else if(m_declareExpansionAsDisContField) else if (m_declareExpansionAsDisContField)
{ {
Exp1D = MemoryManager<MultiRegions::DisContField1D> Exp1D = MemoryManager<MultiRegions::DisContField1D>::
::AllocateSharedPtr(m_session, m_graph, AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else else
{ {
Exp1D = MemoryManager<MultiRegions::ExpList1D> Exp1D = MemoryManager<MultiRegions::ExpList1D>::
::AllocateSharedPtr(m_session, m_graph); AllocateSharedPtr(m_session, m_graph);
} }
exp = Exp1D; exp = Exp1D;
} }
} }
break; break;
case 2: case 2:
{ {
ASSERTL0(NumHomogeneousDir <= 1, ASSERTL0(NumHomogeneousDir <= 1,
"NumHomogeneousDir is only set up for 1"); "NumHomogeneousDir is only set up for 1");
...@@ -291,16 +284,17 @@ struct Field { ...@@ -291,16 +284,17 @@ struct Field {
NekDouble lz; NekDouble lz;
LibUtilities::BasisType btype; LibUtilities::BasisType btype;
if(fldfilegiven) if (fldfilegiven)
{ {
nplanes = m_fielddef[0]->m_numModes[2]; nplanes = m_fielddef[0]->m_numModes[2];
lz = m_fielddef[0]->m_homogeneousLengths[0]; lz = m_fielddef[0]->m_homogeneousLengths[0];
btype = m_fielddef[0]->m_basis[2]; btype = m_fielddef[0]->m_basis[2];
if (btype == LibUtilities::eFourierSingleMode) if (btype == LibUtilities::eFourierSingleMode)
{ {
btype = LibUtilities::eFourier; btype = LibUtilities::eFourier;
m_fielddef[0]->m_basis[2] = LibUtilities::eFourierSingleMode; m_fielddef[0]->m_basis[2] =
LibUtilities::eFourierSingleMode;
if (nplanes <= 2) if (nplanes <= 2)
{ {
nplanes = 4; nplanes = 4;
...@@ -310,38 +304,37 @@ struct Field { ...@@ -310,38 +304,37 @@ struct Field {
else else
{ {
m_session->LoadParameter("HomModesZ", nplanes); m_session->LoadParameter("HomModesZ", nplanes);
m_session->LoadParameter("LZ",lz); m_session->LoadParameter("LZ", lz);
btype = LibUtilities::eFourier; btype = LibUtilities::eFourier;
} }
// Choose points to be at evenly spaced points at // Choose points to be at evenly spaced points at
// nplanes points // nplanes points
const LibUtilities::PointsKey const LibUtilities::PointsKey Pkey(
Pkey(nplanes, LibUtilities::eFourierEvenlySpaced); nplanes, LibUtilities::eFourierEvenlySpaced);
const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey); const LibUtilities::BasisKey Bkey(btype, nplanes, Pkey);
if(m_declareExpansionAsContField) if (m_declareExpansionAsContField)
{ {
Exp3DH1 = MemoryManager<MultiRegions:: Exp3DH1 = MemoryManager<
ContField3DHomogeneous1D>:: MultiRegions::ContField3DHomogeneous1D>::
AllocateSharedPtr(m_session, Bkey, lz, m_useFFT, AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
dealiasing, m_graph, dealiasing, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else if (m_declareExpansionAsDisContField) else if (m_declareExpansionAsDisContField)
{ {
Exp3DH1 = MemoryManager<MultiRegions:: Exp3DH1 = MemoryManager<
DisContField3DHomogeneous1D>:: MultiRegions::DisContField3DHomogeneous1D>::
AllocateSharedPtr(m_session, AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
Bkey, lz, m_useFFT,
dealiasing, m_graph, dealiasing, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else else
{ {
Exp3DH1 = MemoryManager<MultiRegions:: Exp3DH1 = MemoryManager<
ExpList3DHomogeneous1D>:: MultiRegions::ExpList3DHomogeneous1D>::
AllocateSharedPtr(m_session, Bkey, lz, m_useFFT, AllocateSharedPtr(m_session, Bkey, lz, m_useFFT,
dealiasing, m_graph); dealiasing, m_graph);
} }
...@@ -351,67 +344,66 @@ struct Field { ...@@ -351,67 +344,66 @@ struct Field {
{ {
MultiRegions::ExpList2DSharedPtr Exp2D; MultiRegions::ExpList2DSharedPtr Exp2D;
if(m_declareExpansionAsContField) if (m_declareExpansionAsContField)
{ {
Exp2D = MemoryManager<MultiRegions::ContField2D> Exp2D = MemoryManager<MultiRegions::ContField2D>::
::AllocateSharedPtr(m_session,m_graph, AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else if(m_declareExpansionAsDisContField) else if (m_declareExpansionAsDisContField)
{ {
Exp2D = MemoryManager<MultiRegions::DisContField2D> Exp2D = MemoryManager<MultiRegions::DisContField2D>::
::AllocateSharedPtr(m_session,m_graph, AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else else
{ {
Exp2D = MemoryManager<MultiRegions::ExpList2D> Exp2D = MemoryManager<MultiRegions::ExpList2D>::
::AllocateSharedPtr(m_session,m_graph); AllocateSharedPtr(m_session, m_graph);
} }
exp = Exp2D; exp = Exp2D;
} }
} }
break; break;
case 3: case 3:
{ {
MultiRegions::ExpList3DSharedPtr Exp3D; MultiRegions::ExpList3DSharedPtr Exp3D;
if(m_declareExpansionAsContField) if (m_declareExpansionAsContField)
{ {
Exp3D = MemoryManager<MultiRegions::ContField3D> Exp3D = MemoryManager<MultiRegions::ContField3D>::
::AllocateSharedPtr(m_session,m_graph, AllocateSharedPtr(m_session, m_graph,
m_session->GetVariable(0)); m_session->GetVariable(0));
} }
else if(m_declareExpansionAsDisContField) else if (m_declareExpansionAsDisContField)
{ {
Exp3D = MemoryManager<MultiRegions::DisContField3D> Exp3D = MemoryManager<MultiRegions::DisContField3D>::
::AllocateSharedPtr(m_session,m_graph,