[Getfem-commits] [getfem-commits] branch master updated: Enable accessing parallel MUMPS in the scripting API linsolve function

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 3f88b0cb Enable accessing parallel MUMPS in the scripting API linsolve 
function
3f88b0cb is described below

commit 3f88b0cbaf33dc600183b70dd5f69107e383627e
Author: Konstantinos Poulios 
AuthorDate: Sun Apr 28 10:37:44 2024 +0200

Enable accessing parallel MUMPS in the scripting API linsolve function
---
 interface/src/gf_linsolve.cc | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/interface/src/gf_linsolve.cc b/interface/src/gf_linsolve.cc
index d3f7da65..5e07e7ca 100644
--- a/interface/src/gf_linsolve.cc
+++ b/interface/src/gf_linsolve.cc
@@ -106,7 +106,13 @@ mumps_solver(gsparse ,
   garray b = in.pop().to_garray(int(gsp.nrows()), T());
   garray x = out.pop().create_array(b.getm(), b.getn(), T());
   gsp.to_csc();
-  gmm::MUMPS_solve(gsp.csc(T()),x,b);
+# if GETFEM_PARA_LEVEL > 1
+  double t_ref = MPI_Wtime();
+  gmm::MUMPS_distributed_matrix_solve(gsp.csc(T()), x, b);
+  if (getfem::MPI_IS_MASTER()) cout << "MUMPS solve time " << 
MPI_Wtime()-t_ref << endl;
+# else
+  gmm::MUMPS_solve(gsp.csc(T()), x, b);
+# endif
 }
 #endif
 



[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: Whitespace and typos

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 98f393a0 Whitespace and typos
98f393a0 is described below

commit 98f393a0e635ac66ccb81ff7db0543b64cc13b0e
Author: Konstantinos Poulios 
AuthorDate: Sun Apr 28 10:33:41 2024 +0200

Whitespace and typos
---
 contrib/xfem_contact/xfem_dirichlet.cc | 761 -
 src/getfem/getfem_mesh_region.h|   4 +-
 src/gmm/gmm_MUMPS_interface.h  |  32 +-
 3 files changed, 396 insertions(+), 401 deletions(-)

diff --git a/contrib/xfem_contact/xfem_dirichlet.cc 
b/contrib/xfem_contact/xfem_dirichlet.cc
index dc792d51..740d4fdc 100644
--- a/contrib/xfem_contact/xfem_dirichlet.cc
+++ b/contrib/xfem_contact/xfem_dirichlet.cc
@@ -73,8 +73,8 @@ typedef getfem::modeling_standard_plain_vector  plain_vector;
 
 typedef gmm::row_matrix sparse_row_matrix;
 
-/* 
- * Exact solution 
+/*
+ * Exact solution
  */
 double Radius;
 int u_version;
@@ -89,7 +89,7 @@ double u_exact(const base_node ) {
   switch (u_version) {
   case 0: {
 double sum = std::accumulate(p.begin(), p.end(), double(0));
-
+
 return 5.0 * sin(sum) * (r*r - Radius*Radius);
   }
   case 1: {
@@ -98,11 +98,11 @@ double u_exact(const base_node ) {
   }
   case 2: {
 double A=u_alpha, n=u_n, B=u_B;
-return (R*R - r*r *(1+A*(1.0 + sin(n*T * cos(B*r);  
+return (R*R - r*r *(1+A*(1.0 + sin(n*T * cos(B*r);
   }
   case 3: {
 double A=u_alpha, n=u_n;
-return 5*(R*R*R*R - r*r*r*r*(1+A*(1.0 + sin(n*T;  
+return 5*(R*R*R*R - r*r*r*r*(1+A*(1.0 + sin(n*T;
   }
   case 4:{
 return 5.0 * (r*r*r - Radius*Radius*Radius);
@@ -114,17 +114,17 @@ double u_exact(const base_node ) {
   }
   case 6:{
 double sum = std::accumulate(p.begin(), p.end(), double(0));
-
+
 return 5.0 * sin(sum) * (r*r*r - Radius*Radius*Radius);
   }
   case 7:{
 double sum = std::accumulate(p.begin(), p.end(), double(0));
-
+
 return 5.0 * sin(sum) * (r*r*r*r - Radius*Radius*Radius*Radius);
   }
   case 8:{
-double rho=gmm::sqrt(p[0]*p[0]+ p[1]*p[1]+ p[2]*p[2]); 
-
+double rho=gmm::sqrt(p[0]*p[0]+ p[1]*p[1]+ p[2]*p[2]);
+
 return 5.0 * ( Radius*Radius* Radius-rho*rho*rho);
   }
   }
@@ -140,33 +140,33 @@ double g_exact(const base_node ) {
 double sum=std::accumulate(p.begin(), p.end(), double(0)), norm_sqr = r*r;
 if (norm_sqr < 1e-10) norm_sqr = 1e-10;
 return 5.0 * (sum * cos(sum) * (norm_sqr - R*R)
- + 2.0 * norm_sqr * sin(sum)) / sqrt(norm_sqr);
+  + 2.0 * norm_sqr * sin(sum)) / sqrt(norm_sqr);
   }
   case 1: {
 double A=u_alpha, T=atan2(p[1], p[0])+dtheta, n=u_n;
 return - 
sqrt(r*r*pow(2.0*sin(T)+2.0*sin(T)*A+2.0*sin(T)*A*sin(n*T)+cos(T)*A*cos(n*T)*n,2.0)+r*r*pow(-2.0*cos(T)-2.0*cos(T)*A-2.0*cos(T)*A*sin(n*T)+sin(T)*A*cos(n*T)*n,2.0));
-  } 
+  }
   case 2: {
 double A=u_alpha, T=atan2(p[1], p[0])+dtheta, n=u_n,B=u_B;
 if (gmm::abs(r) < 1e-10) r = 1e-10;
 return -(4.0*r*cos(B*r)+8.0*r*cos(B*r)*A+8.0*r*cos(B*r)*A*A
-+2.0*sin(B*r)*B*R*R-2.0*sin(B*r)*B*r*r
-+r*A*A*pow(cos(n*T),2.0)*n*n*cos(B*r)+8.0*r*cos(B*r)*A*A*sin(n*T)
--4.0*sin(B*r)*B*r*r*A*sin(n*T)
-+2.0*sin(B*r)*B*r*r*A*A*pow(cos(n*T),2.0)
--4.0*r*cos(B*r)*A*A*pow(cos(n*T),2.0)+8.0*r*cos(B*r)*A*sin(n*T)
--4.0*sin(B*r)*B*r*r*A*A*sin(n*T)-4.0*sin(B*r)*B*r*r*A*A
--4.0*sin(B*r)*B*r*r*A+2.0*sin(B*r)*B*R*R*A
-+2.0*sin(B*r)*B*R*R*A*sin(n*T))
+ +2.0*sin(B*r)*B*R*R-2.0*sin(B*r)*B*r*r
+ +r*A*A*pow(cos(n*T),2.0)*n*n*cos(B*r)+8.0*r*cos(B*r)*A*A*sin(n*T)
+ -4.0*sin(B*r)*B*r*r*A*sin(n*T)
+ +2.0*sin(B*r)*B*r*r*A*A*pow(cos(n*T),2.0)
+ -4.0*r*cos(B*r)*A*A*pow(cos(n*T),2.0)+8.0*r*cos(B*r)*A*sin(n*T)
+ -4.0*sin(B*r)*B*r*r*A*A*sin(n*T)-4.0*sin(B*r)*B*r*r*A*A
+ -4.0*sin(B*r)*B*r*r*A+2.0*sin(B*r)*B*R*R*A
+ +2.0*sin(B*r)*B*R*R*A*sin(n*T))
   / sqrt(A*A*pow(cos(n*T),2.0)*n*n +4.0+8.0*A+8.0*A*sin(n*T)
-+8.0*A*A+8.0*A*A*sin(n*T)-4.0*A*A*pow(cos(n*T),2.0));
+ +8.0*A*A+8.0*A*A*sin(n*T)-4.0*A*A*pow(cos(n*T),2.0));
   }
   case 3: {
 double A=u_alpha, T=atan2(p[1], p[0])+dtheta, n=u_n;
 return -5*r*r*r*sqrt(16.0 + 32.0*A*A + 32.0*A*sin(n*T) + 32.0*A
-+ 32.0*A*A*sin(n*T) - 16*gmm::sqr(A*cos(n*T))
-+ gmm::sqr(A*cos(n*T)*n));
-  }   
+ + 32.0*A*A*sin(n*T) - 16*gmm::sqr(A*cos(n*T))
+ + gmm::sqr(A*cos(n*T)*n));
+  }
   case 4: {
 r=gmm::vect_norm2(p);
 return 15*r*r;
@@ -175,20 +175,20 @@ double g_exact(const base_node ) {
 double a = sol5_a, b = sol5_b;
 double T = atan2(p[1], p[0]);
 return 5.0*r*sqrt(