Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
WaveSpeedVPP.C
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 // MOOSE includes
11 #include "WaveSpeedVPP.h"
13 #include "MooseMesh.h"
14 #include "HLLCUserObject.h"
15 
16 registerMooseObject("NavierStokesApp", WaveSpeedVPP);
17 
20 {
22  params.addRequiredParam<unsigned int>("elem_id", "ID of the element");
23  params.addRequiredParam<unsigned int>("side_id", "ID of the side");
24  params.addRequiredParam<UserObjectName>("hllc_uo", "Name of HLLC UO");
25  params.addClassDescription("Extracts wave speeds from HLLC userobject for a given face");
26  return params;
27 }
28 
30  : GeneralVectorPostprocessor(parameters),
31  _hllc(getUserObject<HLLCUserObject>("hllc_uo")),
32  _side_id(getParam<unsigned int>("side_id")),
33  _wave_speeds(declareVector("wave_speed"))
34 {
35 }
36 
37 void
39 {
40  _elem = _fe_problem.mesh().queryElemPtr(getParam<unsigned int>("elem_id"));
41  _wave_speeds.clear();
42 }
43 
44 void
46 {
47  if (!_elem || !_hllc.hasData(_elem, _side_id))
48  return;
49 
50  const auto & ws = _hllc.waveSpeed(_elem, _side_id);
51  _wave_speeds.resize(ws.size());
52  for (const auto j : index_range(ws))
54 }
55 
56 void
58 {
60 }
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
static InputParameters validParams()
Definition: WaveSpeedVPP.C:19
virtual void finalize() override
Definition: WaveSpeedVPP.C:57
auto raw_value(const Eigen::Map< T > &in)
const Parallel::Communicator & _communicator
bool hasData(const Elem *elem, unsigned int side) const
Query whether this processor has data for the provided element and side.
const unsigned int _side_id
Definition: WaveSpeedVPP.h:34
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Elem * queryElemPtr(const dof_id_type i)
virtual void initialize() override
Definition: WaveSpeedVPP.C:38
static InputParameters validParams()
std::vector< ADReal > waveSpeed(const Elem *elem, unsigned int side) const
accessor for the wave speed
const HLLCUserObject & _hllc
Definition: WaveSpeedVPP.h:33
registerMooseObject("NavierStokesApp", WaveSpeedVPP)
Gets wave speeds from HLLC user object.
Definition: WaveSpeedVPP.h:21
FEProblemBase & _fe_problem
virtual MooseMesh & mesh() override
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
WaveSpeedVPP(const InputParameters &parameters)
Definition: WaveSpeedVPP.C:29
const Elem * _elem
Definition: WaveSpeedVPP.h:35
virtual void execute() override
Definition: WaveSpeedVPP.C:45
VectorPostprocessorValue & _wave_speeds
Definition: WaveSpeedVPP.h:36
void ErrorVector unsigned int
auto index_range(const T &sizable)