|
libMesh
|
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 with weight of 1.0. 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 (std::vector< FEMNormType > norms) | |
| Constructor, for unweighted sobolev norms on systems with multiple variables. More... | |
| SystemNorm (std::vector< FEMNormType > norms, std::vector< Real > &weights) | |
| Constructor, for weighted sobolev norms on systems with multiple variables. More... | |
| SystemNorm (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 | |
| 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) |
Sets the type of the norm in variable var, as well as for any unset variables with index less than 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, as well as for any unset variables with index less than 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... | |
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.
For ease of use, if a norm or weight is queried for variable n but has not been set for variable n, then the norm or weight set for the highest-numbered variable below n is returned.
Definition at line 49 of file system_norm.h.
| libMesh::SystemNorm::SystemNorm | ( | ) |
Constructor, defaults to DISCRETE_L2 with weight of 1.0.
Definition at line 27 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 33 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 39 of file system_norm.C.
References _norms, and libMesh::DISCRETE_L2.
| libMesh::SystemNorm::SystemNorm | ( | 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 47 of file system_norm.C.
References _norms, _weights, _weights_sq, libMesh::DISCRETE_L2, and libMesh::index_range().
| libMesh::SystemNorm::SystemNorm | ( | 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 65 of file system_norm.C.
References _norms, _off_diagonal_weights, _weights, _weights_sq, libMesh::DISCRETE_L2, and libMesh::index_range().
|
default |
Copy/move ctor, copy/move assignment operator, and destructor are all explicitly defaulted for this simple class.
|
default |
|
virtualdefault |
Definition at line 232 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 185 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 99 of file system_norm.C.
References _norms, libMesh::DISCRETE_L1, libMesh::DISCRETE_L2, libMesh::DISCRETE_L_INF, and libMesh::libmesh_assert().
| 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 237 of file system_norm.C.
References _off_diagonal_weights, and _weights.
Referenced by libMesh::AdjointResidualErrorEstimator::estimate_error().
|
default |
|
default |
Sets the weight corresponding to the norm from the variable pair v1(var1) coming from v2(var2).
See calculate_norm
Definition at line 156 of file system_norm.C.
References _off_diagonal_weights, _weights, and libMesh::libmesh_assert().
| void libMesh::SystemNorm::set_type | ( | unsigned int | var, |
| const FEMNormType & | t | ||
| ) |
Sets the type of the norm in variable var, as well as for any unset variables with index less than var.
Definition at line 123 of file system_norm.C.
References _norms, and libMesh::libmesh_assert().
Referenced by main().
Sets the weight corresponding to the norm in variable var, as well as for any unset variables with index less than var.
Definition at line 142 of file system_norm.C.
References _weights, _weights_sq, and libMesh::libmesh_assert().
Referenced by main().
| FEMNormType libMesh::SystemNorm::type | ( | unsigned int | var | ) | const |
var If no norm has been explicitly set for var, then the highest-index norm explicitly set is returned, or DISCRETE_L2 is returned if no norms have been explicitly set.
Definition at line 112 of file system_norm.C.
References _norms, and libMesh::libmesh_assert().
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::ErrorEstimator::estimate_errors(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()().
var If no weight has been explicitly set for var, then the highest-index weight explicitly set is returned, or 1.0 is returned if no weights have been explicitly set.
Definition at line 134 of file system_norm.C.
References _weights, and libMesh::libmesh_assert().
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().
var. We cache that at construction time to save a few flops. Definition at line 177 of file system_norm.C.
References _weights_sq, and libMesh::libmesh_assert().
Referenced by libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), and libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()().
|
private |
Definition at line 174 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 183 of file system_norm.h.
Referenced by calculate_norm(), is_identity(), set_off_diagonal_weight(), and SystemNorm().
|
private |
Definition at line 176 of file system_norm.h.
Referenced by calculate_norm(), is_identity(), set_off_diagonal_weight(), set_weight(), SystemNorm(), and weight().
|
private |
Definition at line 177 of file system_norm.h.
Referenced by set_weight(), SystemNorm(), and weight_sq().
1.8.14