|
Philote-Cpp
C++ bindings for the Philote MDO standard
|
Implicit discipline class. More...
#include <implicit.h>
Public Member Functions | |
| ImplicitDiscipline () | |
| Construct a new Implicit Discipline object. | |
| ~ImplicitDiscipline () noexcept | |
| Destroy the Implicit Discipline object. | |
| void | RegisterServices (grpc::ServerBuilder &builder) |
| Registers all services with a gRPC channel. | |
| void | DeclarePartials (const std::string &f, const std::string &x) |
| Declare a (set of) partial(s) for the discipline. | |
| virtual void | ComputeResiduals (const philote::Variables &inputs, const philote::Variables &outputs, philote::Variables &residuals) |
| Computes the residual for the discipline. | |
| virtual void | SolveResiduals (const philote::Variables &inputs, philote::Variables &outputs) |
| Solves the residuals to obtain the outputs for the discipline. | |
| virtual void | ComputeResidualGradients (const philote::Variables &inputs, const philote::Variables &outputs, Partials &partials) |
| Computes the gradients of the residuals 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) | |
Implicit discipline class.
This class should be overriden by discipline developers. The basic discipline an implicit 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.
Implicit disciplines define residuals R(x,y) that must be solved to find outputs. They are suitable for analyses involving systems of equations, iterative solvers, or problems where outputs cannot be computed directly.
| philote::ImplicitDiscipline::ImplicitDiscipline | ( | ) |
Construct a new Implicit Discipline object.
|
noexcept |
Destroy the Implicit Discipline object.
|
virtual |
Computes the gradients of the residuals 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) |
|
virtual |
Computes the residual for the discipline.
This function should be overridden by the developer of the discipline.
| inputs | input variables for the discipline (continuous and discrete) |
| void philote::ImplicitDiscipline::DeclarePartials | ( | const std::string & | f, |
| const std::string & | x | ||
| ) |
Declare a (set of) partial(s) for the discipline.
| f | |
| x |
| void philote::ImplicitDiscipline::RegisterServices | ( | grpc::ServerBuilder & | builder | ) |
Registers all services with a gRPC channel.
| builder |
|
virtual |
Solves the residuals to obtain the outputs for the discipline.
This function should be overridden by the developer of the discipline.
| inputs | input variables for the discipline |
| outputs | output variables for the discipline (will be assigned during the function call) |