Re: [DuMuX] Setting Properties

2016-01-28 Thread Christoph GrĂ¼ninger
Hi Georg,
not sure whether there is a nice DuMuX property way to achieve what you
want, but C++11 offers std::conditional.

Bye
Christoph

-- 
The method has been developed for use on a high-speed electronic
computer and would be impractical for hand-solution purposes.
   [Harlow & Welch 1965]



signature.asc
Description: OpenPGP digital signature
___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux


[DuMuX] Setting Properties

2016-01-28 Thread Georg.Futter
Hello Dumuxers,

I have a question concerning the property system. Is it possible to set a 
property depending on the value of another property? I have something in mind 
like this:

SET_PROP(MyProblem, MyProperty)
{
private:
enum { boolValue = GET_PROP_VALUE(TypeTag, MyBoolValue) };
public:
if(boolValue)
typedef Dumux::ClassA type;
else
typedef Dumux:: ClassB  type;
};

Obviously the code has a wrong syntax.
Is there a syntax which could be used to do what I want or do I need to pass 
the property value (boolValue ) to the Class and then use class specializations?


Best regards

Georg Futter

--
German Aerospace Center (DLR)
Institute of Engineering Thermodynamics | Computational Electrochemistry | 
Pfaffenwaldring 38-40 | 70569 Stuttgart

Dipl.-Ing. Georg Futter | Ph.D. student
Telefon 0711/6862-8135 | georg.fut...@dlr.de
www.DLR.de


___
Dumux mailing list
Dumux@listserv.uni-stuttgart.de
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux