MAST
MAST::LevelSetElementBase Class Reference

#include <level_set_elem_base.h>

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

Public Member Functions

 LevelSetElementBase (MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem)
 Constructor. More...
 
virtual ~LevelSetElementBase ()
 
void set_velocity_function (const MAST::FieldFunction< Real > &vel)
 
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...
 
virtual bool internal_residual (bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
 internal 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...
 
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 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...
 
virtual bool internal_residual_sensitivity (bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
 sensitivity of the internal 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...
 
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...
 
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...
 
Real volume ()
 
Real perimeter ()
 Approximates the integral of the Dirac delta function to approximate the perimeter. More...
 
Real perimeter_sensitivity ()
 computes the partial derivative of the integral of the Dirac delta function using the solution and sensitivity solution set for this element. More...
 
Real volume_boundary_velocity_on_side (unsigned int s)
 
- Public Member Functions inherited from MAST::ElementBase
 ElementBase (MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem)
 The default constructor. More...
 
virtual ~ElementBase ()
 Default virtual destructor. More...
 
MAST::SystemInitializationsystem_initialization ()
 
MAST::AssemblyBaseassembly ()
 
MAST::NonlinearSystemsystem ()
 
const MAST::GeomElemelem () const
 
const RealVectorXsol (bool if_sens=false) const
 
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_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_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_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...
 
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_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_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...
 
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...
 

Protected Member Functions

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...
 
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 _dc_operator (const MAST::FEBase &fe, const unsigned int qp, const std::vector< MAST::FEMOperatorMatrix > &dB_mat, const RealVectorX &vel, Real &dc)
 
void _calculate_dxidX (const MAST::FEBase &fe, const unsigned int qp, RealMatrixX &dxi_dX)
 
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...

 

Protected Attributes

const MAST::FieldFunction< Real > * _phi_vel
 element property More...
 
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...
 
RealVectorX _ref_sol
 reference solution for reinitialization of the level set More...
 
- Protected Attributes inherited from MAST::ElementBase
MAST::SystemInitialization_system
 SystemInitialization object associated with this element. More...
 
MAST::AssemblyBase_assembly
 Assembly object. More...
 
const MAST::GeomElem_elem
 geometric element for which the computations are performed More...
 
MAST::FunctionBase_active_sol_function
 pointer to the active solution mesh field function. More...
 
const Real_time
 time for which system is being assembled More...
 
RealVectorX _sol
 local solution More...
 
RealVectorX _sol_sens
 local solution sensitivity 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_sol
 local solution used for linearized analysis More...
 
RealVectorX _delta_sol_sens
 local solution used for linearized analysis More...
 
RealVectorX _vel
 local velocity More...
 
RealVectorX _vel_sens
 local velocity More...
 
RealVectorX _delta_vel
 local velocity More...
 
RealVectorX _delta_vel_sens
 local velocity More...
 
RealVectorX _accel
 local acceleration More...
 
RealVectorX _accel_sens
 local acceleration More...
 
RealVectorX _delta_accel
 local acceleration More...
 
RealVectorX _delta_accel_sens
 local acceleration More...
 

Detailed Description

Definition at line 36 of file level_set_elem_base.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 37 of file level_set_elem_base.cpp.

MAST::LevelSetElementBase::~LevelSetElementBase ( )
virtual

Definition at line 48 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 615 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 567 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 689 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 525 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 471 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

internal force contribution to system residual

Definition at line 65 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 291 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Real MAST::LevelSetElementBase::perimeter ( )

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 345 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Real MAST::LevelSetElementBase::perimeter_sensitivity ( )

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 378 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 63 of file level_set_elem_base.h.

Here is the call graph for this function:

Here is the caller graph for this function:

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 56 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 52 of file level_set_elem_base.h.

Here is the caller graph for this function:

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 235 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 263 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Here is the call graph for this function:

Here is the caller graph for this function:

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 303 of file level_set_elem_base.cpp.

Here is the caller graph for this function:

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

Definition at line 314 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 415 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 250 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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 277 of file level_set_elem_base.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

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 250 of file level_set_elem_base.h.

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

element property

Definition at line 244 of file level_set_elem_base.h.

RealVectorX MAST::LevelSetElementBase::_ref_sol
protected

reference solution for reinitialization of the level set

Definition at line 255 of file level_set_elem_base.h.


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