Utility class to use an Exodus mesh to define controllable parameters for optimization problems This class will: More...
#include <ParameterMesh.h>
Public Member Functions | |
ParameterMesh (const libMesh::FEType ¶m_type, const std::string &exodus_mesh, const std::vector< std::string > &var_names={}, 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... | |
std::vector< Real > | getParameterValues (std::string var_name, unsigned int timestep) const |
Initializes parameter data and sets bounds in the main optmiization application getParameterValues is only used by ParameterMeshOptimization. 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 | |
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... | |
Utility class to use an Exodus mesh to define controllable parameters for optimization problems This class will:
Definition at line 42 of file ParameterMesh.h.
ParameterMesh::ParameterMesh | ( | const libMesh::FEType & | param_type, |
const std::string & | exodus_mesh, | ||
const std::vector< std::string > & | var_names = {} , |
||
const bool | find_closest = false , |
||
const unsigned int | kdtree_candidates = 5 |
||
) |
Definition at line 37 of file ParameterMesh.C.
Find closest point on the element to the given point.
elem | |
p |
Definition at line 318 of file ParameterMesh.C.
Referenced by projectToMesh().
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 |
std::vector< Real > ParameterMesh::getParameterValues | ( | std::string | var_name, |
unsigned int | timestep | ||
) | const |
Initializes parameter data and sets bounds in the main optmiization application getParameterValues is only used by ParameterMeshOptimization.
var_name | variable to read off mesh |
timestep | timestep to read variable off mesh |
Definition at line 211 of file ParameterMesh.C.
Referenced by ParameterMeshOptimization::parseExodusData().
Returns the point on the parameter mesh that is projected from the test point.
p | test point |
Definition at line 248 of file ParameterMesh.C.
|
inline |
Definition at line 54 of file ParameterMesh.h.
Referenced by ParameterMeshFunction::checkSize(), ParameterMeshFunction::gradient(), ParameterMeshFunction::parameterGradient(), ParameterMeshOptimization::parseExodusData(), ParameterMeshOptimization::setICsandBounds(), ParameterMeshFunction::timeDerivative(), and ParameterMeshFunction::value().
|
protected |
Definition at line 85 of file ParameterMesh.h.
|
protected |
Definition at line 89 of file ParameterMesh.h.
Referenced by ParameterMesh().
|
protected |
Definition at line 92 of file ParameterMesh.h.
Referenced by getParameterValues(), and ParameterMesh().
|
protected |
Find closest projection points.
Definition at line 88 of file ParameterMesh.h.
Referenced by ParameterMesh().
|
protected |
Definition at line 100 of file ParameterMesh.h.
Referenced by projectToMesh().
|
protected |
Definition at line 86 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Node-based KDTree optimization.
Definition at line 97 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 98 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 99 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 94 of file ParameterMesh.h.
Referenced by ParameterMesh(), and size().
|
protected |
Definition at line 91 of file ParameterMesh.h.
Referenced by ParameterMesh(), and projectToMesh().
|
protected |
Definition at line 90 of file ParameterMesh.h.
Referenced by getParameterValues(), and ParameterMesh().