udm

13
User-Defined Models (UDMs) in FLAC & FLAC3D Constitutive models can be written in the C++ language and compiled as DLLs (Dynamic Link Libraries) that are loaded whenever needed during a run. The models run almost as fast as the built- in models in FLAC, and at the same speed in FLAC3D. For example, in FLAC3D, a UDM is loaded and used as follows - config cppudm model load userssoft.dll gen zone bric size 2 2 2 model userssoft Note that required models must be loaded whenever FLAC3D is started …only the ID number of a model is saved on a save-file, not the actual model. (Use the INI file!)

Upload: dce40

Post on 17-Aug-2015

225 views

Category:

Documents


0 download

TRANSCRIPT

User-Defined Models (UDMs) in FLAC & FLAC3D Constitutive models can be written in the C++ language and compiled as DLLs (Dynamic Link Libraries) that are loaded whenever needed during a run. The models run almost as fast as the builtin models in FLAC! and at the same speed in FLAC3D. "or e#ample! in FLAC3D! a $D% is loaded and used as follows config cppudmmodel load userssoft.dllgen zone bric size 2 2 2model userssoft&ote that re'uired models must be loaded whenever FLAC3D is started (only the )D number of a model is saved on a savefile! not the actual model. ($se the )&) file*) $D%scontinued+ll $D%s are instances of C++ classes derived from a base class called Constitutive%odel (defined in an )tascasupplied header file). "or e#ample class UserSsoft : public ConstitutiveModel {};The base class specifies a number of virtual functions that must be overridden by samenamed functions in the derived class. These functions contain userwritten code that specify how the model works! the names of properties! and so on. "or e#ample!virtual car !"e#$ord%void& ' (;( is the baseclass function to supply a model name! and (car !UserSsoft::"e#$ord%void& {return%)userssoft)&;}( is the overriding function that actually specifies the name. The main task of the $D% is to compute new stresses from strainrates. )t does this via the ,un( ) function of the base class-virtual const car !*un%unsigned u+im,State !pst&'(;The argument uDim is the code dimensionality (2 for FLAC and 3 for FLAC3D)! and .tate is a structure! as follows struct State {unsigned car b#Sub-one, b#.otSub-ones, b#/verla#; unsigned long mState;double dSub-one0olume, d-one0olume; S.ensorstn1, stnS, stn2; double d*ot3, d*ot4, d*ot-;double d+ensit#, d.emp, d.imeStep; double d552nc, d5orosit#, d.MUtilit#; bool b6arge, b.erm, bCreep, b7luid, b0iscous;}; The current stress tensor is available in stn.! and the strain increment tensor in stn/! using the .Tensor structure! defined (in part) as follows- struct S.ensor {double d88, d22, d99, d82, d89, d29;};The $D% ,un( ) function must compute new comonents for stn.! using the initial values and the components of stn/.+s an e#ample! the ,un( ) function for the elastic model in FLAC3D is coded as follow ( const car !1lasticModel::*un%unsigned,State !ps& {double d188 ' ps:;stn1.d88;double d122 ' ps:;stn1.d22;double d199 ' ps:;stn1.d99;ps:;stnS.d88