#include <system_norm.h>
Public Member Functions | |
SystemNorm () | |
SystemNorm (const FEMNormType &t) | |
SystemNorm (const std::vector< FEMNormType > &norms) | |
SystemNorm (const std::vector< FEMNormType > &norms, std::vector< Real > &weights) | |
SystemNorm (const std::vector< FEMNormType > &norms, std::vector< std::vector< Real >> &weights) | |
SystemNorm (const SystemNorm &)=default | |
SystemNorm (SystemNorm &&)=default | |
SystemNorm & | operator= (const SystemNorm &)=default |
SystemNorm & | operator= (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) |
Real | weight (unsigned int var) const |
void | set_weight (unsigned int var, Real w) |
void | set_off_diagonal_weight (unsigned int i, unsigned int j, Real w) |
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 |
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.
Definition at line 51 of file system_norm.h.
libMesh::SystemNorm::SystemNorm | ( | ) |
Constructor, defaults to DISCRETE_L2
Definition at line 26 of file system_norm.C.
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"
Definition at line 32 of file system_norm.C.
|
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.
Definition at line 38 of file system_norm.C.
References _norms, and libMesh::DISCRETE_L2.
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.
Definition at line 46 of file system_norm.C.
References _norms, _weights, _weights_sq, and libMesh::DISCRETE_L2.
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
Definition at line 63 of file system_norm.C.
References _norms, _off_diagonal_weights, _weights, _weights_sq, and libMesh::DISCRETE_L2.
|
default |
Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class.
|
default |
|
virtualdefault |
Definition at line 230 of file system_norm.C.
Referenced by libMesh::AdjointResidualErrorEstimator::estimate_error().
Real libMesh::SystemNorm::calculate_norm | ( | const std::vector< Real > & | v1, |
const std::vector< Real > & | v2 | ||
) |
Definition at line 183 of file system_norm.C.
References _off_diagonal_weights, _weights, and libMesh::Real.
bool libMesh::SystemNorm::is_discrete | ( | ) | const |
true
if this is purely a discrete norm Definition at line 97 of file system_norm.C.
References _norms, libMesh::DISCRETE_L1, libMesh::DISCRETE_L2, and libMesh::DISCRETE_L_INF.
Referenced by libMesh::System::calculate_norm().
bool libMesh::SystemNorm::is_identity | ( | ) |
true
if no weight matrix W is specified or an identity matrix is specified, otherwise returns false Definition at line 235 of file system_norm.C.
References _off_diagonal_weights, and _weights.
Referenced by libMesh::AdjointResidualErrorEstimator::estimate_error().
|
default |
|
default |
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
Definition at line 154 of file system_norm.C.
References _off_diagonal_weights, and _weights.
void libMesh::SystemNorm::set_type | ( | unsigned int | var, |
const FEMNormType & | t | ||
) |
Sets the type of the norm in variable var
Definition at line 121 of file system_norm.C.
References _norms.
void libMesh::SystemNorm::set_weight | ( | unsigned int | var, |
Real | w | ||
) |
Sets the weight corresponding to the norm in variable var
Definition at line 140 of file system_norm.C.
References _weights, and _weights_sq.
FEMNormType libMesh::SystemNorm::type | ( | unsigned int | var | ) | const |
var
Definition at line 110 of file system_norm.C.
References _norms.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::System::calculate_norm(), libMesh::ErrorEstimator::estimate_errors(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()().
Real libMesh::SystemNorm::weight | ( | unsigned int | var | ) | const |
var
Definition at line 132 of file system_norm.C.
References _weights.
Referenced by libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::System::calculate_norm(), libMesh::JumpErrorEstimator::estimate_error(), libMesh::ExactErrorEstimator::estimate_error(), libMesh::LaplacianErrorEstimator::init_context(), libMesh::DiscontinuityMeasure::init_context(), libMesh::KellyErrorEstimator::init_context(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::KellyErrorEstimator::internal_side_integration(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::JumpErrorEstimator::reinit_sides().
Real libMesh::SystemNorm::weight_sq | ( | unsigned int | var | ) | const |
var
. We cache that at construction time to save a few flops. Definition at line 175 of file system_norm.C.
References _weights_sq.
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::System::calculate_norm(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()().
|
private |
Definition at line 166 of file system_norm.h.
Referenced by is_discrete(), set_type(), SystemNorm(), and type().
|
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.
Referenced by calculate_norm(), is_identity(), set_off_diagonal_weight(), and SystemNorm().
|
private |
Definition at line 168 of file system_norm.h.
Referenced by calculate_norm(), is_identity(), set_off_diagonal_weight(), set_weight(), SystemNorm(), and weight().
|
private |
Definition at line 169 of file system_norm.h.
Referenced by set_weight(), SystemNorm(), and weight_sq().