Re: [Getfem-commits] please merge branch devel-tetsuo-add_lumped_mass_python_interface_squash

2021-04-22 Thread Konstantinos Poulios via Getfem-commits
Dear Tetsuo,

Thanks for tidying things up and testing. I have merged your branch. Maybe
Yves will suggest some deprecation aliases for the old function names, but
if so we can still add these later.

BR
Kostas

On Wed, Apr 21, 2021 at 2:59 AM Tetsuo Koyama  wrote:

> Dear Kostas
>
> Thanks for your point out.I fixed it and checked that all tests passed in
> C++, python, scilab octave except matlab (sorry, but I don't have a matlab
> license).
>
> Best regards
> Tetsuo
>
> 2021年4月19日(月) 19:42 Konstantinos Poulios :
>
>> Dear Tetsuo,
>>
>> Could I get you to update some uses of the old pstress and pstrain brick
>> names in the following files?
>>
>> model_linear_elasticity.rst
>> demo_elasticity.m
>>
>> I hope I haven't missed any other affected files.
>>
>> Otherwise if all tests run successfully, then it is fine for me to merge
>> the branch.
>>
>> Best regards
>> Kostas
>>
>> On Fri, Apr 16, 2021 at 1:29 PM Tetsuo Koyama 
>> wrote:
>>
>>> Dear Yves and Kostas
>>>
>>> Thanks for your comments.
>>> I updated the method names.
>>> Please review it.
>>>
>>> Best regards,
>>>
>>> Tetsuo
>>>
>>> 2021年4月16日(金) 17:37 Yves Renard :
>>>


 Dear Tetsuo,

 I also think that these name changes are convenient.

 Best regards,

 Yves

 On 10/04/2021 06:57, Tetsuo Koyama wrote:

 Dear Kostas and Yves

 @Kostas Thank you for your comment. It is a good point.
 I am a fan of adding brick at the end of the methods.

 add_isotropic_linearized_elasticity_pstrain_brick
 add_isotropic_linearized_elasticity_pstrain_brick
 add_lumped_mass_for_first_order_brick

 If you don't mind I will fix the name of these methods in this branch.

 Best regards Tetsuo

 2021年4月10日(土) 4:24 Konstantinos Poulios :

> Dear Tetsuo and Yves
>
> @Tetsuo thanks for this interface functions. I would like to use this
> opportunity to discuss about the word "brick" in the naming of our
> functions adding PDE term matrices. Traditionally, "brick" was only used 
> at
> the end of the function name. More recently, Yves started skipping "brick"
> from some of the newer terms, which I think is fine. Now we have a mix 
> with
> names including "brick" and some without. Apart from that, there are 3
> functions that do not follow the old naming convention at all:
>
> add_isotropic_linearized_elasticity_brick_pstrainadd_isotropic_linearized_elasticity_brick_pstrainadd_lumped_mass_brick_for_first_order
>
> I would like to avoid this kind of inconsistencies in the naming so
> that all functions for adding a PDE matrix either have "brick" at the end
> of their name or that they do not include it at all.
>
> For Tetsuo's function I would suggest one of
> add_lumped_mass_matrix_for_first_order
> add_lumped_mass_for_first_order_brick
>
> Both in c++ and the interfaces.
>
> What do you think?
>
> Best regards
> Kostas
>
> On Fri, Apr 9, 2021 at 11:23 AM Tetsuo Koyama 
> wrote:
>
>> Dear GetFEM project
>>
>> I added the lumped mass for first order to the python interface.
>> Could you merge devel-tetsuo-add_lumped_mass_python_interface_squash ?
>>
>> BR Tetsuo
>>
>
 --

   Yves Renard (yves.ren...@insa-lyon.fr)   tel : (33) 04.72.43.87.08
   INSA-Lyon
   20, rue Albert Einstein
   69621 Villeurbanne Cedex, FRANCE
   http://math.univ-lyon1.fr/~renard

 -




[Getfem-commits] [getfem-commits] branch master updated: Rename brick addition functions and new interface function for lumped mass brick

2021-04-22 Thread Konstantinos Poulios via Getfem-commits
This is an automated email from the git hooks/post-receive script.

logari81 pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
 new 0241496  Rename brick addition functions and new interface function 
for lumped mass brick
0241496 is described below

commit 0241496a72624aca5f7f6a4f3725accee863d46e
Author: Tetsuo Koyama 
AuthorDate: Thu Apr 22 18:59:19 2021 +0200

Rename brick addition functions and new interface function for lumped mass 
brick
---
 .../source/userdoc/model_linear_elasticity.rst |  4 +--
 interface/src/gf_model_set.cc  | 35 ++
 interface/tests/matlab-octave/demo_elasticity.m|  4 +--
 interface/tests/python/demo_wave_equation.py   | 11 +++
 src/getfem/getfem_models.h |  6 ++--
 src/getfem_models.cc   | 12 
 6 files changed, 53 insertions(+), 19 deletions(-)

diff --git a/doc/sphinx/source/userdoc/model_linear_elasticity.rst 
b/doc/sphinx/source/userdoc/model_linear_elasticity.rst
index 6ebbf1f..ca28a87 100644
--- a/doc/sphinx/source/userdoc/model_linear_elasticity.rst
+++ b/doc/sphinx/source/userdoc/model_linear_elasticity.rst
@@ -56,13 +56,13 @@ representing the |Lame| coefficients.
 
 The function which adds this brick to a model and parametrized with Young 
modulus and Poisson ratio is::
 
-  ind_brick = getfem::add_isotropic_linearized_elasticity_brick_pstrain
+  ind_brick = getfem::add_isotropic_linearized_elasticity_pstrain_brick
   (md, mim, varname, data_E, data_nu, region = size_type(-1));
 
 
 This brick represent a plane strain approximation when it is applied to a 2D 
mesh (and a standard model on a 3D mesh). In order to obtain a plane stress 
approximation for 2D meshes, one can use::
 
-  ind_brick = getfem::add_isotropic_linearized_elasticity_brick_pstress
+  ind_brick = getfem::add_isotropic_linearized_elasticity_pstress_brick
   (md, mim, varname, data_E, data_nu, region = size_type(-1));
 
 For 3D meshes, the two previous bricks give the same result.
diff --git a/interface/src/gf_model_set.cc b/interface/src/gf_model_set.cc
index 288572d..2c90b65 100644
--- a/interface/src/gf_model_set.cc
+++ b/interface/src/gf_model_set.cc
@@ -1978,7 +1978,7 @@ void gf_model_set(getfemint::mexargs_in& m_in,
out.pop().from_integer(int(ind));
);
 
-/*@SET ind = ('add isotropic linearized elasticity brick pstrain', @tmim 
mim, @str varname, @str data_E, @str data_nu[, @int region])
+/*@SET ind = ('add isotropic linearized elasticity pstrain brick', @tmim 
mim, @str varname, @str data_E, @str data_nu[, @int region])
   Add an isotropic linearized elasticity term to the model relatively to
   the variable `varname`. `data_E` and `data_nu` should
   contain the Young modulus and Poisson ratio, respectively.
@@ -1990,7 +1990,7 @@ void gf_model_set(getfemint::mexargs_in& m_in,
   standard model. 
   Return the brick index in the model.@*/
 sub_command
-  ("add isotropic linearized elasticity brick pstrain", 4, 5, 0, 1,
+  ("add isotropic linearized elasticity pstrain brick", 4, 5, 0, 1,
getfem::mesh_im *mim = to_meshim_object(in.pop());
std::string varname = in.pop().to_string();
std::string data_E = in.pop().to_string();
@@ -1998,14 +1998,14 @@ void gf_model_set(getfemint::mexargs_in& m_in,
size_type region = size_type(-1);
if (in.remaining()) region = in.pop().to_integer();
size_type ind
-   = getfem::add_isotropic_linearized_elasticity_brick_pstrain
+   = getfem::add_isotropic_linearized_elasticity_pstrain_brick
(*md, *mim, varname, data_E, data_nu, region)
+ config::base_index();
workspace().set_dependence(md, mim);
out.pop().from_integer(int(ind));
);
 
-/*@SET ind = ('add isotropic linearized elasticity brick pstress', @tmim 
mim, @str varname, @str data_E, @str data_nu[, @int region])
+/*@SET ind = ('add isotropic linearized elasticity pstress brick', @tmim 
mim, @str varname, @str data_E, @str data_nu[, @int region])
   Add an isotropic linearized elasticity term to the model relatively to
   the variable `varname`. `data_E` and `data_nu` should
   contain the Young modulus and Poisson ratio, respectively.
@@ -2017,7 +2017,7 @@ void gf_model_set(getfemint::mexargs_in& m_in,
   standard model. 
   Return the brick index in the model.@*/
 sub_command
-  ("add isotropic linearized elasticity brick pstress", 4, 5, 0, 1,
+  ("add isotropic linearized elasticity pstress brick", 4, 5, 0, 1,
getfem::mesh_im *mim = to_meshim_object(in.pop());
std::string varname = in.pop().to_string();
std::string data_E = in.pop().to_string();
@@ -2025,7 +2025,7 @@ void gf_model_set(getfemint::mexargs_in& m_in,
size_type region = size_type(-1);
if (in.remaining())