Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • feature/blockgssteps_autoCopy
  • feature/cmakelists-sources-target
  • feature/incomplete-cholesky-rebased
  • feature/istl-preconditioners
  • feature/optional-ignore
  • feature/update-buildsystem
  • feature/update-to-clang-7
  • feature/use-smart-ptr-ignorenodes
  • feature/whitespace-fix
  • fix/error-norm
  • fix_linking_module
  • flexible-loopsolver-max
  • generalized-blockgsstep-rebased
  • implement-overlappingblockgsstep
  • make-getiterationstep-return-shared-ptr
  • master
  • more-features-for-cholmodsolver
  • new_interface
  • releases/2.0-1
  • releases/2.1-1
  • releases/2.10
  • releases/2.2-1
  • releases/2.3-1
  • releases/2.4-1
  • releases/2.5-1
  • releases/2.6-1
  • releases/2.7
  • releases/2.8
  • releases/2.9
  • subversion->git
30 results

Target

Select target project
  • lisa_julia.nebel_at_tu-dresden.de/dune-solvers
  • patrick.jaap_at_tu-dresden.de/dune-solvers
  • burchardt_at_igpm.rwth-aachen.de/dune-solvers
  • agnumpde/dune-solvers
4 results
Select Git revision
  • codespell
  • feature/P0-element-tranferoperators
  • feature/cholmod-reuse-factorization
  • feature/cholmod-solver
  • feature/cmakelists-sources-target
  • feature/codespell
  • feature/generic-transfer-operators
  • feature/incomplete-cholesky-rebased
  • feature/istl-preconditioners
  • feature/multitype-cholmod
  • feature/optional-ignore
  • feature/pn-solver
  • feature/replace-unused
  • feature/two-norm
  • feature/umfpack-multitype
  • fix-master
  • fix/loopsolver-criterions
  • fix_linking_module
  • flexible-loopsolver-max
  • generalized-blockgsstep-rebased
  • master
  • new_interface
  • proximal-gradient-solver
  • releases/2.0-1
  • releases/2.1-1
  • releases/2.2-1
  • releases/2.3-1
  • releases/2.4-1
  • releases/2.5-1
  • releases/2.7-1
  • releases/2.8
  • test
  • subversion->git
33 results
Show changes
Commits on Source (160)
Showing
with 213 additions and 120 deletions
---
# Install external dependencies
before_script:
- duneci-install-module https://git.imp.fu-berlin.de/agnumpde/dune-matrix-vector.git
dune:git--clang:
image: duneci/dune:git
script: duneci-standard-test --opts=/duneci/opts.clang
# For release-based jobs, we use corresponding images,
# that already contain all core and staging dependencies.
.release_based_job:
before_script:
- duneci-install-module https://gitlab.dune-project.org/fufem/dune-matrix-vector.git
dune:git--gcc:
image: duneci/dune:git
# For branch-based-based jobs, we need to install all dependencies manually.
.branch_base_job:
before_script:
- . /duneci/bin/duneci-init-job
- duneci-install-module https://gitlab.dune-project.org/core/dune-common.git
- duneci-install-module https://gitlab.dune-project.org/core/dune-geometry.git
- duneci-install-module https://gitlab.dune-project.org/core/dune-localfunctions.git
- duneci-install-module https://gitlab.dune-project.org/staging/dune-uggrid.git
- duneci-install-module https://gitlab.dune-project.org/core/dune-grid.git
- duneci-install-module https://gitlab.dune-project.org/core/dune-istl.git
- duneci-install-module https://gitlab.dune-project.org/fufem/dune-matrix-vector.git
# The 2.9 release is the one in Debian 12 ('bookworm', 'stable' at the time of writing)
dune:2.9 debian-11 gcc-10 C++20:
extends: .release_based_job
variables:
DUNECI_BRANCH: releases/2.9
image: registry.dune-project.org/docker/ci/dune:2.9-debian-11-gcc-10-20
script: duneci-standard-test
# The 2.10 release is the one in Debian 13 ('trixie', 'testing' at the time of writing)
# To test against 2.10 we need an image with the corresponding version of the core modules.
# Unfortunately, there is no 2.10 image with a recent enough compiler.
dune:2.10 debian-11 gcc-10 C++20:
extends: .release_based_job
variables:
DUNECI_BRANCH: releases/2.10
image: registry.dune-project.org/docker/ci/dune:2.10-debian-11-gcc-10-20
script: duneci-standard-test
# Also test with the current development branch
dune:git debian-11 clang-13 C++20:
extends: .branch_base_job
# image: registry.dune-project.org/docker/ci/dune:git-debian-11-clang-13-20
image: registry.dune-project.org/docker/ci/debian:11
variables:
DUNECI_TOOLCHAIN: clang-13-20
script: duneci-standard-test
dune:git debian-11 gcc-10 C++20:
extends: .branch_base_job
# image: registry.dune-project.org/docker/ci/dune:git-debian-11-gcc-10-20
image: registry.dune-project.org/docker/ci/debian:11
variables:
DUNECI_TOOLCHAIN: gcc-10-20
script: duneci-standard-test
# Check for spelling mistakes in text
code-spelling-check:
stage: .pre
# Avoid the global 'before_script'
before_script: ""
image: registry.dune-project.org/docker/ci/debian:11
script:
- codespell
--ignore-words-list foo,bar
# Master (will become release 2.11)
- ...
# Release 2.10
- Deprecate the file `tuplevector.hh`. An equivalent file exists in `dune-common`
since 2016. Please use that from now on.
- `UMFPackSolver` accepts each correctly formed blocked matrix. The user has to make sure that the vector types of `x` and `rhs` are compatible to the matrix.
The main advantage is that it is now possible to use `MultiTypeBlockMatrix`.
- A new solver `ProximalNewtonSolver` is added which solves non-smooth minimization problems.
# Release 2.9
- The internal matrix of the`EnergyNorm` can now be accessed by `getMatrix()`.
- The default `BitVectorType` of the class `IterationStep` is now
`Solvers::DefaultBitVector_t<VectorType>` rather than `Dune::BitSetVector`.
This should do the right thing in more situations, while being fully
backward-compatible.
- `codespell` spell checker is now active for automated spell checking in the Gitlab CI.
To exclude false positives add the words to the `--ignore-words-list` in `.gitlab-ci.yml`.
# Release 2.8
- `UMFPackSolver` can now handle matrices and vectors with scalar entries.
- CholmodSolver: Added `errorCode_` member to report errors and warnings during the matrix decomposition
- CholmodSolver: `CholmodSolver` can be used with any blocked matrix/vector type supported by `flatMatrixForEach` and `flatVectorForEach` in dune-istl.
- CholmodSolver: There are now various new methods that allow to factorize the matrix once,
and use the factorization to solve linear systems with several right hand sides.
## Deprecations and removals
- The file `blockgsstep.hh` has been removed after four years of deprecation. Use the replacement
in `blockgssteps.hh` instead.
cmake_minimum_required(VERSION 2.8.6)
if(dune-common_VERSION VERSION_GREATER_EQUAL 2.10.0)
cmake_minimum_required(VERSION 3.16)
else()
cmake_minimum_required(VERSION 3.13)
endif()
project(dune-solvers CXX)
if(NOT (dune-common_DIR OR dune-common_ROOT OR
......@@ -22,9 +26,17 @@ dune_project()
find_package(SuiteSparse OPTIONAL_COMPONENTS UMFPACK)
include(AddSuiteSparseFlags)
# Create library target and export it as Dune::Solvers
dune_add_library(dunesolvers EXPORT_NAME Solvers LINK_LIBRARIES ${DUNE_LIBS})
dune_register_package_flags(LIBRARIES dunesolvers)
add_subdirectory("dune")
add_subdirectory("doc")
add_subdirectory("cmake/modules")
# finalize the dune project, e.g. generating config.h etc.
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
if(dune-common_VERSION VERSION_GREATER_EQUAL 2.10.0)
finalize_dune_project()
else()
finalize_dune_project(GENERATE_CONFIG_H_CMAKE)
endif()
......@@ -7,7 +7,7 @@ function(add_dune_ipopt_flags _targets)
set_target_properties(${_target} PROPERTIES COMPILE_FLAGS
"${_props} ${DUNE_IPOPT_CFLAGS}")
if(NOT ADD_DUNE_IPOPT_FLAGS_OBJECT)
target_link_libraries(${_target} ${IPOPT_LIBRARY})
target_link_libraries(${_target} PUBLIC ${IPOPT_LIBRARY})
endif()
endforeach(_target ${_targets})
endif(IPOPT_FOUND)
......
......@@ -8,23 +8,39 @@ find_library(DL_LIBRARY dl)
find_path(IPOPT_INCLUDE_DIR
NAMES "IpNLP.hpp"
PATH_SUFFIXES "include" "include/coin"
PATHS ${IPOPT_ROOT}
PATH_SUFFIXES "include" "include/coin" "include/coin-or"
NO_DEFAULT_PATH
)
find_path(IPOPT_INCLUDE_DIR
NAMES "IpNLP.hpp"
PATH_SUFFIXES "include" "include/coin" "include/coin-or"
)
find_library(IPOPT_LIBRARY
NAMES ipopt
PATHS ${IPOPT_ROOT}
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH
)
find_library(IPOPT_LIBRARY
NAMES ipopt
)
# If you want to want to use other linear solver
find_library(HSL_LIBRARY
NAMES hsl coinhsl
PATHS ${IPOPT_ROOT}
PATH_SUFFIXES "lib"
NO_DEFAULT_PATH
)
find_library(HSL_LIBRARY
NAMES hsl coinhsl
)
find_package_handle_standard_args(hsl DEFAULT_MSG HSL_LIBRARY)
find_package_handle_standard_args(dl DEFAULT_MSG DL_LIBRARY)
find_package_handle_standard_args(Ipopt DEFAULT_MSG IPOPT_INCLUDE_DIR IPOPT_LIBRARY)
find_package_handle_standard_args(IPOpt DEFAULT_MSG IPOPT_INCLUDE_DIR IPOPT_LIBRARY)
if(IPOPT_FOUND)
set(HAVE_IPOPT ENABLE_IPOPT)
......
......@@ -21,7 +21,7 @@ CHANGES REQUIRING CODE ADAPTATION
---------------------------------------------------------------------------------------
CHANGES POSSIBLY AFFECTING PERFOMANCE (INCLUDING BUGFIXES)
CHANGES POSSIBLY AFFECTING PERFORMANCE (INCLUDING BUGFIXES)
----------------------------------------------------------
----------------------------------------------------------
......
......@@ -4,7 +4,7 @@
#Name of the module
Module: dune-solvers
Version: 2.6-git
Version: 2.11-git
Maintainer: oliver.sander@tu-dresden.de
#depending on
Depends: dune-common dune-grid dune-istl dune-localfunctions dune-matrix-vector
......
dune_add_library("dunesolvers"
iterationsteps/blockgssteps.cc
solvers/criterion.cc)
dune_register_package_flags(LIBRARIES dunesolvers)
add_subdirectory("common")
add_subdirectory("iterationsteps")
add_subdirectory("norms")
......@@ -12,6 +6,10 @@ add_subdirectory("solvers")
add_subdirectory("test")
add_subdirectory("transferoperators")
target_sources(dunesolvers PRIVATE
iterationsteps/blockgssteps.cc
solvers/criterion.cc)
install(FILES
computeenergy.hh
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/dune/solvers)
install(FILES
arithmetic.hh
boxconstraint.hh
canignore.hh
copyorreference.hh
......
// -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=8 sw=4 sts=4:
#ifndef ARITHMETIC_HH
#define ARITHMETIC_HH
#warning arithmetic.hh is deprecated, please use dune-matrix-vector instead!
#include <dune/matrix-vector/axpy.hh>
#include <dune/matrix-vector/axy.hh>
#include <dune/matrix-vector/crossproduct.hh>
#include <dune/matrix-vector/matrixtraits.hh>
#include <dune/matrix-vector/promote.hh>
#include <dune/matrix-vector/scalartraits.hh>
#include <dune/matrix-vector/transpose.hh>
namespace Arithmetic
{
using Dune::MatrixVector::Promote;
using Dune::MatrixVector::ScalarTraits;
using Dune::MatrixVector::MatrixTraits;
using Dune::MatrixVector::Transposed;
using Dune::MatrixVector::addProduct;
using Dune::MatrixVector::subtractProduct;
using Dune::MatrixVector::crossProduct;
using Dune::MatrixVector::transpose;
using Dune::MatrixVector::Axy;
using Dune::MatrixVector::bmAxy;
}
#endif
......@@ -18,9 +18,7 @@ public:
/**
* \brief Default constructor
*/
CanIgnore()
: ignoreNodes_(nullptr)
{}
CanIgnore() = default;
/**
* \brief Constructor from bit vector
......@@ -36,8 +34,7 @@ public:
*
* Does NOT delete the bitfield!
*/
~CanIgnore()
{}
~CanIgnore() = default;
/**
* \brief Set bit vector
......@@ -68,7 +65,7 @@ public:
/**
* \brief A flag for each degree of freedom stating whether the dof should be ignored by the solver
*/
const BitVectorType* ignoreNodes_;
const BitVectorType* ignoreNodes_ = nullptr;
};
......
......@@ -21,6 +21,16 @@ namespace Solvers {
*
* If T is of reference type, the wrapper stores a reference
* to the passed object. Otherwise it stores a copy.
*
* Internally, for reference type T, this wrapper stores a pointer, which
* results in CopyOrReference being copyable (etc.). This sets this wrapper
* apart from having a pure member type T in a class in particular.
* Furthermore, using this wrapper provides gclarity for the reader that type T
* may be both, of raw type or of reference type.
*
* Usage of this wrapper comes at the price of get()-semantics.
* As an alternative with pointer semantics consider using wrap_own_share but
* mind the dynamic overhead.
*/
template<class T>
class CopyOrReference
......
......@@ -10,7 +10,7 @@
#include <dune/istl/bvector.hh>
#include <dune/istl/multitypeblockvector.hh>
#include <dune/solvers/common/tuplevector.hh>
#include <dune/common/tuplevector.hh>
namespace Dune {
namespace Solvers {
......@@ -18,11 +18,18 @@ namespace Solvers {
namespace Imp {
/** \brief Construct a bitvector type with a nesting that matches the one of a given vector
*
* The default implementation implements the case where the vector is a number type
* (to end recursion), and returns 'char' in such cases.
*
* \tparam Vector The vector types whose nesting shall be matched
*/
template<class Vector>
struct DefaultBitVector
{
static_assert(AlwaysFalse<Vector>::value, "No DefaultBitVector known for this type.");
using type = void;
static_assert(IsNumber<Vector>::value, "No DefaultBitVector known for this type.");
using type = char;
};
template<class T, int i>
......
......@@ -34,7 +34,7 @@ struct GenericVector
//! Write vector to given stream
template <class VectorType>
DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::Generic::writeBinary instead.")
[[deprecated("Please use Dune::MatrixVector::Generic::writeBinary instead.")]]
static void writeBinary(std::ostream& s, const VectorType& v)
{
Dune::MatrixVector::Generic::writeBinary(s, v);
......@@ -42,23 +42,23 @@ struct GenericVector
//! Read vector from a given stream
template <class VectorType>
DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::Generic::readBinary instead.")
[[deprecated("Please use Dune::MatrixVector::Generic::readBinary instead.")]]
static void readBinary(std::istream& s, VectorType& v)
{
Dune::MatrixVector::Generic::readBinary(s, v);
}
//! Resize vector recursivly to size of given vector/matrix
//! Resize vector recursively to size of given vector/matrix
template <class VectorTypeA, class VectorTypeB>
DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::resize instead.")
[[deprecated("Please use Dune::MatrixVector::resize instead.")]]
static void resize(VectorTypeA& a, const VectorTypeB& b)
{
Dune::MatrixVector::resize(a, b);
}
//! Set vector to zero at indices that are true in bitvector recursivly
//! Set vector to zero at indices that are true in bitvector recursively
template <class VectorType, class BitVectorType>
DUNE_DEPRECATED_MSG("Please use Dune::MatrixVector::Generic::truncate instead.")
[[deprecated("Please use Dune::MatrixVector::Generic::truncate instead.")]]
static void truncate(VectorType& v, const BitVectorType& tr)
{
Dune::MatrixVector::Generic::truncate(v, tr);
......@@ -66,7 +66,7 @@ struct GenericVector
//! weave two vector blocks into each other e.g. [[u1...un][w1...wn]] --> [[u1 w1]...[un wn]]
template <class LVectorType, class RVectorType>
static void interlace(const LVectorType& lvec DUNE_UNUSED, RVectorType& rvec DUNE_UNUSED)
static void interlace([[maybe_unused]] const LVectorType& lvec, [[maybe_unused]] RVectorType& rvec)
{
DUNE_THROW(Dune::NotImplemented,"GenericVector::interlace not implemented for given VectorTypes");
}
......@@ -132,7 +132,7 @@ struct GenericVector
//! unweave two vectors previously interlaced e.g. [[u1 w1]...[un wn]] --> [[u1...un][w1...wn]]
template <class LVectorType, class RVectorType>
static void deinterlace(const LVectorType& lvec DUNE_UNUSED, RVectorType& rvec DUNE_UNUSED)
static void deinterlace([[maybe_unused]] const LVectorType& lvec, [[maybe_unused]] RVectorType& rvec)
{
DUNE_THROW(Dune::NotImplemented,"GenericVector::deinterlace not implemented for given VectorTypes");
}
......@@ -183,7 +183,7 @@ struct GenericVector
struct GenericMatrix
{
//! Set matrix to zero at indices that are true in bitvector recursivly
//! Set matrix to zero at indices that are true in bitvector recursively
template <class MatrixType, class BitVectorTypeR, class BitVectorTypeC>
static void truncate(MatrixType& mat, const BitVectorTypeR& trows, const BitVectorTypeC& tcols, bool setTruncatedDiagonalOne)
{
......
......@@ -57,6 +57,20 @@ public:
return *this;
}
/** \brief Scalar multiplication
*/
Interval& operator*=(const field_type& c)
{
data_[0] *= c;
data_[1] *= c;
// swap if multiplication with negative number
if ( c < 0.0 )
std::swap(data_[0],data_[1]);
return *this;
}
/** \brief Project a scalar onto the interval
*/
field_type projectIn(const field_type& x) const
......@@ -97,6 +111,22 @@ private:
std::array<field_type,2> data_;
};
//! Scalar multiplication from the left
template <class field_type>
Interval<field_type> operator*(const field_type& c, const Interval<field_type>& i)
{
auto ret = i;
return ret *= c;
}
//! Scalar multiplication from the right
template <class field_type>
Interval<field_type> operator*(const Interval<field_type>& i, const field_type& c)
{
return c * i;
}
//! Output operator for Interval
template <class field_type>
inline std::ostream& operator<< (std::ostream& s, const Interval<field_type>& interval)
......
......@@ -16,7 +16,7 @@ public:
/** \brief Different levels of verbosity */
enum VerbosityMode {QUIET, REDUCED, FULL};
/** \brief Constructor, per defaut uses FULL. */
/** \brief Constructor, per default uses FULL. */
NumProc(VerbosityMode verbosity = FULL)
: verbosity_(verbosity)
{}
......
......@@ -15,7 +15,7 @@
//! Idea of implementation: define an ordering for the nodes (with respect to the axis of anisotropy)
//! and then use a merge sort algorithm to renumerate the nodes along the lines which are parallel to this axis.
//! to do so, we introduce a 'NodeList' class.
//! everything is handeled by the PermutationManager
//! everything is handled by the PermutationManager
// type of nodes:
......@@ -151,7 +151,7 @@ public:
// the information about the axis of anisotropy is in NodeList, since this list contains a methode "less_equal", which describes the ordering of the nodes.
// the information about the axis of anisotropy is in NodeList, since this list contains a method "less_equal", which describes the ordering of the nodes.
// this ordering depends on the axis of anisotropy
template< class GridViewImp >
class PermutationManager{
......@@ -430,9 +430,9 @@ public:
for( int i = 0; i < node_list_.size(); ++i )
{
std::cout << "Original node[" << get_inverse_permuted_index( i ) << "] = (" << node_list_[i].get_global_coordinate() << ") recieved permuted index " << i << std::endl;
std::cout << "Original node[" << get_inverse_permuted_index( i ) << "] = (" << node_list_[i].get_global_coordinate() << ") received permuted index " << i << std::endl;
// alternative:
//std::cout << "Original node[" << get_inverse_permuted_index( i ) << "] = (" << original_node_list_[get_inverse_permuted_index( i )].get_global_coordinate() << ") recieved permuted index " << i << std::endl;
//std::cout << "Original node[" << get_inverse_permuted_index( i ) << "] = (" << original_node_list_[get_inverse_permuted_index( i )].get_global_coordinate() << ") received permuted index " << i << std::endl;
}
#if 0
......
......@@ -41,14 +41,14 @@ void resizeInitialize(Dune::BitSetVector<size, Alloc>& x, const Vector& y, bool
}
template<class TargetVector, class Vector, class Value,
std::enable_if_t<not Dune::is_indexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0>
std::enable_if_t<not Dune::IsIndexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0>
void resizeInitialize(TargetVector& x, const Vector& y, const Value& value)
{
x = value;
}
template<class TargetVector, class Vector, class Value,
std::enable_if_t<Dune::is_indexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0>
std::enable_if_t<Dune::IsIndexable<TargetVector, std::integral_constant<std::size_t,0> >::value, int> = 0>
void resizeInitialize(TargetVector& x, const Vector& y, const Value& value)
{
namespace H = Dune::Hybrid;
......
......@@ -16,8 +16,6 @@
#include <dune/matrix-vector/scalartraits.hh>
#include <dune/matrix-vector/transformmatrix.hh>
#include "arithmetic.hh"
namespace StaticMatrix
{
// type promotion (smallest matrix that can hold the sum of two matrices *******************
......
......@@ -3,9 +3,9 @@
#ifndef DUNE_SOLVERS_COMMON_TUPLEVECTOR_HH
#define DUNE_SOLVERS_COMMON_TUPLEVECTOR_HH
#include <tuple>
#warning This file is deprecated! Use tuplevector.hh from the dune-common module instead!
#include <dune/common/indices.hh>
#include <dune/common/tuplevector.hh>
namespace Dune
{
......@@ -16,45 +16,7 @@ namespace Solvers
* \brief A std::tuple that allows access to its element via operator[]
*/
template<class... T>
class TupleVector : public std::tuple<T...>
{
using Base = std::tuple<T...>;
public:
/** \brief Construct from a set of arguments */
template<class... TT>
constexpr TupleVector(TT&&... tt) :
Base(std::forward<TT>(tt)...)
{}
/** \brief Default constructor */
constexpr TupleVector()
{}
/** \brief Const access to the tuple elements */
template<std::size_t i>
auto operator[](const Dune::index_constant<i>&) const
->decltype(std::get<i>(*this))
{
return std::get<i>(*this);
}
/** \brief Non-const access to the tuple elements */
template<std::size_t i>
auto operator[](const Dune::index_constant<i>&)
->decltype(std::get<i>(*this))
{
return std::get<i>(*this);
}
/** \brief Number of elements of the tuple */
static constexpr std::size_t size()
{
return std::tuple_size<Base>::value;
}
};
using TupleVector = Dune::TupleVector<T...>;
} // namespace Functions
......