libMesh
Public Member Functions | Private Attributes | List of all members
libMesh::SystemNorm Class Reference

This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a finite element space. More...

#include <system_norm.h>

Public Member Functions

 SystemNorm ()
 Constructor, defaults to DISCRETE_L2. More...
 
 SystemNorm (const FEMNormType &t)
 Constructor, for discrete vector norms, systems with one variable, and systems for which the same norm type should be used with a weight of one on each variable. More...
 
 SystemNorm (const std::vector< FEMNormType > &norms)
 Constructor, for unweighted sobolev norms on systems with multiple variables. More...
 
 SystemNorm (const std::vector< FEMNormType > &norms, std::vector< Real > &weights)
 Constructor, for weighted sobolev norms on systems with multiple variables. More...
 
 SystemNorm (const std::vector< FEMNormType > &norms, std::vector< std::vector< Real >> &weights)
 Constructor, for weighted sobolev norms on systems with multiple variables and their adjoints. More...
 
 SystemNorm (const SystemNorm &)=default
 Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class. More...
 
 SystemNorm (SystemNorm &&)=default
 
SystemNormoperator= (const SystemNorm &)=default
 
SystemNormoperator= (SystemNorm &&)=default
 
virtual ~SystemNorm ()=default
 
bool is_discrete () const
 
Real calculate_norm (const std::vector< Real > &v)
 
Real calculate_norm (const std::vector< Real > &v1, const std::vector< Real > &v2)
 
bool is_identity ()
 
FEMNormType type (unsigned int var) const
 
void set_type (unsigned int var, const FEMNormType &t)
 Sets the type of the norm in variable var. More...
 
Real weight (unsigned int var) const
 
void set_weight (unsigned int var, Real w)
 Sets the weight corresponding to the norm in variable var. More...
 
void set_off_diagonal_weight (unsigned int i, unsigned int j, Real w)
 Sets the weight corresponding to the norm from the variable pair v1(var1) coming from v2(var2). More...
 
Real weight_sq (unsigned int var) const
 

Private Attributes

std::vector< FEMNormType_norms
 
std::vector< Real_weights
 
std::vector< Real_weights_sq
 
std::vector< std::vector< Real > > _off_diagonal_weights
 One more data structure needed to store the off diagonal components for the generalize SystemNorm case. More...
 

Detailed Description

This class defines a norm/seminorm to be applied to a NumericVector which contains coefficients in a finite element space.

Discrete vector norms and weighted l2 combinations of Sobolev norms and seminorms are representable.

Author
Roy H. Stogner
Date
2008

Definition at line 51 of file system_norm.h.

Constructor & Destructor Documentation

◆ SystemNorm() [1/7]

libMesh::SystemNorm::SystemNorm ( )

Constructor, defaults to DISCRETE_L2.

◆ SystemNorm() [2/7]

libMesh::SystemNorm::SystemNorm ( const FEMNormType t)

Constructor, for discrete vector norms, systems with one variable, and systems for which the same norm type should be used with a weight of one on each variable.

This is deliberately an implicit constructor; we want user code to be able to include lines like "error_norm = L2"

◆ SystemNorm() [3/7]

libMesh::SystemNorm::SystemNorm ( const std::vector< FEMNormType > &  norms)
explicit

Constructor, for unweighted sobolev norms on systems with multiple variables.

For a system with n variables, the final norm will be the l2 norm of the n-vector of the norms in each variable.

◆ SystemNorm() [4/7]

libMesh::SystemNorm::SystemNorm ( const std::vector< FEMNormType > &  norms,
std::vector< Real > &  weights 
)

Constructor, for weighted sobolev norms on systems with multiple variables.

For a system with n variables, the final norm will be the l2 norm of the n-vector of the norms in each variable, each multiplied by weight.

◆ SystemNorm() [5/7]

libMesh::SystemNorm::SystemNorm ( const std::vector< FEMNormType > &  norms,
std::vector< std::vector< Real >> &  weights 
)

Constructor, for weighted sobolev norms on systems with multiple variables and their adjoints.

For a system with n variables, the final norm computed will be of the form norm_u^T*R*norm_z where R is a scaling matrix

◆ SystemNorm() [6/7]

libMesh::SystemNorm::SystemNorm ( const SystemNorm )
default

Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class.

◆ SystemNorm() [7/7]

libMesh::SystemNorm::SystemNorm ( SystemNorm &&  )
default

◆ ~SystemNorm()

virtual libMesh::SystemNorm::~SystemNorm ( )
virtualdefault

Member Function Documentation

◆ calculate_norm() [1/2]

Real libMesh::SystemNorm::calculate_norm ( const std::vector< Real > &  v)
Returns
The weighted norm v^T*W*v where W represents our weights matrix or weights vector times identity matrix.

◆ calculate_norm() [2/2]

Real libMesh::SystemNorm::calculate_norm ( const std::vector< Real > &  v1,
const std::vector< Real > &  v2 
)
Returns
The weighted inner product v1^T*W*v2 where R is our weights

◆ is_discrete()

bool libMesh::SystemNorm::is_discrete ( ) const
Returns
true if this is purely a discrete norm

◆ is_identity()

bool libMesh::SystemNorm::is_identity ( )
Returns
true if no weight matrix W is specified or an identity matrix is specified, otherwise returns false

◆ operator=() [1/2]

SystemNorm& libMesh::SystemNorm::operator= ( const SystemNorm )
default

◆ operator=() [2/2]

SystemNorm& libMesh::SystemNorm::operator= ( SystemNorm &&  )
default

◆ set_off_diagonal_weight()

void libMesh::SystemNorm::set_off_diagonal_weight ( unsigned int  i,
unsigned int  j,
Real  w 
)

Sets the weight corresponding to the norm from the variable pair v1(var1) coming from v2(var2).

See calculate_norm

◆ set_type()

void libMesh::SystemNorm::set_type ( unsigned int  var,
const FEMNormType t 
)

Sets the type of the norm in variable var.

◆ set_weight()

void libMesh::SystemNorm::set_weight ( unsigned int  var,
Real  w 
)

Sets the weight corresponding to the norm in variable var.

◆ type()

FEMNormType libMesh::SystemNorm::type ( unsigned int  var) const
Returns
The type of the norm in variable var

◆ weight()

Real libMesh::SystemNorm::weight ( unsigned int  var) const
Returns
The weight corresponding to the norm in variable var

◆ weight_sq()

Real libMesh::SystemNorm::weight_sq ( unsigned int  var) const
Returns
The squared weight corresponding to the norm in variable var. We cache that at construction time to save a few flops.

Member Data Documentation

◆ _norms

std::vector<FEMNormType> libMesh::SystemNorm::_norms
private

Definition at line 166 of file system_norm.h.

◆ _off_diagonal_weights

std::vector<std::vector<Real> > libMesh::SystemNorm::_off_diagonal_weights
private

One more data structure needed to store the off diagonal components for the generalize SystemNorm case.

Definition at line 175 of file system_norm.h.

◆ _weights

std::vector<Real> libMesh::SystemNorm::_weights
private

Definition at line 168 of file system_norm.h.

◆ _weights_sq

std::vector<Real> libMesh::SystemNorm::_weights_sq
private

Definition at line 169 of file system_norm.h.


The documentation for this class was generated from the following file: