Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F102378094
stress_transformations.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Feb 20, 02:15
Size
2 KB
Mime Type
text/x-c
Expires
Sat, Feb 22, 02:15 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
24341633
Attached To
rMUSPECTRE µSpectre
stress_transformations.hh
View Options
/**
* @file stress_transformations.hh
*
* @author Till Junge <till.junge@altermail.ch>
*
* @date 29 Oct 2018
*
* @brief isolation of stress conversions for quicker compilation
*
* Copyright © 2018 Till Junge
*
* µSpectre is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3, or (at
* your option) any later version.
*
* µSpectre is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with µSpectre; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "common/muSpectre_common.hh"
#include <libmugrid/eigen_tools.hh>
#include "materials/stress_transformations_PK1.hh"
#ifndef SRC_MATERIALS_STRESS_TRANSFORMATIONS_HH_
#define SRC_MATERIALS_STRESS_TRANSFORMATIONS_HH_
namespace muSpectre {
namespace MatTB {
/* ---------------------------------------------------------------------- */
//! set of functions returning an expression for PK2 stress based on
template <StressMeasure StressM, StrainMeasure StrainM, class Stress_t,
class Strain_t>
decltype(auto) PK1_stress(Strain_t && strain, Stress_t && stress) {
constexpr Dim_t dim{muGrid::EigenCheck::tensor_dim<Strain_t>::value};
static_assert((dim == muGrid::EigenCheck::tensor_dim<Stress_t>::value),
"Stress and strain tensors have differing dimensions");
return internal::PK1_stress<dim, StressM, StrainM>::compute(
std::forward<Strain_t>(strain), std::forward<Stress_t>(stress));
}
/* ---------------------------------------------------------------------- */
//! set of functions returning an expression for PK2 stress based on
template <StressMeasure StressM, StrainMeasure StrainM, class Stress_t,
class Strain_t, class Tangent_t>
decltype(auto) PK1_stress(Strain_t && strain, Stress_t && stress,
Tangent_t && tangent) {
constexpr Dim_t dim{muGrid::EigenCheck::tensor_dim<Strain_t>::value};
static_assert((dim == muGrid::EigenCheck::tensor_dim<Stress_t>::value),
"Stress and strain tensors have differing dimensions");
static_assert((dim == muGrid::EigenCheck::tensor_4_dim<Tangent_t>::value),
"Stress and tangent tensors have differing dimensions");
return internal::PK1_stress<dim, StressM, StrainM>::compute(
std::forward<Strain_t>(strain), std::forward<Stress_t>(stress),
std::forward<Tangent_t>(tangent));
}
} // namespace MatTB
} // namespace muSpectre
#endif // SRC_MATERIALS_STRESS_TRANSFORMATIONS_HH_
Event Timeline
Log In to Comment