Commit a61639ba authored by David Moxey's avatar David Moxey

MultiRegions tests now working

parent 1502ab78
......@@ -228,6 +228,15 @@ int main(int argc, char *argv[])
Exp->GetFieldDefinitions();
std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
std::ofstream outfile("blah.vtk");
Exp->WriteVtkHeader(outfile);
for (i = 0; i < Exp->GetExpSize(); ++i)
{
Exp->WriteVtkPieceHeader(outfile, i);
Exp->WriteVtkPieceFooter(outfile, i);
}
Exp->WriteVtkFooter(outfile);
Exp->GlobalToLocal(Exp->GetCoeffs(),Exp->UpdateCoeffs());
for(i = 0; i < FieldDef.size(); ++i)
{
......
......@@ -100,7 +100,7 @@ void InputFld::Process(po::variables_map &vm)
{
for (auto &compIter : domain[d])
{
for (auto &x : *compIter.second)
for (auto &x : compIter.second->m_geomVec)
{
IDs.push_back(x->GetGlobalID());
}
......
......@@ -40,7 +40,7 @@ using namespace std;
#include "OutputInfo.h"
#include <LibUtilities/BasicUtils/FieldIOXml.h>
#include <LibUtilities/BasicUtils/MeshPartition.h>
#include <SpatialDomains/MeshPartition.h>
#include <boost/format.hpp>
namespace Nektar
......@@ -97,13 +97,13 @@ void OutputInfo::Process(po::variables_map &vm)
LibUtilities::SessionReaderSharedPtr vSession =
std::shared_ptr<LibUtilities::SessionReader>(
new LibUtilities::SessionReader(0, 0, files, vComm));
vSession->SetUpXmlDoc();
vSession->InitSession();
// Default partitioner to use is Metis. Use Scotch as default
// if it is installed. Override default with command-line flags
// if they are set.
string vPartitionerName = "Metis";
if (LibUtilities::GetMeshPartitionFactory().ModuleExists("Scotch"))
if (SpatialDomains::GetMeshPartitionFactory().ModuleExists("Scotch"))
{
vPartitionerName = "Scotch";
}
......@@ -116,9 +116,13 @@ void OutputInfo::Process(po::variables_map &vm)
vPartitionerName = "Scotch";
}
LibUtilities::MeshPartitionSharedPtr vMeshPartition =
LibUtilities::GetMeshPartitionFactory().CreateInstance(vPartitionerName,
vSession);
// Construct MeshGraph to read geometry.
SpatialDomains::MeshGraphSharedPtr mesh =
GetMeshGraphFactory().CreateInstance(vSession->GetGeometryType());
SpatialDomains::MeshPartitionSharedPtr vMeshPartition =
SpatialDomains::GetMeshPartitionFactory().CreateInstance(
vPartitionerName, vSession);
vMeshPartition->PartitionMesh(nparts, true);
......
......@@ -38,7 +38,6 @@
using namespace std;
#include "OutputStdOut.h"
#include <LibUtilities/BasicUtils/MeshPartition.h>
#include <boost/format.hpp>
namespace Nektar
......
......@@ -102,8 +102,9 @@ void ProcessAddCompositeID::Process(po::variables_map &vm)
// loop over composite list and search for geometry pointer in list
for (auto &it : CompositeMap)
{
if (find(it.second->begin(), it.second->end(), elmt->GetGeom()) !=
it.second->end())
if (find(it.second->m_geomVec.begin(),
it.second->m_geomVec.end(), elmt->GetGeom()) !=
it.second->m_geomVec.end())
{
compid = it.first;
break;
......
......@@ -120,7 +120,7 @@ void ProcessCreateExp::Process(po::variables_map &vm)
{
for (auto &compIter : domain[d])
{
for (auto &x : *compIter.second)
for (auto &x : *compIter.second->m_geomVec)
{
IDs.push_back(x->GetGlobalID());
}
......
......@@ -314,7 +314,7 @@ namespace Nektar
for (i = 0; i < npoints[0]; i++)
{
physEdge[0][i] = inarray[i];
physEdge[2][i] = inarray[npoints[0]*npoints[1]-1-i];
physEdge[2][i] = inarray[npoints[0]*(npoints[1]-1)+i];
}
for (i = 0; i < npoints[1]; i++)
......@@ -322,7 +322,7 @@ namespace Nektar
physEdge[1][i] =
inarray[npoints[0]-1+i*npoints[0]];
physEdge[3][i] =
inarray[(npoints[1]-1)*npoints[0]-i*npoints[0]];
inarray[i*npoints[0]];
}
for (i = 0; i < 4; i++)
......
......@@ -320,7 +320,7 @@ namespace Nektar
NekDouble sign;
// define an orientation to get EdgeToElmtMapping from Cartesian data
StdRegions::Orientation orient[3] = {StdRegions::eForwards,StdRegions::eForwards,
StdRegions::eBackwards};
StdRegions::eForwards};
for(i = 0; i < 3; i++)
{
......
......@@ -874,6 +874,7 @@ void HexGeom::v_Setup()
{
if(!m_setupState)
{
std::cout << "CALLED SETUP " << m_globalID << std::endl;
for (int i = 0; i < 6; ++i)
{
m_faces[i]->Setup();
......
......@@ -107,7 +107,7 @@ MeshGraphSharedPtr MeshGraph::Read(
// Convert to a vector of chars so that we can broadcast.
std::vector<char> v(geomType.c_str(),
geomType.c_str() + geomType.length() + 1);
geomType.c_str() + geomType.length());
size_t length = v.size();
comm->Bcast(length, 0);
......@@ -127,6 +127,7 @@ MeshGraphSharedPtr MeshGraph::Read(
// Every process then creates a mesh. Partitioning logic takes place inside
// the PartitionMesh function so that we can support different options for
// XML and HDF5.
std::cout << comm->GetRank() << std::endl;
MeshGraphSharedPtr mesh = GetMeshGraphFactory().CreateInstance(geomType);
mesh->PartitionMesh(session);
......
......@@ -168,6 +168,8 @@ void MeshGraphXml::PartitionMesh(
// Read 'lite' geometry information
ReadGeometry(NullDomainRangeShPtr, false);
std::cout << "Read " << m_hexGeoms.size() << " elements" << std::endl;
// Create mesh partitioner.
MeshPartitionSharedPtr partitioner =
GetMeshPartitionFactory().CreateInstance(
......@@ -326,8 +328,7 @@ void MeshGraphXml::ReadGeometry(
m_expansionMapShPtrMap.clear();
m_geomInfo.clear();
m_faceToElMap.clear();
m_domainRange = rng;
m_xmlGeom = m_session->GetElement("NEKTAR/GEOMETRY");
......
......@@ -307,7 +307,13 @@ namespace Nektar
{
fill(signarray.get(), signarray.get()+nEdgeCoeffs, 1);
}
Orientation orient = edgeOrient;
if (eid == 2)
{
orient = orient == eForwards ? eBackwards : eForwards;
}
maparray[0] = eid;
maparray[1] = eid == 2 ? 0 : eid+1;
for (int i = 2; i < nEdgeCoeffs; i++)
......@@ -315,7 +321,7 @@ namespace Nektar
maparray[i] = eid*(nEdgeCoeffs-2)+1+i;
}
if (edgeOrient == eBackwards)
if (orient == eBackwards)
{
reverse(maparray.get(), maparray.get()+nEdgeCoeffs);
}
......@@ -353,13 +359,19 @@ namespace Nektar
{
fill(signarray.get(), signarray.get()+nEdgeIntCoeffs, 1);
}
Orientation orient = edgeOrient;
if (eid == 2)
{
orient = orient == eForwards ? eBackwards : eForwards;
}
for (int i = 0; i < nEdgeIntCoeffs; i++)
{
maparray[i] = eid*nEdgeIntCoeffs+3+i;
}
if (edgeOrient == eBackwards)
if (orient == eBackwards)
{
reverse(maparray.get(), maparray.get()+nEdgeIntCoeffs);
}
......
......@@ -1128,7 +1128,7 @@ namespace Nektar
{
for(i = 0; i < nEdgeIntCoeffs; i++)
{
maparray[i] = nummodes0*(nummodes1-1) + i;
maparray[i] = nummodes0*(nummodes1-1) + i + 1;
}
}
break;
......@@ -1136,7 +1136,7 @@ namespace Nektar
{
for(i = 0; i < nEdgeIntCoeffs; i++)
{
maparray[i] = nummodes0 * i;
maparray[i] = nummodes0 * (i+1);
}
}
break;
......
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