|
Philote-Cpp
C++ bindings for the Philote MDO standard
|
Explicit discipline class. More...
#include <explicit.h>
Public Member Functions | |
| ExplicitDiscipline () | |
| Construct a new Explicit Discipline object. | |
| ~ExplicitDiscipline () noexcept | |
| Destroy the Explicit Discipline object. | |
| void | RegisterServices (grpc::ServerBuilder &builder) |
| Registers all services with a gRPC channel. | |
| virtual void | Compute (const philote::Variables &inputs, philote::Variables &outputs) |
| Function evaluation for the discipline. | |
| virtual void | ComputePartials (const philote::Variables &inputs, Partials &partials) |
| Gradient evaluation for the discipline. | |
Public Member Functions inherited from philote::Discipline | |
| Discipline () | |
| Construct a new Discipline object. | |
| ~Discipline () noexcept | |
| Destroy the Discipline object. | |
| std::map< std::string, std::string > & | options_list () |
| Gets the options list. | |
| std::vector< philote::VariableMetaData > & | var_meta () |
| Accesses the variable meta data. | |
| const std::vector< philote::VariableMetaData > & | var_meta () const noexcept |
| std::vector< philote::PartialsMetaData > & | partials_meta () |
| Accesses the partials meta data. | |
| const std::vector< philote::PartialsMetaData > & | partials_meta () const noexcept |
| philote::DisciplineProperties & | properties () |
| Gets the discipline properties. | |
| philote::StreamOptions & | stream_opts () |
| Gets the stream options. | |
| const philote::StreamOptions & | stream_opts () const noexcept |
| void | AddInput (const std::string &name, const std::vector< int64_t > &shape, const std::string &units) |
| Declares an input. | |
| void | AddOutput (const std::string &name, const std::vector< int64_t > &shape, const std::string &units) |
| Declares an output. | |
| void | DeclarePartials (const std::string &f, const std::string &x) |
| Declare a (set of) partial(s) for the discipline. | |
| void | AddOption (const std::string &name, const std::string &type) |
| Add an option to the discipline. | |
| virtual void | Initialize () |
| Initialize function that sets up available options. | |
| virtual void | Configure () |
| Configure function that is called after options are set. | |
| virtual void | SetOptions (const google::protobuf::Struct &options_struct) |
| Sets up all discipline options based on a protobuf struct that the server received from the client. | |
| virtual void | Setup () |
| Setup function that is called by the server when the client calls the setup RPC. | |
| virtual void | SetupPartials () |
| Setup function that is called by the server when the client calls the setup RPC. | |
| void | SetContext (grpc::ServerContext *context) const noexcept |
| Set the gRPC server context for cancellation detection. | |
| void | ClearContext () const noexcept |
| Clear the gRPC server context. | |
| bool | IsCancelled () const noexcept |
| Check if the current operation has been cancelled. | |
Additional Inherited Members | |
Protected Member Functions inherited from philote::Discipline | |
| std::vector< int64_t > | ComputePartialShape (const std::string &f, const std::string &x, bool allow_output_as_x) |
| Computes the shape for a partial derivative df/dx. | |
Protected Attributes inherited from philote::Discipline | |
| std::map< std::string, std::string > | options_list_ |
| List of options that can be set by the client. | |
| std::vector< philote::VariableMetaData > | var_meta_ |
| List of variable meta data. | |
| std::vector< philote::PartialsMetaData > | partials_meta_ |
| List of partials meta data. | |
| philote::DisciplineProperties | properties_ |
| Discipline properties. | |
| philote::StreamOptions | stream_opts_ |
| Stream options. | |
| grpc::ServerContext * | current_context_ = nullptr |
| Current gRPC server context for cancellation detection (mutable for const correctness) | |
Explicit discipline class.
This class should be overriden by discipline developers. The basic discipline and explicit discipline servers are private member variables of this class and are registered to a gRPC connection together via the RegisterServers member function. The discipline developer should not have to interact further with these services.
Explicit disciplines compute direct function evaluations (f(x) = y) and optionally their gradients. They are suitable for analyses where outputs can be computed directly from inputs without solving implicit equations.
| philote::ExplicitDiscipline::ExplicitDiscipline | ( | ) |
Construct a new Explicit Discipline object.
|
noexcept |
Destroy the Explicit Discipline object.
|
virtual |
Function evaluation for the discipline.
This function should be overridden by the developer of the discipline.
| inputs | input variables for the discipline (continuous and discrete) |
|
virtual |
Gradient evaluation for the discipline.
This function should be overridden by the developer of the discipline, if applicable (not every discipline can provide partials).
| inputs | input variables for the discipline (continuous and discrete) |
| void philote::ExplicitDiscipline::RegisterServices | ( | grpc::ServerBuilder & | builder | ) |
Registers all services with a gRPC channel.
| builder |