libMesh
|
Defines a dense vector for use in Finite Element-type computations. More...
#include <meshless_interpolation_function.h>
Public Member Functions | |
DenseVector (const unsigned int n=0) | |
Constructor. More... | |
DenseVector (const unsigned int n, const T &val) | |
Constructor. More... | |
template<typename T2 > | |
DenseVector (const DenseVector< T2 > &other_vector) | |
Copy-constructor. More... | |
template<typename T2 > | |
DenseVector (const std::vector< T2 > &other_vector) | |
Copy-constructor, from a std::vector . More... | |
DenseVector (DenseVector &&)=default | |
The 5 special functions can be defaulted for this class, as it does not manage any memory itself. More... | |
DenseVector (const DenseVector &)=default | |
DenseVector & | operator= (const DenseVector &)=default |
DenseVector & | operator= (DenseVector &&)=default |
virtual | ~DenseVector ()=default |
virtual unsigned int | size () const override |
virtual bool | empty () const override |
virtual void | zero () override |
Set every element in the vector to 0. More... | |
const T & | operator() (const unsigned int i) const |
T & | operator() (const unsigned int i) |
virtual T | el (const unsigned int i) const override |
virtual T & | el (const unsigned int i) override |
template<typename T2 > | |
DenseVector< T > & | operator= (const DenseVector< T2 > &other_vector) |
Assignment operator. More... | |
void | swap (DenseVector< T > &other_vector) |
STL-like swap method. More... | |
void | resize (const unsigned int n) |
Resize the vector. More... | |
template<typename T2 > | |
void | append (const DenseVector< T2 > &other_vector) |
Append additional entries to (resizing, but unchanging) the vector. More... | |
void | scale (const T factor) |
Multiplies every element in the vector by factor . More... | |
DenseVector< T > & | operator*= (const T factor) |
Multiplies every element in the vector by factor . More... | |
template<typename T2 , typename T3 > | |
boostcopy::enable_if_c< ScalarTraits< T2 >::value, void >::type | add (const T2 factor, const DenseVector< T3 > &vec) |
Adds factor times vec to this vector. More... | |
template<typename T2 > | |
CompareTypes< T, T2 >::supertype | dot (const DenseVector< T2 > &vec) const |
template<typename T2 > | |
CompareTypes< T, T2 >::supertype | indefinite_dot (const DenseVector< T2 > &vec) const |
template<typename T2 > | |
bool | operator== (const DenseVector< T2 > &vec) const |
template<typename T2 > | |
bool | operator!= (const DenseVector< T2 > &vec) const |
template<typename T2 > | |
DenseVector< T > & | operator+= (const DenseVector< T2 > &vec) |
Adds vec to this vector. More... | |
template<typename T2 > | |
DenseVector< T > & | operator-= (const DenseVector< T2 > &vec) |
Subtracts vec from this vector. More... | |
Real | min () const |
Real | max () const |
Real | l1_norm () const |
Real | l2_norm () const |
Real | linfty_norm () const |
void | get_principal_subvector (unsigned int sub_n, DenseVector< T > &dest) const |
Puts the principal subvector of size sub_n (i.e. More... | |
std::vector< T > & | get_values () |
const std::vector< T > & | get_values () const |
void | print (std::ostream &os) const |
Pretty-print the vector to stdout . More... | |
void | print_scientific (std::ostream &os, unsigned precision=8) const |
Prints the entries of the vector with additional decimal places in scientific notation. More... | |
Private Attributes | |
std::vector< T > | _val |
The actual data values, stored as a 1D array. More... | |
Defines a dense vector for use in Finite Element-type computations.
This class is to basically compliment the DenseMatrix
class. It has additional capabilities over the std::vector
that make it useful for finite elements, particularly for systems of equations. All overridden virtual functions are documented in dense_vector_base.h.
Definition at line 39 of file meshless_interpolation_function.h.
|
inlineexplicit |
|
inlineexplicit |
Constructor.
Creates a dense vector of dimension n
where all entries have value val
.
Definition at line 285 of file dense_vector.h.
|
inline |
Copy-constructor.
Definition at line 296 of file dense_vector.h.
|
inline |
Copy-constructor, from a std::vector
.
Definition at line 315 of file dense_vector.h.
|
default |
The 5 special functions can be defaulted for this class, as it does not manage any memory itself.
|
default |
|
virtualdefault |
|
inline |
Adds factor
times vec
to this vector.
This should only work if T += T2 * T3 is valid C++ and if T2 is scalar. Return type is void
Definition at line 436 of file dense_vector.h.
Referenced by libMesh::EulerSolver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::rb_solve_again(), and libMesh::DenseMatrix< Real >::vector_mult_add().
|
inline |
Append additional entries to (resizing, but unchanging) the vector.
Definition at line 367 of file dense_vector.h.
Referenced by libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values().
|
inline |
vec
.In the complex-valued case, uses the complex conjugate of vec
.
Definition at line 451 of file dense_vector.h.
Referenced by libMesh::TransientRBConstruction::assemble_affine_expansion(), libMesh::TransientRBEvaluation::compute_residual_dual_norm(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBConstruction::set_error_temporal_data(), and libMesh::TransientRBConstruction::update_RB_initial_condition_all_N().
|
inlineoverridevirtual |
(i) element of the vector. Implements libMesh::DenseVectorBase< T >.
Definition at line 112 of file dense_vector.h.
|
inlineoverridevirtual |
(i) element of the vector as a writable reference. Implements libMesh::DenseVectorBase< T >.
Definition at line 115 of file dense_vector.h.
|
inlineoverridevirtual |
true
iff size() is 0. Reimplemented from libMesh::DenseVectorBase< T >.
Definition at line 97 of file dense_vector.h.
Referenced by libMesh::NumericVector< Number >::add_vector(), and libMesh::NumericVector< Number >::insert().
|
inline |
Puts the principal subvector of size sub_n
(i.e.
first sub_n entries) into dest
.
Definition at line 672 of file dense_vector.h.
Referenced by libMesh::TransientRBConstruction::update_RB_initial_condition_all_N().
|
inline |
This should be used with caution (i.e. one should not change the size of the vector, etc.) but is useful for interoperating with low level BLAS routines which expect a simple array.
Definition at line 256 of file dense_vector.h.
Referenced by libMesh::DenseMatrix< Real >::_evd_lapack(), libMesh::DenseMatrix< Real >::_lu_back_substitute_lapack(), libMesh::DenseMatrix< Real >::_matvec_blas(), libMesh::DenseMatrix< Real >::_svd_solve_lapack(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::FEMContext::pre_fe_reinit(), and DenseMatrixTest::testEVD_helper().
|
inline |
Definition at line 261 of file dense_vector.h.
|
inline |
vec
.In the complex-valued case, does not use the complex conjugate of vec
.
Definition at line 484 of file dense_vector.h.
|
inline |
Definition at line 601 of file dense_vector.h.
|
inline |
Definition at line 622 of file dense_vector.h.
|
inline |
Definition at line 648 of file dense_vector.h.
|
inline |
Definition at line 583 of file dense_vector.h.
|
inline |
Definition at line 565 of file dense_vector.h.
|
inline |
true
if vec
is not exactly equal to this vector, false otherwise. Definition at line 517 of file dense_vector.h.
|
inline |
i
of the vector as a writable reference. Definition at line 401 of file dense_vector.h.
|
inline |
i
of the vector as a const reference. Definition at line 390 of file dense_vector.h.
|
inline |
Multiplies every element in the vector by factor
.
Definition at line 423 of file dense_vector.h.
|
inline |
Adds vec
to this vector.
Definition at line 534 of file dense_vector.h.
|
inline |
Subtracts vec
from this vector.
Definition at line 550 of file dense_vector.h.
|
default |
|
inline |
|
default |
|
inline |
true
if vec
is exactly equal to this vector, false otherwise. Definition at line 500 of file dense_vector.h.
|
inherited |
Pretty-print the vector to stdout
.
Definition at line 51 of file dense_vector_base.C.
|
inherited |
Prints the entries of the vector with additional decimal places in scientific notation.
Definition at line 31 of file dense_vector_base.C.
|
inline |
Resize the vector.
Sets all elements to 0.
Definition at line 355 of file dense_vector.h.
Referenced by libMesh::DenseMatrix< Real >::_cholesky_back_substitute(), libMesh::DenseMatrix< Real >::_evd_lapack(), libMesh::DenseMatrix< Real >::_lu_back_substitute(), libMesh::DenseMatrix< Real >::_svd_lapack(), libMesh::DenseMatrix< Real >::_svd_solve_lapack(), libMesh::HPCoarsenTest::add_projection(), libMesh::TransientRBConstruction::allocate_data_structures(), assemble(), LinearElasticity::assemble(), assemble_1D(), AssembleOptimization::assemble_A_and_F(), assemble_biharmonic(), assemble_cd(), assemble_elasticity(), assemble_ellipticdg(), assemble_helmholtz(), assemble_laplace(), assemble_matrix_and_rhs(), assemble_poisson(), assemble_shell(), assemble_stokes(), assemble_wave(), Biharmonic::JR::bounds(), libMesh::DofMap::build_constraint_matrix_and_vector(), libMesh::TransientRBEvaluation::cache_online_residual_terms(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::RBEIMConstruction::compute_best_fit_error(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_periodic_constraints(), libMesh::FEGenericBase< FEOutputType< T >::type >::compute_proj_constraints(), compute_residual(), SolidSystem::element_time_derivative(), libMesh::DGFEMContext::neighbor_side_fe_reinit(), BdyFunction::operator()(), libMesh::MeshlessInterpolationFunction::operator()(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::CompositeFEMFunction< Output >::operator()(), libMesh::CompositeFunction< Output >::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::MeshFunction::operator()(), libMesh::MeshTools::Generation::Private::GaussLobattoRedistributionFunction::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::FEMContext::pre_fe_reinit(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::rb_solve_again(), LaplaceYoung::residual(), LargeDeformationElasticity::residual(), Biharmonic::JR::residual_and_jacobian(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::DenseVector< Output >::resize(), libMesh::TransientRBEvaluation::resize_data_structures(), libMesh::HPCoarsenTest::select_refinement(), libMesh::DenseMatrix< Real >::vector_mult(), libMesh::DenseMatrix< Real >::vector_mult_add(), and libMesh::DenseMatrix< Real >::vector_mult_transpose().
|
inline |
Multiplies every element in the vector by factor
.
Definition at line 412 of file dense_vector.h.
Referenced by SolidSystem::element_time_derivative().
|
inlineoverridevirtual |
Implements libMesh::DenseVectorBase< T >.
Definition at line 92 of file dense_vector.h.
Referenced by libMesh::EulerSolver::_general_residual(), libMesh::Euler2Solver::_general_residual(), libMesh::NewmarkSolver::_general_residual(), libMesh::DenseMatrix< Real >::_lu_back_substitute(), libMesh::DenseMatrix< Real >::_matvec_blas(), libMesh::DenseMatrix< Real >::_svd_lapack(), libMesh::DenseMatrix< Real >::_svd_solve_lapack(), libMesh::HPCoarsenTest::add_projection(), libMesh::NumericVector< Number >::add_vector(), libMesh::FEMSystem::assembly(), libMesh::GenericProjector< FFunctor, GFunctor, FValue, ProjectionAction >::SubProjector::construct_projection(), libMesh::MeshFunction::discontinuous_gradient(), libMesh::MeshFunction::discontinuous_value(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::RBEIMConstruction::evaluate_mesh_function(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::MeshFunction::gradient(), libMesh::MeshFunction::hessian(), libMesh::index_range(), libMesh::VectorSetAction< Val >::insert(), libMesh::NumericVector< Number >::insert(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::RBEIMConstruction::load_rb_solution(), libMesh::RBConstruction::load_rb_solution(), libMesh::TransientRBConstruction::load_rb_solution(), ExampleOneFunction::operator()(), SlitFunc::operator()(), libMesh::ConstFunction< Output >::operator()(), libMesh::WrappedFunction< Output >::operator()(), libMesh::ParsedFEMFunction< T >::operator()(), libMesh::CompositeFEMFunction< Output >::operator()(), libMesh::CompositeFunction< Output >::operator()(), libMesh::MeshFunction::operator()(), TripleFunction::operator()(), libMesh::DenseMatrix< Real >::outer_product(), libMesh::RBEIMEvaluation::rb_solve(), libMesh::TransientRBEvaluation::rb_solve_again(), DenseMatrixTest::testComplexSVD(), DenseMatrixTest::testEVD_helper(), DenseMatrixTest::testOuterProduct(), DenseMatrixTest::testSVD(), libMesh::DenseMatrix< Real >::vector_mult(), libMesh::DenseMatrix< Real >::vector_mult_add(), and libMesh::DenseMatrix< Real >::vector_mult_transpose().
|
inline |
STL-like swap method.
Definition at line 346 of file dense_vector.h.
Referenced by libMesh::EulerSolver::_general_residual(), and libMesh::Euler2Solver::_general_residual().
|
inlineoverridevirtual |
Set every element in the vector to 0.
Needs to be pure virtual since the storage method may be different in derived classes.
Implements libMesh::DenseVectorBase< T >.
Definition at line 379 of file dense_vector.h.
Referenced by libMesh::HPCoarsenTest::add_projection(), libMesh::FEGenericBase< FEOutputType< T >::type >::coarsened_dof_values(), libMesh::FEMSystem::numerical_jacobian(), SolutionFunction::operator()(), BdyFunction::operator()(), SolutionGradient::operator()(), libMesh::CompositeFEMFunction< Output >::operator()(), libMesh::CompositeFunction< Output >::operator()(), libMesh::BoundaryProjectSolution::operator()(), libMesh::TransientRBEvaluation::rb_solve(), libMesh::RBEvaluation::rb_solve(), libMesh::TransientRBEvaluation::rb_solve_again(), libMesh::HPCoarsenTest::select_refinement(), DenseMatrixTest::testEVD_helper(), and libMesh::TransientRBConstruction::update_RB_initial_condition_all_N().
|
private |
The actual data values, stored as a 1D array.
Definition at line 268 of file dense_vector.h.
Referenced by libMesh::DenseVector< Output >::empty(), libMesh::DenseVector< Output >::get_values(), and libMesh::DenseVector< Output >::size().