Returns internal variables defined by the specific material model, if any.
733{
734 return {{"damage.kappa_d", 1,
735 [](typename MechanicsBase<
736 DisplacementDim>::MaterialStateVariables const& state,
737 std::vector<double>& cache) -> std::vector<double> const&
738 {
739 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
740 &state) != nullptr);
741 auto const& ehlers_state =
742 static_cast<StateVariables<DisplacementDim> const&>(state);
743
744 cache.resize(1);
745 cache.front() = ehlers_state.damage.kappa_d();
746 return cache;
747 },
748 [](typename MechanicsBase<DisplacementDim>::MaterialStateVariables&
749 state) -> std::span<double>
750 {
751 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
752 &state) != nullptr);
753 auto& ehlers_state =
754 static_cast<StateVariables<DisplacementDim>&>(state);
755
756 return {&ehlers_state.damage.kappa_d(), 1};
757 }},
758 {"damage.value", 1,
759 [](typename MechanicsBase<
760 DisplacementDim>::MaterialStateVariables const& state,
761 std::vector<double>& cache) -> std::vector<double> const&
762 {
763 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
764 &state) != nullptr);
765 auto const& ehlers_state =
766 static_cast<StateVariables<DisplacementDim> const&>(state);
767
768 cache.resize(1);
769 cache.front() = ehlers_state.damage.value();
770 return cache;
771 },
772 [](typename MechanicsBase<DisplacementDim>::MaterialStateVariables&
773 state) -> std::span<double>
774 {
775 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
776 &state) != nullptr);
777 auto& ehlers_state =
778 static_cast<StateVariables<DisplacementDim>&>(state);
779
780 return {&ehlers_state.damage.value(), 1};
781 }},
782 {"eps_p.D", KelvinVector::RowsAtCompileTime,
783 [](typename MechanicsBase<
784 DisplacementDim>::MaterialStateVariables const& state,
785 std::vector<double>& cache) -> std::vector<double> const&
786 {
787 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
788 &state) != nullptr);
789 auto const& ehlers_state =
790 static_cast<StateVariables<DisplacementDim> const&>(state);
791
792 cache.resize(KelvinVector::RowsAtCompileTime);
794 cache, KelvinVector::RowsAtCompileTime) =
796 ehlers_state.eps_p.D);
797
798 return cache;
799 },
800 [](typename MechanicsBase<DisplacementDim>::MaterialStateVariables&
801 state) -> std::span<double>
802 {
803 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
804 &state) != nullptr);
805 auto& ehlers_state =
806 static_cast<StateVariables<DisplacementDim>&>(state);
807
808 return {
809 ehlers_state.eps_p.D.data(),
810 static_cast<std::size_t>(KelvinVector::RowsAtCompileTime)};
811 }},
812 {"eps_p.V", 1,
813 [](typename MechanicsBase<
814 DisplacementDim>::MaterialStateVariables const& state,
815 std::vector<double>& cache) -> std::vector<double> const&
816 {
817 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
818 &state) != nullptr);
819 auto const& ehlers_state =
820 static_cast<StateVariables<DisplacementDim> const&>(state);
821
822 cache.resize(1);
823 cache.front() = ehlers_state.eps_p.V;
824 return cache;
825 },
826 [](typename MechanicsBase<DisplacementDim>::MaterialStateVariables&
827 state) -> std::span<double>
828 {
829 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
830 &state) != nullptr);
831 auto& ehlers_state =
832 static_cast<StateVariables<DisplacementDim>&>(state);
833
834 return {&ehlers_state.eps_p.V, 1};
835 }},
836 {"eps_p.eff", 1,
837 [](typename MechanicsBase<
838 DisplacementDim>::MaterialStateVariables const& state,
839 std::vector<double>& cache) -> std::vector<double> const&
840 {
841 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
842 &state) != nullptr);
843 auto const& ehlers_state =
844 static_cast<StateVariables<DisplacementDim> const&>(state);
845
846 cache.resize(1);
847 cache.front() = ehlers_state.eps_p.eff;
848 return cache;
849 },
850 [](typename MechanicsBase<DisplacementDim>::MaterialStateVariables&
851 state) -> std::span<double>
852 {
853 assert(dynamic_cast<StateVariables<DisplacementDim> const*>(
854 &state) != nullptr);
855 auto& ehlers_state =
856 static_cast<StateVariables<DisplacementDim>&>(state);
857
858 return {&ehlers_state.eps_p.eff, 1};
859 }}};
860}
Eigen::Matrix< double, 4, 1 > kelvinVectorToSymmetricTensor(Eigen::Matrix< double, 4, 1, Eigen::ColMajor, 4, 1 > const &v)
Eigen::Map< const Vector > toVector(std::vector< double > const &data, Eigen::VectorXd::Index size)
Creates an Eigen mapped vector from the given data vector.