Skip to content
Snippets Groups Projects
Commit f320e33d authored by Müller, Felix's avatar Müller, Felix Committed by Praetorius, Simon
Browse files

replaced calls to leafGridView by globalBasis->gridView, estimator is now accessed by treepath

parent bd9927ab
No related branches found
No related tags found
No related merge requests found
...@@ -18,6 +18,7 @@ namespace AMDiS { ...@@ -18,6 +18,7 @@ namespace AMDiS {
switch (strategy) { switch (strategy) {
case 0: // no refinement/coarsening case 0: // no refinement/coarsening
marker = NULL;
break; break;
case 1: case 1:
msg("Creating global refinement (GR) marker\n"); msg("Creating global refinement (GR) marker\n");
......
...@@ -279,13 +279,19 @@ namespace AMDiS ...@@ -279,13 +279,19 @@ namespace AMDiS
solution_ = std::make_shared<SystemVector>(*globalBasis_, "solution"); solution_ = std::make_shared<SystemVector>(*globalBasis_, "solution");
rhs_ = std::make_shared<SystemVector>(*globalBasis_, "rhs"); rhs_ = std::make_shared<SystemVector>(*globalBasis_, "rhs");
estimates.resize(leafGridView().indexSet().size(0)); systemMatrix = std::make_shared<SystemMatrix>(*globalBasis, *globalBasis, "mat");
for (std::size_t i = 0; i < estimates.size(); i++) { solution = std::make_shared<SystemVector>(*globalBasis, "solution");
estimates[i].resize(nComponents);
for (std::size_t j = 0; j < estimates[i].size(); j++) { auto localView = globalBasis->localView();
forEachNode(localView.tree(), [&,this](auto const& node, auto treePath)
{
std::string i = to_string(treePath);
estimates[i].resize(globalBasis->gridView().indexSet().size(0));
for (std::size_t j = 0; j < estimates[i].size(); j++)
estimates[i][j] = 0.0; // TODO: Remove when estimate() is implemented estimates[i][j] = 0.0; // TODO: Remove when estimate() is implemented
} });
}
rhs_ = std::make_shared<SystemVector>(*globalBasis_, "rhs");
} }
void createSolver() void createSolver()
...@@ -300,7 +306,7 @@ namespace AMDiS ...@@ -300,7 +306,7 @@ namespace AMDiS
} }
void createEstimator() void createEstimator()
{/* {/* COPIED FROM AMDiS
for (std::size_t i = 0, i < nComponents, i++) { for (std::size_t i = 0, i < nComponents, i++) {
std::string estName = ""; std::string estName = "";
Parameters::get(name + "->estimator->name[" + std::to_string(i) + "]", estName); Parameters::get(name + "->estimator->name[" + std::to_string(i) + "]", estName);
...@@ -400,7 +406,7 @@ namespace AMDiS ...@@ -400,7 +406,7 @@ namespace AMDiS
/// A vector with the local element error estimates /// A vector with the local element error estimates
/// reverse indexed by [component index][element index] /// reverse indexed by [component index][element index]
std::vector<std::vector<double> > estimates; std::map<std::string, std::vector<double> > estimates;
/// A block-vector (load-vector) corresponding to the right.hand side /// A block-vector (load-vector) corresponding to the right.hand side
/// of the equation, filled during assembling /// of the equation, filled during assembling
......
...@@ -142,9 +142,11 @@ void ProblemStat<Traits>::createMarker() ...@@ -142,9 +142,11 @@ void ProblemStat<Traits>::createMarker()
return; return;
int i = std::stoi(to_string(treePath)); // TODO: To be removed int i = std::stoi(to_string(treePath)); // TODO: To be removed
// replace with treePath once supported // replace i with treePath once supported
marker.push_back(Marker<Traits>::createMarker( auto marker_ = Marker<Traits>::createMarker(
componentName, i, estimates[i], componentGrids[i])); componentName, i, estimates[std::to_string(i)], componentGrids[i]);
if (marker_)
marker.push_back(marker_);
// If there is more than one marker, and all components are defined // If there is more than one marker, and all components are defined
// on the same grid, the maximum marking has to be enabled. // on the same grid, the maximum marking has to be enabled.
...@@ -379,7 +381,7 @@ Flag ProblemStat<Traits>::refineMesh(AdaptInfo& adaptInfo) ...@@ -379,7 +381,7 @@ Flag ProblemStat<Traits>::refineMesh(AdaptInfo& adaptInfo)
std::map<typename Grid::LocalIdSet::IdType, double> vertexData; std::map<typename Grid::LocalIdSet::IdType, double> vertexData;
// std::map<typename Grid::LocalIdSet::IdType, double> elementData; // std::map<typename Grid::LocalIdSet::IdType, double> elementData;
const auto& gridView = grid->leafGridView(); const auto& gridView = globalBasis->gridView();
const auto& indexSet = gridView.indexSet(); const auto& indexSet = gridView.indexSet();
const auto& idSet = grid->localIdSet(); const auto& idSet = grid->localIdSet();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment