15 #include "libmesh/id_types.h" 16 #include <unordered_map> 17 #include "libmesh/parallel.h" 18 #include "libmesh/fe_type.h" 19 #include "libmesh/point.h" 20 #include "libmesh/replicated_mesh.h" 21 #include "libmesh/equation_systems.h" 22 #include "libmesh/point_locator_base.h" 23 #include "libmesh/exodusII_io.h" 46 const std::string & exodus_mesh,
47 const std::vector<std::string> & var_names = {},
48 const bool find_closest =
false,
49 const unsigned int kdtree_candidates = 5);
63 std::vector<dof_id_type> & dof_indices,
64 std::vector<Real> & weights)
const;
73 std::vector<dof_id_type> & dof_indices,
74 std::vector<RealGradient> & weights)
const;
82 std::vector<Real>
getParameterValues(std::string var_name,
unsigned int timestep)
const;
89 std::unique_ptr<libMesh::EquationSystems>
_eq;
116 Point
closestPoint(
const Elem & elem,
const Point & p)
const;
RealVectorValue RealGradient
libMesh::ReplicatedMesh _mesh
Utility class to use an Exodus mesh to define controllable parameters for optimization problems This ...
std::unique_ptr< libMesh::ExodusII_IO > _exodusII_io
const bool _find_closest
Find closest projection points.
std::unique_ptr< libMesh::PointLocatorBase > _point_locator
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
libMesh::Parallel::Communicator _communicator
std::unordered_map< dof_id_type, std::set< const libMesh::Elem * > > _node_to_elements
unsigned int _kdtree_candidates
std::unique_ptr< libMesh::EquationSystems > _eq
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)
Point closestPoint(const Elem &elem, const Point &p) const
Find closest point on the element to the given point.
std::unique_ptr< KDTree > _node_kdtree
std::vector< Point > _mesh_nodes
Node-based KDTree optimization.
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 ParameterMeshFun...
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...
Point projectToMesh(const Point &p) const
Returns the point on the parameter mesh that is projected from the test point.