[Getfem-commits] [getfem-commits] branch master updated: Minor fix

2024-04-28 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 04b6aac6 Minor fix
04b6aac6 is described below

commit 04b6aac6c9edd78c3ba2b38879af02807013a57a
Author: Konstantinos Poulios 
AuthorDate: Sun Apr 28 10:35:45 2024 +0200

Minor fix
---
 src/getfem_models.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index 81d015cd..36979703 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -2337,7 +2337,7 @@ namespace getfem {
 GMM_ASSERT1(version != BUILD_WITH_INTERNAL,
 "Invalid assembly version BUILD_WITH_INTERNAL");
 int nbp=1;
-#if GETFEM_PARA_LEVEL > 1
+#if GETFEM_PARA_LEVEL > 0
 double t_ref = MPI_Wtime();
 int rk=0;
 MPI_Comm_rank(MPI_COMM_WORLD, );
@@ -2878,8 +2878,7 @@ namespace getfem {
MPI_BCAST0_SCALAR(approx_external_load_);
 }
 
-#if GETFEM_PARA_LEVEL > 1
-// int rk; MPI_Comm_rank(MPI_COMM_WORLD, );
+#if GETFEM_PARA_LEVEL > 0
 if (MPI_IS_MASTER()) cout << "Assembly time " << MPI_Wtime()-t_ref << endl;
 #endif
 



[Getfem-commits] [getfem-commits] branch master updated: Minor fix in scripting API

2024-04-28 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 9e1450d7 Minor fix in scripting API
9e1450d7 is described below

commit 9e1450d7c4049ab7bb3d0901c291cbe9e2394653
Author: Konstantinos Poulios 
AuthorDate: Sun Apr 28 10:34:41 2024 +0200

Minor fix in scripting API
---
 interface/src/gf_util.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/interface/src/gf_util.cc b/interface/src/gf_util.cc
index 4fed4dab..c36a181f 100644
--- a/interface/src/gf_util.cc
+++ b/interface/src/gf_util.cc
@@ -119,7 +119,7 @@ void gf_util(getfemint::mexargs_in& m_in, 
getfemint::mexargs_out& m_out) {
);
 
 
-/*@FUNC tl = ('warning level', @int level)
+/*@FUNC tl = ('warning level' [, @int level])
   Filter the less important warnings displayed by getfem.
 
   0 means no warnings, default level is 3. if no level is given,



[Getfem-commits] [getfem-commits] branch master updated: minor fix

2022-06-23 Thread Yves Renard
This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
 new 20c315d5 minor fix
20c315d5 is described below

commit 20c315d50174ef3bb264a3d849a46e059f540668
Author: Renard Yves 
AuthorDate: Thu Jun 23 16:02:13 2022 +0200

minor fix
---
 interface/tests/matlab-octave/check_all_octave.sh | 2 +-
 interface/tests/matlab-octave/demo_refine.m   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/interface/tests/matlab-octave/check_all_octave.sh 
b/interface/tests/matlab-octave/check_all_octave.sh
index 53dd703a..36282a56 100755
--- a/interface/tests/matlab-octave/check_all_octave.sh
+++ b/interface/tests/matlab-octave/check_all_octave.sh
@@ -32,7 +32,7 @@ echo "  srcdir='$srcdir'"
 
 # s=$(echo "s=getenv('MATLABPATH'); while (length(s)), [a,s]=strtok(s,':'); 
addpath(a); end; disp(pwd); check_all; pause(1)" | ${MLAB} 2>&1);
 
-s=$(echo "addpath('../../src/octave'); addpath('${srcdir}/../../src/octave'); 
disp(pwd); pause(1);" | octave check_all.m 2>&1);
+s=$(echo "addpath('../../src/octave'); addpath('${srcdir}/../../src/octave'); 
disp(pwd); pause(1); check_all; pause(1);" | octave 2>&1);
 
 # echo $s
 
diff --git a/interface/tests/matlab-octave/demo_refine.m 
b/interface/tests/matlab-octave/demo_refine.m
index 65849c25..70642052 100644
--- a/interface/tests/matlab-octave/demo_refine.m
+++ b/interface/tests/matlab-octave/demo_refine.m
@@ -68,7 +68,7 @@ gf_model_set(md, 'add Dirichlet condition with multipliers', 
mim, 'u', mfu, 1);
 
 
 
-for step=1:8,
+for step=1:7,
   gf_model_get(md, 'solve');
   U = gf_model_get(md, 'variable', 'u');
   



[Getfem-commits] [getfem-commits] branch master updated: minor fix on matrix_j2 operator

2022-06-13 Thread Yves Renard
This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
 new 97aac8bf minor fix on matrix_j2 operator
97aac8bf is described below

commit 97aac8bfb35da839043bd43396361589544e4022
Author: Renard Yves 
AuthorDate: Mon Jun 13 15:46:09 2022 +0200

minor fix on matrix_j2 operator
---
 src/getfem_nonlinear_elasticity.cc | 13 ++---
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/getfem_nonlinear_elasticity.cc 
b/src/getfem_nonlinear_elasticity.cc
index 42581611..8dc3a8ef 100644
--- a/src/getfem_nonlinear_elasticity.cc
+++ b/src/getfem_nonlinear_elasticity.cc
@@ -221,8 +221,7 @@ namespace getfem {
   const base_matrix _ = grad_i2();
   const base_matrix _ = grad_i3();
   scalar_type coeff1 = scalar_type(2) / (scalar_type(3)*i3());
-  scalar_type coeff2 = scalar_type(5) * coeff1 * coeff1 * i2()
-   / scalar_type(2);
+  scalar_type coeff2 = scalar_type(5)*coeff1*coeff1*i2() / scalar_type(2);
   ddj2 = sym_grad_grad_i2();
   gmm::add(gmm::scaled(sym_grad_grad_i3().as_vector(), -i2() * coeff1),
ddj2.as_vector());
@@ -1467,7 +1466,7 @@ namespace getfem {
   for (size_type j = 0; j < N; ++j)
 for (size_type i = 0; i < N; ++i, ++it)
   *it = (((i == j) ? tr : scalar_type(0)) - t[j+N*i]
- - scalar_type(2)*i2*M(j,i)/scalar_type(3))
+ - scalar_type(2)*i2*M(j,i)/(det*scalar_type(3)))
 / pow(det, scalar_type(2)/scalar_type(3));
   GMM_ASSERT1(it == result.end(), "Internal error");
 }
@@ -1494,11 +1493,11 @@ namespace getfem {
 for (size_type i = 0; i < N; ++i, ++it)
   *it = ( ((i==j) ? 1. : 0.) * ((k==l) ? 1. : 0.)
   - ((i==l) ? 1. : 0.) * ((k==j) ? 1. : 0.)
-  - 2.*tr*M(j,i)*((k==l) ? 1. : 0.)/3.
-  + 2.*tr*M(j,i)*M(l,k)/3.
-  - 2.*i2*M(i,k)*M(l,j)/3.
+  - 2.*tr*M(j,i)*((k==l) ? 1. : 0.)/(3.*det)
+  + 2.*tr*M(j,i)*M(l,k)/(3.*det)
+  - 2.*i2*M(i,k)*M(l,j)/(3.*det)
   - 2.*((tr*((i==j) ? 1. : 0.))-t[j+N*i]
-- 2.*i2*M(j,i)/3)*M(l,k)/3.)
+- 2.*i2*M(j,i)/(3.*det))*M(l,k)/(3.*det))
 / pow(det, scalar_type(2)/scalar_type(3));
 }
   };



[Getfem-commits] [getfem-commits] branch master updated: minor fix with a verification on im_data size

2020-06-21 Thread Yves Renard
This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
 new abd78b0  minor fix with a verification on im_data size
abd78b0 is described below

commit abd78b096280b4d90c0f2ff80db672b43befe3ce
Author: Yves Renard 
AuthorDate: Sun Jun 21 13:23:41 2020 +0200

minor fix with a verification on im_data size
---
 src/getfem_models.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/getfem_models.cc b/src/getfem_models.cc
index 2306f2a..a33ae53 100644
--- a/src/getfem_models.cc
+++ b/src/getfem_models.cc
@@ -2902,7 +2902,7 @@ namespace getfem {
   return mi;
 } else if (imd) {
   bgeot::multi_index mi = imd->tensor_size();
-  size_type q = n / imd->nb_filtered_index();
+  size_type q = n * imd->nb_filtered_index();
   GMM_ASSERT1(q % imd->nb_tensor_elem() == 0,
   "Invalid mesh im data vector");
   if (n > 1 || it->second.qdims.size() > 1) {



[Getfem-commits] [getfem-commits] branch master updated: minor fix on integration method definition

2020-02-29 Thread Yves Renard
This is an automated email from the git hooks/post-receive script.

renard pushed a commit to branch master
in repository getfem.

The following commit(s) were added to refs/heads/master by this push:
 new 78cda97  minor fix on integration method definition
78cda97 is described below

commit 78cda97e6bbb700c05d24231ee78c040bac91636
Author: Yves Renard 
AuthorDate: Sat Feb 29 14:57:46 2020 +0100

minor fix on integration method definition
---
 doc/sphinx/source/tutorial/thermo_coupling.rst| 8 
 .../scilab/demos/demo_thermo_elasticity_electrical_coupling.sce   | 2 +-
 .../tests/matlab/demo_thermo_elasticity_electrical_coupling.m | 2 +-
 .../tests/python/demo_thermo_elasticity_electrical_coupling.py| 2 +-
 tests/thermo_elasticity_electrical_coupling.cc| 2 +-
 5 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/doc/sphinx/source/tutorial/thermo_coupling.rst 
b/doc/sphinx/source/tutorial/thermo_coupling.rst
index 8267ec1..4192595 100644
--- a/doc/sphinx/source/tutorial/thermo_coupling.rst
+++ b/doc/sphinx/source/tutorial/thermo_coupling.rst
@@ -438,7 +438,7 @@ The last thing to define is an integration method `mim`. 
There is no default int
 
mfvm.set_classical_discontinuous_finite_element(elements_degree);
 
 getfem::mesh_im  mim(mesh);
-
mim.set_integration_method(bgeot::dim_type(gmm::sqr(elements_degree)));
+mim.set_integration_method(2*elements_degree);
 -- 
---
 **Python** .. code-block:: python
 
@@ -448,7 +448,7 @@ The last thing to define is an integration method `mim`. 
There is no default int
 mft.set_classical_fem(elements_degree)
 mfvm = gf.MeshFem(mesh, 1)
 mfvm.set_classical_discontinuous_fem(elements_degree)
-mim = gf.MeshIm(mesh, pow(elements_degree,2))
+mim = gf.MeshIm(mesh, elements_degree*2)
 -- 
---
 **Scilab** .. code-block:: matlab
 
@@ -458,7 +458,7 @@ The last thing to define is an integration method `mim`. 
There is no default int
 gf_mesh_fem_set(mft, 'classical fem', elements_degree);
 mfvm = gf_mesh_fem(mesh, 1);
 gf_mesh_fem_set(mfvm, 'classical discontinuous fem', 
elements_degree-1);
-mim = gf_mesh_im(mesh, elements_degree^2);
+mim = gf_mesh_im(mesh, elements_degree*2);
 -- 
---
 **Matlab** .. code-block:: matlab
 
@@ -468,7 +468,7 @@ The last thing to define is an integration method `mim`. 
There is no default int
 gf_mesh_fem_set(mft, 'classical fem', elements_degree);
 mfvm = gf_mesh_fem(mesh, 1);
 gf_mesh_fem_set(mfvm, 'classical discontinuous fem', 
elements_degree-1);
-mim = gf_mesh_im(mesh, elements_degree^2);
+mim = gf_mesh_im(mesh, elements_degree*2);
 == 
===
 
 
diff --git 
a/interface/src/scilab/demos/demo_thermo_elasticity_electrical_coupling.sce 
b/interface/src/scilab/demos/demo_thermo_elasticity_electrical_coupling.sce
index 0cffdc7..e182250 100644
--- a/interface/src/scilab/demos/demo_thermo_elasticity_electrical_coupling.sce
+++ b/interface/src/scilab/demos/demo_thermo_elasticity_electrical_coupling.sce
@@ -142,7 +142,7 @@ mft = gf_mesh_fem(mesh, 1); // Finite element for the 
temperature and the electr
 gf_mesh_fem_set(mft, 'classical fem', elements_degree);
 mfvm = gf_mesh_fem(mesh, 1); // Finite element for Von Mises stress 
interpolation
 gf_mesh_fem_set(mfvm, 'classical discontinuous fem', elements_degree-1);
-mim = gf_mesh_im(mesh, elements_degree^2);   // Integration method
+mim = gf_mesh_im(mesh, elements_degree*2);   // Integration method
 
 
 //
diff --git 
a/interface/tests/matlab/demo_thermo_elasticity_electrical_coupling.m 
b/interface/tests/matlab/demo_thermo_elasticity_electrical_coupling.m
index b4fd158..66640c9 100644
--- a/interface/tests/matlab/demo_thermo_elasticity_electrical_coupling.m
+++ b/interface/tests/matlab/demo_thermo_elasticity_electrical_coupling.m
@@ -129,7 +129,7 @@ mft = gf_mesh_fem(mesh, 1); % Finite element for the 
temperature and the electri
 gf_mesh_fem_set(mft, 'classical fem', elements_degree);
 mfvm = gf_mesh_fem(mesh, 1); % Finite element for Von Mises stress 
interpolation
 gf_mesh_fem_set(mfvm, 'classical discontinuous fem', elements_degree-1);
-mim = gf_mesh_im(mesh, elements_degree^2);   % Integration method
+mim = gf_mesh_im(mesh, elements_degree*2);   % Integration method
 
 
 %
diff --git 
a/interface/tests/python/demo_thermo_elasticity_electrical_coupling.py