Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
scalar_objective.hpp
Go to the documentation of this file.
1 // Copyright Lawrence Livermore National Security, LLC and
2 // other Smith Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 
13 #pragma once
14 
15 #include <vector>
16 #include "smith/physics/common.hpp"
18 
19 namespace mfem {
20 class Vector;
21 } // namespace mfem
22 
23 namespace smith {
24 
25 class FiniteElementState;
26 
29  public:
31  ScalarObjective(const std::string& name) : name_(name) {}
32 
34  virtual ~ScalarObjective() {}
35 
45  virtual double evaluate(double time, double dt, ConstFieldPtr shape_disp,
46  const std::vector<ConstFieldPtr>& fields) const = 0;
47 
57  virtual mfem::Vector gradient(double time, double dt, ConstFieldPtr shape_disp,
58  const std::vector<ConstFieldPtr>& fields, int field_ordinal) const = 0;
59 
68  virtual mfem::Vector mesh_coordinate_gradient(double time, double dt, ConstFieldPtr shape_disp,
69  const std::vector<ConstFieldPtr>& fields) const = 0;
70 
72  std::string name() const { return name_; }
73 
74  private:
76  std::string name_;
77 };
78 
79 } // namespace smith
Abstract residual class.
virtual mfem::Vector mesh_coordinate_gradient(double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields) const =0
Virtual interface for computing objective gradient with respect to the mesh coordinates.
virtual ~ScalarObjective()
destructor
virtual mfem::Vector gradient(double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields, int field_ordinal) const =0
Virtual interface for computing objective gradient from a vector of smith::FiniteElementState*.
std::string name() const
name
virtual double evaluate(double time, double dt, ConstFieldPtr shape_disp, const std::vector< ConstFieldPtr > &fields) const =0
Virtual interface for computing the scale value for the objective/constrant, given a vector of smith:...
ScalarObjective(const std::string &name)
base constructor takes the name of the physics
A file defining some enums and structs that are used by the different physics modules.
Defines common types and helper functions for using the residual and scalar_objective classes.
Accelerator functionality.
Definition: smith.cpp:36
FiniteElementState const * ConstFieldPtr
using
Definition: field_types.hpp:36