MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
homogenized_density_function_base.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2020 Manav Bhatia and MAST authors
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef __mast__homogenized_density_function_base_h__
21 #define __mast__homogenized_density_function_base_h__
22 
23 // MAST includes
25 
26 // libMesh includes
27 #include "libmesh/mesh_base.h"
28 
29 
30 namespace MAST {
31 
32  // Forward declerations
33  class FilterBase;
34  class SystemInitialization;
35 
36 
38  public MAST::FieldFunction<Real> {
39 
40  public:
41 
42  HomogenizedDensityFunctionBase(const std::string& nm);
43 
45 
46  virtual void init(MAST::SystemInitialization& level_set_sys,
47  libMesh::MeshBase& analysis_mesh,
48  MAST::FieldFunction<Real>& level_set,
49  MAST::FilterBase& filter);
50 
51  virtual bool depends_on(const MAST::FunctionBase& f) const { return true;}
52 
53  virtual void operator() (const libMesh::Point& p, const Real t, Real& v) const;
54 
55  virtual void derivative(const MAST::FunctionBase& f,
56  const libMesh::Point& p, const Real t, Real& v) const;
57 
58  const std::map<const libMesh::Elem*, Real>&
60 
61  const std::map<const libMesh::Elem*, Real>*
63 
64  Real
65  get_elem_volume_fraction(const libMesh::Elem& e) const;
66 
67  Real
69  const libMesh::Elem& e) const;
70 
71  virtual void initialize_element_volume_fractions() = 0;
72 
73  virtual void
75 
76  virtual void
78 
79  virtual void
81 
82  protected:
83 
85 
86  libMesh::MeshBase *_analysis_mesh;
87 
89 
91 
92  std::map<const libMesh::Elem*, Real> _elem_volume_fraction;
93 
94  std::map<const MAST::FunctionBase*, std::map<const libMesh::Elem*, Real>>
96 
97  std::unique_ptr<libMesh::PointLocatorBase> _sub_point_locator;
98  };
99 }
100 
101 #endif // __mast__homogenized_density_function_base_h__
102 
const std::map< const libMesh::Elem *, Real > * get_elem_volume_fraction_sensitivity_map(const MAST::FunctionBase &f) const
virtual void initialize_element_volume_fractions()=0
libMesh::Real Real
virtual bool depends_on(const MAST::FunctionBase &f) const
returns true if the function depends on the provided value
const std::map< const libMesh::Elem *, Real > & get_elem_volume_fraction_map() const
This creates the base class for functions that have a saptial and temporal dependence, and provide sensitivity operations with respect to the functions and parameters.
Real get_elem_volume_fraction(const libMesh::Elem &e) const
Creates a geometric filter for the level-set design variables.
Definition: filter_base.h:39
virtual void init(MAST::SystemInitialization &level_set_sys, libMesh::MeshBase &analysis_mesh, MAST::FieldFunction< Real > &level_set, MAST::FilterBase &filter)
std::map< const MAST::FunctionBase *, std::map< const libMesh::Elem *, Real > > _elem_volume_fraction_sensitivity
virtual void derivative(const MAST::FunctionBase &f, const libMesh::Point &p, const Real t, Real &v) const
calculates the value of the derivative of function with respect to the function f at the specified po...
std::map< const libMesh::Elem *, Real > _elem_volume_fraction
std::unique_ptr< libMesh::PointLocatorBase > _sub_point_locator
Real get_elem_volume_fraction_sensitivity(const MAST::FunctionBase &f, const libMesh::Elem &e) const
virtual void initialize_element_volume_fraction_sensitivity(const MAST::FunctionBase &f)=0
virtual void operator()(const libMesh::Point &p, const Real t, Real &v) const
calculates the value of the function at the specified point, p, and time, t, and returns it in v...