v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpSensitivityInteriorGradient Struct Reference
Inheritance diagram for EshelbianPlasticity::OpSensitivityInteriorGradient:
[legend]
Collaboration diagram for EshelbianPlasticity::OpSensitivityInteriorGradient:
[legend]

Public Member Functions

 OpSensitivityInteriorGradient (const std::string field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, SmartPetscObj< Vec > assemble_vec, const double alpha, const double rho, const double alpha_viscous_omega=0, boost::shared_ptr< double > J_ptr=nullptr)
 
MoFEMErrorCode integrate (EntData &data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleVolume >
 OpAssembleTopologicalObjectiveDerivativeImplBase (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< TopologicalData > topo_ptr, boost::shared_ptr< double > J_ptr, SmartPetscObj< Vec > assemble_vec, Tag topo_tag)
 
MoFEMErrorCode assemble (int side, EntityType type, EntData &data) override
 
- Public Member Functions inherited from OpAssembleVolume
MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from OpAssembleBasic< VolUserDataOperator >
 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
 OpAssembleBasic (const FieldSpace space)
 
virtual MoFEMErrorCode integrate (EntData &)
 
virtual MoFEMErrorCode integrate (int, EntityType, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &, EntData &)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int, EntityType, EntData &data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
- Public Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
int getNumNodes ()
 get element number of nodes
 
const EntityHandle * getConn ()
 get element connectivity
 
double getVolume () const
 element volume (linear geometry)
 
doublegetVolume ()
 element volume (linear geometry)
 
FTensor::Tensor2< double *, 3, 3 > & getJac ()
 get element Jacobian
 
FTensor::Tensor2< double *, 3, 3 > & getInvJac ()
 get element inverse Jacobian
 
VectorDoublegetCoords ()
 nodal coordinates
 
VolumeElementForcesAndSourcesCoregetVolumeFE () const
 return pointer to Generic Volume Finite Element object
 
- Public Member Functions inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
 UserDataOperator (const FieldSpace space, const char type=OPSPACE, const bool symm=true)
 Constructor for operators working on finite element spaces.
 
 UserDataOperator (const std::string field_name, const char type, const bool symm=true)
 Constructor for operators working on a single field.
 
 UserDataOperator (const std::string row_field_name, const std::string col_field_name, const char type, const bool symm=true)
 Constructor for operators working on two fields (bilinear forms)
 
boost::shared_ptr< const NumeredEntFiniteElementgetNumeredEntFiniteElementPtr () const
 Return raw pointer to NumeredEntFiniteElement.
 
EntityHandle getFEEntityHandle () const
 Return finite element entity handle.
 
int getFEDim () const
 Get dimension of finite element.
 
EntityType getFEType () const
 Get dimension of finite element.
 
boost::weak_ptr< SideNumbergetSideNumberPtr (const int side_number, const EntityType type)
 Get the side number pointer.
 
EntityHandle getSideEntity (const int side_number, const EntityType type)
 Get the side entity.
 
int getNumberOfNodesOnElement () const
 Get the number of nodes on finite element.
 
MoFEMErrorCode getProblemRowIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get row indices.
 
MoFEMErrorCode getProblemColIndices (const std::string filed_name, const EntityType type, const int side, VectorInt &indices) const
 Get col indices.
 
const FEMethodgetFEMethod () const
 Return raw pointer to Finite Element Method object.
 
int getOpType () const
 Get operator types.
 
void setOpType (const OpType type)
 Set operator type.
 
void addOpType (const OpType type)
 Add operator type.
 
int getNinTheLoop () const
 get number of finite element in the loop
 
int getLoopSize () const
 get size of elements in the loop
 
std::string getFEName () const
 Get name of the element.
 
ForcesAndSourcesCoregetPtrFE () const
 
ForcesAndSourcesCoregetSidePtrFE () const
 
ForcesAndSourcesCoregetRefinePtrFE () const
 
const PetscData::SwitchesgetDataCtx () const
 
KspMethod::KSPContext getKSPCtx () const
 
SnesMethod::SNESContext getSNESCtx () const
 
TSMethod::TSContext getTSCtx () const
 
Vec getKSPf () const
 
Mat getKSPA () const
 
Mat getKSPB () const
 
Vec getSNESf () const
 
Vec getSNESx () const
 
Mat getSNESA () const
 
Mat getSNESB () const
 
Vec getTSu () const
 
Vec getTSu_t () const
 
Vec getTSu_tt () const
 
Vec getTSf () const
 
Mat getTSA () const
 
Mat getTSB () const
 
int getTSstep () const
 
double getTStime () const
 
double getTStimeStep () const
 
double getTSa () const
 
double getTSaa () const
 
MatrixDoublegetGaussPts ()
 matrix of integration (Gauss) points for Volume Element
 
auto getFTensor0IntegrationWeight ()
 Get integration weights.
 
MatrixDoublegetCoordsAtGaussPts ()
 Gauss points and weight, matrix (nb. of points x 3)
 
auto getFTensor1CoordsAtGaussPts ()
 Get coordinates at integration points assuming linear geometry.
 
double getMeasure () const
 get measure of element
 
doublegetMeasure ()
 get measure of element
 
MoFEM::InterfacegetMField ()
 
moab::Interface & getMoab ()
 
virtual boost::weak_ptr< ForcesAndSourcesCoregetSubPipelinePtr () const
 
MoFEMErrorCode loopSide (const string &fe_name, ForcesAndSourcesCore *side_fe, const size_t dim, const EntityHandle ent_for_side=0, boost::shared_ptr< Range > fe_range=nullptr, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy, AdjCache *adj_cache=nullptr)
 User calls this function to loop over elements on the side of face. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopThis (const string &fe_name, ForcesAndSourcesCore *this_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over the same element using a different set of integration points. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopParent (const string &fe_name, ForcesAndSourcesCore *parent_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopChildren (const string &fe_name, ForcesAndSourcesCore *child_fe, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 User calls this function to loop over parent elements. This function calls finite element with its operator to do calculations.
 
MoFEMErrorCode loopRange (const string &fe_name, ForcesAndSourcesCore *range_fe, boost::shared_ptr< Range > fe_range, const int verb=QUIET, const LogManager::SeverityLevel sev=Sev::noisy)
 Iterate over range of elements.
 
- Public Member Functions inherited from MoFEM::DataOperator
 DataOperator (const bool symm=true)
 
virtual ~DataOperator ()=default
 
virtual MoFEMErrorCode opLhs (EntitiesFieldData &row_data, EntitiesFieldData &col_data)
 
virtual MoFEMErrorCode opRhs (EntitiesFieldData &data, const bool error_if_no_base=false)
 
bool getSymm () const
 Get if operator uses symmetry of DOFs or not.
 
void setSymm ()
 set if operator is executed taking in account symmetry
 
void unSetSymm ()
 unset if operator is executed for non symmetric problem
 

Private Attributes

const double alphaW
 
const double alphaRho
 
const double alphaViscousOmega
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleVolume >
using OP = OpAssembleVolume
 
- Public Types inherited from OpAssembleVolume
using OP = OpAssembleBasic< VolUserDataOperator >
 
using ScaleOff = typename OP::ScaleOff
 
- Public Types inherited from OpAssembleBasic< VolUserDataOperator >
using ScaleOff = boost::function< double()>
 
- Public Types inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
enum  OpType {
  OPROW = 1 << 0 , OPCOL = 1 << 1 , OPROWCOL = 1 << 2 , OPSPACE = 1 << 3 ,
  OPLAST = 1 << 3
}
 Controls loop over entities on element. More...
 
using AdjCache = std::map< EntityHandle, std::vector< boost::weak_ptr< NumeredEntFiniteElement > > >
 
- Public Types inherited from MoFEM::DataOperator
using DoWorkLhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int row_side, int col_side, EntityType row_type, EntityType col_type, EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)>
 
using DoWorkRhsHookFunType = boost::function< MoFEMErrorCode(DataOperator *op_ptr, int side, EntityType type, EntitiesFieldData::EntData &data)>
 
- Public Attributes inherited from OpAssembleBasic< VolUserDataOperator >
const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts
 
VectorDouble nF
 local right hand side vector
 
MatrixDouble K
 local tangent matrix
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 
- Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
char opType
 
std::string rowFieldName
 
std::string colFieldName
 
FieldSpace sPace
 
- Public Attributes inherited from MoFEM::DataOperator
DoWorkLhsHookFunType doWorkLhsHook
 
DoWorkRhsHookFunType doWorkRhsHook
 
bool sYmm
 If true assume that matrix is symmetric structure.
 
std::array< bool, MBMAXTYPE > doEntities
 If true operator is executed for entity.
 
booldoVertices
 \deprectaed If false skip vertices
 
booldoEdges
 \deprectaed If false skip edges
 
booldoQuads
 \deprectaed
 
booldoTris
 \deprectaed
 
booldoTets
 \deprectaed
 
booldoPrisms
 \deprectaed
 
- Static Public Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
static const char *const OpTypeNames []
 
- Protected Member Functions inherited from MoFEM::VolumeElementForcesAndSourcesCore::UserDataOperator
MoFEMErrorCode setPtrFE (ForcesAndSourcesCore *ptr)
 
- Protected Attributes inherited from EshelbianPlasticity::OpAssembleTopologicalObjectiveDerivativeImplBase< OpAssembleVolume >
double locJ
 
boost::shared_ptr< doubleJPtr
 
SmartPetscObj< Vec > assembleVec
 
Tag topoTag
 
boost::shared_ptr< TopologicalDatatopoData
 
- Protected Attributes inherited from MoFEM::ForcesAndSourcesCore::UserDataOperator
ForcesAndSourcesCoreptrFE
 
- Static Protected Attributes inherited from OpAssembleVolume
static std::map< std::pair< std::string, std::string >, MatrixDouble > mapMatrix
 

Detailed Description

Definition at line 1617 of file EshelbianTopologicalDerivativeOperators.cpp.

Constructor & Destructor Documentation

◆ OpSensitivityInteriorGradient()

EshelbianPlasticity::OpSensitivityInteriorGradient::OpSensitivityInteriorGradient ( const std::string  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
boost::shared_ptr< TopologicalData topo_ptr,
SmartPetscObj< Vec >  assemble_vec,
const double  alpha,
const double  rho,
const double  alpha_viscous_omega = 0,
boost::shared_ptr< double J_ptr = nullptr 
)
inline

Member Function Documentation

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::OpSensitivityInteriorGradient::integrate ( EntData data)
inline

Definition at line 1631 of file EshelbianTopologicalDerivativeOperators.cpp.

1631 {
1633#ifndef NDEBUG
1635 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1636 "L2 user base scale is set to %d, current inplementation only "
1637 "hanlde case for false",
1639 }
1640#endif // NDEBUG
1641
1642#ifndef NDEBUG
1643 if (!dataAtPts)
1644 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1645 "DataAtIntegrationPts pointer is null");
1646#endif // NDEBUG
1647
1648 const int nb_dofs = data.getIndices().size();
1649 if (!nb_dofs)
1651
1652 const int nb_integration_pts = getGaussPts().size2();
1653
1654 const auto v = getVolume();
1655 auto t_w = getFTensor0IntegrationWeight();
1656 // OpSpatialEquilibrium
1657 auto t_div_P = dataAtPts->getFTensorDivP(nb_integration_pts);
1658 auto t_var_w = dataAtPts->getFTensorVarWL2(nb_integration_pts);
1659 // OpSpatialRotation
1660 auto t_approx_P = dataAtPts->getFTensorApproxP(nb_integration_pts);
1661 auto t_omega = dataAtPts->getFTensorRotAxis(nb_integration_pts);
1662 auto t_u_h1 = dataAtPts->getFTensorStretchH1(nb_integration_pts);
1663 auto t_var_omega = dataAtPts->getFTensorVarRotAxis(nb_integration_pts);
1664 // OpSpatialConsistencyP
1665 auto t_h = dataAtPts->getFTensorSmallH(nb_integration_pts);
1666 auto t_var_P = dataAtPts->getFTensorVarPiola(nb_integration_pts);
1667 auto t_w_l2 = dataAtPts->getFTensorSmallWL2(nb_integration_pts);
1668 auto t_var_div_P = dataAtPts->getFTensorDivVarPiola(nb_integration_pts);
1669
1670 auto t_jac = topoData->getFTensorJacobian(nb_integration_pts);
1671
1672 auto get_ftensor1 = [](auto &v) {
1674 &v[0], &v[1], &v[2]);
1675 };
1676
1677 auto next = [&]() {
1678 ++t_w;
1679 ++t_div_P;
1680 ++t_var_w;
1681 ++t_approx_P;
1682 ++t_omega;
1683 ++t_u_h1;
1684 ++t_var_omega;
1685 ++t_h;
1686 ++t_var_P;
1687 ++t_w_l2;
1688 ++t_var_div_P;
1689 ++t_jac;
1690 };
1691
1698
1701
1702 constexpr auto t_kd = FTensor::Kronecker_Delta<double>();
1703
1704 locJ = 0;
1705 for (int gg = 0; gg != nb_integration_pts; ++gg) {
1706 double a = v * t_w;
1707
1709 // rotation
1711 case SMALL_ROT:
1712 t_diff_R(i, j, k) = levi_civita(i, j, k);
1713 break;
1714 case LARGE_ROT:
1715 t_diff_R(i, j, k) =
1716 LieGroups::SO3::diffExp(t_omega, t_omega.l2())(i, j, k);
1717 break;
1718 default:
1719 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1720 "rotationSelector not handled");
1721 }
1722
1724 t_diff;
1725 t_diff(i, j, l, k) = t_kd(i, l) * t_kd(j, k);
1726
1727 // OpSpatialEqulibrium
1728 {
1729 const auto beta = a * (t_div_P(i) * t_var_w(i));
1730 locJ -= beta;
1731 }
1732 // OpSpatialEquilibrium
1733 {
1734 double beta;
1738 case LARGE_ROT:
1739 case MODERATE_ROT:
1740 beta =
1741
1742 ((t_diff_R(j, k, m) * t_var_omega(m)) * t_u_h1(k, l))
1743
1744 * (t_approx_P(j, n) * t_jac(l, n));
1745
1746 t_beta_dX(I, J) =
1747
1748 ((t_diff_R(j, k, m) * t_var_omega(m)) * t_u_h1(k, l))
1749
1750 * (t_approx_P(j, n) * t_diff(l, n, I, J));
1751
1752 break;
1753 case SMALL_ROT:
1754 beta =
1755
1756 (levi_civita(i, j, k) * t_var_omega(k))
1757
1758 * (t_approx_P(i, n) * t_jac(j, n));
1759
1760 t_beta_dX(I, J) =
1761
1762 (t_diff_R(i, j, k) * t_var_omega(k))
1763
1764 * (t_approx_P(i, n) * t_diff(j, n, I, J));
1765
1766 break;
1767 default:
1768 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1769 "gradApproximator not handled");
1770 break;
1771 };
1772
1773 locJ -= a * beta;
1774 auto t_nf = get_ftensor1(nF);
1775 auto t_base_diff = data.getFTensor1DiffN<3>(gg, 0);
1776 for (int bb = 0; bb != nb_dofs / SPACE_DIM; ++bb) {
1777 t_nf(i) -= a * (t_beta_dX(i, j) * t_base_diff(j));
1778 ++t_nf;
1779 ++t_base_diff;
1780 }
1781 }
1782 // OpSpatialConsistency
1783 {
1784 const auto beta =
1785 (t_h(i, j) - t_kd(i, j)) * (t_var_P(i, n) * t_jac(j, n));
1787 t_beta_dX(I, J) =
1788 (t_h(i, j) - t_kd(i, j)) * (t_var_P(i, n) * t_diff(j, n, I, J));
1789 locJ -= a * beta;
1790 auto t_nf = get_ftensor1(nF);
1791 auto t_base_diff = data.getFTensor1DiffN<3>(gg, 0);
1792 for (int bb = 0; bb != nb_dofs / SPACE_DIM; ++bb) {
1793 t_nf(i) -= a * (t_beta_dX(i, j) * t_base_diff(j));
1794 ++t_nf;
1795 ++t_base_diff;
1796 }
1797 }
1798 // OpSpatialConsistency, cont
1799 {
1800 const auto beta = t_w_l2(i) * t_var_div_P(i);
1801 locJ -= a * beta;
1802 }
1803
1804
1805 next();
1806 }
1807
1809 }
#define FTENSOR_INDEX(DIM, I)
constexpr double a
constexpr int SPACE_DIM
Kronecker Delta class.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
const double v
phase velocity of light in medium (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'J', DIM1 > J
Definition level_set.cpp:30
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
constexpr IntegrationType I
FTensor::Index< 'm', 3 > m
static PetscBool l2UserBaseScale
static enum RotSelector rotSelector
static enum RotSelector gradApproximator
static auto diffExp(A &&t_w_vee, B &&theta)
Definition Lie.hpp:105
auto getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
const VectorInt & getIndices() const
Get global indices of degrees of freedom on entity.
auto getFTensor0IntegrationWeight()
Get integration weights.
MatrixDouble & getGaussPts()
matrix of integration (Gauss) points for Volume Element
VectorDouble nF
local right hand side vector
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Data Documentation

◆ alphaRho

const double EshelbianPlasticity::OpSensitivityInteriorGradient::alphaRho
private

◆ alphaViscousOmega

const double EshelbianPlasticity::OpSensitivityInteriorGradient::alphaViscousOmega
private

◆ alphaW

const double EshelbianPlasticity::OpSensitivityInteriorGradient::alphaW
private

The documentation for this struct was generated from the following file: