Commit 3c2d7f72 authored by Douglas Serson's avatar Douglas Serson
Browse files

Change field definitions for homogeneous strips case

parent 8889ff6a
......@@ -219,6 +219,11 @@ namespace Nektar
shapeStringStream << "-HomogenousExp2D";
}
if (fielddefs[f]->m_homoStrips)
{
shapeStringStream << "-Strips";
}
shapeString = shapeStringStream.str();
}
elemTag->SetAttribute("SHAPE", shapeString);
......@@ -818,6 +823,14 @@ namespace Nektar
attr = attr->Next();
}
// Check to see if using strips formulation
bool strips = false;
if(shapeString.find("Strips")!=string::npos)
{
strips = true;
}
// Check to see if homogeneous expansion and if so
// strip down the shapeString definition
int numHomoDir = 0;
......@@ -889,7 +902,7 @@ namespace Nektar
// Get Homogeneous strips IDs
std::vector<unsigned int> homoSIDs;
if(numHomoDir == 1)
if(strips)
{
valid = ParseUtils::GenerateSeqVector(homoSIDsString.c_str(), homoSIDs);
ASSERTL0(valid, "Unable to correctly parse homogeneous strips IDs.");
......@@ -963,7 +976,11 @@ namespace Nektar
valid = ParseUtils::GenerateOrderedStringVector(fieldsString.c_str(), Fields);
ASSERTL0(valid, "Unable to correctly parse the number of fields.");
FieldDefinitionsSharedPtr fielddef = MemoryManager<FieldDefinitions>::AllocateSharedPtr(shape, elementIds, basis, UniOrder, numModes, Fields, numHomoDir, homoLengths, homoSIDs, homoZIDs, homoYIDs, points, pointDef, numPoints, numPointDef);
FieldDefinitionsSharedPtr fielddef =
MemoryManager<FieldDefinitions>::AllocateSharedPtr(shape,
elementIds, basis, UniOrder, numModes, Fields, numHomoDir,
homoLengths, strips, homoSIDs, homoZIDs, homoYIDs,
points, pointDef, numPoints, numPointDef);
fielddefs.push_back(fielddef);
......
......@@ -79,6 +79,7 @@ namespace Nektar
int NumHomoDir = 0,
const std::vector<NekDouble> &HomoLengths =
NullNekDoubleVector,
bool homoStrips = false,
const std::vector<unsigned int> &HomoSIDs =
NullUnsignedIntVector,
const std::vector<unsigned int> &HomoZIDs =
......@@ -96,6 +97,7 @@ namespace Nektar
m_basis(basis),
m_numHomogeneousDir(NumHomoDir),
m_homogeneousLengths(HomoLengths),
m_homoStrips(homoStrips),
m_homogeneousSIDs(HomoSIDs),
m_homogeneousZIDs(HomoZIDs),
m_homogeneousYIDs(HomoYIDs),
......@@ -109,14 +111,15 @@ namespace Nektar
{
}
ShapeType m_shapeType;
std::vector<unsigned int> m_elementIDs;
ShapeType m_shapeType;
std::vector<unsigned int> m_elementIDs;
std::vector<LibUtilities::BasisType> m_basis;
int m_numHomogeneousDir;
std::vector<NekDouble> m_homogeneousLengths;
int m_numHomogeneousDir;
std::vector<NekDouble> m_homogeneousLengths;
bool m_homoStrips;
std::vector<unsigned int> m_homogeneousSIDs;
std::vector<unsigned int> m_homogeneousZIDs;
std::vector<unsigned int> m_homogeneousYIDs;
std::vector<unsigned int> m_homogeneousZIDs;
std::vector<unsigned int> m_homogeneousYIDs;
/// Define the type of points per direction.
std::vector<LibUtilities::PointsType> m_points;
......
......@@ -71,7 +71,7 @@ namespace Nektar
{
#ifndef NEKTAR_MAX_MEMORY_MANAGER_CONSTRUCTOR_ARGS
#define NEKTAR_MAX_MEMORY_MANAGER_CONSTRUCTOR_ARGS 16
#define NEKTAR_MAX_MEMORY_MANAGER_CONSTRUCTOR_ARGS 20
#endif //NEKTAR_MAX_MEMORY_MANAGER_CONSTRUCTOR_ARGS
/// @brief General purpose memory allocation routines with the ability
......
......@@ -1938,6 +1938,7 @@ namespace Nektar
int NumHomoDir,
Array<OneD, LibUtilities::BasisSharedPtr> &HomoBasis,
std::vector<NekDouble> &HomoLen,
bool homoStrips,
std::vector<unsigned int> &HomoSIDs,
std::vector<unsigned int> &HomoZIDs,
std::vector<unsigned int> &HomoYIDs)
......@@ -2030,8 +2031,8 @@ namespace Nektar
MemoryManager<LibUtilities::FieldDefinitions>::
AllocateSharedPtr(shape, elementIDs, basis,
UniOrder, numModes,fields,
NumHomoDir, HomoLen, HomoSIDs,
HomoZIDs, HomoYIDs);
NumHomoDir, HomoLen, homoStrips,
HomoSIDs, HomoZIDs, HomoYIDs);
fielddef.push_back(fdef);
}
}
......
......@@ -737,6 +737,7 @@ namespace Nektar
LibUtilities::NullBasisSharedPtr1DArray,
std::vector<NekDouble> &HomoLen =
LibUtilities::NullNekDoubleVector,
bool homoStrips = false,
std::vector<unsigned int> &HomoSIDs =
LibUtilities::NullUnsignedIntVector,
std::vector<unsigned int> &HomoZIDs =
......
......@@ -106,6 +106,7 @@ namespace Nektar
ExpListHomogeneous1D::ExpListHomogeneous1D(const ExpListHomogeneous1D &In):
ExpList(In,false),
m_transposition(In.m_transposition),
m_StripZcomm(In.m_StripZcomm),
m_useFFT(In.m_useFFT),
m_FFT(In.m_FFT),
m_tmpIN(In.m_tmpIN),
......@@ -114,8 +115,7 @@ namespace Nektar
m_lhom(In.m_lhom),
m_homogeneous1DBlockMat(In.m_homogeneous1DBlockMat),
m_dealiasing(In.m_dealiasing),
m_padsize(In.m_padsize),
m_StripZcomm(In.m_StripZcomm)
m_padsize(In.m_padsize)
{
m_planes = Array<OneD, ExpListSharedPtr>(In.m_planes.num_elements());
}
......@@ -608,7 +608,12 @@ namespace Nektar
std::vector<unsigned int> StripsIDs;
StripsIDs.push_back(m_transposition->GetStripID());
bool strips;
m_session->MatchSolverInfo("HomoStrip","True",strips,false);
if (strips)
{
StripsIDs.push_back(m_transposition->GetStripID());
}
std::vector<unsigned int> PlanesIDs;
......@@ -617,7 +622,8 @@ namespace Nektar
PlanesIDs.push_back(m_transposition->GetPlaneID(i));
}
m_planes[0]->GeneralGetFieldDefinitions(returnval, 1, HomoBasis, HomoLen, StripsIDs, PlanesIDs);
m_planes[0]->GeneralGetFieldDefinitions(returnval, 1, HomoBasis,
HomoLen, strips, StripsIDs, PlanesIDs);
return returnval;
}
......@@ -631,7 +637,12 @@ namespace Nektar
std::vector<unsigned int> StripsIDs;
StripsIDs.push_back(m_transposition->GetStripID());
bool strips;
m_session->MatchSolverInfo("HomoStrip","True",strips,false);
if (strips)
{
StripsIDs.push_back(m_transposition->GetStripID());
}
std::vector<unsigned int> PlanesIDs;
......@@ -641,7 +652,8 @@ namespace Nektar
}
// enforce NumHomoDir == 1 by direct call
m_planes[0]->GeneralGetFieldDefinitions(fielddef, 1, HomoBasis, HomoLen, StripsIDs, PlanesIDs);
m_planes[0]->GeneralGetFieldDefinitions(fielddef, 1, HomoBasis,
HomoLen, strips, StripsIDs, PlanesIDs);
}
......
......@@ -608,7 +608,8 @@ namespace Nektar
}
m_lines[0]->GeneralGetFieldDefinitions(returnval, 2, HomoBasis,
HomoLen, sIDs, zIDs, yIDs);
HomoLen, false,
sIDs, zIDs, yIDs);
return returnval;
}
......@@ -642,7 +643,8 @@ namespace Nektar
// enforce NumHomoDir == 1 by direct call
m_lines[0]->GeneralGetFieldDefinitions(fielddef, 2, HomoBasis,
HomoLen, sIDs, zIDs, yIDs);
HomoLen, false,
sIDs, zIDs, yIDs);
}
void ExpListHomogeneous2D::v_AppendFieldData(LibUtilities::FieldDefinitionsSharedPtr &fielddef, std::vector<NekDouble> &fielddata, Array<OneD, NekDouble> &coeffs)
......
  • @d.serson hi, The changes in your commit looks very better, I totally agree with you!

Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment