https://mooseframework.inl.gov
DiscreteVariableResidualNorm.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #pragma once
11 
12 #include "ElementPostprocessor.h"
13 
18 {
19 public:
21 
23  enum class NormType
24  {
25  l_1 = 0,
26  l_2 = 1,
27  l_inf = 2
28  };
29 
31 
32  virtual void initialize() override;
33  virtual void execute() override;
34  virtual void threadJoin(const UserObject & y) override;
35  virtual void finalize() override;
36 
37  virtual PostprocessorValue getValue() const override;
38 
39 protected:
45  const bool _correct_mesh_bias;
49  std::set<dof_id_type> _local_dof_indices;
51  std::map<processor_id_type, std::vector<dof_id_type>> _nonlocal_dof_indices_map;
54 };
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
virtual void execute() override
Execute method.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
NumericVector< Number > & _nl_residual_vector
Nonlinear residual vector.
This class provides an interface for common operations on field variables of both FE and FV types wit...
virtual void finalize() override
This is called after execute() and after threadJoin()! This is probably where you want to do MPI comm...
MooseVariableFieldBase & _var
The variable we compute the residual for.
virtual void threadJoin(const UserObject &y) override
Must override.
const bool _correct_mesh_bias
If true, correct mesh-size bias in norm.
std::map< processor_id_type, std::vector< dof_id_type > > _nonlocal_dof_indices_map
Non-local DoF indices map, indexed by the owning PID.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::set< dof_id_type > _local_dof_indices
Local DoF indices for the variable, block-restricted.
DiscreteVariableResidualNorm(const InputParameters &parameters)
const InputParameters & parameters() const
Get the parameters of the object.
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
Computes a discrete norm for a block-restricted variable residual.
Base class for user-specific data.
Definition: UserObject.h:40
const NormType _norm_type
Type of norm to compute.
Real _norm
The computed residual norm.