CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Option_Structure.hpp

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By hlk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 6, 2017, 22:36
Default Option_Structure.hpp
  #1
Member
 
Tom
Join Date: Oct 2015
Posts: 67
Rep Power: 10
mlooti is on a distinguished road
Hi

Can anyone give me an explanation about Option_Structure.hpp file?

I want to know the reason of all those "enum" type definitions and also the main idea behind the "map" construction. (it is more a c++ question)

since when I want to add new feature to the config file I just define that as data member in config_structure.hpp and then put the definition in config_structure.cpp

It would be great if one can explain the whole "config file reading" style which I believe is related to the following files:

Option_Structure.hpp
config_structure.hpp
config_structure.cpp
config_structure.inl
mlooti is offline   Reply With Quote

Old   January 11, 2017, 14:57
Default
  #2
hlk
Senior Member
 
Heather Kline
Join Date: Jun 2013
Posts: 309
Rep Power: 13
hlk is on a distinguished road
Quote:
Originally Posted by mlooti View Post
Hi

Can anyone give me an explanation about Option_Structure.hpp file?

I want to know the reason of all those "enum" type definitions and also the main idea behind the "map" construction. (it is more a c++ question)

since when I want to add new feature to the config file I just define that as data member in config_structure.hpp and then put the definition in config_structure.cpp

It would be great if one can explain the whole "config file reading" style which I believe is related to the following files:

Option_Structure.hpp
config_structure.hpp
config_structure.cpp
config_structure.inl

The enum/map structure allows options to be specified using strings in the config file, and referred to by name in the code. From the C++ side this means that the options read in as strings are stored using very little memory, and referred to by human-readable variable names in the code.
If you are creating a new option, you only need to add the enum/map structure if you are introducing an option that chooses something from a list (ie, DV_KIND). If you are adding an option that sets a numerical value, the enum/map is not needed (ie, CFL number).

When adding an option, you need to define the option in config_structure.cpp such that it can be read from the config file, declare the variable in config_structure.hpp such that the variable will exist in the config class, and define the getter function in config_structure.inl such that the value can be accessed from outside the config class.
In C++, *.inl files are the preferred location for functions that take up only one or two lines.
mlooti likes this.
hlk is offline   Reply With Quote

Old   November 7, 2019, 17:42
Default New Option in SU2 for DV_KIND
  #3
New Member
 
Vishal Chauhan
Join Date: Jan 2012
Posts: 14
Rep Power: 14
vishu343 is on a distinguished road
Hello,


I just read this post about adding new option for DV_KIND. I am also trying to do same i.e. adding new option similar to FFD_CONTROL_POINT and so on. I was wondering which files needs to be modified in such cases!!


I have modified following files already:


1) config_structure.hpp
1) config_structure.cpp
3) option_structure.hpp
4) grid_movement_structure.cpp


While running SU2_CFD "name_of_file.cfg" I got following error.


-----------------------------------------------*****------------------------------------------------



DV_KIND: invalid option value XXXXXX. Check current SU2 options in config_template.cfg.
DV_PARAM: Design_Variable array has not been allocated. Check that DV_KIND appears before DV_PARAM in configuration file.
DV_VALUE: Design_Variable array has not been allocated. Check that DV_KIND appears before DV_VALUE in configuration file.



----------------------------------------------******-----------------------------------------------


Here XXXXXX is the new option added. Due to contract reasons, I can not reveal the parameter.


Thanks a lot in advance.
vishu343 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 05:55.