-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
645 tfel material add eshelby tensor in anisotropic medium #649
base: master
Are you sure you want to change the base?
645 tfel material add eshelby tensor in anisotropic medium #649
Conversation
645-tfel-material-add-eshelby-tensor-in-anisotropic-medium update 645 with master
…ed branch with master
Could you update the documentation and the release notes ? |
|
Do not hesitate to use the |
include/CMakeLists.txt
Outdated
install_header(TFEL/Material Eshelby.hxx) | ||
install_header(TFEL/Material Eshelby.ixx) | ||
install_header(TFEL/Material EshelbyAnisotropic.hxx) | ||
install_header(TFEL/Material EshelbyAnisotropic.ixx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
install_header(TFEL/Material Eshelby.hxx) | |
install_header(TFEL/Material Eshelby.ixx) | |
install_header(TFEL/Material EshelbyAnisotropic.hxx) | |
install_header(TFEL/Material EshelbyAnisotropic.ixx) | |
install_header(TFEL/Material IsotropicEshelbyLinearHomogeneization.hxx) | |
install_header(TFEL/Material IsotropicEshelbyLinearHomogeneization.ixx) | |
install_header(TFEL/Material AnisotropicEshelbyLinearHomogeneization.hxx) | |
install_header(TFEL/Material AnisotropicEshelbyLinearHomogeneization.ixx) |
tests/Material/CMakeLists.txt
Outdated
@@ -14,6 +14,7 @@ endmacro(tests_material) | |||
tests_material(EshelbyBasedHomogenization) | |||
tests_material(Eshelby) | |||
tests_material(Lame) | |||
tests_material(EshelbyAnisotropic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous proposal of renaming
if (I > 2){fac/=std::sqrt(2);}; | ||
if (J > 2){fac/=std::sqrt(2);}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to use tfel::math::Cste
or constants defined in std::numbers
. For instance, 1/sqrt(2) is given by:
constexpr auto icste = tfel::math::Cste<real>::isqrt2;
which can be used as follows:
if (I > 2){fac/=std::sqrt(2);}; | |
if (J > 2){fac/=std::sqrt(2);}; | |
if (I > 2){fac*=icste;}; | |
if (J > 2){fac*=icste;}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
if (I > 2){fac*=std::sqrt(2);}; | ||
if (J > 2){fac*=std::sqrt(2);}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}; | ||
|
||
template<typename Type,typename real> | ||
TFEL_HOST_DEVICE Type getStensor(const tfel::math::stensor<3u,Type>& A, int i, int j){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFEL_HOST_DEVICE Type getStensor(const tfel::math::stensor<3u,Type>& A, int i, int j){ | |
TFEL_HOST_DEVICE Type getStensorComponent(const tfel::math::stensor<3u,Type>& A, int i, int j){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}; | ||
|
||
template<typename Type,typename real> | ||
TFEL_HOST_DEVICE void setStensor(tfel::math::stensor<3u,Type>& A, int i, int j,Type Aij){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFEL_HOST_DEVICE void setStensor(tfel::math::stensor<3u,Type>& A, int i, int j,Type Aij){ | |
TFEL_HOST_DEVICE void setStensorComponent(tfel::math::stensor<3u,Type>& A, int i, int j,Type Aij){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In TFEL, we use unsigned short
for indexing values in small objects. This is questionable, but this is how it is done.
TFEL_HOST_DEVICE void setStensor(tfel::math::stensor<3u,Type>& A, int i, int j,Type Aij){ | |
TFEL_HOST_DEVICE void setStensorComponent(tfel::math::stensor<3u,Type>& A, | |
typename tfel::math::stensor<3u,Type>::size_type i, | |
typename tfel::math::stensor<3u,Type>::size_type j, | |
Type Aij){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}; | ||
|
||
template<typename Type,typename real> | ||
TFEL_HOST_DEVICE void setSt4(tfel::math::st2tost2<3u,Type>& A, int i, int j, int k, int l,Type Aijkl){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the remark below for int
.
TFEL_HOST_DEVICE void setSt4(tfel::math::st2tost2<3u,Type>& A, int i, int j, int k, int l,Type Aijkl){ | |
TFEL_HOST_DEVICE void setST2toST2Component(tfel::math::st2tost2<3u,Type>& A, int i, int j, int k, int l,Type Aijkl){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
ceaa660
to
60a2f3f
Compare
…nisotropicEshelbyTensor
eshelby and hill tensor of a 3d ellipsoid embedded in an anisotropic matrix
included : tests which show that when the matrix is isotropic, the computation coincides with the formulas already available for isotropic case
But it would be great to compare with other libraries