MAST
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__nonlinear_implicit_assembly__
21 #define __mast__nonlinear_implicit_assembly__
22 
23 // MAST includes
24 #include "base/assembly_base.h"
25 
26 // libMesh includes
27 #include "libmesh/nonlinear_implicit_system.h"
28 
29 
30 namespace MAST {
31 
32  // Forward declerations
33  class NonlinearImplicitAssemblyElemOperations;
34 
35 
37  public MAST::AssemblyBase {
38  public:
39 
40 
47 
48  public:
51  virtual void post_assembly(const libMesh::NumericVector<Real>& X,
52  libMesh::NumericVector<Real>* R,
53  libMesh::SparseMatrix<Real>* J,
54  libMesh::NonlinearImplicitSystem& S) = 0;
55  };
56 
61 
62 
68 
69 
70 
74  Real res_l2_norm() const { return _res_l2_norm; }
75 
77 
82  _res_l2_norm = 0.;
84  }
85 
92  void
94 
99  virtual void
100  residual_and_jacobian (const libMesh::NumericVector<Real>& X,
101  libMesh::NumericVector<Real>* R,
102  libMesh::SparseMatrix<Real>* J,
103  libMesh::NonlinearImplicitSystem& S);
104 
105 
114  virtual void
115  linearized_jacobian_solution_product(const libMesh::NumericVector<Real>& X,
116  const libMesh::NumericVector<Real>& dX,
117  libMesh::NumericVector<Real>& JdX,
118  libMesh::NonlinearImplicitSystem& S);
119 
120 
124  virtual void
125  second_derivative_dot_solution_assembly(const libMesh::NumericVector<Real>& X,
126  const libMesh::NumericVector<Real>& dX,
127  libMesh::SparseMatrix<Real>& d_JdX_dX,
128  libMesh::NonlinearImplicitSystem& S);
129 
130 
142  virtual bool
144  libMesh::NumericVector<Real>& sensitivity_rhs);
145 
146  protected:
147 
148 
149 
155 
160 
161  };
162 }
163 
164 
165 #endif //__mast__nonlinear_implicit_assembly__
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 ...
Real _res_l2_norm
L2 norm of the last-assembled residual.
void reset_residual_norm_history()
reset L2 norm of the last-assembled residual
virtual bool sensitivity_assemble(const MAST::FunctionBase &f, libMesh::NumericVector< Real > &sensitivity_rhs)
Assembly function.
virtual void second_derivative_dot_solution_assembly(const libMesh::NumericVector< Real > &X, const libMesh::NumericVector< Real > &dX, libMesh::SparseMatrix< Real > &d_JdX_dX, libMesh::NonlinearImplicitSystem &S)
calculates .
libMesh::Real Real
virtual void linearized_jacobian_solution_product(const libMesh::NumericVector< Real > &X, const libMesh::NumericVector< Real > &dX, libMesh::NumericVector< Real > &JdX, libMesh::NonlinearImplicitSystem &S)
calculates the product of the Jacobian and a perturbation in solution vector .
virtual void post_assembly(const libMesh::NumericVector< Real > &X, libMesh::NumericVector< Real > *R, libMesh::SparseMatrix< Real > *J, libMesh::NonlinearImplicitSystem &S)=0
NonlinearImplicitAssembly()
constructor associates this assembly object with the system
MAST::NonlinearImplicitAssembly::PostAssemblyOperation * _post_assembly
this object, if non-NULL is user-provided to perform actions after assembly and before returning to t...
Real res_l2_norm() const
L2 norm of the last-assembled residual.
virtual ~PostAssemblyOperation()
user-provided object to perform actions after assembly and before returning to the solver...
PostAssemblyOperation()
void set_post_assembly_operation(MAST::NonlinearImplicitAssembly::PostAssemblyOperation &post)
sets the PostAssemblyOperation object for use after assembly.
virtual ~NonlinearImplicitAssembly()
destructor resets the association of this assembly object with the system