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/camclay.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(4);
00058 prms[0] = 0.25 ;
00059 prms[1] = 0.05 ;
00060 prms[2] = 20.0 ;
00061 prms[3] = 10000 ;
00062
00063
00064 Array<REAL> inidata; inidata.resize(5);
00065 inidata[0] = 24;
00066 inidata[1] = 24;
00067 inidata[2] = 24;
00068 inidata[3] = 1.8;
00069 inidata[4] = OCR;
00070
00071
00072 CamClay cam(prms, inidata);
00073
00074
00075 IntegSchemesCtes isc;
00076 isc.Type (IntegSchemesCtes::FE);
00077 isc.FE_ndiv (FEndiv);
00078 isc.ME_maxSS (100000);
00079 isc.ME_STOL (1e-5);
00080 isc.ME_dTini (0.1);
00081 isc.EdMax (20);
00082 EquilibModel::SetIntegSchemesCtes(isc);
00083
00084
00085 Tensor4 Dep;
00086 cam.TgStiffness(Dep);
00087 cout << "Dep =\n" << Dep << endl;
00088 cout << endl << endl;
00089
00090
00091 Tensor2 DSig; DSig=DSigX,DSigY,DSigZ, 0,0,0;
00092 Tensor2 DEps;
00093 cout << ".... Actualize ...\n";
00094 cam.BackupState();
00095 cam.Actualize(DSig, DEps);
00096 cam.RestoreState();
00097
00098
00099 Tensor2 dsig;
00100 cout << ".... StressUpdate ...\n";
00101 cam.StressUpdate(DEps, dsig);
00102
00103
00104 cout << "DSig = " << DSig*1 << endl;
00105 cout << "DEps (%) = " << DEps*100.0 << endl;
00106 cout << "dsig = " << dsig*1 << endl;
00107
00108 return 0;
00109 }
00110 catch (Exception * e)
00111 {
00112 e->Cout();
00113 if (e->IsFatal()) exit(1);
00114 delete e;
00115 }
00116 catch (char const * s)
00117 {
00118 cout << "[1;31m Fatal:" << s << "[0m\n";
00119 exit(1);
00120 }
00121
00122