MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (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-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__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
125  sensitivity_assemble (const libMesh::NumericVector<Real>& X,
126  bool if_localize_sol,
127  const MAST::FunctionBase& f,
128  libMesh::NumericVector<Real>& sensitivity_rhs,
129  bool close_vector = true);
130 
131 
132  virtual void
133  calculate_output_derivative(const libMesh::NumericVector<Real>& X,
134  bool if_localize_sol,
136  libMesh::NumericVector<Real>& dq_dX);
137 
138 //#define MAST_ENABLE_PLPLOT 1
139 #if MAST_ENABLE_PLPLOT == 1
140  void plot_sub_elems(bool plot_reference_elem,
141  bool plot_low_phi_elem,
142  bool plot_high_phi_elem);
143 #endif
144 
145 
149  virtual void
150  calculate_output(const libMesh::NumericVector<Real>& X,
151  bool if_localize_sol,
153 
154 
155 
166  virtual void
167  calculate_output_direct_sensitivity(const libMesh::NumericVector<Real>& X,
168  bool if_localize_sol,
169  const libMesh::NumericVector<Real>* dXdp,
170  bool if_localize_sol_sens,
171  const MAST::FunctionBase& p,
173 
174 
175  protected:
176 
178 
180 
182 
184 
186 
188 
190 
192 
194 
195  };
196 }
197 
198 
199 #endif //__mast__level_set_nonlinear_implicit_assembly_h__
200 
This provides the base class for definitin of element level contribution of output quantity in an ana...
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 calculate_output_direct_sensitivity(const libMesh::NumericVector< Real > &X, bool if_localize_sol, const libMesh::NumericVector< Real > *dXdp, bool if_localize_sol_sens, const MAST::FunctionBase &p, MAST::OutputAssemblyElemOperations &output)
evaluates the sensitivity of the outputs in the attached discipline with respect to the parametrs in ...
virtual void calculate_output(const libMesh::NumericVector< Real > &X, bool if_localize_sol, MAST::OutputAssemblyElemOperations &output)
calculates the value of quantity .
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 bool sensitivity_assemble(const libMesh::NumericVector< Real > &X, bool if_localize_sol, const MAST::FunctionBase &f, libMesh::NumericVector< Real > &sensitivity_rhs, bool close_vector=true)
Assembly function.
virtual void clear_level_set_velocity_function()
clears the velocity function
virtual void calculate_output_derivative(const libMesh::NumericVector< Real > &X, bool if_localize_sol, MAST::OutputAssemblyElemOperations &output, libMesh::NumericVector< Real > &dq_dX)
calculates
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 ...