00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MECHSYS_COUPLEDCAMCLAY_H
00023 #define MECHSYS_COUPLEDCAMCLAY_H
00024
00025
00026 #include "models/coupled/genericc.h"
00027 #include "models/camclay.h"
00028 #include "models/flow/linearflow.h"
00029
00030 class CCamClay : public GenericC<CamClay, LinearFlow>
00031 {
00032 public:
00033
00034 CCamClay(Array<REAL> const & Prms, Array<REAL> const & IniData);
00035
00036
00037 String Name() const { return "CCamClay"; }
00038
00039 };
00040
00041
00043
00044
00045 inline CCamClay::CCamClay(Array<REAL> const & Prms, Array<REAL> const & IniData)
00046 {
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 const size_t n_equi_prms = CamClay ::NPRMS;
00059 const size_t n_flow_prms = LinearFlow::NPRMS;
00060 const size_t n_prms = n_equi_prms+n_flow_prms;
00061 if (Prms.size()!=n_prms)
00062 throw new Fatal(_("CCamClay::Constructor: The number of parameters (%d) is incorrect. It must be equal to %d"), Prms.size(), n_prms);
00063
00064
00065 Array<REAL> equi_prms; equi_prms.resize(n_equi_prms); for (size_t i=0; i<n_equi_prms; ++i) equi_prms[i]=Prms[i];
00066 Array<REAL> flow_prms; flow_prms.resize(n_flow_prms); for (size_t i=0; i<n_flow_prms; ++i) flow_prms[i]=Prms[i+n_equi_prms];
00067
00068
00069
00070
00071 const size_t n_equi_idat = CamClay ::NIDAT;
00072 const size_t n_flow_idat = LinearFlow::NIDAT;
00073 const size_t n_idat = n_equi_idat+n_flow_idat;
00074 if (IniData.size()!=n_idat)
00075 throw new Fatal(_("CCamClay::Constructor: The number of initial data is not sufficiet (it must be equal to 5). { SigX SigY SigZ vini OCR Pp }"));
00076
00077
00078 Array<REAL> equi_idat; equi_idat.resize(n_equi_idat); for (size_t i=0; i<n_equi_idat; ++i) equi_idat[i]=IniData[i];
00079 Array<REAL> flow_idat; flow_idat.resize(n_flow_idat); for (size_t i=0; i<n_flow_idat; ++i) flow_idat[i]=IniData[i+n_equi_idat];
00080
00081
00082
00083
00084 AllocateSubModels(equi_prms, equi_idat, flow_prms, flow_idat);
00085
00086 }
00087
00088
00090
00091
00092 CoupledModel * CCamClayMaker(Array<REAL> const & Prms, Array<REAL> const & IniData)
00093 {
00094 return new CCamClay(Prms, IniData);
00095 }
00096
00097
00098 int CCamClayRegister()
00099 {
00100 CoupledModelFactory["CCamClay"] = CCamClayMaker;
00101 return 0;
00102 }
00103
00104
00105 int __CCamClay_dummy_int = CCamClayRegister();
00106
00107
00108
00109 #endif // MECHSYS_COUPLEDCAMCLAY_H
00110
00111