Loading...
Searching...
No Matches
VectorSpaceBasis.h
// Copyright (C) 2013-2017 Patrick E. Farrell and Garth N. Wells
//
// This file is part of DOLFIN.
//
// DOLFIN is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// DOLFIN is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
#ifndef __VECTOR_SPACE_BASIS_H
#define __VECTOR_SPACE_BASIS_H
#include <memory>
#include <vector>
namespace dolfin
{
class GenericVector;
class VectorSpaceBasis
{
public:
VectorSpaceBasis(const std::vector<std::shared_ptr<GenericVector>> basis);
~VectorSpaceBasis() {}
void orthonormalize(double tol=1.0e-10);
bool is_orthonormal(double tol=1.0e-10) const;
bool is_orthogonal(double tol=1.0e-10) const;
void orthogonalize(GenericVector& x) const;
std::size_t dim() const;
std::shared_ptr<const GenericVector> operator[] (std::size_t i) const;
private:
// Basis vectors
const std::vector<std::shared_ptr<GenericVector>> _basis;
};
}
#endif
dolfin::GenericVector
This class defines a common interface for vectors.
Definition GenericVector.h:48
dolfin::VectorSpaceBasis::~VectorSpaceBasis
~VectorSpaceBasis()
Destructor.
Definition VectorSpaceBasis.h:41
dolfin::VectorSpaceBasis::VectorSpaceBasis
VectorSpaceBasis(const std::vector< std::shared_ptr< GenericVector > > basis)
Constructor.
Definition VectorSpaceBasis.cpp:29
dolfin::VectorSpaceBasis::operator[]
std::shared_ptr< const GenericVector > operator[](std::size_t i) const
Get a particular basis vector.
Definition VectorSpaceBasis.cpp:114
dolfin::VectorSpaceBasis::is_orthonormal
bool is_orthonormal(double tol=1.0e-10) const
Test if basis is orthonormal.
Definition VectorSpaceBasis.cpp:60
dolfin::VectorSpaceBasis::dim
std::size_t dim() const
Number of vectors in the basis.
Definition VectorSpaceBasis.cpp:108
dolfin::VectorSpaceBasis::orthonormalize
void orthonormalize(double tol=1.0e-10)
Definition VectorSpaceBasis.cpp:35
dolfin::VectorSpaceBasis::is_orthogonal
bool is_orthogonal(double tol=1.0e-10) const
Test if basis is orthogonal.
Definition VectorSpaceBasis.cpp:78
dolfin::VectorSpaceBasis::orthogonalize
void orthogonalize(GenericVector &x) const
Orthogonalize x with respect to basis.
Definition VectorSpaceBasis.cpp:98
dolfin
Definition adapt.h:30