28 "End time used for reversing the time integration when evaluating function derivative.");
34 : _ip_problem(*parameters.getCheckedPointerParam<
FEProblemBase *>(
"_fe_problem_base")),
36 parameters.
get<FunctionName>(
"function"), parameters.
get<
THREAD_ID>(
"_tid")))),
37 _reverse_time_end(parameters.
get<
Real>(
"reverse_time_end")),
38 _simulation_time(_ip_problem.getMooseApp().getStartTime())
42 parameters.
get<std::string>(
"_type"),
43 " must be an OptimizationFunction.");
57 _time_ip.emplace_back(time, std::vector<Real>());
70 mooseError(
"Internal error, 'setCurrentTime' needs to be called before calling 'update'.");
100 nvar = std::max(nvar, it.second.size());
102 it.second.resize(nvar);
103 result.assign(nvar, 0.0);
108 [](
const std::pair<Real, std::vector<Real>> &
a,
109 const std::pair<Real, std::vector<Real>> &
b) {
return a.first <
b.first; });
116 result[i] += ti.second[i];
std::vector< std::pair< Real, std::vector< Real > > > _time_ip
Vector holding data for each time.
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
void update(const Point &q_point, Real q_inner_product)
Accumulates integration for inner product by multiplying the given value by the function's parameterG...
void mooseError(Args &&... args)
static InputParameters validParams()
void setCurrentTime(Real time, Real dt)
This function sets up member variables for the inner product accumulation at certain time...
void add(const OptimizationFunctionInnerProductHelper &other)
Accumulates inner product integration in _curr_time_ip vector from another object.
const Parallel::Communicator & comm() const
std::vector< Real > * _curr_time_ip
Vector for current time.
const OptimizationFunction *const _function
Function used in optimization.
FEProblemBase & _ip_problem
FEProblem used for getting system quantities.
const Real & _reverse_time_end
The final time when we want to reverse the time index in function evaluation.
virtual std::vector< Real > parameterGradient(Real t, const Point &pt) const =0
OptimizationFunctionInnerProductHelper(const InputParameters ¶meters)
void getVector(std::vector< Real > &result)
Gathers _curr_time_ip from other processors and performs time integration.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _actual_time
Time the actual problem is at, defined by _reverse_time_end.
Base class for functions used in inverse optimization The parameterDerivative function is used in adj...
void max(const T &r, T &o, Request &req) const
bool relativeFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
IntRange< T > make_range(T beg, T end)
virtual bool isTransient() const override
auto index_range(const T &sizable)
const Elem & get(const ElemType type_in)