Commit 3cd117f2 authored by Guido Giuntoli's avatar Guido Giuntoli

Adding a map<int, string> to store micro-structure names

parent d41ca9e5
......@@ -30,6 +30,7 @@
#include <iomanip>
#include <string>
#include <sstream>
#include <map>
#include <cmath>
#include <cassert>
......@@ -131,19 +132,34 @@ typedef struct {
enum {
MIC_HOMOGENEOUS,
MIC_SPHERE,
MIC_LAYER_Y,
MIC_CILI_FIB_X,
MIC_CILI_FIB_Z,
MIC_CILI_FIB_XZ,
MIC_QUAD_FIB_XYZ,
MIC_QUAD_FIB_XZ,
MIC_SPHERE,
MIC_LAYER_Y,
MIC_CILI_FIB_X,
MIC_CILI_FIB_Z,
MIC_CILI_FIB_XZ,
MIC_QUAD_FIB_XYZ,
MIC_QUAD_FIB_XZ,
MIC_QUAD_FIB_XZ_BROKEN_X,
MIC3D_SPHERES,
MIC3D_8,
MIC3D_FIBS_20_DISORDER
};
static map<int, std::string> micro_names = {
{MIC_HOMOGENEOUS, "MIC_HOMOGENEOUS"},
{MIC_SPHERE, "MIC_SPHERE"},
{MIC_LAYER_Y, "MIC_LAYER_Y"},
{MIC_CILI_FIB_X, "MIC_CILI_FIB_X"},
{MIC_CILI_FIB_Z, "MIC_CILI_FIB_Z"},
{MIC_CILI_FIB_XZ, "MIC_CILI_FIB_XZ"},
{MIC_QUAD_FIB_XYZ, "MIC_QUAD_FIB_XYZ"},
{MIC_QUAD_FIB_XZ, "MIC_QUAD_FIB_XZ"},
{MIC_QUAD_FIB_XZ_BROKEN_X, "MIC_QUAD_FIB_XZ_BROKEN_X"},
{MIC3D_SPHERES, "MIC3D_SPHERES"},
{MIC3D_8, "MIC3D_8"},
{MIC3D_FIBS_20_DISORDER, "MIC3D_FIBS_20_DISORDER"}
};
/*
* MIC_SPHERES : (2 materials) One sphere in the middle
*
......
......@@ -823,45 +823,7 @@ void micropp<tdim>::print_info() const
{
cout << "micropp" << dim << endl;
cout << "Micro-structure : ";
switch(micro_type) {
case(MIC_SPHERE):
cout << "MIC_SPHERE" << endl;
break;
case(MIC_LAYER_Y):
cout << "MIC_LAYER_Y" << endl;
break;
case(MIC_CILI_FIB_X):
cout << "MIC_CILI_FIB_X" << endl;
break;
case(MIC_CILI_FIB_Z):
cout << "MIC_CILI_FIB_Z" << endl;
break;
case(MIC_CILI_FIB_XZ):
cout << "MIC_CILI_FIB_XZ" << endl;
break;
case(MIC_QUAD_FIB_XYZ):
cout << "MIC_QUAD_FIB_XYZ" << endl;
break;
case(MIC_QUAD_FIB_XZ):
cout << "MIC_QUAD_FIB_XZ" << endl;
break;
case(MIC_QUAD_FIB_XZ_BROKEN_X):
cout << "MIC_QUAD_FIB_XZ_BROKEN_X" << endl;
break;
case(MIC3D_SPHERES):
cout << "MIC3D_SPHERES" << endl;
break;
case(MIC3D_8):
cout << "MIC3D_8" << endl;
break;
case(MIC3D_FIBS_20_DISORDER):
cout << "MIC3D_FIBS_20_DISORDER" << endl;
break;
default:
cout << "NO TYPE" << endl;
break;
}
cout << "Micro-structure : " << micro_names[micro_type] << endl;
cout << "MATRIX [%] : " << Vm << endl;
cout << "FIBER [%] : " << Vf << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment