<< MASCARET_setBool Toolbox Mascaret MASCARET_setInt >>

Toolbox Mascaret >> Toolbox Mascaret > MASCARET_setDouble

MASCARET_setDouble

Mutator to control changes to a real variable

Calling sequence

[error]=MASCARET_setDouble(id,nameVar,index1,index2,index3,value)

Arguments

error

(Output argument) Error code value : zero indicates that no errors occurred

id

MASCARET instance number returned by the function MASCARET_create

nameVar

Name of the variable (dot notation), the list of all the possible variables is returned by MASCARET_getDescVar

index1

value of the 1st index

index2

value of the 2nd index

index3

value of the 3rd index

value

New real value of a variable with the specific indices

Description

Mutator to control changes to a real variable of the model or of the state

Example

toolbox_dir=getenv("toolbox_dir");
c = filesep();

// creation of the MASCARET model
[err, id] = MASCARET_create();
assert_checktrue(id>0);

// read data from files
path_xml = "file://"+toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.xcas";
TabNomFichier = [strsubst(path_xml,'\','/'), ..
                 toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.geo", ..
                 toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_0.loi", ..
                 toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_1.loi", ..
                 toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.lis", ..
                 toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.opt"];
 
TypeNomFichier = ["xcas","geo","loi","loi","listing","res"];
impression = 0;
err = MASCARET_importModel(id,TabNomFichier,TypeNomFichier,impression);
assert_checkequal(err,0);
        
// initialisation
err = MASCARET_initStateName(id,toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.lig",impression);
assert_checkequal(err,0);      
        
// set and get the initial state on the cross-section #10 (water level)  
[err] = MASCARET_setDouble(id,"State.Z",10,0,0,0.2);   
assert_checkequal(err,0);
[err,Z] = MASCARET_getDouble(id,"State.Z",10,0,0);
assert_checkequal(err,0);
disp(Z); 

// model deletion
err = MASCARET_delete(id);
assert_checkequal(err,0);

See also


Report an issue
<< MASCARET_setBool Toolbox Mascaret MASCARET_setInt >>