https://mooseframework.inl.gov
ConditionalSampleReporter.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 
13 #include "FunctionParserUtils.h"
14 
15 // Forward declaration
16 template <typename T>
18 
19 // Typedef for object registration
21 
29 template <typename T>
31  public FunctionParserUtils<false>
32 {
33 public:
36 
37 protected:
43  virtual bool needSample(const std::vector<Real> & row,
44  dof_id_type local_ind,
45  dof_id_type global_ind,
46  T & val) override;
47 
48 private:
50  const std::string & _function;
52  const T & _default_value;
55  const std::vector<std::pair<std::string, unsigned int>> _sampler_vars;
57  const bool _use_time;
60 };
const std::vector< std::pair< std::string, unsigned int > > _sampler_vars
Pairs between the variables in the function string and their associated sampler column index...
std::shared_ptr< SymFunction > SymFunctionPtr
ConditionalSampleReporterTempl< Real > ConditionalSampleReporter
This object is mainly meant for demonstration for eventual active learning algorithms, but could prove useful.
ConditionalSampleReporterTempl(const InputParameters &parameters)
SymFunctionPtr _func_F
Parsed function pointer.
const std::string & _function
User-inputted function string.
virtual bool needSample(const std::vector< Real > &row, dof_id_type local_ind, dof_id_type global_ind, T &val) override
This evaluates the inputted function to determine whether a multiapp solve is necessary/allowed, otherwise it replaces the "transferred" quantity with a default value.
const InputParameters & parameters() const
const T & _default_value
User-inputted default value.
This is a base class for performing active learning routines, meant to be used in conjunction with Sa...
uint8_t dof_id_type
const bool _use_time
Whether or not the function string includes a time variable.