https://mooseframework.inl.gov
Loading...
Searching...
No Matches
LAROMANCEPartitionStressUpdateBase.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9#pragma once
10
12
13template <bool is_ad>
15{
16public:
18
20
21protected:
22 virtual void initialSetup() override;
23 virtual void computePartitionWeights(std::vector<GenericReal<is_ad>> & weights,
24 std::vector<GenericReal<is_ad>> & dweights_dstress) override;
25
26 virtual void exportJSON() override;
27
33
36
40 virtual void
41 computeDSecondPartitionWeightDStress(GenericReal<is_ad> & dsecond_partition_weight_dstress);
42
44 virtual std::vector<std::vector<Real>> getClassificationLuu()
45 {
46 this->checkJSONKey("luu");
47 return this->_json["luu"].template get<std::vector<std::vector<Real>>>();
48 }
49 std::vector<std::vector<Real>> _partition_Luu;
51
53 virtual std::vector<std::vector<Real>> getClassificationXu()
54 {
55 this->checkJSONKey("xu");
56 return this->_json["xu"].template get<std::vector<std::vector<Real>>>();
57 }
58 std::vector<std::vector<Real>> _partition_Xu;
60
62 virtual DenseVector<Real> getClassificationVind()
63 {
64 this->checkJSONKey("vind");
65 return DenseVector<Real>(this->_json["vind"].template get<std::vector<Real>>());
66 }
67 DenseVector<Real> _partition_Vind;
69
71 virtual std::vector<Real> getClassificationMmean()
72 {
73 this->checkJSONKey("m_mean");
74 return this->_json["m_mean"].template get<std::vector<Real>>();
75 }
76 std::vector<Real> _partition_Mmean;
78
80 virtual std::vector<Real> getClassificationMscale()
81 {
82 this->checkJSONKey("m_scale");
83 return this->_json["m_scale"].template get<std::vector<Real>>();
84 }
85 std::vector<Real> _partition_Mscale;
87
89 virtual Real getClassificationEll()
90 {
91 this->checkJSONKey("ell");
92 return this->_json["ell"].template get<Real>();
93 }
96
98 virtual Real getClassificationEta()
99 {
100 this->checkJSONKey("eta");
101 return this->_json["eta"].template get<Real>();
102 }
105
107 std::vector<std::vector<GenericReal<is_ad>>> _partition_difference;
108 std::vector<GenericReal<is_ad>> _partition_distance;
109 std::vector<GenericReal<is_ad>> _partition_covariance;
110 DenseVector<GenericReal<is_ad>> _partition_b;
111 DenseMatrix<GenericReal<is_ad>> _partition_A;
113
122};
123
LAROMANCEPartitionStressUpdateBaseTempl< true > ADLAROMANCEPartitionStressUpdateBase
LAROMANCEPartitionStressUpdateBaseTempl< false > LAROMANCEPartitionStressUpdateBase
Moose::GenericType< Real, is_ad > GenericReal
virtual std::vector< Real > getClassificationMmean()
Method and container for the mean values of the training input.
virtual std::vector< Real > getClassificationMscale()
Method and container for the scale factor of the training input points to normalize all input paramet...
virtual Real getClassificationEta()
Method and container for the calibrated Gaussian Regression Model hyperparameter "Eta",...
virtual void computeDSecondPartitionWeightDStress(GenericReal< is_ad > &dsecond_partition_weight_dstress)
Compute the derivative of the partition weight of the second partition w.r.t.
std::vector< std::vector< GenericReal< is_ad > > > _partition_difference
Containers for parition math.
virtual DenseVector< Real > getClassificationVind()
Method and container for the inducing points of the Gaussian Process Regression model.
virtual GenericReal< is_ad > computeSecondPartitionWeight()
Compute the partition weight on the location in input-space, based on a calibrated Gaussian Process R...
virtual std::vector< std::vector< Real > > getClassificationXu()
Method and container for the Gaussian Process Regression model training points.
const Real _finite_difference_width
Width to determine the finite difference derivative for the partition weight.
virtual Real getClassificationEll()
Method and container for the calibrated Gaussian Regression Model hyperparameter "Ell",...
std::vector< GenericReal< is_ad > > _partition_covariance
virtual std::vector< std::vector< Real > > getClassificationLuu()
Method and container for the Gaussian Process Regression lower triangular covariance matrix.
virtual void computePartitionWeights(std::vector< GenericReal< is_ad > > &weights, std::vector< GenericReal< is_ad > > &dweights_dstress) override
Compute the weight of the different partitions.
void checkJSONKey(const std::string &key)
check if a JSON file was loaded and if the specified key exists
unsigned int _num_inputs
Number of inputs for the ROM data set.
std::vector< GenericReal< is_ad > > _input_values
Container for input values.
const unsigned int _stress_input_index
Index corresponding to the position for the stress in the input vector.
GenericReal< is_ad > sigmoid(const Real lower, const Real upper, const GenericReal< is_ad > &val, const bool derivative=false)
Calculate the sigmoid function weighting for the input based on the limits.
const unsigned int _old_strain_input_index
Index corresponding to the position for the old strain in the input vector.
GenericMaterialProperty< Real, is_ad > & _second_partition_weight
Material property to store partition weight.
nlohmann::json _json
JSON object constructed from the datafile.
unsigned int _num_partitions
Number of partitions.
const InputParameters & parameters() const