00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <iostream>
00023
00024 #include "util/array.h"
00025 #include "util/exception.h"
00026 #include "models/subcam.h"
00027
00028 using std::cout;
00029 using std::endl;
00030
00031 int main(int argc, char **argv) try
00032 {
00033 REAL OCR = 1.0;
00034 REAL DSigX = 10;
00035 REAL DSigY = 10;
00036 REAL DSigZ = 10;
00037 int FEndiv = 1;
00038 if (argc>=2) OCR = atof(argv[1]);
00039 if (argc>=3) DSigX = atof(argv[2]);
00040 if (argc>=4) DSigY = atof(argv[3]);
00041 if (argc>=5) DSigZ = atof(argv[4]);
00042 if (argc>=6) FEndiv = atoi(argv[5]);
00043
00044 cout << "OCR = " << OCR << endl;
00045 cout << "DSigX = " << DSigX << endl;
00046 cout << "DSigY = " << DSigY << endl;
00047 cout << "DSigZ = " << DSigZ << endl;
00048 cout << "FEndiv = " << FEndiv << endl;
00049 cout << endl << endl;
00050
00052 Array<REAL> sub_cam_prms;
00053 sub_cam_prms.push_back(0.0891);
00054 sub_cam_prms.push_back(0.0196);
00055 sub_cam_prms.push_back(0.20);
00056 sub_cam_prms.push_back(3.2);
00057 sub_cam_prms.push_back(5000);
00058
00060 Array<REAL> ini_data;
00061 ini_data.push_back(2);
00062 ini_data.push_back(2);
00063 ini_data.push_back(2);
00064 ini_data.push_back(1.691);
00065 ini_data.push_back(1);
00066
00068 SubCam SC(sub_cam_prms, ini_data);
00069
00070
00071 IntegSchemesCtes isc;
00072 isc.Type (IntegSchemesCtes::FE);
00073 isc.FE_ndiv (FEndiv);
00074 isc.ME_maxSS (20);
00075 isc.ME_STOL (1e-1);
00076 isc.ME_dTini (0.1);
00077 isc.EdMax (20);
00078 EquilibModel::SetIntegSchemesCtes(isc);
00079
00080
00081 Tensor2 DSig; DSig=DSigX,DSigY,DSigZ, 0,0,0;
00082 Tensor2 DEps;
00083 cout << ".... Actualize ...\n";
00084 SC.BackupState();
00085 SC.Actualize(DSig, DEps);
00086 SC.RestoreState();
00087
00088
00089 Tensor2 dsig;
00090 cout << ".... StressUpdate ...\n";
00091 SC.StressUpdate(DEps, dsig);
00092
00093
00094 cout << "DSig = " << DSig*1 << endl;
00095 cout << "DEps (%) = " << DEps*100.0 << endl;
00096 cout << "dsig = " << dsig*1 << endl;
00097
00098 return 0;
00099 }
00100 catch (Exception * e)
00101 {
00102 e->Cout();
00103 if (e->IsFatal()) exit(1);
00104 delete e;
00105 }
00106 catch (char const * s)
00107 {
00108 cout << "[1;31m Fatal:" << s << "[0m\n";
00109 exit(1);
00110 }