Cardinal
FieldTransferBase.h
Go to the documentation of this file.
1 /********************************************************************/
2 /* SOFTWARE COPYRIGHT NOTIFICATION */
3 /* Cardinal */
4 /* */
5 /* (c) 2021 UChicago Argonne, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by UChicago Argonne, LLC */
9 /* Under Contract No. DE-AC02-06CH11357 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* Prepared by Battelle Energy Alliance, LLC */
13 /* Under Contract No. DE-AC07-05ID14517 */
14 /* With the U. S. Department of Energy */
15 /* */
16 /* See LICENSE for full restrictions */
17 /********************************************************************/
18 
19 #pragma once
20 
21 #include "NekTransferBase.h"
22 #include "AuxiliarySystem.h"
23 
29 {
30 public:
31  static InputParameters validParams();
32 
33  FieldTransferBase(const InputParameters & parameters);
34 
36 
41  static std::map<unsigned int, std::string> usrwrkMap() { return _field_usrwrk_map; }
42 
47  static std::map<std::string, std::pair<Real, Real>> usrwrkScales()
48  {
49  return _field_usrwrk_scales;
50  }
51 
52 protected:
58  void fillAuxVariable(const unsigned int var_number, const double * value);
59 
64  void addExternalVariable(const std::string name);
65 
73  void addExternalVariable(const unsigned int slot,
74  const std::string name,
75  const Real additive,
76  const Real divisor);
77 
79  std::string _variable;
80 
82  std::vector<unsigned int> _usrwrk_slot;
83 
85  std::map<std::string, unsigned int> _variable_number;
86 
91  static std::map<unsigned int, std::string> _field_usrwrk_map;
92 
97  static std::map<std::string, std::pair<Real, Real>> _field_usrwrk_scales;
98 
101 
104 
106  double * _v_face = nullptr;
107 
109  double * _v_elem = nullptr;
110 
112  double * _external_data = nullptr;
113 };
int _n_per_surf
Number of points on the MOOSE mesh to write per element surface.
Definition: FieldTransferBase.h:100
std::string _variable
Variable name (or prefix of names) to create in MOOSE to facilitate data passing.
Definition: FieldTransferBase.h:79
void fillAuxVariable(const unsigned int var_number, const double *value)
Definition: NekTransferBase.h:31
std::map< std::string, unsigned int > _variable_number
Internal number for the variable(s) created in MOOSE (name, number)
Definition: FieldTransferBase.h:85
std::vector< unsigned int > _usrwrk_slot
Slot in usrwrk array to use for writing data, if 'direction = to_nek'.
Definition: FieldTransferBase.h:82
static std::map< unsigned int, std::string > usrwrkMap()
Definition: FieldTransferBase.h:41
void addExternalVariable(const std::string name)
static std::map< unsigned int, std::string > _field_usrwrk_map
Definition: FieldTransferBase.h:91
int _n_per_vol
Number of points on the MOOSE mesh to write per element volume.
Definition: FieldTransferBase.h:103
FieldTransferBase(const InputParameters &parameters)
double * _v_face
MOOSE data interpolated onto the (boundary) data transfer mesh.
Definition: FieldTransferBase.h:106
double * _v_elem
MOOSE data interpolated onto the (volume) data transfer mesh.
Definition: FieldTransferBase.h:109
double * _external_data
Scratch space to place external NekRS fields before writing into auxiliary variables.
Definition: FieldTransferBase.h:112
static std::map< std::string, std::pair< Real, Real > > _field_usrwrk_scales
Definition: FieldTransferBase.h:97
static InputParameters validParams()
static std::map< std::string, std::pair< Real, Real > > usrwrkScales()
Definition: FieldTransferBase.h:47
Definition: FieldTransferBase.h:28