https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
OptimizationData Class Reference

#include <OptimizationData.h>

Inheritance diagram for OptimizationData:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 OptimizationData (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
void computeMisfit ()
 Compute misfit vectors from the simulations and measurement values.
 
Real computeMisfitValue ()
 Compute half the sum of the misfit (squared) values.
 
void threadJoin (const UserObject &) final
 
bool shouldStore () const override final
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObject * primaryThreadCopy ()
 
SubProblem & getSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObject > getSharedPtr ()
 
std::shared_ptr< const MooseObject > getSharedPtr () const
 
bool isKokkosObject () const
 
MooseApp & getMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParameters & parameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void initialSetup ()
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnum & getExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBase & getUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainID > getMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryID > getMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void store (nlohmann::json &json) const
 
virtual void declareLateValues ()
 
void buildOutputHideVariableList (std::set< std::string > variable_names)
 
const std::set< OutputName > & getOutputs ()
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterial (const std::string &name)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBase & getMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
const Function & getFunction (const std::string &name) const
 
const Function & getFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const T & getKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const T & getKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValue & getVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValue & getScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
T & getSampler (const std::string &name)
 
Sampler & getSampler (const std::string &name)
 
T & getSamplerByName (const SamplerName &name)
 
Sampler & getSamplerByName (const SamplerName &name)
 
virtual void meshChanged ()
 
virtual void meshDisplaced ()
 
PerfGraph & perfGraph ()
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValue & getPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValue & getPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValue & getPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Distribution & getDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBase & getReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterName & getReporterName (const std::string &param_name) const
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValue & coupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledMatrixTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValue & adCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValue & coupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValueByName (const std::string &var_name, const std::string &tag_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledVectorTagScalarValue (const std::string &var_name, const std::string &tag_param_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::VariableValue kokkosCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
Moose::Kokkos::Scalar< const Real > kokkosCoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalar * getScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
T & declareUnusedValue (Args &&... args)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValue (const std::string &param_name, Args &&... args)
 
T & declareValue (const std::string &param_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, Args &&... args)
 
T & declareValueByName (const ReporterValueName &value_name, ReporterMode mode, Args &&... args)
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

std::vector< Real > & _simulation_values
 simulated values at measurement xyzt
 
std::vector< Real > & _misfit_values
 difference between simulation and measurement values at measurement xyzt
 
Real & _objective_val
 Reporter value that will hold the objective value.
 
const Moose::CoordinateSystemType & _coord_sys
 
const THREAD_ID _tid
 
SubProblem & _subproblem
 
FEProblemBase & _fe_problem
 
SystemBase & _sys
 
Assembly & _assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp & _app
 
Factory & _factory
 
ActionFactory & _action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters & _pars
 
const ExecFlagEnum & _execute_enum
 
const ExecFlagType & _current_execute_flag
 
MooseApp & _restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase & _mci_feproblem
 
FEProblemBase & _mdi_feproblem
 
MooseApp & _pg_moose_app
 
const std::string _prefix
 
FEProblemBase & _sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real & _real_zero
 
const VariableValue & _scalar_zero
 
const Point & _point_zero
 
const InputParameters & _mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase & _mi_feproblem
 
SubProblem & _mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData & _material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int > _material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters & _ti_params
 
FEProblemBase & _ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int & _t_step
 
Real & _dt
 
Real & _dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 
std::vector< Real > & _measurement_xcoord
 
std::vector< Real > & _measurement_ycoord
 
std::vector< Real > & _measurement_zcoord
 
std::vector< Real > & _measurement_time
 
std::vector< Real > & _measurement_values
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Private Member Functions

void readMeasurementsFromFile ()
 parse measurement data from csv file
 
void readMeasurementsFromInput ()
 parse measurement data from input file
 
void errorCheckDataSize ()
 helper to check data sizes
 
const Moose::FunctionBase * getKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBase & getUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const T & castUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValue & getVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValue & registerRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValue & getMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValue * getDefaultValue (const std::string &var_name) const
 
const ADVariableValue * getADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::Kokkos::Variable kokkosCoupledVectorTagScalarVariable (const std::string &var_name, const std::string &tag_name, unsigned int comp) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const ReporterValueName & getReporterValueName (const std::string &param_name) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValue & getPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::vector< MooseVariableFieldBase * > _var_vec
 variable
 
std::vector< std::vector< Real > * > _variable_weights
 Weight names to reporter values.
 
std::map< std::string, std::vector< Real > * > _weight_names_weights_map
 Weight names to reporter values map created from input file.
 
const bool _always_store
 
UserObject * _primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject & _parent
 
const MooseBase & _si_moose_base
 
const FEProblemBase * _si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject & _fni_object
 
const InputParameters & _fni_params
 
FEProblemBase & _fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject & _uoi_moose_object
 
const FEProblemBase & _uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject & _ppi_moose_object
 
const InputParameters & _ppi_params
 
const FEProblemBase & _ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject & _vpi_moose_object
 
const FEProblemBase & _vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters & _ri_params
 
FEProblemBase & _ri_fe_problem_base
 
const ReporterData & _ri_reporter_data
 
const MooseObject & _ri_moose_object
 
const InputParameters & _dni_params
 
FEProblemBase & _dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters & _si_params
 
FEProblemBase & _si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp & _meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters & _sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID > _sc_coupleable_vector_tags
 
std::set< TagID > _sc_coupleable_matrix_tags
 
const MooseObject & _mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
const MooseObject & _reporter_moose_object
 
const InputParameters & _reporter_params
 
const std::string & _reporter_name
 
FEProblemBase & _reporter_fe_problem
 
ReporterData & _reporter_data
 
std::vector< std::unique_ptr< UnusedWrapperBase > > _unused_values
 
MooseApp & _oi_moose_app
 
OutputWarehouse & _oi_output_warehouse
 
std::set< OutputName > _oi_outputs
 

Detailed Description

Definition at line 24 of file OptimizationData.h.

Constructor & Destructor Documentation

◆ OptimizationData()

OptimizationData::OptimizationData ( const InputParameters &  parameters)

Definition at line 60 of file OptimizationData.C.

63 declareValueByName<std::vector<Real>>("measurement_xcoord", REPORTER_MODE_REPLICATED)),
65 declareValueByName<std::vector<Real>>("measurement_ycoord", REPORTER_MODE_REPLICATED)),
67 declareValueByName<std::vector<Real>>("measurement_zcoord", REPORTER_MODE_REPLICATED)),
69 declareValueByName<std::vector<Real>>("measurement_time", REPORTER_MODE_REPLICATED)),
71 declareValueByName<std::vector<Real>>("measurement_values", REPORTER_MODE_REPLICATED)),
73 declareValueByName<std::vector<Real>>("simulation_values", REPORTER_MODE_REPLICATED)),
75 declareValueByName<std::vector<Real>>("misfit_values", REPORTER_MODE_REPLICATED)),
76 _objective_val(isParamSetByUser("objective_name")
77 ? declareValueByName<Real>(getParam<ReporterValueName>("objective_name"),
78 REPORTER_MODE_REPLICATED)
80{
81 // read in data
82 if (isParamValid("measurement_file") && isParamValid("measurement_points"))
83 mooseError("Input file can only define a single input for measurement data. Use only "
84 "measurement_file or measurement_points, but never both");
85 else if (isParamValid("measurement_file"))
87 else if (isParamValid("measurement_points"))
89
91
92 if (isParamValid("variable"))
93 {
94 std::vector<VariableName> var_names(getParam<std::vector<VariableName>>("variable"));
95 for (const auto & name : var_names)
96 _var_vec.push_back(&_fe_problem.getVariable(
98 }
99 if (isParamValid("variable_weight_names"))
100 {
101 std::vector<std::string> weight_names(
102 getParam<std::vector<std::string>>("variable_weight_names"));
103 for (const auto & name : weight_names)
104 {
105 if (_weight_names_weights_map.count(name) == 1)
106 {
108 }
109 else
110 {
111 // default is to create a new weight reporter and fill it with 1's
112 // these will be overwritten by a reporter transfer.
113 _variable_weights.push_back(
114 &declareValueByName<std::vector<Real>>(name, REPORTER_MODE_REPLICATED));
115 _variable_weights.back()->assign(_measurement_xcoord.size(), 1);
116 }
117 }
118 }
119 if (isParamValid("variable") && isParamValid("variable_weight_names") &&
120 _variable_weights.size() != _var_vec.size())
121 {
122 paramError("variable_weight_names",
123 "The same number of names must be in both 'variable_weight_names' and 'variable'.");
124 }
125}
const InputParameters & parameters() const
const std::string & name() const
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &name) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
std::vector< Real > & _measurement_xcoord
std::vector< MooseVariableFieldBase * > _var_vec
variable
void readMeasurementsFromFile()
parse measurement data from csv file
std::vector< Real > & _simulation_values
simulated values at measurement xyzt
Real & _objective_val
Reporter value that will hold the objective value.
std::vector< Real > & _measurement_zcoord
std::vector< Real > & _measurement_time
std::vector< Real > & _misfit_values
difference between simulation and measurement values at measurement xyzt
std::vector< Real > & _measurement_ycoord
void readMeasurementsFromInput()
parse measurement data from input file
std::vector< std::vector< Real > * > _variable_weights
Weight names to reporter values.
std::map< std::string, std::vector< Real > * > _weight_names_weights_map
Weight names to reporter values map created from input file.
std::vector< Real > & _measurement_values
T & declareValueByName(const ReporterValueName &value_name, Args &&... args)
T & declareUnusedValue(Args &&... args)
FEProblemBase & _fe_problem
const THREAD_ID _tid
VAR_FIELD_STANDARD
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Member Function Documentation

◆ computeMisfit()

void OptimizationData::computeMisfit ( )

Compute misfit vectors from the simulations and measurement values.

Definition at line 135 of file OptimizationData.C.

136{
137 if (_var_vec.empty())
138 return;
139
140 // FIXME: This is basically copied from PointValue.
141 // Implementation can be improved using the functionality in PointSamplerBase,
142 // but this will require changes in MOOSE to work for reporters.
143
144 const std::size_t nvals = _measurement_values.size();
145 _simulation_values.resize(nvals, 0.0);
146 _misfit_values.resize(nvals);
147
149 for (const auto var_index : make_range(_var_vec.size()))
150 {
151 const auto & sys = _var_vec[var_index]->sys().system();
152 const auto vnum = _var_vec[var_index]->number();
153 // A weight reporter is not automatically created and for those cases, we
154 // set the weight to 1.
155 std::vector<Real> weights(_variable_weights.empty()
156 ? std::vector<Real>(_measurement_xcoord.size(), 1)
157 : (*_variable_weights[var_index]));
158 for (const auto & i : make_range(nvals))
159 {
160 if (MooseUtils::absoluteFuzzyEqual(_t, _measurement_time[i]))
161 {
162 // If we are on the first var, make sure reset the simulation values so they aren't
163 // accumulated on repeated timesteps
164 if (var_index == 0)
165 _simulation_values[i] = 0.0;
166
167 const Point point(_measurement_xcoord[i], _measurement_ycoord[i], _measurement_zcoord[i]);
168 const Real val = sys.point_value(vnum, point, false);
169
170 _simulation_values[i] += weights[i] * val;
172 }
173 }
174 }
175}
void errorCheckDataSize()
helper to check data sizes
IntRange< T > make_range(T beg, T end)

Referenced by execute().

◆ computeMisfitValue()

Real OptimizationData::computeMisfitValue ( )

Compute half the sum of the misfit (squared) values.

Returns
1/2 of the sum of the misfit values.

Definition at line 314 of file OptimizationData.C.

315{
316 Real val = 0.0;
317 for (auto & misfit : _misfit_values)
318 val += misfit * misfit;
319
320 return val * 0.5;
321}

Referenced by execute().

◆ errorCheckDataSize()

void OptimizationData::errorCheckDataSize ( )
private

helper to check data sizes

Definition at line 293 of file OptimizationData.C.

294{
295 const std::size_t nvals = _measurement_values.size();
296 std::string msg = "";
297 if (_measurement_xcoord.size() != nvals)
298 msg += "x-coordinate data (" + std::to_string(_measurement_xcoord.size()) + "), ";
299 if (_measurement_ycoord.size() != nvals)
300 msg += "y-coordinate data (" + std::to_string(_measurement_ycoord.size()) + "), ";
301 if (_measurement_zcoord.size() != nvals)
302 msg += "z-coordinate data (" + std::to_string(_measurement_zcoord.size()) + "), ";
303 if (_measurement_time.size() != nvals)
304 msg += "time data (" + std::to_string(_measurement_time.size()) + "), ";
305 if (!msg.empty())
306 mooseError("Number of entries in ",
307 std::string(msg.begin(), msg.end() - 2),
308 " does not match number of entries in value data (",
309 std::to_string(nvals),
310 ").");
311}

Referenced by computeMisfit().

◆ execute()

void OptimizationData::execute ( )
overridevirtual

Implements GeneralReporter.

Definition at line 128 of file OptimizationData.C.

129{
132}
Real computeMisfitValue()
Compute half the sum of the misfit (squared) values.
void computeMisfit()
Compute misfit vectors from the simulations and measurement values.

◆ finalize()

virtual void OptimizationData::finalize ( )
inlineoverridevirtual

Implements GeneralReporter.

Definition at line 32 of file OptimizationData.h.

32{}

◆ initialize()

virtual void OptimizationData::initialize ( )
inlineoverridevirtual

Implements GeneralReporter.

Definition at line 30 of file OptimizationData.h.

30{}

◆ readMeasurementsFromFile()

void OptimizationData::readMeasurementsFromFile ( )
private

parse measurement data from csv file

Definition at line 178 of file OptimizationData.C.

179{
180 std::string xName = getParam<std::string>("file_xcoord");
181 std::string yName = getParam<std::string>("file_ycoord");
182 std::string zName = getParam<std::string>("file_zcoord");
183 std::string tName = getParam<std::string>("file_time");
184 std::string valueName = getParam<std::string>("file_value");
185 std::vector<std::string> weightNames =
186 getParam<std::vector<std::string>>("file_variable_weights");
187
188 bool found_x = false;
189 bool found_y = false;
190 bool found_z = false;
191 bool found_t = false;
192 bool found_value = false;
193
194 MooseUtils::DelimitedFileReader reader(getParam<FileName>("measurement_file"));
195 reader.read();
196
197 auto const & names = reader.getNames();
198 auto const & data = reader.getData();
199
200 const std::size_t rows = data[0].size();
201 for (std::size_t i = 0; i < names.size(); ++i)
202 {
203 // make sure all data columns have the same length
204 if (data[i].size() != rows)
205 paramError("file", "Mismatching column lengths in file");
206
207 if (names[i] == xName)
208 {
209 _measurement_xcoord = data[i];
210 found_x = true;
211 }
212 else if (names[i] == yName)
213 {
214 _measurement_ycoord = data[i];
215 found_y = true;
216 }
217 else if (names[i] == zName)
218 {
219 _measurement_zcoord = data[i];
220 found_z = true;
221 }
222 else if (names[i] == tName)
223 {
224 _measurement_time = data[i];
225 found_t = true;
226 }
227 else if (names[i] == valueName)
228 {
229 _measurement_values = data[i];
230 found_value = true;
231 }
232 else if (std::find(weightNames.begin(), weightNames.end(), names[i]) != weightNames.end())
233 {
235 names[i], &(declareValueByName<std::vector<Real>>(names[i], REPORTER_MODE_REPLICATED)));
236 _weight_names_weights_map[names[i]]->assign(data[i].begin(), data[i].end());
237 }
238 }
239
240 // check if all required columns were found
241 if (!found_x)
242 paramError("measurement_file", "Column with name '", xName, "' missing from measurement file");
243 if (!found_y)
244 paramError("measurement_file", "Column with name '", yName, "' missing from measurement file");
245 if (!found_z)
246 paramError("measurement_file", "Column with name '", zName, "' missing from measurement file");
247 if (!found_t)
248 _measurement_time.assign(rows, 0);
249 if (!found_value)
251 "measurement_file", "Column with name '", valueName, "' missing from measurement file");
252 if (_weight_names_weights_map.size() != weightNames.size())
253 {
254 std::string out("\n Measurement file column names: ");
255 for (const auto & name : names)
256 out += " " + name;
257 out += "\n file_variable_weights names: ";
258 for (const auto & name : weightNames)
259 out += " " + name;
260 paramError("measurement_file",
261 "Not all of the file_variable_weights names were found in the measurement_file.",
262 out);
263 }
264}
OStreamProxy out(std::cout)

Referenced by OptimizationData().

◆ readMeasurementsFromInput()

void OptimizationData::readMeasurementsFromInput ( )
private

parse measurement data from input file

Definition at line 267 of file OptimizationData.C.

268{
269 if (!getParam<std::vector<std::string>>("file_variable_weights").empty())
270 paramError("measurement_values",
271 "file_variable_weights cannot be used with measurement data read from the input "
272 "file, use measure_file input instead.");
273
274 for (const auto & p : getParam<std::vector<Point>>("measurement_points"))
275 {
276 _measurement_xcoord.push_back(p(0));
277 _measurement_ycoord.push_back(p(1));
278 _measurement_zcoord.push_back(p(2));
279 }
280
281 if (isParamValid("measurement_times"))
282 _measurement_time = getParam<std::vector<Real>>("measurement_times");
283 else
284 _measurement_time.assign(_measurement_xcoord.size(), 0.0);
285
286 if (isParamValid("measurement_values"))
287 _measurement_values = getParam<std::vector<Real>>("measurement_values");
288 else
289 paramError("measurement_values", "Input file must contain measurement points and values");
290}
const Real p

Referenced by OptimizationData().

◆ validParams()

InputParameters OptimizationData::validParams ( )
static

Definition at line 15 of file OptimizationData.C.

16{
18
20 "Reporter to hold measurement and simulation data for optimization problems");
21 params.addParam<std::vector<Real>>(
22 "measurement_values",
23 "Measurement values collected from locations given by measurement_points");
24 params.addParam<std::vector<Point>>("measurement_points",
25 "Point locations corresponding to each measurement value");
26 params.addParam<std::vector<Real>>("measurement_times",
27 "Times corresponding to each measurement value");
28
29 params.addParam<FileName>("measurement_file",
30 "CSV file with measurement value and coordinates (value, x, y, z).");
31 params.addParam<std::string>(
32 "file_xcoord", "x", "x coordinate column name from measurement_file csv being read in.");
33 params.addParam<std::string>(
34 "file_ycoord", "y", "y coordinate column name from csv file being read in.");
35 params.addParam<std::string>(
36 "file_zcoord", "z", "z coordinate column name from csv file being read in.");
37 params.addParam<std::string>(
38 "file_time", "time", "time column name from csv file being read in.");
39 params.addParam<std::vector<std::string>>(
40 "file_variable_weights", {}, "variable weight column names from csv file being read in.");
41 params.addParam<std::string>(
42 "file_value", "value", "measurement value column name from csv file being read in.");
43
44 params.addParam<std::vector<std::string>>(
45 "variable_weight_names",
46 "Vector of weight reporter names that will create a reporter to transfer weights into. The "
47 "ordering of these weight reporter names corresponds to the ordering used in variable.");
48 params.addParam<std::vector<VariableName>>(
49 "variable", "Vector of variable names to sample at measurement points.");
50 params.addParam<ReporterValueName>("objective_name",
51 "Name of reporter value defining the objective.");
52 params.addParamNamesToGroup("measurement_points measurement_values measurement_times",
53 "Input Measurement Data");
54 params.addParamNamesToGroup("measurement_file file_xcoord file_ycoord file_zcoord file_time "
55 "file_value file_variable_weights",
56 "File Measurement Data");
57 return params;
58}
static InputParameters validParams()
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)

Referenced by TransientSyntheticDataCreator::validParams().

Member Data Documentation

◆ _measurement_time

std::vector<Real>& OptimizationData::_measurement_time
protected

◆ _measurement_values

std::vector<Real>& OptimizationData::_measurement_values
protected

◆ _measurement_xcoord

std::vector<Real>& OptimizationData::_measurement_xcoord
protected

◆ _measurement_ycoord

std::vector<Real>& OptimizationData::_measurement_ycoord
protected

◆ _measurement_zcoord

std::vector<Real>& OptimizationData::_measurement_zcoord
protected

◆ _misfit_values

std::vector<Real>& OptimizationData::_misfit_values
protected

difference between simulation and measurement values at measurement xyzt

Definition at line 57 of file OptimizationData.h.

Referenced by computeMisfit(), computeMisfitValue(), and OptimizationData().

◆ _objective_val

Real& OptimizationData::_objective_val
protected

Reporter value that will hold the objective value.

Definition at line 60 of file OptimizationData.h.

Referenced by execute().

◆ _simulation_values

std::vector<Real>& OptimizationData::_simulation_values
protected

simulated values at measurement xyzt

Definition at line 55 of file OptimizationData.h.

Referenced by computeMisfit().

◆ _var_vec

std::vector<MooseVariableFieldBase *> OptimizationData::_var_vec
private

variable

Definition at line 68 of file OptimizationData.h.

Referenced by computeMisfit(), and OptimizationData().

◆ _variable_weights

std::vector<std::vector<Real> *> OptimizationData::_variable_weights
private

Weight names to reporter values.

Definition at line 70 of file OptimizationData.h.

Referenced by computeMisfit(), and OptimizationData().

◆ _weight_names_weights_map

std::map<std::string, std::vector<Real> *> OptimizationData::_weight_names_weights_map
private

Weight names to reporter values map created from input file.

Definition at line 72 of file OptimizationData.h.

Referenced by OptimizationData(), and readMeasurementsFromFile().


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