[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5035 - in /trunk/getfem: interface/tests/matlab/demo_N
From: |
logari81 |
Subject: |
[Getfem-commits] r5035 - in /trunk/getfem: interface/tests/matlab/demo_Nitsche_contact_by_hand.m src/getfem_contact_and_friction_nodal.cc |
Date: |
Thu, 11 Jun 2015 12:39:27 -0000 |
Author: logari81
Date: Thu Jun 11 14:39:25 2015
New Revision: 5035
URL: http://svn.gna.org/viewcvs/getfem?rev=5035&view=rev
Log:
fix whitespace and typos
Modified:
trunk/getfem/interface/tests/matlab/demo_Nitsche_contact_by_hand.m
trunk/getfem/src/getfem_contact_and_friction_nodal.cc
Modified: trunk/getfem/interface/tests/matlab/demo_Nitsche_contact_by_hand.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_Nitsche_contact_by_hand.m?rev=5035&r1=5034&r2=5035&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_Nitsche_contact_by_hand.m
(original)
+++ trunk/getfem/interface/tests/matlab/demo_Nitsche_contact_by_hand.m Thu Jun
11 14:39:25 2015
@@ -14,27 +14,27 @@
draw_mesh = true;
ref_sol = 0 % 0 : Reference solution (Von Mises)
- % 1 : Convergence curves in L2 and H1 norms on ??1and
??2.
+ % 1 : Convergence curves in L2 and H1 norms on
Omega_1and Omega_2.
% 2 : Error as fonction of gamma0 for different values
of theta
-% The test case: The numerical tests in two dimensions (resp. three
dimensions) are performed on a domain ?? =]???0.5, 0.5[^2 (resp. ?? =]???0.5,
0.5[^3
-% containing the first body: ??1 , a disk of radius R and center (0,0) (resp.
a sphere of radius 0.25 and center (0,0,0)), and the second: ??2 =]???0.5,
0.5[??]???0.5, ???0.25[
-% (resp. ??2 =]???0.5, 0.5[2 ??]???0.5, 0.25[). The contact surface ??_c1 is
the lower semicircle and ??_c2 is the top surface of ??2 (i.e.??1 = {x ???
?????1 ; x2 <=0} and
-% ??_c2 = {x ??? ?????2 ; x2 = ???0.25}. A Dirichlet condition is prescribed
on the bottom of the rectangle (resp. cuboid).Since no Dirichlet condition is
applied on ??1 the problem is only
+% The test case: The numerical tests in two dimensions (resp. three
dimensions) are performed on a domain Omega =]-0.5, 0.5[^2 (resp. Omega =]-0.5,
0.5[^3
+% containing the first body: Omega_1 , a disk of radius R and center (0,0)
(resp. a sphere of radius 0.25 and center (0,0,0)), and the second: Omega_2
=]-0.5, 0.5[ times ]-0.5, -0.25[
+% (resp. Omega_2 =]-0.5, 0.5[2 times ]-0.5, 0.25[). The contact surface
Gamma_c1 is the lower semicircle and Gamma_c2 is the top surface of Omega_2
(i.e.Gamma_1 = {x in partial Omega_1 ; x2 <=0} and
+% Gamma_c2 = {x in partial Omega_2 ; x2 = -0.25}. A Dirichlet condition is
prescribed on the bottom of the rectangle (resp. cuboid).Since no Dirichlet
condition is applied on Omega_1 the problem is only
% semi-coercive,so we apply a penalisation on it and to overcome the
non-definiteness coming from the free rigid motions, the horizontal
displacement is prescribed to be zero on the two points of coordinates (0,0) and
-% (0,0.1) which blocks the horizontal translation and the rigid rotation.The
projector ??1 is defined from ??1 to ??2 in the vertical direction. All
remaining parts of the boundaries are
-% considered traction free. The Lame coefficients are ?? and ?? and we apply a
vertical volume density of force on ??1.
+% (0,0.1) which blocks the horizontal translation and the rigid rotation.The
projector PI_1 is defined from Gamma_1 to Gamma_2 in the vertical direction.
All remaining parts of the boundaries are
+% considered traction free. The Lame coefficients are lambda and mu and we
apply a vertical volume density of force on Omega_1.
N = 2 % 2 or 3 dimensions
-R=0.25; % Radiaus of ??1.
+R=0.25; % Radiaus of Omega_1.
dirichlet_val = 0; % Dirchelet condition.
f_coeff=0; % friction coefficient.
-clambda = 1; % Lame coefficient ??.
-cmu = 1; % Lame coefficient ??.
-vertical_force = -0.1; % Verticvertical volume density of force on ??1.
-penalty_parameter = 1E-7; % penalisation parmeter on ??1.
-elments_degre = 2 % degre of elments (1 or 2).
+clambda = 1; % Lame coefficient lambda.
+cmu = 1; % Lame coefficient mu.
+vertical_force = -0.1; % Vertical volume density of force on Omega_1.
+penalty_parameter = 1E-7; % penalisation parmeter on Omega_1.
+elements_degree = 2 % degre of elments (1 or 2).
if (ref_sol == 0)
Theta = [-1]; % theta
@@ -66,26 +66,26 @@
%mesh constuction
if (N==2)
- mo1 = gf_mesher_object('ball',[0 0],R); % ??1
+ mo1 = gf_mesher_object('ball',[0 0],R); % Omega_1
mesh1 = gf_mesh('generate', mo1, 1/NX ,4) ;
- mo2=gf_mesher_object('rectangle', [-0.5 -0.5], [0.5 -0.25]); % ??2
+ mo2=gf_mesher_object('rectangle', [-0.5 -0.5], [0.5 -0.25]); % Omega_2
mesh2 = gf_mesh('generate', mo2, 1/NX ,2) ;
elseif (N==3)
- mo1 = gf_mesher_object('ball',[0 0 0],R); % ??1
+ mo1 = gf_mesher_object('ball',[0 0 0],R); % Omega_1
mesh1 = gf_mesh('generate', mo1, 1/NX ,2) ;
- mo2=gf_mesher_object('rectangle', [-0.5 -0.5 -0.5], [0.5 0.5 -0.25]);
% ??2
+ mo2=gf_mesher_object('rectangle', [-0.5 -0.5 -0.5], [0.5 0.5 -0.25]);
% Omega_2
mesh2 = gf_mesh('generate', mo2, 1/NX ,2) ;
end
- mfu1 = gf_mesh_fem(mesh1, N) ;gf_mesh_fem_set(mfu1, 'classical fem',
elments_degre);
- mflambda1 = gf_mesh_fem(mesh1, 1); gf_mesh_fem_set(mflambda1, 'classical
fem', elments_degre);
-
- mfvm1 = gf_mesh_fem(mesh1); gf_mesh_fem_set(mfvm1, 'classical
discontinuous fem', elments_degre);
-
- mfu2 = gf_mesh_fem(mesh2, N); gf_mesh_fem_set(mfu2, 'classical fem',
elments_degre);
-
- mfvm2 = gf_mesh_fem(mesh2); gf_mesh_fem_set(mfvm2, 'classical
discontinuous fem', elments_degre);
+ mfu1 = gf_mesh_fem(mesh1, N) ;gf_mesh_fem_set(mfu1, 'classical fem',
elements_degree);
+ mflambda1 = gf_mesh_fem(mesh1, 1); gf_mesh_fem_set(mflambda1, 'classical
fem', elements_degree);
+
+ mfvm1 = gf_mesh_fem(mesh1); gf_mesh_fem_set(mfvm1, 'classical
discontinuous fem', elements_degree);
+
+ mfu2 = gf_mesh_fem(mesh2, N); gf_mesh_fem_set(mfu2, 'classical fem',
elements_degree);
+
+ mfvm2 = gf_mesh_fem(mesh2); gf_mesh_fem_set(mfvm2, 'classical
discontinuous fem', elements_degree);
mim1 = gf_mesh_im(mesh1, 4);
mim1_contact = gf_mesh_im(mesh1, 6);
@@ -281,8 +281,8 @@
mfu_ref2 = gf_mesh_fem('load', 'sol_ref_mesh_fem2',mesh_ref2);
N =gf_mesh_get(mesh_ref2,'dim');
- %mfu_ref1 = gf_mesh_fem(mesh_ref1, N); gf_mesh_fem_set(mfu_ref1,
'classical fem', elments_degre);
- %mfu_ref2 = gf_mesh_fem(mesh_ref2, N);gf_mesh_fem_set(mfu_ref2,
'classical fem', elments_degre);
+ %mfu_ref1 = gf_mesh_fem(mesh_ref1, N); gf_mesh_fem_set(mfu_ref1,
'classical fem', elements_degree);
+ %mfu_ref2 = gf_mesh_fem(mesh_ref2, N);gf_mesh_fem_set(mfu_ref2,
'classical fem', elements_degree);
mim_ref1 = gf_mesh_im(mesh_ref1, 4);
mim_ref2 = gf_mesh_im(mesh_ref2, 4);
Modified: trunk/getfem/src/getfem_contact_and_friction_nodal.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_contact_and_friction_nodal.cc?rev=5035&r1=5034&r2=5035&view=diff
==============================================================================
--- trunk/getfem/src/getfem_contact_and_friction_nodal.cc (original)
+++ trunk/getfem/src/getfem_contact_and_friction_nodal.cc Thu Jun 11
14:39:25 2015
@@ -1,9 +1,9 @@
/*===========================================================================
-
+
Copyright (C) 2004-2012 Yves Renard, Konstantinos Poulios.
-
+
This file is a part of GETFEM++
-
+
Getfem++ is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation; either version 3 of the License, or
@@ -16,7 +16,7 @@
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
-
+
===========================================================================*/
@@ -774,7 +774,7 @@
gmm::mat_nrows(T_t_u1));
model_real_sparse_matrix tmp4(gmm::mat_ncols(T_t_u2),
gmm::mat_nrows(T_t_u2));
-
+
for (size_type i=0; i < nbc; ++i) {
gmm::sub_interval SUBI(i*d, d);
scalar_type th = - (std::min(vt0, RLN[i])) * friction_coeff[i];
@@ -794,7 +794,7 @@
if (two_variables)
gmm::add(gmm::scaled(gmm::mat_row(BT2,i*d+k),
vg[k]*friction_coeff[i]), gmm::mat_col(T_u2_n, i));
-
+
gmm::copy(gmm::scaled(gmm::mat_row(BBT1,i*d+k),
-r*friction_coeff[i]*vg[k]),
gmm::mat_col(tmp5, i*d+k));
@@ -815,7 +815,7 @@
gmm::add(gmm::transposed(tmp3), T_t_u1);
if (two_variables)
gmm::add(gmm::transposed(tmp4), T_t_u2);
-
+
if (augmentation_version == 2) {
model_real_sparse_matrix tmp1(gmm::mat_ncols(BN1),
gmm::mat_ncols(BN1));
@@ -975,7 +975,7 @@
}
for (size_type i = 0; i < nbc; ++i) {
rlambda_n[i] = (lambda_n[i] - RLN[i]) / (r * alpha[i]);
- if (!contact_only)
+ if (!contact_only)
for (size_type k = 0; k < d; ++k)
rlambda_t[i*d+k]
= (lambda_t[i*d+k] - RLT[i*d+k]) / (r * alpha[i]);
@@ -999,7 +999,7 @@
}
for (size_type i = 0; i < nbc; ++i) {
rlambda_n[i] = (lambda_n[i] - RLN[i]) / (r * alpha[i]);
- if (!contact_only)
+ if (!contact_only)
for (size_type k = 0; k < d; ++k)
rlambda_t[i*d+k]
= (lambda_t[i*d+k] - RLT[i*d+k]) / (r * alpha[i]);
@@ -1032,7 +1032,7 @@
}
for (size_type i = 0; i < nbc; ++i) {
rlambda_n[i] /= alpha[i];
- if (!contact_only)
+ if (!contact_only)
for (size_type k = 0; k < d; ++k) rlambda_t[i*d+k] /= alpha[i];
}
break;
@@ -1066,7 +1066,7 @@
if (two_variables) gmm::mult_add(BBN2, u2, rlambda_n);
for (size_type i = 0; i < nbc; ++i) {
rlambda_n[i] /= alpha[i];
- if (!contact_only)
+ if (!contact_only)
for (size_type k = 0; k < d; ++k) rlambda_t[i*d+k] /= alpha[i];
}
break;
@@ -1474,7 +1474,7 @@
getfem::ga_workspace gw;
getfem::ga_function f(gw, obstacle);
-
+
size_type N = d+1;
getfem::model_real_plain_vector pt(N);
gw.add_fixed_size_constant("X", pt);
@@ -1482,7 +1482,7 @@
if (N >= 2) gw.add_macro("y", "X(2)");
if (N >= 3) gw.add_macro("z", "X(3)");
if (N >= 4) gw.add_macro("w", "X(4)");
-
+
f.compile();
gmm::resize(gap, nbc);
@@ -1501,7 +1501,7 @@
// Computation of gap
gap[j] = (f.eval())[0];
-
+
// computation of BN
size_type cv = mf_u1.first_convex_of_basic_dof(id);
scalar_type eps
@@ -1513,15 +1513,15 @@
}
// unit normal vector
base_node un = - grad / gmm::vect_norm2(grad);
-
+
for (size_type k = 0; k <= d; ++k)
BN1(j, id + k) = un[k];
-
+
// computation of BT
if (!contact_only) {
-
+
orthonormal_basis_to_unit_vec(d, un, ut);
-
+
for (size_type k = 0; k <= d; ++k)
for (size_type nn = 0; nn < d; ++nn)
BT1(j*d+nn, id + k) = ut[nn][k];
@@ -1838,7 +1838,7 @@
multname_n = md.new_name("contact_multiplier");
else
GMM_ASSERT1(multname_n.compare(md.new_name(multname_n)) == 0,
- "The given name for the multiplier is alraedy reserved in
the model");
+ "The given name for the multiplier is already reserved in
the model");
md.add_fixed_size_variable(multname_n, nbc);
model::termlist tl;
@@ -1909,13 +1909,13 @@
multname_n = md.new_name("contact_normal_multiplier");
else
GMM_ASSERT1(multname_n.compare(md.new_name(multname_n)) == 0,
- "The given name for the multiplier is alraedy reserved in
the model");
+ "The given name for the multiplier is already reserved in
the model");
md.add_fixed_size_variable(multname_n, nbc);
if (multname_t.size() == 0)
multname_t = md.new_name("contact_tangent_multiplier");
else
GMM_ASSERT1(multname_t.compare(md.new_name(multname_t)) == 0,
- "The given name for the multiplier is alraedy reserved in
the model");
+ "The given name for the multiplier is already reserved in
the model");
md.add_fixed_size_variable(multname_t, nbc * (mf_u1.get_qdim() - 1) ); //
??
model::termlist tl;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5035 - in /trunk/getfem: interface/tests/matlab/demo_Nitsche_contact_by_hand.m src/getfem_contact_and_friction_nodal.cc,
logari81 <=