20 #ifndef __mast__system_assembly_base_h__ 21 #define __mast__system_assembly_base_h__ 33 #include "libmesh/system.h" 34 #include "libmesh/nonlinear_implicit_system.h" 35 #include "libmesh/sparse_matrix.h" 41 class PhysicsDisciplineBase;
42 class SystemInitialization;
44 class MeshFieldFunction;
45 class NonlinearSystem;
47 class AssemblyElemOperations;
48 class OutputAssemblyElemOperations;
52 public libMesh::NonlinearImplicitSystem::ComputeResidualandJacobian {
72 virtual void clear() = 0;
90 virtual bool if_elem_depends_on_parameter(
const libMesh::Elem& e,
221 libMesh::NumericVector<Real>* R,
222 libMesh::SparseMatrix<Real>* J,
223 libMesh::NonlinearImplicitSystem& S) {
224 libmesh_assert(
false);
240 libMesh::NumericVector<Real>& sensitivity_rhs) {
241 libmesh_assert(
false);
258 libMesh::NumericVector<Real>& dq_dX);
272 const libMesh::NumericVector<Real>* dXdp,
284 const libMesh::NumericVector<Real>& dq_dX,
288 const bool include_partial_sens =
true);
296 std::unique_ptr<libMesh::NumericVector<Real> >
298 const libMesh::NumericVector<Real>& global)
const;
341 #endif // __mast__system_assembly_base_h__
MAST::AssemblyElemOperations * _elem_ops
provides assembly elem operations for use by this class
AssemblyBase()
constructor takes a reference to the discipline that provides the boundary conditions, volume loads, properties, etc.
void clear_solver_monitor()
clears the monitor object
This class implements a system for solution of nonlinear systems.
bool override_flag
if true, assume zero solution sensitivity when elem does not dependent on parameter.
virtual void clear_elem_operation_object()
clears the association of this object with the assembly element operation object. ...
virtual bool sensitivity_assemble(const MAST::FunctionBase &f, libMesh::NumericVector< Real > &sensitivity_rhs)
Assembly function.
This provides a wrapper FieldFunction compatible class that interpolates the solution using libMesh's...
void attach_solution_function(MAST::MeshFieldFunction &f)
tells the assembly object that this function is will need to be initialized before each residual eval...
virtual void calculate_output_derivative(const libMesh::NumericVector< Real > &X, MAST::OutputAssemblyElemOperations &output, libMesh::NumericVector< Real > &dq_dX)
calculates
void attach_elem_parameter_dependence_object(MAST::AssemblyBase::ElemParameterDependence &dep)
This object, if provided by user, will be used to reduce unnecessary computations in sensitivity anal...
virtual Real calculate_output_adjoint_sensitivity(const libMesh::NumericVector< Real > &X, const libMesh::NumericVector< Real > &dq_dX, const MAST::FunctionBase &p, MAST::AssemblyElemOperations &elem_ops, MAST::OutputAssemblyElemOperations &output, const bool include_partial_sens=true)
Evaluates the total sensitivity of output wrt p using the adjoint solution provided in dq_dX for a li...
void set_solver_monitor(MAST::AssemblyBase::SolverMonitor &monitor)
attaches the solver monitor, which is a user provided routine that is called each time ...
This provides the base class for definitin of element level contribution of output quantity in an ana...
ElemParameterDependence(bool o_flag)
bool close_matrix
flag to control the closing fo the Jacobian after assembly
virtual void set_elem_operation_object(MAST::AssemblyElemOperations &elem_ops)
attaches a element operation to this object, and associated this with the element operation object...
MAST::SystemInitialization * _system
System for which this assembly is performed.
virtual void init(MAST::AssemblyBase &assembly)=0
void detach_solution_function()
removes the attachment of the solution function
MAST::PhysicsDisciplineBase * _discipline
PhysicsDisciplineBase object for which this class is assembling.
virtual void clear_discipline_and_system()
clears association with a system to this discipline
virtual void calculate_output(const libMesh::NumericVector< Real > &X, MAST::OutputAssemblyElemOperations &output)
calculates the value of quantity .
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 ...
virtual ~ElemParameterDependence()
void clear_elem_parameter_dependence_object()
std::unique_ptr< libMesh::NumericVector< Real > > build_localized_vector(const libMesh::System &sys, const libMesh::NumericVector< Real > &global) const
localizes the parallel vector so that the local copy stores all values necessary for calculation of t...
MAST::AssemblyBase::SolverMonitor * get_solver_monitor()
Inherited objects from this class can be provided by the user provide assessment of whether or not an...
MAST::SystemInitialization & system_init()
MAST::AssemblyBase::ElemParameterDependence * _param_dependence
If provided by user, this object is used by sensitiivty analysis to check for whether or the current ...
virtual void set_discipline_and_system(MAST::PhysicsDisciplineBase &discipline, MAST::SystemInitialization &system)
attaches a system to this discipline
virtual ~AssemblyBase()
virtual destructor
MAST::AssemblyElemOperations & get_elem_ops()
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 ...
MAST::AssemblyBase::SolverMonitor * _solver_monitor
User provided solver monitor is attached to the linear nonlinear solvers, if provided.
const MAST::NonlinearSystem & system() const
MAST::MeshFieldFunction * _sol_function
system solution that will be initialized before each solution
const MAST::PhysicsDisciplineBase & discipline() const