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/barcelonax.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 OSI = 10.0;
00040 REAL Pp_ini = -10.0;
00041 REAL DSigX = 10;
00042 REAL DSigY = 10;
00043 REAL DSigZ = 10;
00044 REAL DPp = -20;
00045 int FEndiv = 1;
00046 if (argc>=2) OCR = atof(argv[1]);
00047 if (argc>=3) OSI = atof(argv[2]);
00048 if (argc>=4) Pp_ini = atof(argv[3]);
00049 if (argc>=5) DSigX = atof(argv[4]);
00050 if (argc>=6) DSigY = atof(argv[5]);
00051 if (argc>=7) DSigZ = atof(argv[6]);
00052 if (argc>=8) DPp = atof(argv[7]);
00053 if (argc>=9) FEndiv = atoi(argv[8]);
00054
00055 cout << "OCR = " << OCR << endl;
00056 cout << "OSI = " << OSI << endl;
00057 cout << "Pp_ini = " << Pp_ini << endl;
00058 cout << "DSigX = " << DSigX << endl;
00059 cout << "DSigY = " << DSigY << endl;
00060 cout << "DSigZ = " << DSigZ << endl;
00061 cout << "DPp = " << DPp << endl;
00062 cout << "FEndiv = " << FEndiv << endl;
00063 cout << endl << endl;
00064
00065
00066 Array<REAL> prms; prms.resize(18);
00067 prms[0] = 0.25 ;
00068 prms[1] = 0.05 ;
00069 prms[2] = 20.0 ;
00070 prms[3] = 10000 ;
00071 prms[4] = 0.9 ;
00072 prms[5] = 0.1 ;
00073 prms[6] = 0.5 ;
00074 prms[7] = 0.002 ;
00075 prms[8] = 0.001 ;
00076 prms[9] = 101.3 ;
00077 prms[10] = 1 ;
00078 prms[11] = 10 ;
00079
00080 prms[12] = 0.1;
00081 prms[13] = 0.5;
00082 prms[14] = 1.0;
00083 prms[15] = 2.0;
00084 prms[16] = 10e-8;
00085 prms[17] = 10;
00086
00087
00088 Array<REAL> inidata; inidata.resize(7);
00089 inidata[0] = 24;
00090 inidata[1] = 24;
00091 inidata[2] = 24;
00092 inidata[3] = 1.8;
00093 inidata[4] = OCR;
00094 inidata[5] = OSI;
00095 inidata[6] = Pp_ini;
00096
00097
00098 BarcelonaX barx(prms, inidata);
00099
00100
00101 IntegSchemesCtes isc;
00102 isc.Type (IntegSchemesCtes::FE);
00103 isc.FE_ndiv (FEndiv);
00104 isc.ME_maxSS (20);
00105 isc.ME_STOL (1e-1);
00106 isc.ME_dTini (0.1);
00107 isc.EdMax (20);
00108 CoupledModel::SetIntegSchemesCtes(isc);
00109
00110
00111 Tensor4 Dep;
00112 Tensor2 dep;
00113 barx.TgStiffness(Dep,dep);
00114 cout << "Dep =\n" << Dep << endl;
00115 cout << "dep =" << dep << endl;
00116 cout << endl << endl;
00117
00118
00119 Tensor2 DSig; DSig=DSigX,DSigY,DSigZ, 0,0,0;
00120 Tensor2 DEps;
00121 REAL DnSr;
00122 cout << ".... Actualize ...\n";
00123 barx.BackupState();
00124 barx.Actualize(DSig,DPp, DEps,DnSr);
00125 barx.RestoreState();
00126
00127
00128 Tensor2 dsig;
00129 REAL dnsr;
00130 cout << ".... StressUpdate ...\n";
00131 barx.StressUpdate(DEps,DPp, dsig,dnsr);
00132
00133
00134 cout << "DSig = " << DSig*1 << endl;
00135 cout << "DEps (%) = " << DEps*100.0 << endl;
00136 cout << "dsig = " << dsig*1 << endl;
00137 cout << "DnSr = " << DnSr << endl;
00138 cout << "dnsr = " << dnsr << endl;
00139
00140 return 0;
00141 }
00142 catch (Exception * e)
00143 {
00144 e->Cout();
00145 if (e->IsFatal()) exit(1);
00146 delete e;
00147 }
00148 catch (char const * s)
00149 {
00150 cout << "[1;31m Fatal:" << s << "[0m\n";
00151 exit(1);
00152 }
00153
00154