MAST
Multidisciplinary-design Adaptation and Sensitivity Toolkit (MAST)
MAST::LevelSetNonlinearImplicitAssembly Class Reference

Detailed Description

Definition at line 37 of file level_set_nonlinear_implicit_assembly.h.

#include <level_set_nonlinear_implicit_assembly.h>

Inheritance diagram for MAST::LevelSetNonlinearImplicitAssembly:
Collaboration diagram for MAST::LevelSetNonlinearImplicitAssembly:

Public Member Functions

 LevelSetNonlinearImplicitAssembly (bool enable_dof_handler)
 constructor associates this assembly object with the system More...
 
virtual ~LevelSetNonlinearImplicitAssembly ()
 destructor resets the association of this assembly object with the system More...
 
virtual void calculate_output (const libMesh::NumericVector< Real > &X, bool if_localize_sol, MAST::OutputAssemblyElemOperations &output)
 calculates the value of quantity $ q(X,p) $. More...
 
virtual void calculate_output_derivative (const libMesh::NumericVector< Real > &X, bool if_localize_sol, MAST::OutputAssemblyElemOperations &output, libMesh::NumericVector< Real > &dq_dX)
 calculates $ \frac{\partial q(X, p)}{\partial X} $ More...
 
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 params. More...
 
virtual void clear_level_set_function ()
 clears association with level set function More...
 
virtual void clear_level_set_velocity_function ()
 clears the velocity function More...
 
MAST::LevelSetInterfaceDofHandlerget_dof_handler ()
 
MAST::LevelSetIntersectionget_intersection ()
 
bool if_use_dof_handler () const
 
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 More...
 
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. More...
 
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 More...
 
virtual void set_indicator_function (MAST::FieldFunction< RealVectorX > &indicator)
 attaches indicator function to this. More...
 
virtual void set_level_set_function (MAST::FieldFunction< Real > &level_set, const MAST::FilterBase &filter)
 attaches level set function to this More...
 
virtual void set_level_set_velocity_function (MAST::FieldFunction< RealVectorX > &velocity)
 the velocity function used to calculate topology sensitivity More...
 
- Public Member Functions inherited from MAST::NonlinearImplicitAssembly
 NonlinearImplicitAssembly ()
 constructor associates this assembly object with the system More...
 
virtual ~NonlinearImplicitAssembly ()
 destructor resets the association of this assembly object with the system More...
 
Real first_iter_res_l2_norm () const
 
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 $ [J] \{\Delta X\} $. More...
 
Real res_l2_norm () const
 L2 norm of the last-assembled residual. More...
 
void reset_residual_norm_history ()
 reset L2 norm of the last-assembled residual More...
 
virtual void second_derivative_dot_solution_assembly (const libMesh::NumericVector< Real > &X, bool if_localize_sol, const libMesh::NumericVector< Real > &dX, bool if_localize_sol_sens, libMesh::SparseMatrix< Real > &d_JdX_dX, libMesh::NonlinearImplicitSystem &S)
 calculates $ d ([J] \{\Delta X\})/ dX $. More...
 
void set_post_assembly_operation (MAST::NonlinearImplicitAssembly::PostAssemblyOperation &post)
 sets the PostAssemblyOperation object for use after assembly. More...
 
- Public Member Functions inherited from MAST::AssemblyBase
 AssemblyBase ()
 constructor takes a reference to the discipline that provides the boundary conditions, volume loads, properties, etc. More...
 
virtual ~AssemblyBase ()
 virtual destructor More...
 
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 analysis assembly operations. More...
 
void attach_solution_function (MAST::MeshFieldFunction &f)
 tells the assembly object that this function is will need to be initialized before each residual evaluation More...
 
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 the element quantities More...
 
virtual Real calculate_output_adjoint_sensitivity (const libMesh::NumericVector< Real > &X, bool if_localize_sol, const libMesh::NumericVector< Real > &adj_sol, 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 adj_sol for a linearization about solution X. More...
 
virtual void calculate_output_adjoint_sensitivity_multiple_parameters_no_direct (const libMesh::NumericVector< Real > &X, bool if_localize_sol, const libMesh::NumericVector< Real > &adj_sol, const std::vector< const MAST::FunctionBase *> &p_vec, MAST::AssemblyElemOperations &elem_ops, MAST::OutputAssemblyElemOperations &output, std::vector< Real > &sens)
 Evaluates the dot product between adj_sol and sensitivity of residual about X for multiple parameter_vectors p_vec and returns the results in sens. More...
 
virtual void clear_discipline_and_system ()
 clears association with a system to this discipline More...
 
virtual void clear_elem_operation_object ()
 clears the association of this object with the assembly element operation object. More...
 
void clear_elem_parameter_dependence_object ()
 
void clear_solver_monitor ()
 clears the monitor object More...
 
void detach_solution_function ()
 removes the attachment of the solution function More...
 
const MAST::PhysicsDisciplineBasediscipline () const
 
MAST::PhysicsDisciplineBasediscipline ()
 
MAST::AssemblyElemOperationsget_elem_ops ()
 
MAST::AssemblyBase::SolverMonitorget_solver_monitor ()
 
virtual void set_discipline_and_system (MAST::PhysicsDisciplineBase &discipline, MAST::SystemInitialization &system)
 attaches a system to this discipline More...
 
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. More...
 
void set_solver_monitor (MAST::AssemblyBase::SolverMonitor &monitor)
 attaches the solver monitor, which is a user provided routine that is called each time More...
 
const MAST::NonlinearSystemsystem () const
 
MAST::NonlinearSystemsystem ()
 
MAST::SystemInitializationsystem_init ()
 

Protected Attributes

MAST::LevelSetInterfaceDofHandler_dof_handler
 
bool _enable_dof_handler
 
bool _evaluate_output_on_negative_phi
 
const MAST::FilterBase_filter
 
MAST::FieldFunction< RealVectorX > * _indicator
 
MAST::LevelSetIntersection_intersection
 
MAST::FieldFunction< Real > * _level_set
 
MAST::FieldFunction< RealVectorX > * _velocity
 
MAST::LevelSetVoidSolution_void_solution_monitor
 
- Protected Attributes inherited from MAST::NonlinearImplicitAssembly
Real _first_iter_res_l2_norm
 
MAST::NonlinearImplicitAssembly::PostAssemblyOperation_post_assembly
 this object, if non-NULL is user-provided to perform actions after assembly and before returning to the solver More...
 
Real _res_l2_norm
 L2 norm of the last-assembled residual. More...
 
- Protected Attributes inherited from MAST::AssemblyBase
MAST::PhysicsDisciplineBase_discipline
 PhysicsDisciplineBase object for which this class is assembling. More...
 
MAST::AssemblyElemOperations_elem_ops
 provides assembly elem operations for use by this class More...
 
MAST::AssemblyBase::ElemParameterDependence_param_dependence
 If provided by user, this object is used by sensitiivty analysis to check for whether or the current design parameter influences an element. More...
 
MAST::MeshFieldFunction_sol_function
 system solution that will be initialized before each solution More...
 
MAST::AssemblyBase::SolverMonitor_solver_monitor
 User provided solver monitor is attached to the linear nonlinear solvers, if provided. More...
 
MAST::SystemInitialization_system
 System for which this assembly is performed. More...
 

Additional Inherited Members

- Public Attributes inherited from MAST::AssemblyBase
bool close_matrix
 flag to control the closing fo the Jacobian after assembly More...
 
std::set< unsigned int > diagonal_elem_subdomain_id
 subdomain ids for which residuakl and Jacobian contributions will not be computed. More...
 

Constructor & Destructor Documentation

◆ LevelSetNonlinearImplicitAssembly()

MAST::LevelSetNonlinearImplicitAssembly::LevelSetNonlinearImplicitAssembly ( bool  enable_dof_handler)

constructor associates this assembly object with the system

Definition at line 47 of file level_set_nonlinear_implicit_assembly.cpp.

◆ ~LevelSetNonlinearImplicitAssembly()

MAST::LevelSetNonlinearImplicitAssembly::~LevelSetNonlinearImplicitAssembly ( )
virtual

destructor resets the association of this assembly object with the system

Definition at line 63 of file level_set_nonlinear_implicit_assembly.cpp.

Member Function Documentation

◆ calculate_output()

void MAST::LevelSetNonlinearImplicitAssembly::calculate_output ( const libMesh::NumericVector< Real > &  X,
bool  if_localize_sol,
MAST::OutputAssemblyElemOperations output 
)
virtual

calculates the value of quantity $ q(X,p) $.

Reimplemented from MAST::AssemblyBase.

Definition at line 772 of file level_set_nonlinear_implicit_assembly.cpp.

◆ calculate_output_derivative()

void MAST::LevelSetNonlinearImplicitAssembly::calculate_output_derivative ( const libMesh::NumericVector< Real > &  X,
bool  if_localize_sol,
MAST::OutputAssemblyElemOperations output,
libMesh::NumericVector< Real > &  dq_dX 
)
virtual

calculates $ \frac{\partial q(X, p)}{\partial X} $

Reimplemented from MAST::AssemblyBase.

Definition at line 935 of file level_set_nonlinear_implicit_assembly.cpp.

◆ calculate_output_direct_sensitivity()

void MAST::LevelSetNonlinearImplicitAssembly::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 
)
virtual

evaluates the sensitivity of the outputs in the attached discipline with respect to the parametrs in params.

The base solution should be provided in X. If total sensitivity is desired, then dXdp should contain the sensitivity of solution wrt the parameter p, otherwise it can be set to nullptr. If dXdp is nullptr, the calculated sensitivity will be the partial derivarive of output wrt p.

Reimplemented from MAST::AssemblyBase.

Definition at line 1167 of file level_set_nonlinear_implicit_assembly.cpp.

◆ clear_level_set_function()

void MAST::LevelSetNonlinearImplicitAssembly::clear_level_set_function ( )
virtual

clears association with level set function

Definition at line 137 of file level_set_nonlinear_implicit_assembly.cpp.

◆ clear_level_set_velocity_function()

void MAST::LevelSetNonlinearImplicitAssembly::clear_level_set_velocity_function ( )
virtual

clears the velocity function

Definition at line 171 of file level_set_nonlinear_implicit_assembly.cpp.

◆ get_dof_handler()

MAST::LevelSetInterfaceDofHandler & MAST::LevelSetNonlinearImplicitAssembly::get_dof_handler ( )
Returns
a reference to the LevelSetInterfaceDofHandler object

Definition at line 94 of file level_set_nonlinear_implicit_assembly.cpp.

◆ get_intersection()

MAST::LevelSetIntersection & MAST::LevelSetNonlinearImplicitAssembly::get_intersection ( )
Returns
a reference to the level set function

Definition at line 72 of file level_set_nonlinear_implicit_assembly.cpp.

◆ if_use_dof_handler()

bool MAST::LevelSetNonlinearImplicitAssembly::if_use_dof_handler ( ) const
Returns
flag if using dof_handler or not

Definition at line 88 of file level_set_nonlinear_implicit_assembly.cpp.

◆ residual_and_jacobian()

void MAST::LevelSetNonlinearImplicitAssembly::residual_and_jacobian ( const libMesh::NumericVector< Real > &  X,
libMesh::NumericVector< Real > *  R,
libMesh::SparseMatrix< Real > *  J,
libMesh::NonlinearImplicitSystem &  S 
)
virtual

function that assembles the matrices and vectors quantities for nonlinear solution

Reimplemented from MAST::NonlinearImplicitAssembly.

Definition at line 322 of file level_set_nonlinear_implicit_assembly.cpp.

◆ sensitivity_assemble()

bool MAST::LevelSetNonlinearImplicitAssembly::sensitivity_assemble ( const libMesh::NumericVector< Real > &  X,
bool  if_localize_sol,
const MAST::FunctionBase f,
libMesh::NumericVector< Real > &  sensitivity_rhs,
bool  close_vector = true 
)
virtual

Assembly function.

This function will be called to assemble the RHS of the sensitivity equations (which is -1 times sensitivity of system residual) prior to a solve and must be provided by the user in a derived class. The method provides dR/dp for f parameter.

If the routine is not able to provide sensitivity for this parameter, then it should return false, and the system will attempt to use finite differencing.

Reimplemented from MAST::NonlinearImplicitAssembly.

Definition at line 553 of file level_set_nonlinear_implicit_assembly.cpp.

◆ set_evaluate_output_on_negative_phi()

void MAST::LevelSetNonlinearImplicitAssembly::set_evaluate_output_on_negative_phi ( bool  f)

sets the flag on whether or not to evaluate the output on negative level set function

Definition at line 81 of file level_set_nonlinear_implicit_assembly.cpp.

◆ set_indicator_function()

void MAST::LevelSetNonlinearImplicitAssembly::set_indicator_function ( MAST::FieldFunction< RealVectorX > &  indicator)
virtual

attaches indicator function to this.

Definition at line 126 of file level_set_nonlinear_implicit_assembly.cpp.

◆ set_level_set_function()

void MAST::LevelSetNonlinearImplicitAssembly::set_level_set_function ( MAST::FieldFunction< Real > &  level_set,
const MAST::FilterBase filter 
)
virtual

attaches level set function to this

Definition at line 104 of file level_set_nonlinear_implicit_assembly.cpp.

◆ set_level_set_velocity_function()

void MAST::LevelSetNonlinearImplicitAssembly::set_level_set_velocity_function ( MAST::FieldFunction< RealVectorX > &  velocity)
virtual

the velocity function used to calculate topology sensitivity

Definition at line 158 of file level_set_nonlinear_implicit_assembly.cpp.

Member Data Documentation

◆ _dof_handler

MAST::LevelSetInterfaceDofHandler* MAST::LevelSetNonlinearImplicitAssembly::_dof_handler
protected

Definition at line 187 of file level_set_nonlinear_implicit_assembly.h.

◆ _enable_dof_handler

bool MAST::LevelSetNonlinearImplicitAssembly::_enable_dof_handler
protected

Definition at line 177 of file level_set_nonlinear_implicit_assembly.h.

◆ _evaluate_output_on_negative_phi

bool MAST::LevelSetNonlinearImplicitAssembly::_evaluate_output_on_negative_phi
protected

Definition at line 179 of file level_set_nonlinear_implicit_assembly.h.

◆ _filter

const MAST::FilterBase* MAST::LevelSetNonlinearImplicitAssembly::_filter
protected

Definition at line 193 of file level_set_nonlinear_implicit_assembly.h.

◆ _indicator

MAST::FieldFunction<RealVectorX>* MAST::LevelSetNonlinearImplicitAssembly::_indicator
protected

Definition at line 183 of file level_set_nonlinear_implicit_assembly.h.

◆ _intersection

MAST::LevelSetIntersection* MAST::LevelSetNonlinearImplicitAssembly::_intersection
protected

Definition at line 185 of file level_set_nonlinear_implicit_assembly.h.

◆ _level_set

MAST::FieldFunction<Real>* MAST::LevelSetNonlinearImplicitAssembly::_level_set
protected

Definition at line 181 of file level_set_nonlinear_implicit_assembly.h.

◆ _velocity

MAST::FieldFunction<RealVectorX>* MAST::LevelSetNonlinearImplicitAssembly::_velocity
protected

Definition at line 191 of file level_set_nonlinear_implicit_assembly.h.

◆ _void_solution_monitor

MAST::LevelSetVoidSolution* MAST::LevelSetNonlinearImplicitAssembly::_void_solution_monitor
protected

Definition at line 189 of file level_set_nonlinear_implicit_assembly.h.


The documentation for this class was generated from the following files: