coolfluid / coolfluid3

COOLFluiD is a collaborative simulation environment focused on complex multi-physics simulations
http://coolfluid.github.com
76 stars 77 forks source link

OptionComponent configuration of a const type #188

Closed wdeconinck closed 12 years ago

wdeconinck commented 12 years ago

Configuration of a OptionComponent of a const type An option created by e.g. options().add_option("mesh", Handle<Mesh const>() ); should be possible to configure with: options().configure_option("mesh", component.handle<Component>() ); as well as with: options().configure_option("mesh", component.handle<Mesh>() );

This will solve a bug encountered trying to configure this option from a python script:

+++ Exception thrown on rank 0 ++++++++++++++++++++++++++++++++++++++++++++++ From : '/Users/willem/workspace/coolfluid3/dev/kernel/cf3/common/OptionComponent.hpp:70:change_value' Type : 'BadValue' Message : Bad value of type cf3::Handle<cf3::common::Component> passed where handle of type Mesh was expected for option mesh +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

wdeconinck commented 12 years ago

Fixed in a private branch, to be merged soon.

barche commented 12 years ago

Just reorganized things a little bit, making it easier to add more "base" types to check against (by extending an MPL vector) and avoiding const casts. The test was also updated to avoid regressions.