deal.II version GIT relicensing-6842-g793a97d2aa 2026-10-02 14:00:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Typedefs
Rol Namespace Reference

Typedefs

template<typename VectorType >
using VectorAdaptor = ::TrilinosWrappers::ROLAdaptor< VectorType >
 

Typedef Documentation

◆ VectorAdaptor

template<typename VectorType >
using Rol::VectorAdaptor = typedef ::TrilinosWrappers::ROLAdaptor<VectorType>

An adaptor that provides an interface to the Rapid Optimization Library (ROL), a Trilinos package.

This class provides the implementation of the ROL::Vector interface for vectors of type VectorType. It supports vectors that satisfy the following requirements:

The VectorType should contain the following types.

VectorType::size_type; // The type for size of the vector.
VectorType::value_type; // The type for elements stored in the vector.
VectorType::real_type; // The type for real-valued numbers.

However, ROL doesn't distinguish ROLAdaptor::value_type from ROLAdaptor::real_type. This is due to ROL's assumption that the ROLAdaptor::value_type itself is a type for real-valued numbers. Therefore, ROLAdaptor supports vectors whose real_type is convertible to value_type in the sense that std::is_convertible_v<real_type, value_type> yields true.

The VectorType should contain the following methods.

// Reinitialize the current vector using a given vector's
// size (and the parallel distribution) without copying
// the elements.
void VectorType::reinit(const VectorType &, ...);
// Copies the data of a given vector to the current.
// Resize the current vector if necessary (MPI safe).
VectorType& VectorType::operator=(const VectorType &);
// Return the global size of the current vector.
VectorType::size_type VectorType::size();
// Access the value of the ith component.
VectorType::value_type&
VectorType::operator[](const VectorType::size_type i);
// Compress the vector i.e., flush the buffers of the
// vector object if it has any.
void VectorType::compress(VectorOperation);
Note
The current implementation in ROL doesn't support vector sizes above the largest value of int type. Some of the vectors in deal.II (see Vector) may not satisfy the above requirements.

Optimization and finite elements

Numerical optimization can be a useful tool in the context of finite element methods. However, not all degrees of freedom of a finite element discretization should really be part of the optimization space – typically those that are constrained through boundary conditions and hanging nodes should be excluded from the optimization process.

This can be achieved in two different ways: either through constrained optimization; or by reducing the optimization space which allows unconstrained optimization. For the latter, one way to do it is explicitly defining those vector elements that correspond to the optimization space. All operations necessary for the optimization process would only see these specified entries, which are effectively only a subspace of the finite element discretization.

This wrapper class provides a means for defining the optimization space using an IndexSet upon construction.

Ghost elements on distributed vectors

This wrapper class also manages all distributed vector classes of deal.II.

ROL will manipulate the wrapped vector during the optimization progress. For vector classes of the PETScWrappers and TrilinosWrappers namespaces, this manipulation is only allowed on vectors without ghost elements. For the LinearAlgebra::distributed::Vector class, manipulation with ghost elements is permitted, although it requires a potentially slow ghost exchange. For more information on ghost vectors, see also the corresponding glossary entry.

To enforce the same behavior of this wrapper on all distributed vectors classes, we only allow manipulating operations for vectors without ghost elements.

Deprecated:
Use TrilinosWrappers::ROLAdaptor instead.

Definition at line 34 of file vector_adaptor.h.