[deal.II] Re: Relationships between material parameters

2017-01-12 Thread Jean-Paul Pelteret
Dear Seyed,

It would be great to have your contribution to deal.II! When you have the 
time to implement this, open up an issue 
 on the GitHub page and we 
could discuss this further. We can always refer back to this conversation 
at that point in time.

Best regards,
Jean-Paul

On Thursday, January 12, 2017 at 10:23:36 AM UTC+1, Seyed Ali Mohseni wrote:
>
> Your ideas are very constructive and useful, I didn't think it would be so 
> complex to make it general in deal.II.
> I am not an expert still, but how about we make it something similar to 
> the FEValues class where you just specify the necessary parameters and the 
> desired conversion.
>
> @ Jean-Paul: I am now a bit busy until February, but it would be a great 
> honor for me to contribute to deal.II, if possible.
>
> Kind regards,
> S. A. Mohseni
>

-- 
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.


[deal.II] Re: Relationships between material parameters

2017-01-12 Thread 'Seyed Ali Mohseni' via deal.II User Group
Your ideas are very constructive and useful, I didn't think it would be so 
complex to make it general in deal.II.
I am not an expert still, but how about we make it something similar to the 
FEValues class where you just specify the necessary parameters and the 
desired conversion.

@ Jean-Paul: I am now a bit busy until February, but it would be a great 
honor for me to contribute to deal.II, if possible.

Kind regards,
S. A. Mohseni

-- 
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.


Re: [deal.II] Re: Relationships between material parameters

2017-01-11 Thread Jean-Paul Pelteret
I am most swayed towards Wolfgang's suggestion that takes in some 
identifying enumeration type and the associated material parameters. I 
think its probably the most transparent and easy to maintain option that 
we've come up with thus far.

Seyed, would you like to try to implement this?

Regards,
Jean-Paul

-- 
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.


Re: [deal.II] Re: Relationships between material parameters

2017-01-10 Thread Wolfgang Bangerth

On 01/10/2017 08:26 AM, Jean-Paul Pelteret wrote:

That would work quite nicely but my only concern is that, again, one
might end up with many structs along with the many function definitions
in order to accommodate all of the potential permutations.

What do you think of this concept as an alternative?
|
enumElasticityParameters{LameParameter,PoissonRatio,ShearModulus,YoungsModulus,BulkModulus,...etc};

template
Number
kappa(constNumber &,constNumber &)
{
  AssertThrow(false,ExcNotImplemented());
  return0.0;
}

template<>
Number
bulk_modulus < LameParameter, PoissonRatio > (const Number ,
const Number )
{
const double kappa = lambda + 2.0/3.0*mu;

AssertThrow(kappa > 0.0,
ExcMessage("Non-positive bulk modulus!"));
return kappa;
}

template<>
Number
bulk_modulus 
(const Number , const Number )
{
  return bulk_modulus < LameParameter, PoissonRatio > (lambda, mu);
}

template<>
Number
bulk_modulus< ShearModulus, PoissonRatio > (const Number ,
const Number )
{
const double kappa = (2.0 * mu * (1.0 + nu)) / (3.0 * (1.0 -
2.0 * nu));

AssertThrow(kappa > 0.0,
ExcMessage("Non-positive bulk modulus!"));
return kappa;
}
|


That still leaves many many functions to implement. Overloading is also 
burdensome to program in this case because it creates so many separate 
functions (up to 30) for each coefficient you want to compute.


If you want to go this route, why not do
  double lambda (const ElasticityParameter coefficient1_kind,
 const double  coefficient1,
 const ElasticityParameter coefficient2_kind,
 const double  coefficient2);
where the first two ElasticityParameter arguments indicate how the next 
argument is to be interpreted?


This way, you only need one function. Internally, it would just have 
nested switches.


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.


Re: [deal.II] Re: Relationships between material parameters

2017-01-10 Thread Jean-Paul Pelteret
Hi Wolfgang,

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…

Best,
J-P

> On 10 Jan 2017, at 14:07, Wolfgang Bangerth  wrote:
> 
> On 01/10/2017 04:21 AM, Jean-Paul Pelteret wrote:
>> 
>> There is a table in wikipedia
>>  that details how
>> to convert between fundamental elastic material parameters. Due to the number
>> of permutations that are available, I would be hesitant to add this to 
>> deal.II
>> itself. However, I'm happy to entertain a discussion on it with the other
>> developers since I have many such functions implemented in my own library and
>> could also contribute these.
> 
> I think this could live in a namespace Physics::Elasticity or similar. The 
> formulas are uncontroversial and likely useful in a number of contexts.
> 
> 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 a topic in the 
> Google Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/x4--tyLFS1A/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> dealii+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.


Re: [deal.II] Re: Relationships between material parameters

2017-01-10 Thread Wolfgang Bangerth

On 01/10/2017 04:21 AM, Jean-Paul Pelteret wrote:


There is a table in wikipedia
 that details how
to convert between fundamental elastic material parameters. Due to the number
of permutations that are available, I would be hesitant to add this to deal.II
itself. However, I'm happy to entertain a discussion on it with the other
developers since I have many such functions implemented in my own library and
could also contribute these.


I think this could live in a namespace Physics::Elasticity or similar. The 
formulas are uncontroversial and likely useful in a number of contexts.


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.


[deal.II] Re: Relationships between material parameters

2017-01-10 Thread Jean-Paul Pelteret
Dear Seyed,

There is a table in wikipedia 
 that details 
how to convert between fundamental elastic material parameters. Due to the 
number of permutations that are available, I would be hesitant to add this 
to deal.II itself. However, I'm happy to entertain a discussion on it with 
the other developers since I have many such functions implemented in my own 
library and could also contribute these.

Regards,
Jean-Paul

On Tuesday, January 10, 2017 at 11:46:30 AM UTC+1, Seyed Ali Mohseni wrote:
>
> Hi everyone,
>
> I am just implementing some material parameter relationships such as  
>
> lambda = E * v / (1 + v) / (1 - 2 * v)
>
> for instance.
>
> There is a table for such conversion of quantities.
>
> Would it be beneficial to have such a library that computes and converts 
> these quantities automatically in Deal.II?
> Or is there already such a library that I can access instead of writing 
> everything myself?
>
> If there is not, I would be willing to implement such a library and add it 
> to the core of Deal.II, so people can access it.
>
> Kind regards,
> S. A. Mohseni
>

-- 
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.