On 01/10/2017 06:18 AM, Jean-Paul Pelteret wrote:
Do you have any recommendations on a function hierarchy/naming scheme? Most
of these functions will take two numbers and return another one, which
means that most of them have the same argument list. In my own code I have
nested namespaces and functions like double
Constitutive_Parameters::Bulk_modulus::from_lambda_and_mu(double lambda,
double mu) This can get untidy quite quickly, but I can’t think of a much
better alternative…

What if you had structures Lambda_Mu, E_nu, ..., and functions of the form
  double lambda (const E_nu &e_and_nu)
? This way, the arguments have proper types that make their meaning obvious, and you can overload functions such as lambda() above for different argument types.

Best
 W.

--
------------------------------------------------------------------------
Wolfgang Bangerth          email:                 bange...@colostate.edu
                           www: http://www.math.colostate.edu/~bangerth/

--
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to