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 #include "tensors/tensors.h"
00028 #include "tensors/functions.h"
00029 #include "fem/solver/intsolverdata.h"
00030
00031 using Tensors::Tensor2;
00032 using Tensors::Tensor4;
00033 using std::cout;
00034 using std::endl;
00035
00036 int main(int argc, char **argv) try
00037 {
00038 REAL OCR = 1.0;
00039 REAL DSigX = 10;
00040 REAL DSigY = 10;
00041 REAL DSigZ = 10;
00042 int FEndiv = 1;
00043 if (argc>=2) OCR = atof(argv[1]);
00044 if (argc>=3) DSigX = atof(argv[2]);
00045 if (argc>=4) DSigY = atof(argv[3]);
00046 if (argc>=5) DSigZ = atof(argv[4]);
00047 if (argc>=6) FEndiv = atoi(argv[5]);
00048
00049 cout << "OCR = " << OCR << endl;
00050 cout << "DSigX = " << DSigX << endl;
00051 cout << "DSigY = " << DSigY << endl;
00052 cout << "DSigZ = " << DSigZ << endl;
00053 cout << "FEndiv = " << FEndiv << endl;
00054 cout << endl << endl;
00055
00056
00057 Array<REAL> prms; prms.resize(5);
00058 prms[0] = 0.25 ;
00059 prms[1] = 0.05 ;
00060 prms[2] = 20.0 ;
00061 prms[3] = 10000 ;
00062 prms[4] = 5000 ;
00063
00064
00065 Array<REAL> inidata; inidata.resize(5);
00066 inidata[0] = 24;
00067 inidata[1] = 24;
00068 inidata[2] = 24;
00069 inidata[3] = 1.8;
00070 inidata[4] = OCR;
00071
00072
00073 SubCam scam(prms, inidata);
00074
00075
00076 IntegSchemesCtes isc;
00077 isc.Type (IntegSchemesCtes::FE);
00078 isc.FE_ndiv (FEndiv);
00079 isc.ME_maxSS (100000);
00080 isc.ME_STOL (1e-5);
00081 isc.ME_dTini (0.1);
00082 isc.EdMax (20);
00083 EquilibModel::SetIntegSchemesCtes(isc);
00084
00085
00086 Tensor4 Dep;
00087 scam.TgStiffness(Dep);
00088 cout << "Dep =\n" << Dep << endl;
00089 cout << endl << endl;
00090
00091
00092 Tensor2 DSig; DSig=DSigX,DSigY,DSigZ, 0,0,0;
00093 Tensor2 DEps;
00094 cout << ".... Actualize ...\n";
00095 scam.BackupState();
00096 scam.Actualize(DSig, DEps);
00097 scam.RestoreState();
00098
00099
00100 Tensor2 dsig;
00101 cout << ".... StressUpdate ...\n";
00102 scam.StressUpdate(DEps, dsig);
00103
00104
00105 cout << "DSig = " << DSig*1 << endl;
00106 cout << "DEps (%) = " << DEps*100.0 << endl;
00107 cout << "dsig = " << dsig*1 << endl;
00108
00109 return 0;
00110 }
00111 catch (Exception * e)
00112 {
00113 e->Cout();
00114 if (e->IsFatal()) exit(1);
00115 delete e;
00116 }
00117 catch (char const * s)
00118 {
00119 cout << "[1;31m Fatal:" << s << "[0m\n";
00120 exit(1);
00121 }
00122
00123