MAST
level_set_nonlinear_implicit_assembly.h
Go to the documentation of this file.
1 /*
2  * MAST: Multidisciplinary-design Adaptation and Sensitivity Toolkit
3  * Copyright (C) 2013-2019 Manav Bhatia
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__level_set_nonlinear_implicit_assembly_h__
21 #define __mast__level_set_nonlinear_implicit_assembly_h__
22 
23 // MAST includes
25 
26 
27 namespace MAST {
28 
29  // Forward declerations
30  template <typename ValType> class FieldFunction;
31  class LevelSetIntersection;
32  class LevelSetInterfaceDofHandler;
33  class LevelSetVoidSolution;
34  class FilterBase;
35 
36 
39  public:
40 
41 
45  LevelSetNonlinearImplicitAssembly(bool enable_dof_handler);
46 
47 
53 
59 
60 
64  bool if_use_dof_handler() const;
65 
66 
70  virtual void
72  const MAST::FilterBase& filter);
73 
74 
78  virtual void
80 
84  virtual void
86 
90  virtual void
92 
93 
97  virtual void
99 
100 
105 
106 
111 
112 
117  virtual void
118  residual_and_jacobian (const libMesh::NumericVector<Real>& X,
119  libMesh::NumericVector<Real>* R,
120  libMesh::SparseMatrix<Real>* J,
121  libMesh::NonlinearImplicitSystem& S);
122 
123 
124  virtual bool
126  libMesh::NumericVector<Real>& sensitivity_rhs);
127 
128 
129  virtual void
130  calculate_output_derivative(const libMesh::NumericVector<Real>& X,
132  libMesh::NumericVector<Real>& dq_dX);
133 
134 //#define MAST_ENABLE_PLPLOT 1
135 #if MAST_ENABLE_PLPLOT == 1
136  void plot_sub_elems(bool plot_reference_elem,
137  bool plot_low_phi_elem,
138  bool plot_high_phi_elem);
139 #endif
140 
141 
145  virtual void
146  calculate_output(const libMesh::NumericVector<Real>& X,
148 
149 
150 
161  virtual void
162  calculate_output_direct_sensitivity(const libMesh::NumericVector<Real>& X,
163  const libMesh::NumericVector<Real>* dXdp,
164  const MAST::FunctionBase& p,
166 
167 
173  /*virtual Real
174  calculate_output_adjoint_sensitivity(const libMesh::NumericVector<Real>& X,
175  const libMesh::NumericVector<Real>& dq_dX,
176  const MAST::FunctionBase& p,
177  MAST::AssemblyElemOperations& elem_ops,
178  MAST::OutputAssemblyElemOperations& output,
179  const bool include_partial_sens = true);
180  */
181 
182  protected:
183 
184  /*Real
185  _adjoint_sensitivity_dot_product (const MAST::FunctionBase& f,
186  const libMesh::NumericVector<Real>& X,
187  const libMesh::NumericVector<Real>& dq_dX);
188  */
189 
191 
193 
195 
197 
199 
201 
203 
205 
207 
208  };
209 }
210 
211 
212 #endif //__mast__level_set_nonlinear_implicit_assembly_h__
213 
virtual void calculate_output(const libMesh::NumericVector< Real > &X, MAST::OutputAssemblyElemOperations &output)
calculates the value of quantity .
virtual void calculate_output_derivative(const libMesh::NumericVector< Real > &X, MAST::OutputAssemblyElemOperations &output, libMesh::NumericVector< Real > &dq_dX)
calculates
bool _enable_dof_handler
Evaluates the total sensitivity of output wrt p using the adjoint solution provided in dq_dX for a li...
This provides the base class for definitin of element level contribution of output quantity in an ana...
virtual void calculate_output_direct_sensitivity(const libMesh::NumericVector< Real > &X, const libMesh::NumericVector< Real > *dXdp, const MAST::FunctionBase &p, MAST::OutputAssemblyElemOperations &output)
evaluates the sensitivity of the outputs in the attached discipline with respect to the parametrs in ...
LevelSetNonlinearImplicitAssembly(bool enable_dof_handler)
constructor associates this assembly object with the system
virtual void set_indicator_function(MAST::FieldFunction< RealVectorX > &indicator)
attaches indicator function to this.
virtual void clear_level_set_function()
clears association with level set function
virtual void residual_and_jacobian(const libMesh::NumericVector< Real > &X, libMesh::NumericVector< Real > *R, libMesh::SparseMatrix< Real > *J, libMesh::NonlinearImplicitSystem &S)
function that assembles the matrices and vectors quantities for nonlinear solution ...
This will compute the solution at the interface under the assumption of zero surface normal flux...
Creates a geometric filter for the level-set design variables.
Definition: filter_base.h:39
virtual void set_level_set_function(MAST::FieldFunction< Real > &level_set, const MAST::FilterBase &filter)
attaches level set function to this
virtual void clear_level_set_velocity_function()
clears the velocity function
virtual bool sensitivity_assemble(const MAST::FunctionBase &f, libMesh::NumericVector< Real > &sensitivity_rhs)
Assembly function.
virtual ~LevelSetNonlinearImplicitAssembly()
destructor resets the association of this assembly object with the system
virtual void set_level_set_velocity_function(MAST::FieldFunction< RealVectorX > &velocity)
the velocity function used to calculate topology sensitivity
void set_evaluate_output_on_negative_phi(bool f)
sets the flag on whether or not to evaluate the output on negative level set function ...