https://mooseframework.inl.gov
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 
13 template <bool is_ad>
15 {
16 public:
18 
20 
21 protected:
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 
90  {
91  this->checkJSONKey("ell");
92  return this->_json["ell"].template get<Real>();
93  }
96 
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 
nlohmann::json _json
JSON object constructed from the datafile.
Moose::GenericType< Real, is_ad > GenericReal
virtual void computePartitionWeights(std::vector< GenericReal< is_ad >> &weights, std::vector< GenericReal< is_ad >> &dweights_dstress) override
Compute the weight of the different partitions.
std::vector< GenericReal< is_ad > > _partition_distance
virtual GenericReal< is_ad > computeSecondPartitionWeight()
Compute the partition weight on the location in input-space, based on a calibrated Gaussian Process R...
virtual void computeDSecondPartitionWeightDStress(GenericReal< is_ad > &dsecond_partition_weight_dstress)
Compute the derivative of the partition weight of the second partition w.r.t.
void checkJSONKey(const std::string &key)
check if a JSON file was loaded and if the specified key exists
virtual std::vector< std::vector< Real > > getClassificationXu()
Method and container for the Gaussian Process Regression model training points.
LAROMANCEPartitionStressUpdateBaseTempl(const InputParameters &parameters)
const Real _finite_difference_width
Width to determine the finite difference derivative for the partition weight.
std::vector< GenericReal< is_ad > > _partition_covariance
virtual Real getClassificationEll()
Method and container for the calibrated Gaussian Regression Model hyperparameter "Ell", which controls the decay of the covariance as a function of distance.
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 Real getClassificationEta()
Method and container for the calibrated Gaussian Regression Model hyperparameter "Eta", which is a scale factor that controls the amplitude of the mean.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::vector< Real > getClassificationMscale()
Method and container for the scale factor of the training input points to normalize all input paramet...
virtual std::vector< Real > getClassificationMmean()
Method and container for the mean values of the training input.
LAROMANCEPartitionStressUpdateBaseTempl< true > ADLAROMANCEPartitionStressUpdateBase
virtual std::vector< std::vector< Real > > getClassificationLuu()
Method and container for the Gaussian Process Regression lower triangular covariance matrix...
const InputParameters & parameters() const
LAROMANCEPartitionStressUpdateBaseTempl< false > LAROMANCEPartitionStressUpdateBase