00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef MECHSYS_COUPLEDMODEL_H
00023 #define MECHSYS_COUPLEDMODEL_H
00024
00025 #ifdef HAVE_CONFIG_H
00026 #include "config.h"
00027 #else
00028 #ifndef REAL
00029 #define REAL double
00030 #endif
00031 #endif
00032
00033
00034 #include <map>
00035 #include <string>
00036
00037
00038 #include "tensors/tensors.h"
00039 #include "util/string.h"
00040 #include "util/array.h"
00041 #include "numerical/integschemesctes.h"
00042
00043 using Tensors::Tensor1;
00044 using Tensors::Tensor2;
00045 using Tensors::Tensor4;
00046
00047 class CoupledModel
00048 {
00049 public:
00050
00051
00052 virtual ~CoupledModel(){};
00053
00054
00055 virtual String Name () const =0;
00056 virtual void TgStiffness (Tensor4 & D, Tensor2 & d) const =0;
00057 virtual REAL Sr () const =0;
00058 virtual REAL phi () const =0;
00059 virtual REAL n_times_dSr_dPp () const =0;
00060 virtual void TgPermeability (Tensor2 & k) const =0;
00061 virtual void FlowVelocity (Tensor1 const & Grad, Tensor1 & Vel) const =0;
00062 virtual void Actualize (Tensor2 const & DSig, REAL const & DPp, Tensor2 & DEps, REAL & DnSr) =0;
00063 virtual void StressUpdate (Tensor2 const & DEps, REAL const & DPp, Tensor2 & DSig, REAL & DnSr) =0;
00064 virtual void FlowUpdate (REAL const & DPp) =0;
00065 virtual void BackupState () =0;
00066 virtual void RestoreState () =0;
00067
00068
00069 virtual Tensor2 const & Sig() const =0;
00070 virtual Tensor2 const & Eps() const =0;
00071 virtual REAL Pp () const =0;
00072 virtual REAL GammaW() const =0;
00073 virtual int nInternalStateValues() const =0;
00074 virtual void InternalStateValues (Array<REAL> & IntStateVals ) const =0;
00075 virtual void InternalStateNames (Array<String> & IntStateNames) const =0;
00076
00077
00078 static void SetIntegSchemesCtes(IntegSchemesCtes const & ISC) { _isc=ISC; }
00079
00080 protected:
00081
00082 static IntegSchemesCtes _isc;
00083
00084 };
00085
00086
00088
00089
00090 IntegSchemesCtes CoupledModel::_isc;
00091
00092
00094
00095
00096 typedef CoupledModel * (*CoupledModelMakerPtr)(Array<REAL> const & Prms, Array<REAL> const & IniData);
00097
00098
00099 typedef std::map<String, CoupledModelMakerPtr, std::less<String> > CoupledModelFactory_t;
00100
00101
00102 CoupledModelFactory_t CoupledModelFactory;
00103
00104
00105 CoupledModel * AllocCoupledModel(String const & Name, Array<REAL> const & Prms, Array<REAL> const & IniData)
00106 {
00107 CoupledModelMakerPtr ptr=NULL;
00108 ptr = CoupledModelFactory[Name];
00109 if (ptr==NULL)
00110 throw new Fatal(_("FEM::AllocCoupledModel: There is no < %s > implemented in this library\n"),Name.c_str());
00111 return (*ptr)(Prms, IniData);
00112 }
00113
00114
00115
00116 #endif // MECHSYS_COUPLEDMODEL_H
00117
00118