IgANet
IGAnets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
poisson< Optimizer, GeometryMap, Variable > Class Template Reference

Specialization of the abstract IgANet class for Poisson's equation. More...

Inheritance diagram for poisson< Optimizer, GeometryMap, Variable >:
iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase > iganet::v1::IgANetCustomizable< GeometryMap, Variable > iganet::IgANet< Optimizer, Inputs, Outputs, CollPts > iganet::IgANetCustomizable< Inputs, Outputs > iganet::utils::Serializable iganet::utils::FullQualifiedName iganet::IgABase< typename, typename, typename > iganet::utils::Serializable iganet::utils::FullQualifiedName

Public Member Functions

template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs>
 poisson (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const std::array< int64_t, GeometryMapNumCoeffs > &geometryMapNumCoeffs, const std::array< int64_t, VariableNumCoeffs > &variableNumCoeffs)
 Constructor.
 
template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs>
 poisson (std::vector< int64_t > &&layers, std::vector< std::vector< std::any > > &&activations, std::array< int64_t, GeometryMapNumCoeffs > &&geometryMapNumCoeffs, std::array< int64_t, VariableNumCoeffs > &&variableNumCoeffs)
 Constructor.
 
auto & bdr ()
 Returns a non-constant reference to the boundary.
 
auto const & bdr () const
 Returns a constant reference to the boundary.
 
auto const & collPts () const
 Returns a constant reference to the collocation points.
 
auto const & collPts () const
 Returns a constant reference to the collocation points.
 
bool epoch (int64_t epoch) override
 Initializes the epoch.
 
bool epoch (int64_t epoch) override
 Initializes the epoch.
 
auto & f ()
 Returns a non-constant reference to the right-hand side.
 
auto const & f () const
 Returns a constant reference to the right-hand side.
 
auto & G ()
 Returns a non-constant reference to the geometry.
 
auto const & G () const
 Returns a constant reference to the geometry.
 
torch::Tensor loss (const torch::Tensor &outputs, int64_t epoch) override
 Computes the loss function.
 
torch::Tensor loss (const torch::Tensor &outputs, int64_t epoch) override
 Computes the loss function.
 
auto & ref ()
 Returns a non-constant reference to the reference solution.
 
auto & ref ()
 Returns a non-constant reference to the reference solution.
 
auto const & ref () const
 Returns a constant reference to the reference solution.
 
auto const & ref () const
 Returns a constant reference to the reference solution.
 
auto & u ()
 Returns a non-constant reference to the solution.
 
auto const & u () const
 Returns a constant reference to the solution.
 
- Public Member Functions inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >
 IgANet (const IgANetOptions &defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Default constructor.
 
- Public Member Functions inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >
 IgANet (const IgANetOptions &defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Default constructor.
 
template<typename NumCoeffs >
 IgANet (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const NumCoeffs &numCoeffs, enum init init=init::greville, IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
 
template<typename NumCoeffsInputs , typename NumCoeffsOutputs >
 IgANet (const std::vector< int64_t > &layers, const std::vector< std::vector< std::any > > &activations, const NumCoeffsInputs &numCoeffsInputs, const NumCoeffsOutputs &numCoeffsOutputs, enum init init=init::greville, IgANetOptions defaults={}, iganet::Options< typename Base::value_type > options=iganet::Options< typename Base::value_type >{})
 Constructor: number of layers, activation functions, and number of spline coefficients (same for all inputs and outputs)
 
void eval ()
 Evaluate IgANet.
 
constexpr auto & inputs ()
 Returns a non-constant reference to the tuple of input objects.
 
constexpr const auto & inputs () const
 Returns a constant reference to the tuple of input objects.
 
virtual void inputs (const torch::Tensor &tensor)
 Attaches the given tensor to the inputs.
 
virtual torch::Tensor inputs (int64_t epoch) const
 Returns the network inputs as tensor.
 
void load (const std::string &filename, const std::string &key="iganet")
 Loads the IgANet from file.
 
torch::OrderedDict< std::string, torch::Tensor > named_parameters () const noexcept
 Returns a constant reference to the named parameters of the IgANet object.
 
IgANetGenerator< typename Base::value_type > & net ()
 Returns a non-constant reference to the IgANet generator.
 
const IgANetGenerator< typename Base::value_type > & net () const
 Returns a constant reference to the IgANet generator.
 
std::size_t nparameters () const noexcept
 Returns the total number of parameters of the IgANet object.
 
bool operator!= (const IgANet &other) const
 Returns true if both IgANet objects are different.
 
bool operator== (const IgANet &other) const
 Returns true if both IgANet objects are the same.
 
optimizer_typeoptimizer ()
 Returns a non-constant reference to the optimizer.
 
const optimizer_typeoptimizer () const
 Returns a constant reference to the optimizer.
 
optimizer_options_typeoptimizerOptions (std::size_t param_group=0)
 Returns a non-constant reference to the optimizer options.
 
const optimizer_options_typeoptimizerOptions (std::size_t param_group=0) const
 Returns a constant reference to the optimizer options.
 
void optimizerOptionsReset (const optimizer_options_type &options)
 Resets the optimizer options.
 
void optimizerOptionsReset (const optimizer_options_type &options, std::size_t param_group)
 Resets the optimizer options.
 
void optimizerOptionsReset (optimizer_options_type &&options)
 Resets the optimizer options.
 
void optimizerOptionsReset (optimizer_options_type &&options, std::size_t param_group)
 Resets the optimizer options.
 
void optimizerReset (bool resetOptions=true)
 Resets the optimizer.
 
void optimizerReset (const optimizer_options_type &optimizerOptions)
 Resets the optimizer.
 
auto & options ()
 Returns a non-constant reference to the options structure.
 
const auto & options () const
 Returns a constant reference to the options structure.
 
constexpr auto & outputs ()
 Returns a non-constant reference to the tuple of output objects.
 
constexpr const auto & outputs () const
 Returns a constant reference to the tuple of output objects.
 
virtual void outputs (const torch::Tensor &tensor)
 Attaches the given tensor to the outputs.
 
virtual torch::Tensor outputs (int64_t epoch) const
 Returns the network outputs as tensor.
 
std::vector< torch::Tensor > parameters () const noexcept
 Returns a constant reference to the parameters of the IgANet object.
 
void pretty_print (std::ostream &os) const noexcept override
 Returns a string representation of the IgANet object.
 
torch::serialize::InputArchive & read (torch::serialize::InputArchive &archive, const std::string &key="iganet")
 Loads the IgANet from a torch::serialize::InputArchive object.
 
torch::Tensor & register_parameter (std::string name, torch::Tensor tensor, bool requires_grad=true)
 Registers a parameter.
 
void save (const std::string &filename, const std::string &key="iganet") const
 Saves the IgANet to file.
 
nlohmann::json to_json () const override
 Returns the IgANet object as JSON object.
 
virtual void train ()
 Trains the IgANet.
 
template<typename DataLoader >
void train (DataLoader &loader)
 Trains the IgANet.
 
torch::serialize::OutputArchive & write (torch::serialize::OutputArchive &archive, const std::string &key="iganet") const
 Writes the IgANet into a torch::serialize::OutputArchive object.
 

Private Types

using Base = iganet::v1::IgANet< Optimizer, GeometryMap, Variable >
 Type of the base class.
 
using Base = iganet::IgANet< Optimizer, Inputs, Outputs >
 Type of the base class.
 
using Customizable = iganet::v1::IgANetCustomizable< GeometryMap, Variable >
 Type of the customizable class.
 
using Customizable = iganet::IgANetCustomizable< Inputs, Outputs >
 Type of the customizable class.
 

Private Attributes

Base::variable_collPts_type collPts_
 Collocation points.
 
Base::template collPts_t< 0 > collPts_
 Collocation points.
 
Customizable::geometryMap_interior_coeff_indices_type G_coeff_indices_
 Coefficient indices of the geometry map.
 
Customizable::template input_interior_coeff_indices_t< 0 > G_coeff_indices_
 Coefficient indices of the geometry map.
 
Customizable::geometryMap_interior_knot_indices_type G_knot_indices_
 Knot indices of the geometry map.
 
Customizable::template input_interior_knot_indices_t< 0 > G_knot_indices_
 Knot indices of the geometry map.
 
torch::Tensor log_sigma_bdr_
 
torch::Tensor log_sigma_pde_
 
Variable ref_
 Reference solution.
 
Base::template input_t< 1 > ref_
 Reference solution.
 
Customizable::variable_interior_coeff_indices_type var_coeff_indices_
 Coefficient indices of variables.
 
Customizable::template output_interior_coeff_indices_t< 0 > var_coeff_indices_
 Coefficient indices of variables.
 
Customizable::variable_interior_knot_indices_type var_knot_indices_
 Knot indices of variables.
 
Customizable::template output_interior_knot_indices_t< 0 > var_knot_indices_
 Knot indices of variables.
 

Additional Inherited Members

- Public Types inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >
using Base = IgABase< GeometryMap, Variable >
 Base type.
 
using optimizer_options_type = optimizer_options_type< Optimizer >::type
 Type of the optimizer options.
 
using optimizer_type = Optimizer
 Type of the optimizer.
 
- Public Types inherited from iganet::v1::IgANetCustomizable< GeometryMap, Variable >
using geometryMap_boundary_coeff_indices_type = decltype(std::declval< GeometryMap >() .template find_coeff_indices< functionspace::boundary >(std::declval< typename GeometryMap::boundary_eval_type >()))
 Type of the coefficient indices of geometry type at the boundary.
 
using geometryMap_boundary_knot_indices_type = decltype(std::declval< GeometryMap >() .template find_knot_indices< functionspace::boundary >(std::declval< typename GeometryMap::boundary_eval_type >()))
 Type of the knot indices of the geometry map at the boundary.
 
using geometryMap_interior_coeff_indices_type = decltype(std::declval< GeometryMap >() .template find_coeff_indices< functionspace::interior >(std::declval< typename GeometryMap::eval_type >()))
 Type of the coefficient indices of geometry type in the interior.
 
using geometryMap_interior_knot_indices_type = decltype(std::declval< GeometryMap >() .template find_knot_indices< functionspace::interior >(std::declval< typename GeometryMap::eval_type >()))
 Type of the knot indices of the geometry map in the interior.
 
using variable_boundary_coeff_indices_type = decltype(std::declval< Variable >() .template find_coeff_indices< functionspace::boundary >(std::declval< typename Variable::boundary_eval_type >()))
 Type of the coefficient indices of variable type at the boundary.
 
using variable_boundary_knot_indices_type = decltype(std::declval< Variable >() .template find_knot_indices< functionspace::boundary >(std::declval< typename Variable::boundary_eval_type >()))
 Type of the knot indices of boundary_eval_type type at the boundary.
 
using variable_interior_coeff_indices_type = decltype(std::declval< Variable >() .template find_coeff_indices< functionspace::interior >(std::declval< typename Variable::eval_type >()))
 Type of the coefficient indices of variable type in the interior.
 
using variable_interior_knot_indices_type = decltype(std::declval< Variable >() .template find_knot_indices< functionspace::interior >(std::declval< typename Variable::eval_type >()))
 Type of the knot indices of the variables in the interior.
 
- Public Types inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >
using Base = IgABase< Inputs, Outputs, CollPts >
 Base type.
 
using optimizer_options_type = optimizer_options_type< Optimizer >::type
 Type of the optimizer options.
 
using optimizer_type = Optimizer
 Type of the optimizer.
 
using value_type = Base::value_type
 Value type.
 
- Protected Attributes inherited from iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >
IgANetGenerator< typename Base::value_typenet_
 IgANet generator.
 
std::unique_ptr< optimizer_typeopt_
 Optimizer.
 
IgANetOptions options_
 Options.
 
- Protected Attributes inherited from iganet::IgANet< Optimizer, Inputs, Outputs, CollPts >
IgANetGenerator< typename Base::value_type > net_
 IgANet generator.
 
std::unique_ptr< optimizer_typeopt_
 Optimizer.
 
IgANetOptions options_
 Options.
 

Detailed Description

template<typename Optimizer, typename GeometryMap, typename Variable>
class poisson< Optimizer, GeometryMap, Variable >

Specialization of the abstract IgANet class for Poisson's equation.

Member Typedef Documentation

◆ Base [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
using poisson< Optimizer, GeometryMap, Variable >::Base = iganet::v1::IgANet<Optimizer, GeometryMap, Variable>
private

Type of the base class.

◆ Base [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
using poisson< Optimizer, GeometryMap, Variable >::Base = iganet::IgANet<Optimizer, Inputs, Outputs>
private

Type of the base class.

◆ Customizable [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
using poisson< Optimizer, GeometryMap, Variable >::Customizable = iganet::v1::IgANetCustomizable<GeometryMap, Variable>
private

Type of the customizable class.

◆ Customizable [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
using poisson< Optimizer, GeometryMap, Variable >::Customizable = iganet::IgANetCustomizable<Inputs, Outputs>
private

Type of the customizable class.

Constructor & Destructor Documentation

◆ poisson() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs>
poisson< Optimizer, GeometryMap, Variable >::poisson ( std::vector< int64_t > &&  layers,
std::vector< std::vector< std::any > > &&  activations,
std::array< int64_t, GeometryMapNumCoeffs > &&  geometryMapNumCoeffs,
std::array< int64_t, VariableNumCoeffs > &&  variableNumCoeffs 
)
inline

Constructor.

◆ poisson() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
template<std::size_t GeometryMapNumCoeffs, std::size_t VariableNumCoeffs>
poisson< Optimizer, GeometryMap, Variable >::poisson ( const std::vector< int64_t > &  layers,
const std::vector< std::vector< std::any > > &  activations,
const std::array< int64_t, GeometryMapNumCoeffs > &  geometryMapNumCoeffs,
const std::array< int64_t, VariableNumCoeffs > &  variableNumCoeffs 
)
inline

Constructor.

Member Function Documentation

◆ bdr() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::bdr ( )
inline

Returns a non-constant reference to the boundary.

◆ bdr() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::bdr ( ) const
inline

Returns a constant reference to the boundary.

◆ collPts() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::collPts ( ) const
inline

Returns a constant reference to the collocation points.

◆ collPts() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::collPts ( ) const
inline

Returns a constant reference to the collocation points.

◆ epoch() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
bool poisson< Optimizer, GeometryMap, Variable >::epoch ( int64_t  epoch)
inlineoverridevirtual

Initializes the epoch.

Parameters
[in]epochEpoch number

Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.

◆ epoch() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
bool poisson< Optimizer, GeometryMap, Variable >::epoch ( int64_t  epoch)
inlineoverridevirtual

Initializes the epoch.

Parameters
[in]epochEpoch number

Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.

◆ f() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::f ( )
inline

Returns a non-constant reference to the right-hand side.

◆ f() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::f ( ) const
inline

Returns a constant reference to the right-hand side.

◆ G() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::G ( )
inline

Returns a non-constant reference to the geometry.

◆ G() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::G ( ) const
inline

Returns a constant reference to the geometry.

◆ loss() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
torch::Tensor poisson< Optimizer, GeometryMap, Variable >::loss ( const torch::Tensor &  outputs,
int64_t  epoch 
)
inlineoverridevirtual

Computes the loss function.

Parameters
[in]outputsOutput of the network
[in]epochEpoch number

Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.

◆ loss() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
torch::Tensor poisson< Optimizer, GeometryMap, Variable >::loss ( const torch::Tensor &  outputs,
int64_t  epoch 
)
inlineoverridevirtual

Computes the loss function.

Parameters
[in]outputsOutput of the network
[in]epochEpoch number

Implements iganet::v1::IgANet< Optimizer, GeometryMap, Variable, IgABase >.

◆ ref() [1/4]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::ref ( )
inline

Returns a non-constant reference to the reference solution.

◆ ref() [2/4]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::ref ( )
inline

Returns a non-constant reference to the reference solution.

◆ ref() [3/4]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::ref ( ) const
inline

Returns a constant reference to the reference solution.

◆ ref() [4/4]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::ref ( ) const
inline

Returns a constant reference to the reference solution.

◆ u() [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto & poisson< Optimizer, GeometryMap, Variable >::u ( )
inline

Returns a non-constant reference to the solution.

◆ u() [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
auto const & poisson< Optimizer, GeometryMap, Variable >::u ( ) const
inline

Returns a constant reference to the solution.

Member Data Documentation

◆ collPts_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Base::variable_collPts_type poisson< Optimizer, GeometryMap, Variable >::collPts_
private

Collocation points.

◆ collPts_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Base::template collPts_t<0> poisson< Optimizer, GeometryMap, Variable >::collPts_
private

Collocation points.

◆ G_coeff_indices_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::geometryMap_interior_coeff_indices_type poisson< Optimizer, GeometryMap, Variable >::G_coeff_indices_
private

Coefficient indices of the geometry map.

◆ G_coeff_indices_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::template input_interior_coeff_indices_t<0> poisson< Optimizer, GeometryMap, Variable >::G_coeff_indices_
private

Coefficient indices of the geometry map.

◆ G_knot_indices_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::geometryMap_interior_knot_indices_type poisson< Optimizer, GeometryMap, Variable >::G_knot_indices_
private

Knot indices of the geometry map.

◆ G_knot_indices_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::template input_interior_knot_indices_t<0> poisson< Optimizer, GeometryMap, Variable >::G_knot_indices_
private

Knot indices of the geometry map.

◆ log_sigma_bdr_

template<typename Optimizer , typename GeometryMap , typename Variable >
torch::Tensor poisson< Optimizer, GeometryMap, Variable >::log_sigma_bdr_
private

◆ log_sigma_pde_

template<typename Optimizer , typename GeometryMap , typename Variable >
torch::Tensor poisson< Optimizer, GeometryMap, Variable >::log_sigma_pde_
private

◆ ref_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Variable poisson< Optimizer, GeometryMap, Variable >::ref_
private

Reference solution.

◆ ref_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Base::template input_t<1> poisson< Optimizer, GeometryMap, Variable >::ref_
private

Reference solution.

◆ var_coeff_indices_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::variable_interior_coeff_indices_type poisson< Optimizer, GeometryMap, Variable >::var_coeff_indices_
private

Coefficient indices of variables.

◆ var_coeff_indices_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::template output_interior_coeff_indices_t<0> poisson< Optimizer, GeometryMap, Variable >::var_coeff_indices_
private

Coefficient indices of variables.

◆ var_knot_indices_ [1/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::variable_interior_knot_indices_type poisson< Optimizer, GeometryMap, Variable >::var_knot_indices_
private

Knot indices of variables.

◆ var_knot_indices_ [2/2]

template<typename Optimizer , typename GeometryMap , typename Variable >
Customizable::template output_interior_knot_indices_t<0> poisson< Optimizer, GeometryMap, Variable >::var_knot_indices_
private

Knot indices of variables.


The documentation for this class was generated from the following files: