Skip to content

Commit

Permalink
experimenting with parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Brig Bagley committed Feb 24, 2016
1 parent a615a97 commit 5be12c9
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
18 changes: 14 additions & 4 deletions src/core/cuda/randMIS.cu
Original file line number Diff line number Diff line change
Expand Up @@ -551,19 +551,29 @@ void RandMIS_Aggregator<Matrix, Vector>::computePermutation_d(IdxVector_d &adjIn
}

template <class Matrix, class Vector>
void RandMIS_Aggregator<Matrix, Vector>::computePermutation_d(TriMesh *meshPtr, IdxVector_d &permutation, IdxVector_d &ipermutation, IdxVector_d &aggregateIdx, IdxVector_d &partitionIdx, IdxVector_d &partitionLabel, IdxVector_d &adjIndexesOut, IdxVector_d &adjacencyOut, int parameters, int part_max_size, bool verbose)
void RandMIS_Aggregator<Matrix, Vector>::computePermutation_d(TriMesh *meshPtr,
IdxVector_d &permutation, IdxVector_d &ipermutation, IdxVector_d &aggregateIdx,
IdxVector_d &partitionIdx, IdxVector_d &partitionLabel, IdxVector_d &adjIndexesOut,
IdxVector_d &adjacencyOut, int parameters, int part_max_size, bool verbose)
{
IdxVector_d adjIndexesIn, adjacencyIn;
misHelpers::getAdjacency(meshPtr, adjIndexesIn, adjacencyIn);
computePermutation_d(adjIndexesIn, adjacencyIn, permutation, ipermutation, aggregateIdx, partitionIdx, partitionLabel, adjIndexesOut, adjacencyOut, parameters, part_max_size, verbose);
computePermutation_d(adjIndexesIn, adjacencyIn, permutation, ipermutation,
aggregateIdx, partitionIdx, partitionLabel, adjIndexesOut,
adjacencyOut, parameters, part_max_size, verbose);
}

template <class Matrix, class Vector>
void RandMIS_Aggregator<Matrix, Vector>::computePermutation_d(TetMesh *meshPtr, IdxVector_d &permutation, IdxVector_d &ipermutation, IdxVector_d &aggregateIdx, IdxVector_d &partitionIdx, IdxVector_d &partitionLabel, IdxVector_d &adjIndexesOut, IdxVector_d &adjacencyOut, int parameters, int part_max_size, bool verbose)
void RandMIS_Aggregator<Matrix, Vector>::computePermutation_d(TetMesh *meshPtr,
IdxVector_d &permutation, IdxVector_d &ipermutation, IdxVector_d &aggregateIdx,
IdxVector_d &partitionIdx, IdxVector_d &partitionLabel, IdxVector_d &adjIndexesOut,
IdxVector_d &adjacencyOut, int parameters, int part_max_size, bool verbose)
{
IdxVector_d adjIndexesIn, adjacencyIn;
misHelpers::getAdjacency(meshPtr, adjIndexesIn, adjacencyIn);
computePermutation_d(adjIndexesIn, adjacencyIn, permutation, ipermutation, aggregateIdx, partitionIdx, partitionLabel, adjIndexesOut, adjacencyOut, parameters, part_max_size, verbose);
computePermutation_d(adjIndexesIn, adjacencyIn, permutation, ipermutation,
aggregateIdx, partitionIdx, partitionLabel, adjIndexesOut, adjacencyOut,
parameters, part_max_size, verbose);
}

template <class Matrix, class Vector>
Expand Down
21 changes: 19 additions & 2 deletions src/test/sanity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,24 @@ TEST(SanityTests, EggCarton) {
cfg.tetMesh_ = TetMesh::read(
(cfg.filename_ + ".node").c_str(),
(cfg.filename_ + ".ele").c_str(), true, cfg.verbose_);
cfg.topSize_ = 275;
cfg.maxLevels_ = 100;
cfg.maxIters_ = 100;
cfg.preInnerIters_ = 5;
cfg.postInnerIters_ = 5;
cfg.postRelaxes_ = 1;
cfg.cycleIters_ = 1;
cfg.dsType_ = 0;
cfg.topSize_ = 280;
cfg.metisSize_ = 90102;
cfg.partitionMaxSize_ = 512;
cfg.aggregatorType_ = 1;
cfg.convergeType_ = 0;
cfg.tolerance_ = 1e-6;
cfg.cycleType_ = 0;
cfg.solverType_ = 0;
cfg.smootherWeight_ = 1;
cfg.proOmega_ = .67;

size_t num_vert = cfg.tetMesh_->vertices.size();
float lambda = 1.f;
//create the A matrix
Expand Down Expand Up @@ -43,7 +60,7 @@ TEST(SanityTests, EggCarton) {
error += (x_h[i] - x_answer[i]) * (x_h[i] - x_answer[i]);
x_actual.push_back(x_h[i]);
}
std::cout << "The error is : " << std::sqrt(error) << std::endl;
cfg.writeVTK(x_actual, "test_egg_carton2");
ASSERT_TRUE(std::sqrt(error) < 1.);
std::cout << "The error is : " << std::sqrt(error) << std::endl;
}

0 comments on commit 5be12c9

Please sign in to comment.