Liebe Gitlab-Nutzer, lieber Gitlab-Nutzer, es ist nun möglich sich mittels des ZIH-Logins/LDAP an unserem Dienst anzumelden. Ein Anmelden über dieses erzeugt ein neues Konto. Das alte Konto ist über den Reiter "Standard" erreichbar. Die Administratoren

Dear Gitlab user, it is now possible to log in to our service using the ZIH login/LDAP. Logging in via this will create a new account. The old account can be accessed via the "Standard" tab. The administrators

Commit b6a20add authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Some small corrections and interface cleanup

parent d887ec02
...@@ -55,7 +55,7 @@ int main(int argc, char** argv) ...@@ -55,7 +55,7 @@ int main(int argc, char** argv)
std::vector<double> errH1; errH1.reserve(numLevels); std::vector<double> errH1; errH1.reserve(numLevels);
std::vector<double> widths; widths.reserve(numLevels); std::vector<double> widths; widths.reserve(numLevels);
for (int i = 0; i < numLevels; ++i) { for (int i = 0; i < numLevels; ++i) {
prob.getGrid()->globalRefine(1); prob.grid().globalRefine(1);
auto gridView = prob.gridView(); auto gridView = prob.gridView();
double h = 0; double h = 0;
......
#pragma once #pragma once
#include <dune/functions/functionspacebases/subspacebasis.hh> #include <dune/functions/functionspacebases/subspacebasis.hh>
#include <dune/typetree/traversal.hh>
#include <amdis/utility/TreePath.hpp> #include <amdis/utility/TreePath.hpp>
#include <amdis/utility/Visitor.hpp>
#include <amdis/common/Math.hpp> #include <amdis/common/Math.hpp>
......
...@@ -45,7 +45,7 @@ void ProblemInstat<Traits>::createUhOld() ...@@ -45,7 +45,7 @@ void ProblemInstat<Traits>::createUhOld()
if (oldSolution) if (oldSolution)
warning("oldSolution already created\n"); warning("oldSolution already created\n");
else // create oldSolution else // create oldSolution
oldSolution.reset(new SystemVector(*problemStat.globalBasis(), name + "_uOld")); oldSolution.reset(new SystemVector(problemStat.globalBasis(), name + "_uOld"));
} }
......
...@@ -40,6 +40,10 @@ ...@@ -40,6 +40,10 @@
namespace AMDiS namespace AMDiS
{ {
// forward declaration
template <class Traits>
class ProblemInstat;
template <class Traits> template <class Traits>
class ProblemStat class ProblemStat
: public ProblemStatBase : public ProblemStatBase
...@@ -47,6 +51,8 @@ namespace AMDiS ...@@ -47,6 +51,8 @@ namespace AMDiS
{ {
using Self = ProblemStat; using Self = ProblemStat;
friend class ProblemInstat<Traits>;
public: // typedefs and static constants public: // typedefs and static constants
using GlobalBasis = typename Traits::GlobalBasis; using GlobalBasis = typename Traits::GlobalBasis;
...@@ -153,15 +159,18 @@ namespace AMDiS ...@@ -153,15 +159,18 @@ namespace AMDiS
public: // get-methods public: // get-methods
/// Returns a pointer to system-matrix, \ref systemMatrix_ /// Returns a reference to system-matrix, \ref systemMatrix_
std::shared_ptr<SystemMatrix> getSystemMatrix() { return systemMatrix_; } SystemMatrix& getSystemMatrix() { return *systemMatrix_; }
std::shared_ptr<SystemMatrix> getSystemMatrix() const { return systemMatrix_; } SystemMatrix const& getSystemMatrix() const { return *systemMatrix_; }
/// Returns a reference to the solution vector, \ref solution_
SystemVector& getSolutionVector() { return *solution_; }
SystemVector const& getSolutionVector() const { return *solution_; }
/// Return a reference to the rhs system-vector, \ref rhs
SystemVector& getRhsVector() { return *rhs_; }
SystemVector const& getRhsVector() const { return *rhs_; }
/// Returns a pointer to the solution vector, \ref solution_
std::shared_ptr<SystemVector> getSolutionVector() const
{
return solution_;
}
/// Return a mutable view to a solution component /// Return a mutable view to a solution component
template <class TreePath = RootTreePath> template <class TreePath = RootTreePath>
...@@ -180,27 +189,25 @@ namespace AMDiS ...@@ -180,27 +189,25 @@ namespace AMDiS
} }
/// Return a point to the rhs system-vector, \ref rhs /// Return a reference to the linear solver, \ref linearSolver
std::shared_ptr<SystemVector> getRhsVector() { return rhs_; } LinearSolverType& getSolver() { return *linearSolver_; }
std::shared_ptr<SystemVector> getRhsVector() const { return rhs_; } LinearSolverType const& getSolver() const { return *linearSolver_; }
/// Return a pointer to the linear solver, \ref linearSolver
std::shared_ptr<LinearSolverType> getSolver() { return linearSolver_; }
/// Set a new linear solver for the problem
void setSolver(std::shared_ptr<LinearSolverType> const& solver) void setSolver(std::shared_ptr<LinearSolverType> const& solver)
{ {
linearSolver_ = solver; linearSolver_ = solver;
} }
/// Return a pointer to the grid, \ref grid /// Return a reference to the grid, \ref grid
std::shared_ptr<Grid> getGrid() { return grid_; } Grid& grid() { return *grid_; }
Grid const& grid() const { return *grid_; }
/// Set the mesh. Stores pointer to passed reference and initializes feSpaces /// Set the grid. Stores pointer and initializes feSpaces
/// matrices and vectors, as well as the file-writer. /// matrices and vectors, as well as the file-writer.
void setGrid(Grid& grid) void setGrid(std::shared_ptr<Grid> const& grid)
{ {
grid_ = Dune::stackobject_to_shared_ptr(grid); grid_ = grid;
createGlobalBasis(); createGlobalBasis();
createMatricesAndVectors(); createMatricesAndVectors();
...@@ -208,10 +215,10 @@ namespace AMDiS ...@@ -208,10 +215,10 @@ namespace AMDiS
} }
/// Return the gridView of the leaf-level /// Return the gridView of the leaf-level
auto const& gridView() { return globalBasis_->gridView(); } GridView const& gridView() { return globalBasis_->gridView(); }
/// Return the \ref feSpaces /// Return the \ref feSpaces
std::shared_ptr<GlobalBasis> const& globalBasis() { return globalBasis_; } GlobalBasis const& globalBasis() { return *globalBasis_; }
/// Implementation of \ref ProblemStatBase::getName /// Implementation of \ref ProblemStatBase::getName
...@@ -240,7 +247,7 @@ namespace AMDiS ...@@ -240,7 +247,7 @@ namespace AMDiS
void createGlobalBasis(std::false_type) void createGlobalBasis(std::false_type)
{ {
error_exit("Can not create GlobalBasis from type. Pass a BasisCreator instead!"); error_exit("Cannot create GlobalBasis from type. Pass a BasisCreator instead!");
} }
void createGrid() void createGrid()
......
...@@ -10,6 +10,8 @@ install(FILES ...@@ -10,6 +10,8 @@ install(FILES
MultiIndex.hpp MultiIndex.hpp
RangeType.hpp RangeType.hpp
String.hpp String.hpp
Traversal.hpp
TreeData.hpp TreeData.hpp
TreePath.hpp TreePath.hpp
Visitor.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/utility) DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/amdis/utility)
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
//#include <dune/typetree/traversal.hh>
#include <dune/typetree/typetree.hh> #include <dune/typetree/typetree.hh>
#include <amdis/utility/Visitor.hpp> #include <amdis/utility/Visitor.hpp>
......
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