![]() |
v0.13.2 |
#include <users_modules/fracture_mechanics/src/MWLS.hpp>
Classes | |
struct | OpMWLSBase |
struct | OpMWLSCalculateBaseCoeffcientsAtGaussPtsTmpl |
struct | OpMWLSMaterialStressLhs_Dx |
struct | OpMWLSMaterialStressLhs_DX |
struct | OpMWLSMaterialStressRhs |
Integrate force vector. More... | |
struct | OpMWLSRhoAtGaussPts |
Evaluate density at integration points. More... | |
struct | OpMWLSRhoAtGaussUsingPrecalulatedCoeffs |
struct | OpMWLSRhoPostProcess |
struct | OpMWLSSpatialStressLhs_DX |
struct | OpMWLSSpatialStressRhs |
Integrate force vector. More... | |
struct | OpMWLSStressAndErrorsAtGaussPts |
Evaluate stress at integration points. More... | |
struct | OpMWLSStressAtGaussPts |
Evaluate stress at integration points. More... | |
struct | OpMWLSStressAtGaussUsingPrecalulatedCoeffs |
struct | OpMWLSStressPostProcess |
Public Types | |
typedef ublas::vector< double, ublas::bounded_array< double, 9 > > | VecVals |
typedef ublas::matrix< double, ublas::row_major, ublas::bounded_array< double, 27 > > | MatDiffVals |
typedef ublas::matrix< double, ublas::row_major, ublas::bounded_array< double, 81 > > | MatDiffDiffVals |
typedef OpMWLSCalculateBaseCoeffcientsAtGaussPtsTmpl< VolumeElementForcesAndSourcesCore > | OpMWLSCalculateBaseCoeffcientsAtGaussPts |
typedef OpMWLSCalculateBaseCoeffcientsAtGaussPtsTmpl< FaceElementForcesAndSourcesCore > | OpMWLSCalculateBaseCoeffcientsForFaceAtGaussPts |
Public Member Functions | |
MWLSApprox (MoFEM::Interface &m_field, Vec F_lambda=PETSC_NULL, boost::shared_ptr< DofEntity > arc_length_dof=nullptr) | |
virtual | ~MWLSApprox ()=default |
bool | getUseGlobalBaseAtMaterialReferenceConfiguration () const |
Get the Use Local Base At Material Reference Configuration object. More... | |
MoFEMErrorCode | getMWLSOptions () |
get options from command line for MWLS More... | |
MoFEMErrorCode | loadMWLSMesh (std::string file_name) |
MoFEMErrorCode | getValuesToNodes (Tag th) |
get values form elements to nodes More... | |
MoFEMErrorCode | getInfluenceNodes (double material_coords[3]) |
Get node in influence domain. More... | |
MoFEMErrorCode | calculateApproxCoeff (bool trim_influence_nodes, bool global_derivatives) |
Calculate approximation function coefficients. More... | |
MoFEMErrorCode | evaluateApproxFun (double eval_point[3]) |
evaluate approximation function at material point More... | |
MoFEMErrorCode | evaluateFirstDiffApproxFun (double eval_point[3], bool global_derivatives) |
evaluate 1st derivative of approximation function at material point More... | |
MoFEMErrorCode | evaluateSecondDiffApproxFun (double eval_point[3], bool global_derivatives) |
evaluate 2nd derivative of approximation function at material point More... | |
MoFEMErrorCode | getTagData (Tag th) |
MoFEMErrorCode | getErrorAtNode (Tag th, double &total_stress_at_node, double &total_stress_error_at_node, double &hydro_static_error_at_node, double &deviatoric_error_at_node, double &total_energy, double &total_energy_error, const double young_modulus, const double poisson_ratio) |
Get the norm of the error at nod. More... | |
const VecVals & | getDataApprox () |
const MatDiffVals & | getDiffDataApprox () |
const MatDiffDiffVals & | getDiffDiffDataApprox () |
MatrixDouble & | getInvAB () |
std::vector< EntityHandle > & | getInfluenceNodes () |
auto & | getShortenDm () |
Public Attributes | |
MoFEM::Interface & | mField |
moab::Core | mwlsCore |
moab::Interface & | mwlsMoab |
Vec | F_lambda |
boost::weak_ptr< DofEntity > | arcLengthDof |
MatrixDouble | stressAtGaussPts |
MatrixDouble | diffStressAtGaussPts |
boost::shared_ptr< VectorDouble > | rhoAtGaussPts |
boost::shared_ptr< MatrixDouble > | diffRhoAtGaussPts |
boost::shared_ptr< MatrixDouble > | diffDiffRhoAtGaussPts |
MatrixDouble | singularInitialDisplacement |
MatrixDouble | singularCurrentDisplacement |
MatrixDouble | mwlsMaterialPositions |
MatrixDouble | approxBasePoint |
VectorDouble3 | approxPointCoords |
Range | tetsInBlock |
Range | trisInBlock |
Tag | thMidNode |
std::map< EntityHandle, std::vector< MatrixDouble > > | invABMap |
Store Coefficient of base functions at integration points. More... | |
std::map< EntityHandle, std::vector< std::vector< EntityHandle > > > | influenceNodesMap |
Influence nodes on elements on at integration points. More... | |
std::map< EntityHandle, std::vector< double > > | dmNodesMap |
Store weight function radius at the nodes. More... | |
boost::function< VectorDouble(const double, const double, const double)> | functionTestHack |
This is used to set up analytical function for testing approximation. More... | |
Private Member Functions | |
template<class T = FTensor::Tensor1<double, 3>> | |
MoFEMErrorCode | calculateBase (const T &t_coords) |
template<class T = FTensor::Tensor1<double, 3>> | |
MoFEMErrorCode | calculateDiffBase (const T &t_coords, const double dm) |
template<class T = FTensor::Tensor1<double, 3>> | |
MoFEMErrorCode | calculateDiffDiffBase (const T &t_coords, const double dm) |
double | evalWeight (const double r) |
double | evalDiffWeight (const double r) |
double | evalDiffDiffWeight (const double r) |
Private Attributes | |
boost::shared_ptr< BVHTree > | myTree |
int | nbBasePolynomials |
double | dmFactor |
Relative value of weight function radius. More... | |
double | shortenDm |
int | maxElemsInDMFactor |
int | maxThreeDepth |
Maximal three depths. More... | |
int | splitsPerDir |
Split per direction in the tree. More... | |
PetscBool | useGlobalBaseAtMaterialReferenceConfiguration |
PetscBool | useNodalData |
PetscBool | mwlsAnalyticalInternalStressTest |
EntityHandle | treeRoot |
double | maxEdgeL |
Range | levelNodes |
Range | levelEdges |
Range | levelTets |
std::vector< EntityHandle > | influenceNodes |
std::map< EntityHandle, std::array< double, 3 > > | elemCentreMap |
EntityHandle | nearestInfluenceNode |
ublas::symmetric_matrix< double, ublas::lower > | A |
ublas::symmetric_matrix< double, ublas::lower > | testA |
MatrixDouble | invA |
ublas::triangular_matrix< double, ublas::lower > | L |
MatrixDouble | B |
VectorDouble | baseFun |
VectorDouble | approxFun |
MatrixDouble | invAB |
VectorDouble | baseFunInvA |
ublas::symmetric_matrix< double, ublas::lower, ublas::row_major, DoubleAllocator > | diffA [3] |
ublas::symmetric_matrix< double, ublas::lower, ublas::row_major, DoubleAllocator > | diffInvA [3] |
MatrixDouble | diffB [3] |
VectorDouble | diffBaseFun [3] |
VectorDouble | diffDiffBaseFun [9] |
MatrixDouble | diffApproxFun |
MatrixDouble | diffDiffApproxFun |
MatrixDouble | influenceNodesData |
VecVals | outData |
double | outHydroStaticError |
VecVals | outDeviatoricDifference |
double | outDeviatoricError |
MatDiffVals | outDiffData |
MatDiffDiffVals | outDiffDiffData |
std::vector< EntityHandle > | treeTets |
std::vector< EntityHandle > | leafsTetsVecLeaf |
std::vector< double > | leafsTetsCentre |
std::vector< EntityHandle > | leafsVec |
std::vector< double > | leafsDist |
std::vector< std::pair< double, EntityHandle > > | distLeafs |
Moving least weighted square approximation (MWLS)
\[ u^h(x) = p_k(x)a_k(x)\\ J(x)=\frac{1}{2} \sum_i w(x-x_i)\left(p_j(x_i)a_j(x)-u_i\right)^2 = \\ J(x)=\frac{1}{2} \sum_i w(x-x_i)\left( p_j(x_i)a_j(x) p_k(x_i)a_k(x) - 2p_j(x_i)a_j(x)u_i + u_i^2 \right) \\ \frac{\partial J}{\partial a_j} = \sum_i w(x_i-x)\left(p_j(x_i)p_k(x_i) a_k(x) -p_j(x_j)u_i\right)\\ A_{jk}(x) = \sum_i w(x_i-x)p_j(x_i)p_k(x_i)\\ B_{ji}(x) = w(x-x_i) p_j(x_i)\\ A_{jk}(x) a_k(x) = B_{ji}(x)u_i\\ a_k(x) = \left( A^{-1}_{kj}(x) B_{ji}(x) \right) u_i\\ u^h(x) = p_k(x) \left( A^{-1}_{kj}(x) B_{ji}(x) \right) u_i \\ u^h(x) = \left[ p_k(x) \left( A^{-1}_{kj}(x) B_{ji}(x) \right) \right] u_i \\ \phi_i = p_k(x) \left( A^{-1}_{kj}(x) B_{ji}(x) \right) \\ \phi_{i,l} = p_{k,l}(x) \left( A^{-1}_{kj}(x) B_{ji}(x) \right)+ p_k(x) \left( A^{-1}_{kj,l}(x) B_{ji}(x) + A^{-1}_{kj}(x) B_{ji,l}(x) \right)\\ \phi_{i,l} = p_{k,l}(x) \left( A^{-1}_{kj}(x) B_{ji}(x) \right)+ p_k(x) \left( A^{-1}_{kj,l}(x) B_{ji}(x) + A^{-1}_{kj}(x) B_{ji,l}(x) \right)\\ \left(\mathbf{A}\mathbf{A}^{-1}\right)_{,l} = \mathbf{0} \to \mathbf{A}^{-1}_{,l} = -\mathbf{A}^{-1} \mathbf{A}_{,l} \mathbf{A}^{-1}\\ A_{jk,l} = \sum_i w_{,l}(x_i-x)p_j(x_i)p_k(x_i) \\ B_{ij,l} = w_{,l}(x_i-x)p_j(x_i) \]
typedef ublas::matrix<double, ublas::row_major, ublas::bounded_array<double, 81> > FractureMechanics::MWLSApprox::MatDiffDiffVals |
typedef ublas::matrix<double, ublas::row_major, ublas::bounded_array<double, 27> > FractureMechanics::MWLSApprox::MatDiffVals |
typedef OpMWLSCalculateBaseCoeffcientsAtGaussPtsTmpl< VolumeElementForcesAndSourcesCore> FractureMechanics::MWLSApprox::OpMWLSCalculateBaseCoeffcientsAtGaussPts |
typedef ublas::vector<double, ublas::bounded_array<double, 9> > FractureMechanics::MWLSApprox::VecVals |
FractureMechanics::MWLSApprox::MWLSApprox | ( | MoFEM::Interface & | m_field, |
Vec | F_lambda = PETSC_NULL , |
||
boost::shared_ptr< DofEntity > | arc_length_dof = nullptr |
||
) |
Definition at line 36 of file MWLS.cpp.
|
virtualdefault |
MoFEMErrorCode FractureMechanics::MWLSApprox::calculateApproxCoeff | ( | bool | trim_influence_nodes, |
bool | global_derivatives | ||
) |
Calculate approximation function coefficients.
material_coords | material position |
NOTE: This function remove form influenceNodes entities which are beyond influence radius.
Definition at line 576 of file MWLS.cpp.
|
inlineprivate |
Definition at line 675 of file MWLS.hpp.
|
inlineprivate |
Definition at line 701 of file MWLS.hpp.
|
inlineprivate |
Definition at line 750 of file MWLS.hpp.
MoFEMErrorCode FractureMechanics::MWLSApprox::evaluateApproxFun | ( | double | eval_point[3] | ) |
evaluate approximation function at material point
material_coords | material position |
Definition at line 801 of file MWLS.cpp.
MoFEMErrorCode FractureMechanics::MWLSApprox::evaluateFirstDiffApproxFun | ( | double | eval_point[3], |
bool | global_derivatives | ||
) |
evaluate 1st derivative of approximation function at material point
global_derivatives | decide whether global derivative will be calculated |
Definition at line 836 of file MWLS.cpp.
MoFEMErrorCode FractureMechanics::MWLSApprox::evaluateSecondDiffApproxFun | ( | double | eval_point[3], |
bool | global_derivatives | ||
) |
evaluate 2nd derivative of approximation function at material point
global_derivatives | decide whether global derivative will be calculated |
Definition at line 921 of file MWLS.cpp.
const MWLSApprox::VecVals & FractureMechanics::MWLSApprox::getDataApprox | ( | ) |
Get values at point
const MWLSApprox::MatDiffVals & FractureMechanics::MWLSApprox::getDiffDataApprox | ( | ) |
const MWLSApprox::MatDiffDiffVals & FractureMechanics::MWLSApprox::getDiffDiffDataApprox | ( | ) |
Get second derivatives of values at points
MoFEMErrorCode FractureMechanics::MWLSApprox::getErrorAtNode | ( | Tag | th, |
double & | total_stress_at_node, | ||
double & | total_stress_error_at_node, | ||
double & | hydro_static_error_at_node, | ||
double & | deviatoric_error_at_node, | ||
double & | total_energy, | ||
double & | total_energy_error, | ||
const double | young_modulus, | ||
const double | poisson_ratio | ||
) |
Get the norm of the error at nod.
th | |
total_stress_at_node | |
total_stress_error_at_node | |
hydro_static_error_at_node | |
deviatoric_error_at_node | |
total_energy | |
total_energy_error | |
young_modulus | |
poisson_ratio |
Definition at line 1007 of file MWLS.cpp.
|
inline |
MoFEMErrorCode FractureMechanics::MWLSApprox::getInfluenceNodes | ( | double | material_coords[3] | ) |
Get node in influence domain.
material_coords | material position |
Definition at line 373 of file MWLS.cpp.
|
inline |
MoFEMErrorCode FractureMechanics::MWLSApprox::getMWLSOptions | ( | ) |
get options from command line for MWLS
Definition at line 71 of file MWLS.cpp.
|
inline |
MoFEMErrorCode FractureMechanics::MWLSApprox::getTagData | ( | Tag | th | ) |
Get tag data on influence nodes
th | tag |
Definition at line 978 of file MWLS.cpp.
|
inline |
Get the Use Local Base At Material Reference Configuration object.
If true base is calculated at initail integration point coordinates and base function evaluated at another point. Local derivatives are uses, since weight function is at initial point.
MoFEMErrorCode FractureMechanics::MWLSApprox::getValuesToNodes | ( | Tag | th | ) |
get values form elements to nodes
th | tag with approximated data |
th | tag with approximated data |
Definition at line 275 of file MWLS.cpp.
MoFEMErrorCode FractureMechanics::MWLSApprox::loadMWLSMesh | ( | std::string | file_name | ) |
Load mesh with data and do basic calculation
file_name | File name |
Definition at line 139 of file MWLS.cpp.
|
private |
MatrixDouble FractureMechanics::MWLSApprox::approxBasePoint |
|
private |
VectorDouble3 FractureMechanics::MWLSApprox::approxPointCoords |
boost::weak_ptr<DofEntity> FractureMechanics::MWLSApprox::arcLengthDof |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
boost::shared_ptr<MatrixDouble> FractureMechanics::MWLSApprox::diffDiffRhoAtGaussPts |
|
private |
boost::shared_ptr<MatrixDouble> FractureMechanics::MWLSApprox::diffRhoAtGaussPts |
MatrixDouble FractureMechanics::MWLSApprox::diffStressAtGaussPts |
|
private |
|
private |
std::map<EntityHandle, std::vector<double> > FractureMechanics::MWLSApprox::dmNodesMap |
|
private |
|
private |
|
private |
std::map<EntityHandle, std::vector<std::vector<EntityHandle> > > FractureMechanics::MWLSApprox::influenceNodesMap |
std::map<EntityHandle, std::vector<MatrixDouble> > FractureMechanics::MWLSApprox::invABMap |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
MoFEM::Interface& FractureMechanics::MWLSApprox::mField |
|
private |
MatrixDouble FractureMechanics::MWLSApprox::mwlsMaterialPositions |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
boost::shared_ptr<VectorDouble> FractureMechanics::MWLSApprox::rhoAtGaussPts |
|
private |
MatrixDouble FractureMechanics::MWLSApprox::singularCurrentDisplacement |
MatrixDouble FractureMechanics::MWLSApprox::singularInitialDisplacement |
|
private |
MatrixDouble FractureMechanics::MWLSApprox::stressAtGaussPts |
|
private |
|
private |
|
private |
|
private |
|
private |