<< MASCARET_initState Toolbox Mascaret MASCARET_setBool >>

Toolbox Mascaret >> Toolbox Mascaret > MASCARET_initStateName

MASCARET_initStateName

Import a MASCARET state from a file

Calling sequence

[error] = MASCARET_initStateName(id,nameFile,print)

Arguments

error

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

id

MASCARET instance number returned by the function MASCARET_create

nameFile

Name of the file with the initial solution (max 255 characters)

print

print (write) on the listing files (1-> True 0-> False)

Description

Import a MASCARET state from a file.

This function initialise the MASCARET state from a file for an existing model. The file is created by the GUI software FUDAA-MASCARET with the action : « File | Export | Mascaret | File of initial water levels (Mascaret file format) » or with : « Hydraulics | Conditions Initiales | Initial conditions | Initial water level | Export »

Before using this function, it is necessary to import a MASCARET model with the function MASCARET_importModel.

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);      
        
// model deletion
err = MASCARET_delete(id);
assert_checkequal(err,0);

See also


Report an issue
<< MASCARET_initState Toolbox Mascaret MASCARET_setBool >>