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

Detailed Description

Definition at line 36 of file level_set_elem_base.h.

#include <level_set_elem_base.h>

Inheritance diagram for MAST::LevelSetElementBase:
Collaboration diagram for MAST::LevelSetElementBase:

Public Member Functions

 LevelSetElementBase (MAST::SystemInitialization &sys, const MAST::GeomElem &elem)
 Constructor. More...
 
virtual ~LevelSetElementBase ()
 
Real homogenized_volume_fraction (Real delta=0.1)
 Approximates the volume fraction of the element based on integration of approximated Heaviside function over the element. More...
 
Real homogenized_volume_fraction_sensitivity (Real delta=0.1)
 Sensitivity of the homogenized volume fraction for the specified level set value and its sensitivity. More...
 
virtual bool internal_residual (bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
 internal force contribution to system residual More...
 
virtual bool internal_residual_sensitivity (bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
 sensitivity of the internal force contribution to system residual More...
 
Real perimeter (Real delta=0.1)
 Approximates the integral of the Dirac delta function to approximate the perimeter. More...
 
Real perimeter_sensitivity (Real delta=0.1)
 computes the partial derivative of the integral of the Dirac delta function using the solution and sensitivity solution set for this element. More...
 
void set_propagation_mode (bool f)
 This can operate in one of two modes: propagation of level set given Vn, or reinitialization of level set so that |grad(phi)|=1. More...
 
void set_reference_solution_for_initialization (const RealVectorX &sol)
 For reinitialization to $ |\nabla(\phi)| = 1 $, the solution before initialization is used to calculate the source and velocity switching. More...
 
void set_velocity_function (const MAST::FieldFunction< Real > &vel)
 
bool side_external_residual (bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc)
 side external force contribution to system residual More...
 
bool side_external_residual_sensitivity (bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc)
 sensitivity of the side external force contribution to system residual More...
 
virtual bool velocity_residual (bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac)
 inertial force contribution to system residual More...
 
virtual bool velocity_residual_sensitivity (bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
 sensitivity of the damping force contribution to system residual More...
 
Real volume ()
 
Real volume_boundary_velocity_on_side (unsigned int s)
 
bool volume_external_residual (bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase *> &bc)
 volume external force contribution to system residual More...
 
bool volume_external_residual_sensitivity (bool request_jacobian, RealVectorX &f, RealMatrixX &jac, std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase *> &bc)
 sensitivity of the volume external force contribution to system residual More...
 
- Public Member Functions inherited from MAST::ElementBase
 ElementBase (MAST::SystemInitialization &sys, const MAST::GeomElem &elem)
 The default constructor. More...
 
virtual ~ElementBase ()
 Default virtual destructor. More...
 
void attach_active_solution_function (MAST::FunctionBase &f)
 Attaches the function that represents the system solution. More...
 
void detach_active_solution_function ()
 Detaches the function object that may have been attached to the element. More...
 
const MAST::GeomElemelem () const
 
virtual void set_acceleration (const RealVectorX &vec, bool if_sens=false)
 stores vec as acceleration for element level calculations, or its sensitivity if if_sens is true. More...
 
virtual void set_complex_solution (const ComplexVectorX &vec, bool if_sens=false)
 This provides the complex solution (or its sensitivity if if_sens is true.) for frequecy-domain analysis. More...
 
virtual void set_perturbed_acceleration (const RealVectorX &vec, bool if_sens=false)
 stores vec as perturbed acceleration for element level calculations, or its sensitivity if if_sens is true. More...
 
virtual void set_perturbed_solution (const RealVectorX &vec, bool if_sens=false)
 This provides the perturbed solution (or its sensitivity if if_sens is true.) for linearized analysis. More...
 
virtual void set_perturbed_velocity (const RealVectorX &vec, bool if_sens=false)
 stores vec as perturbed velocity for element level calculations, or its sensitivity if if_sens is true. More...
 
virtual void set_solution (const RealVectorX &vec, bool if_sens=false)
 stores vec as solution for element level calculations, or its sensitivity if if_sens is true. More...
 
virtual void set_velocity (const RealVectorX &vec, bool if_sens=false)
 stores vec as velocity for element level calculations, or its sensitivity if if_sens is true. More...
 
const RealVectorXsol (bool if_sens=false) const
 
MAST::NonlinearSystemsystem ()
 
MAST::SystemInitializationsystem_initialization ()
 

Protected Member Functions

void _calculate_dxidX (const MAST::FEBase &fe, const unsigned int qp, RealMatrixX &dxi_dX)
 
void _dc_operator (const MAST::FEBase &fe, const unsigned int qp, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealVectorX &vel, Real &dc)
 
void _initialize_fem_operators (const unsigned int qp, const MAST::FEBase &fe, MAST::FEMOperatorMatrix &Bmat, std::vector< MAST::FEMOperatorMatrix > &dBmat)
 When mass = false, initializes the FEM operator matrix to the shape functions as

\[ B = \left[ \begin{array}{c} {\bf N} \\ {\bf N} \\ {\bf N} \end{array} \right] \]

\[ dB[0] = \frac{\partial {\bf N}}{\partial x} \]

. More...

 
void _tau (const MAST::FEBase &fe, unsigned int qp, const MAST::FEMOperatorMatrix &Bmat, const std::vector< MAST::FEMOperatorMatrix > &dBmat, const RealVectorX &vel, RealMatrixX &tau)
 initializes the tau operator More...
 
void _velocity_and_source (const unsigned int qp, const libMesh::Point &p, const Real t, const MAST::FEMOperatorMatrix &Bmat, const std::vector< MAST::FEMOperatorMatrix > &dBmat, RealVectorX &vel, Real &source)
 calculates the velocity at the quadrature point More...
 

Protected Attributes

bool _if_propagation
 this can operate in one of two modes: propagation of level set given Vn, or reinitialization of level set so that |grad(phi)|=1 More...
 
const MAST::FieldFunction< Real > * _phi_vel
 element property More...
 
RealVectorX _ref_sol
 reference solution for reinitialization of the level set More...
 
- Protected Attributes inherited from MAST::ElementBase
RealVectorX _accel
 local acceleration More...
 
RealVectorX _accel_sens
 local acceleration More...
 
MAST::FunctionBase_active_sol_function
 pointer to the active solution mesh field function. More...
 
ComplexVectorX _complex_sol
 local solution used for frequency domain analysis More...
 
ComplexVectorX _complex_sol_sens
 local solution used for frequency domain analysis More...
 
RealVectorX _delta_accel
 local acceleration More...
 
RealVectorX _delta_accel_sens
 local acceleration More...
 
RealVectorX _delta_sol
 local solution used for linearized analysis More...
 
RealVectorX _delta_sol_sens
 local solution used for linearized analysis More...
 
RealVectorX _delta_vel
 local velocity More...
 
RealVectorX _delta_vel_sens
 local velocity More...
 
const MAST::GeomElem_elem
 geometric element for which the computations are performed More...
 
RealVectorX _sol
 local solution More...
 
RealVectorX _sol_sens
 local solution sensitivity More...
 
MAST::SystemInitialization_system
 SystemInitialization object associated with this element. More...
 
const Real_time
 time for which system is being assembled More...
 
RealVectorX _vel
 local velocity More...
 
RealVectorX _vel_sens
 local velocity More...
 

Constructor & Destructor Documentation

◆ LevelSetElementBase()

MAST::LevelSetElementBase::LevelSetElementBase ( MAST::SystemInitialization sys,
const MAST::GeomElem elem 
)

Constructor.

Definition at line 37 of file level_set_elem_base.cpp.

◆ ~LevelSetElementBase()

MAST::LevelSetElementBase::~LevelSetElementBase ( )
virtual

Definition at line 47 of file level_set_elem_base.cpp.

Member Function Documentation

◆ _calculate_dxidX()

void MAST::LevelSetElementBase::_calculate_dxidX ( const MAST::FEBase fe,
const unsigned int  qp,
RealMatrixX dxi_dX 
)
protected

Definition at line 691 of file level_set_elem_base.cpp.

◆ _dc_operator()

void MAST::LevelSetElementBase::_dc_operator ( const MAST::FEBase fe,
const unsigned int  qp,
const std::vector< MAST::FEMOperatorMatrix > &  dB_mat,
const RealVectorX vel,
Real dc 
)
protected

Definition at line 643 of file level_set_elem_base.cpp.

◆ _initialize_fem_operators()

void MAST::LevelSetElementBase::_initialize_fem_operators ( const unsigned int  qp,
const MAST::FEBase fe,
MAST::FEMOperatorMatrix Bmat,
std::vector< MAST::FEMOperatorMatrix > &  dBmat 
)
protected

When mass = false, initializes the FEM operator matrix to the shape functions as

\[ B = \left[ \begin{array}{c} {\bf N} \\ {\bf N} \\ {\bf N} \end{array} \right] \]

\[ dB[0] = \frac{\partial {\bf N}}{\partial x} \]

.

\[ dB[1] = \frac{\partial {\bf N}}{\partial y} \]

\[ dB[2] = \frac{\partial {\bf N}}{\partial z} \]

Definition at line 765 of file level_set_elem_base.cpp.

◆ _tau()

void MAST::LevelSetElementBase::_tau ( const MAST::FEBase fe,
unsigned int  qp,
const MAST::FEMOperatorMatrix Bmat,
const std::vector< MAST::FEMOperatorMatrix > &  dBmat,
const RealVectorX vel,
RealMatrixX tau 
)
protected

initializes the tau operator

Definition at line 601 of file level_set_elem_base.cpp.

◆ _velocity_and_source()

void MAST::LevelSetElementBase::_velocity_and_source ( const unsigned int  qp,
const libMesh::Point &  p,
const Real  t,
const MAST::FEMOperatorMatrix Bmat,
const std::vector< MAST::FEMOperatorMatrix > &  dBmat,
RealVectorX vel,
Real source 
)
protected

calculates the velocity at the quadrature point

Definition at line 547 of file level_set_elem_base.cpp.

◆ homogenized_volume_fraction()

Real MAST::LevelSetElementBase::homogenized_volume_fraction ( Real  delta = 0.1)

Approximates the volume fraction of the element based on integration of approximated Heaviside function over the element.

delta is the width over which the function is smoothed.

Definition at line 347 of file level_set_elem_base.cpp.

◆ homogenized_volume_fraction_sensitivity()

Real MAST::LevelSetElementBase::homogenized_volume_fraction_sensitivity ( Real  delta = 0.1)

Sensitivity of the homogenized volume fraction for the specified level set value and its sensitivity.

Definition at line 383 of file level_set_elem_base.cpp.

◆ internal_residual()

bool MAST::LevelSetElementBase::internal_residual ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac 
)
virtual

internal force contribution to system residual

Definition at line 64 of file level_set_elem_base.cpp.

◆ internal_residual_sensitivity()

bool MAST::LevelSetElementBase::internal_residual_sensitivity ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac 
)
virtual

sensitivity of the internal force contribution to system residual

Definition at line 292 of file level_set_elem_base.cpp.

◆ perimeter()

Real MAST::LevelSetElementBase::perimeter ( Real  delta = 0.1)

Approximates the integral of the Dirac delta function to approximate the perimeter.

The approximation of Dirac delta function is obtained from the derivative of an approximation to the Heaviside function

\[ H_d(\phi) \approx \frac{1}{2} \left( 1 + \frac{2}{\pi} \arctan(\phi/d) \right). \]

Then, the derivative defines the Dirac delta function

\[ \delta_d(\phi) = \frac{dH_d(\phi)}{d\phi} = \frac{1}{\pi d} \frac{1}{1+(\phi/d)^2} . \]

Sensitivity analysis requires the derivative of this function with respect to a variable, which is expressed as

\[ \frac{d\delta_d(\phi)}{d\alpha} = \frac{-2 \phi}{\pi d^3} \frac{1}{\left(1+(\phi/d)^2\right)^2} \frac{d\phi}{d\alpha}. \]

Returns
the computed integral of $ \delta_d(\phi) $

Definition at line 421 of file level_set_elem_base.cpp.

◆ perimeter_sensitivity()

Real MAST::LevelSetElementBase::perimeter_sensitivity ( Real  delta = 0.1)

computes the partial derivative of the integral of the Dirac delta function using the solution and sensitivity solution set for this element.

Definition at line 454 of file level_set_elem_base.cpp.

◆ set_propagation_mode()

void MAST::LevelSetElementBase::set_propagation_mode ( bool  f)
inline

This can operate in one of two modes: propagation of level set given Vn, or reinitialization of level set so that |grad(phi)|=1.

This method sets the flag for propagation to true or false.

Definition at line 62 of file level_set_elem_base.h.

◆ set_reference_solution_for_initialization()

void MAST::LevelSetElementBase::set_reference_solution_for_initialization ( const RealVectorX sol)

For reinitialization to $ |\nabla(\phi)| = 1 $, the solution before initialization is used to calculate the source and velocity switching.

This method sets that solution

Definition at line 55 of file level_set_elem_base.cpp.

◆ set_velocity_function()

void MAST::LevelSetElementBase::set_velocity_function ( const MAST::FieldFunction< Real > &  vel)
inline

Definition at line 51 of file level_set_elem_base.h.

◆ side_external_residual()

bool MAST::LevelSetElementBase::side_external_residual ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac,
std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &  bc 
)

side external force contribution to system residual

Definition at line 236 of file level_set_elem_base.cpp.

◆ side_external_residual_sensitivity()

bool MAST::LevelSetElementBase::side_external_residual_sensitivity ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac,
std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &  bc 
)

sensitivity of the side external force contribution to system residual

Definition at line 264 of file level_set_elem_base.cpp.

◆ velocity_residual()

bool MAST::LevelSetElementBase::velocity_residual ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac_xdot,
RealMatrixX jac 
)
virtual

inertial force contribution to system residual

Definition at line 159 of file level_set_elem_base.cpp.

◆ velocity_residual_sensitivity()

bool MAST::LevelSetElementBase::velocity_residual_sensitivity ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac 
)
virtual

sensitivity of the damping force contribution to system residual

Definition at line 304 of file level_set_elem_base.cpp.

◆ volume()

Real MAST::LevelSetElementBase::volume ( )
Returns
the element volume over the domain of the element that has positive level set function

Definition at line 315 of file level_set_elem_base.cpp.

◆ volume_boundary_velocity_on_side()

Real MAST::LevelSetElementBase::volume_boundary_velocity_on_side ( unsigned int  s)
Returns
the contribution of the side to $ \int_\Gamma V_n d\Gamma $, where $ V_n $ is the boundary normal velocity evaluated from the solution and sensitivity.

Definition at line 491 of file level_set_elem_base.cpp.

◆ volume_external_residual()

bool MAST::LevelSetElementBase::volume_external_residual ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac,
std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase *> &  bc 
)

volume external force contribution to system residual

Definition at line 251 of file level_set_elem_base.cpp.

◆ volume_external_residual_sensitivity()

bool MAST::LevelSetElementBase::volume_external_residual_sensitivity ( bool  request_jacobian,
RealVectorX f,
RealMatrixX jac,
std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase *> &  bc 
)

sensitivity of the volume external force contribution to system residual

Definition at line 278 of file level_set_elem_base.cpp.

Member Data Documentation

◆ _if_propagation

bool MAST::LevelSetElementBase::_if_propagation
protected

this can operate in one of two modes: propagation of level set given Vn, or reinitialization of level set so that |grad(phi)|=1

Definition at line 267 of file level_set_elem_base.h.

◆ _phi_vel

const MAST::FieldFunction<Real>* MAST::LevelSetElementBase::_phi_vel
protected

element property

Definition at line 261 of file level_set_elem_base.h.

◆ _ref_sol

RealVectorX MAST::LevelSetElementBase::_ref_sol
protected

reference solution for reinitialization of the level set

Definition at line 272 of file level_set_elem_base.h.


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