    

 ## On this page

  

 

 # ImportDesigns Class Reference

 Last update: 16.07.2025 

A class collecting import information for various design directories. [More...](class_import_designs.xhtml#details)

## <a name="pub-methods"></a>Public Member Functions

 [check](class_import_designs.xhtml#a47c34ec1e578c2ce27cf1c5fcd0d1704) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) Checks validity of these data. [More...](#a47c34ec1e578c2ce27cf1c5fcd0d1704)  
  [filterDesignsByOptiSLang](class_import_designs.xhtml#a5c801245230e33fcaa093d72cba5f117) (string filename) reads the given optiSLang binary file and removes all design numbers which are marked as 'failed' [More...](#a5c801245230e33fcaa093d72cba5f117)  
 [TUIntVector](group__data.xhtml#ga2a154410171578b305471e89715c7d93) [getDesignNumbers](class_import_designs.xhtml#a34c4b23f216aeb33d79984bca8041ea4) () Generates a list of all design sample numbers. [More...](#a34c4b23f216aeb33d79984bca8041ea4)  
 string [getDesignNumbersString](class_import_designs.xhtml#a91d115ad2f6b884384893cb38c794ea7) () generates the defined design range intervals as a string [More...](#a91d115ad2f6b884384893cb38c794ea7)  
 [DataObjectContainer::string\_vector\_type](class_data_object_container.xhtml#ac293ea0e5c280f69a497ea20f20c60b9) [getDesignPathNames](class_import_designs.xhtml#abec8ff4bd28cc81e9c577b482291b498) () generates a list of all design directory path names [More...](#abec8ff4bd28cc81e9c577b482291b498)  
  [import](class_import_designs.xhtml#a73dd3f56399568385400db0c3fc08295) ([Structure](class_structure.xhtml) [database](group__data.xhtml#gaebcac3a2836ec9fdf2e47bd812994b6b)) imports multiple designs from disk This method tries to import as much data as possible and does even proceed in case of errors. [More...](#a73dd3f56399568385400db0c3fc08295)  
  [ImportDesigns](class_import_designs.xhtml#a172a1dfa5c3ddbbfee43f7dd0d9a4d9c) ([ReferenceDesign](class_reference_design.xhtml) [reference\_design](class_import_designs.xhtml#ab0f4ff8e7cbf191376f5487872de03f7)) Initializes defaults and starts a first filesystem scan. [More...](#a172a1dfa5c3ddbbfee43f7dd0d9a4d9c)  
  [scanDesignRanges](class_import_designs.xhtml#a54f34c64e9326398eaaf5cdcb8127e08) () Scans the base path for design directories. [More...](#a54f34c64e9326398eaaf5cdcb8127e08)  
  [setDesignNumbers](class_import_designs.xhtml#a2c914c9ef85b4d3a481ed5e3b56da7f1) (string design\_ranges) Sets the design number intervals given as string The method calls [unifyDesignNumbers()](class_import_designs.xhtml#ad011ce88ed992315a48040de3edbf675 "Unifies the design numbers This method ensures that each design number appears at most once in the de..."); to ensure uniqueness of the defined design numbers. [More...](#a2c914c9ef85b4d3a481ed5e3b56da7f1)  
 <a id="ad011ce88ed992315a48040de3edbf675"></a> [unifyDesignNumbers](class_import_designs.xhtml#ad011ce88ed992315a48040de3edbf675) () Unifies the design numbers This method ensures that each design number appears at most once in the design interval definition.   
 ## <a name="pub-attribs"></a>Public Attributes

<a id="a1be53c8e392d898f99ddc804ff403c84"></a>string [base\_path](class_import_designs.xhtml#a1be53c8e392d898f99ddc804ff403c84) Base path (absolute path)   
 string [design\_name\_format](class_import_designs.xhtml#aa25e23bc102293eb390ebd22691c1a90) Format string for identifying design directories. [More...](#aa25e23bc102293eb390ebd22691c1a90)  
 <a id="ab00d7e5b521806ef2f1ac2e9e45fee82"></a>int [max\_num\_threads](class_import_designs.xhtml#ab00d7e5b521806ef2f1ac2e9e45fee82) If set to 0 (default=4), then multiple designs may be imported in parallel using the default OpenMP settings. Else each design is imported using the defined number of threads.   
 <a id="a845f0717e285151b07a57d047b4dd84e"></a>[TUIntVector](group__data.xhtml#ga2a154410171578b305471e89715c7d93) [ranges\_from](class_import_designs.xhtml#a845f0717e285151b07a57d047b4dd84e) Defines ranges of the design directories, specifically the left interval boundaries.   
 [TUIntVector](group__data.xhtml#ga2a154410171578b305471e89715c7d93) [ranges\_to](class_import_designs.xhtml#ac1cd6c172f196f452af5d57b7299b471) Defines ranges of the design directories, specifically the right interval boundaries. [More...](#ac1cd6c172f196f452af5d57b7299b471)  
 <a id="ab0f4ff8e7cbf191376f5487872de03f7"></a>[ReferenceDesign](class_reference_design.xhtml) [reference\_design](class_import_designs.xhtml#ab0f4ff8e7cbf191376f5487872de03f7) Stores the information on the reference design/design template (defines which data to be imported)   
 number [start\_design\_number](class_import_designs.xhtml#a72dfcf1d918d2b4c2eaa79e34becc576) Associates the start design number to the specified design ranges. [More...](#a72dfcf1d918d2b4c2eaa79e34becc576)  
 <a id="details" name="details"></a>## Detailed Description

A class collecting import information for various design directories.

In a typical SoS workflow the user imports varying outcomes of a repeated experiment. These outcome needs to be saved somewhere, and as SoS orgins the Post-optiSLang area, the program expects this data stored in several directories. Each directory contains at least one file which contains one or several outcome(s) of one of specific experiment. While its expected that the directory name varies for each experiment, the filenames must be constant. At best, the design directory name contains a number which might be directly used by SoS on import to insert the outcomes into its database with a unique design number ident.



## Constructor &amp; Destructor Documentation

<a id="a172a1dfa5c3ddbbfee43f7dd0d9a4d9c"></a>## [◆ ](#a172a1dfa5c3ddbbfee43f7dd0d9a4d9c)ImportDesigns()

 [ImportDesigns](class_import_designs.xhtml)  ( [ReferenceDesign](class_reference_design.xhtml)  *reference\_design*) 

Initializes defaults and starts a first filesystem scan.

At first, the constructor tries to generate a suiteable base path and design template string:

- Usually, the [ReferenceDesign](class_reference_design.xhtml "defines information on imported data and files given a reference design ") object will contain at least one file to be imported. If this is the case, its completed file path will be analyzed using the #DesignPath object. At best, this analysis will return a reliable [base\_path](class_import_designs.xhtml#a1be53c8e392d898f99ddc804ff403c84 "Base path (absolute path) ") as well as [design\_name\_format](class_import_designs.xhtml#aa25e23bc102293eb390ebd22691c1a90 "Format string for identifying design directories. ").
- Otherwise the [ReferenceDesign::base\_path](class_reference_design.xhtml#a1be53c8e392d898f99ddc804ff403c84 "Specifies the base path. Must be changed only via setBasePath()! ") of reference\_design given will be separated. Its parent path will be re-used as [base\_path](class_import_designs.xhtml#a1be53c8e392d898f99ddc804ff403c84 "Base path (absolute path) ") and the other part as [design\_name\_format](class_import_designs.xhtml#aa25e23bc102293eb390ebd22691c1a90 "Format string for identifying design directories. ") Afterwards, [ImportDesigns::scanDesignRanges()](class_import_designs.xhtml#a54f34c64e9326398eaaf5cdcb8127e08 "Scans the base path for design directories. ") will be called automatically and the first design range number re-used as start design ident. Otherise, the design ranges remain empty and the [ImportDesigns::start\_design\_number](class_import_designs.xhtml#a72dfcf1d918d2b4c2eaa79e34becc576 "Associates the start design number to the specified design ranges. ") will be initialized to one.

Parameters reference\_designThe reference design object 



## Member Function Documentation

<a id="a47c34ec1e578c2ce27cf1c5fcd0d1704"></a>## [◆ ](#a47c34ec1e578c2ce27cf1c5fcd0d1704)check()

 check  ( [Structure](class_structure.xhtml)  *database*) 

Checks validity of these data.

- If any of the specified directories, design IDs or files does not exist, an exception is thrown
- It also checks the validity of the reference design

Parameters databasethe data base where the data is going to be imported to 



<a id="a5c801245230e33fcaa093d72cba5f117"></a>## [◆ ](#a5c801245230e33fcaa093d72cba5f117)filterDesignsByOptiSLang()

 filterDesignsByOptiSLang  ( string  *filename*) 

reads the given optiSLang binary file and removes all design numbers which are marked as 'failed'

Parameters filenamethe optiSLang file name, either absolute path or relative to the reference design 



<a id="a34c4b23f216aeb33d79984bca8041ea4"></a>## [◆ ](#a34c4b23f216aeb33d79984bca8041ea4)getDesignNumbers()

 [TUIntVector](group__data.xhtml#ga2a154410171578b305471e89715c7d93) getDesignNumbers  ( ) 

Generates a list of all design sample numbers.

ReturnsA vector of integer numbers where each number represents the design identifier used in the SoS database. The vector indices correspond to the vector of [ImportDesigns::getDesignPathNames](class_import_designs.xhtml#abec8ff4bd28cc81e9c577b482291b498 "generates a list of all design directory path names ") 



<a id="a91d115ad2f6b884384893cb38c794ea7"></a>## [◆ ](#a91d115ad2f6b884384893cb38c794ea7)getDesignNumbersString()

 string getDesignNumbersString  ( ) 

generates the defined design range intervals as a string

Returnsthe design range string, eg. "1-4;6-10;12;15-20" 



<a id="abec8ff4bd28cc81e9c577b482291b498"></a>## [◆ ](#abec8ff4bd28cc81e9c577b482291b498)getDesignPathNames()

 [DataObjectContainer::string\_vector\_type](class_data_object_container.xhtml#ac293ea0e5c280f69a497ea20f20c60b9) getDesignPathNames  ( ) 

generates a list of all design directory path names

ReturnsA vector of strings where each string represents the design path name. Each path name is a valid directory name (already includes the base\_path). 



<a id="a73dd3f56399568385400db0c3fc08295"></a>## [◆ ](#a73dd3f56399568385400db0c3fc08295)import()

 import  ( [Structure](class_structure.xhtml)  *database*) 

imports multiple designs from disk This method tries to import as much data as possible and does even proceed in case of errors.

Parameters databasethe data base where all data is to be added 



<a id="a54f34c64e9326398eaaf5cdcb8127e08"></a>## [◆ ](#a54f34c64e9326398eaaf5cdcb8127e08)scanDesignRanges()

 scanDesignRanges  ( ) 

Scans the base path for design directories.

Depending on the currently storred information (base path, design name properties, defined files in the reference design) the design directories are determined and the ranges of the indicies are stored in ranges\_from and ranges\_to. Only design directories are accepted which contain ALL of the files being contained in the reference path!





<a id="a2c914c9ef85b4d3a481ed5e3b56da7f1"></a>## [◆ ](#a2c914c9ef85b4d3a481ed5e3b56da7f1)setDesignNumbers()

 setDesignNumbers  ( string  *design\_ranges*) 

Sets the design number intervals given as string The method calls [unifyDesignNumbers()](class_import_designs.xhtml#ad011ce88ed992315a48040de3edbf675 "Unifies the design numbers This method ensures that each design number appears at most once in the de..."); to ensure uniqueness of the defined design numbers.

Parameters design\_rangesThe string to be interpreted, must be of format "1-4;12;15-20;" or "1-4" or "1" or "". Exceptions anexception If the string can not be interpreted. In this case, the definition is not changed. 



## Member Data Documentation

<a id="aa25e23bc102293eb390ebd22691c1a90"></a>## [◆ ](#aa25e23bc102293eb390ebd22691c1a90)design\_name\_format

 string design\_name\_format

Format string for identifying design directories.

Format strings shall be defined as [Perl Regular Expressions](http://www.boost.org/doc/libs/1_59_0/libs/regex/doc/html/boost_regex/syntax/perl_syntax.html) including one sub-expression which defines the design ID, eg.

Design_?(\d+)$



 which matches the string Design, followed by one or no underscore and a sub-expression of one or more digits until the end of the string. The digit group will be used as unique design number within the database. Other examples might be

Design_?(\d\d)$



 which expects exactly 2 digits, or

first/.*/Design_?(\d{1,5})/dp\d{2}/mech$



 which matches the directory 'first' relative to *base\_path*, any of its subdirectories, a Design directory consisting of one or 5 digits (zero should be avoided as internal design numbers must be generated in that case), an ANSYS dp subdirectory composed of the dp string followed by exactly 2 digits and as last acceptable subdirectory the string mech. For further common pittfalls - like the maximum sub directory level - refer to DesignScanner::filter ( string )





<a id="ac1cd6c172f196f452af5d57b7299b471"></a>## [◆ ](#ac1cd6c172f196f452af5d57b7299b471)ranges\_to

 [TUIntVector](group__data.xhtml#ga2a154410171578b305471e89715c7d93) ranges\_to

Defines ranges of the design directories, specifically the right interval boundaries.

Must have the same dimensions as #ImportDesings::ranges\_from





<a id="a72dfcf1d918d2b4c2eaa79e34becc576"></a>## [◆ ](#a72dfcf1d918d2b4c2eaa79e34becc576)start\_design\_number

 number start\_design\_number

Associates the start design number to the specified design ranges.

This member offers the possibility to control the design number range associated to the imported designs. For example, for some reason it might be necessary to import the same design range twice into SoS. So the first time the user simply accepts the design directory deduced design number suggestion, but on the second run the user decides to import the same design with an arbitrary chosen start design number. The design number range used on import preserves any range definition on the the design directory range side. In other words, holes within the design directory ranges will be reprocuded. For example, the design directory range '1;5-10;12;14-100' with a [start\_design\_number](class_import_designs.xhtml#a72dfcf1d918d2b4c2eaa79e34becc576 "Associates the start design number to the specified design ranges. ") set to 200 leads to the following used design number range on import '200;204-209;211;213-299'