Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F88523947
common.cc
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
Sat, Oct 19, 07:22
Size
2 KB
Mime Type
text/x-c
Expires
Mon, Oct 21, 07:22 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
21548267
Attached To
rMUSPECTRE µSpectre
common.cc
View Options
/**
* file common.cc
*
* @author Till Junge <till.junge@epfl.ch>
*
* @date 15 Nov 2017
*
* @brief Implementation for common functions
*
* @section LICENCE
*
* Copyright (C) 2017 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 GNU Emacs; see the file COPYING. If not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include <stdexcept>
#include "common/common.hh"
namespace muSpectre {
/* ---------------------------------------------------------------------- */
std::ostream & operator<<(std::ostream & os, Formulation f) {
switch (f) {
case Formulation::small_strain: {os << "small_strain"; break;}
case Formulation::finite_strain: {os << "finite_strain"; break;}
default:
throw std::runtime_error
("unknown formulation.");
break;
}
return os;
}
/* ---------------------------------------------------------------------- */
std::ostream & operator<<(std::ostream & os, StressMeasure s) {
switch (s) {
case StressMeasure::Cauchy: {os << "Cauchy"; break;}
case StressMeasure::PK1: {os << "PK1"; break;}
case StressMeasure::PK2: {os << "PK2"; break;}
case StressMeasure::Kirchhoff: {os << "Kirchhoff"; break;}
case StressMeasure::Biot: {os << "Biot"; break;}
case StressMeasure::Mandel: {os << "Mandel"; break;}
default:
throw std::runtime_error
("a stress measure must be missing");
break;
}
return os;
}
/* ---------------------------------------------------------------------- */
std::ostream & operator<<(std::ostream & os, StrainMeasure s) {
switch (s) {
case StrainMeasure::Gradient: {os << "Gradient"; break;}
case StrainMeasure::Infinitesimal: {os << "Infinitesimal"; break;}
case StrainMeasure::GreenLagrange: {os << "Green-Lagrange"; break;}
case StrainMeasure::Biot: {os << "Biot"; break;}
case StrainMeasure::Log: {os << "Logarithmic"; break;}
case StrainMeasure::Almansi: {os << "Almansi"; break;}
case StrainMeasure::RCauchyGreen: {os << "Right Cauchy-Green"; break;}
case StrainMeasure::LCauchyGreen: {os << "Left Cauchy-Green"; break;}
default:
throw std::runtime_error
("a strain measure must be missing");
}
return os;
}
} // muSpectre
Event Timeline
Log In to Comment