forked from idaholab/moose
/
RenormalizeVector.h
52 lines (39 loc) · 1.25 KB
/
RenormalizeVector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//* This file is part of the MOOSE framework
//* https://www.mooseframework.org
//*
//* All rights reserved, see COPYRIGHT for full restrictions
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
//*
//* Licensed under LGPL 2.1, please see LICENSE for details
//* https://www.gnu.org/licenses/lgpl-2.1.html
#pragma once
#include "GeneralUserObject.h"
#include "MooseMesh.h"
class NonlinearSystemBase;
/**
* Renormalization of a vector variable (i.e. a set of variables comprising a vector)
*/
class RenormalizeVector : public GeneralUserObject
{
public:
static InputParameters validParams();
RenormalizeVector(const InputParameters & parameters);
void initialize() override;
void execute() override;
void finalize() override;
// only needed for ElementUserObjects and NodalUseroObjects
void threadJoin(const UserObject &) override {}
protected:
/// reference to the mesh
MooseMesh & _mesh;
/// names of the variables to renormalize
const std::vector<VariableName> & _var_names;
// internal ID numbers of the variables to renormalize
std::vector<unsigned int> _var_numbers;
/// desired norm
const Real _target_norm;
// MOOSE Nonlinear system
NonlinearSystemBase & _nl_sys;
/// libMesh System pointer
System & _sys;
};