[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5195 - in /trunk/getfem: interface/tests/matlab/demo_d
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r5195 - in /trunk/getfem: interface/tests/matlab/demo_dynamic_contact.m src/getfem_contact_and_friction_common.cc |
Date: |
Thu, 17 Dec 2015 08:54:42 -0000 |
Author: renard
Date: Thu Dec 17 09:54:41 2015
New Revision: 5195
URL: http://svn.gna.org/viewcvs/getfem?rev=5195&view=rev
Log:
bug fix
Modified:
trunk/getfem/interface/tests/matlab/demo_dynamic_contact.m
trunk/getfem/src/getfem_contact_and_friction_common.cc
Modified: trunk/getfem/interface/tests/matlab/demo_dynamic_contact.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_dynamic_contact.m?rev=5195&r1=5194&r2=5195&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_dynamic_contact.m (original)
+++ trunk/getfem/interface/tests/matlab/demo_dynamic_contact.m Thu Dec 17
09:54:41 2015
@@ -83,7 +83,7 @@
theta = 1.0; % Theta-method scheme coefficient
dirichlet = 0; % Dirichlet condition or not
dirichlet_val = 0.45;
- scheme = 1; % 1 = theta-method, 2 = Newmark, 3 = Newmark with
beta = 0, 4 = midpoint modified (Experimental: compile GetFEM with
--enable-experimental)
+ scheme = 4; % 1 = theta-method, 2 = Newmark, 3 = Newmark with
beta = 0, 4 = midpoint modified (Experimental: compile GetFEM with
--enable-experimental)
u_degree = 2;
v_degree = 1;
lambda_degree = 1;
@@ -193,6 +193,7 @@
gf_model_set(md, 'add initialized data', 'clambda', [clambda]);
gf_model_set(md, 'add isotropic linearized elasticity brick', mim, 'u', ...
'clambda', 'cmu');
+
if (singular_mass == 2)
gf_model_set(md, 'add fem variable', 'v', mfv);
switch(scheme)
@@ -230,7 +231,7 @@
if (Nitsche)
gf_model_set(md, 'add initialized data', 'gamma0', [gamma0_N]);
- expr_Neumann = gf_model_get(md, 'Neumann term', 'u', GAMMAC);
+ expr_Neumann = gf_model_get(md, 'Neumann term', 'u', GAMMAC)
if (scheme == 4)
if (friction ~= 0)
error('To be adapted for friction');
@@ -240,9 +241,10 @@
gf_model_set(md, 'add fem data', 'wt', mfu);
% Very experimental brick : compile GetFEM with the option
--enable-experimental
- expr_Neumann_wt = '((clambda*Div_wt)*Normal +
(cmu*(Grad_wt+(Grad_wt'')))*Normal)'
+ expr_Neumann_wt = '((clambda*Div_wt)*Normal +
(cmu*(Grad_wt+(Grad_wt'')))*Normal)';
gf_model_set(md, 'add Nitsche midpoint contact with rigid obstacle
brick', mim_friction, 'u', ...
expr_Neumann, expr_Neumann_wt, 'obstacle', 'gamma0', GAMMAC, theta_N,
'friction_coeff', 'alpha_f', 'wt');
+
else
if (friction == 0)
gf_model_set(md, 'add Nitsche contact with rigid obstacle brick',
mim_friction, 'u', ...
Modified: trunk/getfem/src/getfem_contact_and_friction_common.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_common.cc?rev=5195&r1=5194&r2=5195&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_common.cc (original)
+++ trunk/getfem/src/getfem_contact_and_friction_common.cc Thu Dec 17
09:54:41 2015
@@ -2199,11 +2199,12 @@
// Coulomb_friction_coupled_projection(lambda, n, Vs, g, f, r)
struct Coulomb_friction_coupled_projection : public ga_nonlinear_operator {
bool result_size(const arg_list &args, bgeot::multi_index &sizes) const {
- if (args.size() != 6 || args[1]->size() != args[0]->size()
- || args[2]->size() != args[0]->size()
- || args[3]->size() != 1 || args[4]->size() > 3 || args[4]->size() == 0
- || args[5]->size() != 1 ) return false;
- ga_init_vector(sizes, args[0]->sizes()[0]);
+ if (args.size() != 6) return false;
+ size_type N = args[0]->size();
+ if (N == 0 || args[1]->size() != N || args[2]->size() != N
+ || args[3]->size() != 1 || args[4]->size() > 3
+ || args[4]->size() == 0 || args[5]->size() != 1 ) return false;
+ ga_init_vector(sizes, N);
return true;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5195 - in /trunk/getfem: interface/tests/matlab/demo_dynamic_contact.m src/getfem_contact_and_friction_common.cc,
Yves . Renard <=