Utility class to use an Exodus mesh to define controllable parameters for optimization problems This class will: More...
#include <ParameterMesh.h>
Public Types | |
| enum | RegularizationType { RegularizationType::L2_GRADIENT } |
| Enumerations for regularization computations. More... | |
Public Member Functions | |
| ParameterMesh (const libMesh::FEType ¶m_type, const std::string &exodus_mesh, const bool find_closest=false, const unsigned int kdtree_candidates=5) | |
| dof_id_type | size () const |
| void | getIndexAndWeight (const Point &pt, std::vector< dof_id_type > &dof_indices, std::vector< Real > &weights) const |
| Interpolate parameters onto the computational mesh getIndexAndWeight is only used by ParameterMeshFunction. More... | |
| void | getIndexAndWeight (const Point &pt, std::vector< dof_id_type > &dof_indices, std::vector< RealGradient > &weights) const |
| Performs inner products of parameters with functions on the computational mesh getIndexAndWeight is only used by ParameterMeshFunction. More... | |
| Real | computeRegularizationObjective (const std::vector< Real > ¶meter_values, RegularizationType reg_type) const |
| Computes regularization objective value for a given regularization type. More... | |
| std::vector< Real > | computeRegularizationGradient (const std::vector< Real > ¶meter_values, RegularizationType reg_type) const |
| Computes regularization gradient for a given regularization type. More... | |
Protected Attributes | |
| libMesh::Parallel::Communicator | _communicator |
| libMesh::ReplicatedMesh | _mesh |
| const bool | _find_closest |
| Find closest projection points. More... | |
| std::unique_ptr< libMesh::EquationSystems > | _eq |
| libMesh::System * | _sys |
| std::unique_ptr< libMesh::PointLocatorBase > | _point_locator |
| std::unique_ptr< libMesh::ExodusII_IO > | _exodusII_io |
| dof_id_type | _param_dofs |
| std::vector< Point > | _mesh_nodes |
| Node-based KDTree optimization. More... | |
| std::unique_ptr< KDTree > | _node_kdtree |
| std::unordered_map< dof_id_type, std::set< const libMesh::Elem * > > | _node_to_elements |
| unsigned int | _kdtree_candidates |
Private Member Functions | |
| template<typename T > | |
| T | computeRegularizationLoop (const std::vector< Real > ¶meter_values, RegularizationType reg_type) const |
| Template method containing the element loop for regularization computations. More... | |
| Point | projectToMesh (const Point &p) const |
| Returns the point on the parameter mesh that is projected from the test point. More... | |
| Point | closestPoint (const Elem &elem, const Point &p) const |
| Find closest point on the element to the given point. More... | |
| Real | computeRegularizationQp (const std::vector< Real > ¶meter_values, const std::vector< std::vector< Real >> &phi, const std::vector< std::vector< RealGradient >> &dphi, const unsigned int qp, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &JxW, RegularizationType reg_type) const |
| Compute regularization objective for a single quadrature point This is the main function users should modify to add new regularization types for objectives. More... | |
| void | computeRegularizationGradientQp (const std::vector< Real > ¶meter_values, const std::vector< std::vector< Real >> &phi, const std::vector< std::vector< RealGradient >> &dphi, const unsigned int qp, const std::vector< dof_id_type > &dof_indices, const std::vector< Real > &JxW, RegularizationType reg_type, std::vector< Real > &gradient) const |
| Compute regularization gradient for a single quadrature point This is the main function users should modify to add new regularization types for gradients. More... | |
Private Attributes | |
| const unsigned short int | _param_var_id |
| const libMesh::DofMap * | _dof_map |
| const libMesh::FEType | _fe_type |
Utility class to use an Exodus mesh to define controllable parameters for optimization problems This class will:
Definition at line 43 of file ParameterMesh.h.
|
strong |
Enumerations for regularization computations.
| Enumerator | |
|---|---|
| L2_GRADIENT | |
Definition at line 52 of file ParameterMesh.h.
| ParameterMesh::ParameterMesh | ( | const libMesh::FEType & | param_type, |
| const std::string & | exodus_mesh, | ||
| const bool | find_closest = false, |
||
| const unsigned int | kdtree_candidates = 5 |
||
| ) |
Definition at line 40 of file ParameterMesh.C.
Find closest point on the element to the given point.
| elem | |
| p |
Definition at line 237 of file ParameterMesh.C.
Referenced by projectToMesh().
| std::vector< Real > ParameterMesh::computeRegularizationGradient | ( | const std::vector< Real > & | parameter_values, |
| RegularizationType | reg_type | ||
| ) | const |
Computes regularization gradient for a given regularization type.
| parameter_values | vector of parameter values to compute gradient for |
| reg_type | type of regularization (L2_GRADIENT, etc.) |
Definition at line 382 of file ParameterMesh.C.
|
private |
Compute regularization gradient for a single quadrature point This is the main function users should modify to add new regularization types for gradients.
| parameter_values | all parameter values |
| phi | shape function values (full array) |
| dphi | shape function gradients (full array) |
| qp | quadrature point index |
| dof_indices | element DOF indices |
| JxW | quadrature weights array |
| reg_type | type of regularization to compute |
| gradient | gradient vector to update |
Definition at line 421 of file ParameterMesh.C.
Referenced by computeRegularizationLoop().
|
private |
Template method containing the element loop for regularization computations.
| parameter_values | vector of parameter values |
| reg_type | type of regularization |
Definition at line 321 of file ParameterMesh.C.
| Real ParameterMesh::computeRegularizationObjective | ( | const std::vector< Real > & | parameter_values, |
| RegularizationType | reg_type | ||
| ) | const |
Computes regularization objective value for a given regularization type.
| parameter_values | vector of parameter values to compute regularization for |
| reg_type | type of regularization (L2_GRADIENT, etc.) |
Definition at line 375 of file ParameterMesh.C.
|
private |
Compute regularization objective for a single quadrature point This is the main function users should modify to add new regularization types for objectives.
| parameter_values | all parameter values |
| phi | shape function values (full array) |
| dphi | shape function gradients (full array) |
| qp | quadrature point index |
| dof_indices | element DOF indices |
| JxW | quadrature weights array |
| reg_type | type of regularization to compute |
Definition at line 389 of file ParameterMesh.C.
Referenced by computeRegularizationLoop().
| void ParameterMesh::getIndexAndWeight | ( | const Point & | pt, |
| std::vector< dof_id_type > & | dof_indices, | ||
| std::vector< Real > & | weights | ||
| ) | const |
Interpolate parameters onto the computational mesh getIndexAndWeight is only used by ParameterMeshFunction.
| pt | location to compute elemnent dof_indices weights |
| dof_indices | return dof indices for element containing pt |
| weights | returns element shape function weights at pt |
Referenced by ParameterMeshFunction::gradient(), ParameterMeshFunction::parameterGradient(), ParameterMeshFunction::timeDerivative(), and ParameterMeshFunction::value().
| void ParameterMesh::getIndexAndWeight | ( | const Point & | pt, |
| std::vector< dof_id_type > & | dof_indices, | ||
| std::vector< RealGradient > & | weights | ||
| ) | const |
Performs inner products of parameters with functions on the computational mesh getIndexAndWeight is only used by ParameterMeshFunction.
| pt | location to compute elemnent dof_indices weights |
| dof_indices | return dof indices for element containing pt |
| weights | returns element shape function gradient weights at pt |
Returns the point on the parameter mesh that is projected from the test point.
| p | test point |
Definition at line 167 of file ParameterMesh.C.
|
inline |
Definition at line 64 of file ParameterMesh.h.
Referenced by ParameterMeshFunction::checkSize(), ParameterMeshFunction::gradient(), ParameterMeshFunction::parameterGradient(), ParameterMeshFunction::timeDerivative(), and ParameterMeshFunction::value().
|
protected |
Definition at line 115 of file ParameterMesh.h.
|
private |
Definition at line 190 of file ParameterMesh.h.
Referenced by computeRegularizationLoop(), and ParameterMesh().
|
protected |
Definition at line 119 of file ParameterMesh.h.
Referenced by ParameterMesh().
|
protected |
Definition at line 122 of file ParameterMesh.h.
Referenced by ParameterMesh().
|
private |
Definition at line 191 of file ParameterMesh.h.
Referenced by computeRegularizationLoop(), and ParameterMesh().
|
protected |
Find closest projection points.
Definition at line 118 of file ParameterMesh.h.
Referenced by ParameterMesh().
|
protected |
Definition at line 130 of file ParameterMesh.h.
Referenced by projectToMesh().
|
protected |
Definition at line 116 of file ParameterMesh.h.
Referenced by computeRegularizationLoop(), ParameterMesh(), and projectToMesh().
|
protected |
Node-based KDTree optimization.
Definition at line 127 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 128 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 129 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 124 of file ParameterMesh.h.
Referenced by computeRegularizationLoop(), ParameterMesh(), and size().
|
private |
Definition at line 189 of file ParameterMesh.h.
Referenced by computeRegularizationLoop(), and ParameterMesh().
|
protected |
Definition at line 121 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 120 of file ParameterMesh.h.
Referenced by ParameterMesh().
1.8.14