https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
37void
39{
40 _elem = _fe_problem.mesh().queryElemPtr(getParam<unsigned int>("elem_id"));
41 _wave_speeds.clear();
42}
43
44void
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
56void
registerMooseObject("NavierStokesApp", WaveSpeedVPP)
void ErrorVector unsigned int
virtual MooseMesh & mesh() override
static InputParameters validParams()
std::vector< ADReal > waveSpeed(const Elem *elem, unsigned int side) const
accessor for the wave speed
bool hasData(const Elem *elem, unsigned int side) const
Query whether this processor has data for the provided element and side.
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual Elem * queryElemPtr(const dof_id_type i)
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
FEProblemBase & _fe_problem
Gets wave speeds from HLLC user object.
virtual void initialize() override
const HLLCUserObject & _hllc
static InputParameters validParams()
virtual void execute() override
const Elem * _elem
virtual void finalize() override
WaveSpeedVPP(const InputParameters &parameters)
VectorPostprocessorValue & _wave_speeds
const unsigned int _side_id
const Parallel::Communicator & _communicator
auto raw_value(const Eigen::Map< T > &in)