[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r4568 - in /trunk/getfem: doc/sphinx/source/userdoc/ in
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r4568 - in /trunk/getfem: doc/sphinx/source/userdoc/ interface/src/ interface/tests/matlab/ src/getfem/ |
Date: |
Sat, 29 Mar 2014 20:12:58 -0000 |
Author: renard
Date: Sat Mar 29 21:12:57 2014
New Revision: 4568
URL: http://svn.gna.org/viewcvs/getfem?rev=4568&view=rev
Log:
adding a new incompressibility brick
Modified:
trunk/getfem/doc/sphinx/source/userdoc/model_nonlinear_elasticity.rst
trunk/getfem/interface/src/gf_model_set.cc
trunk/getfem/interface/tests/matlab/demo_nonlinear_elasticity.m
trunk/getfem/src/getfem/getfem_nonlinear_elasticity.h
Modified: trunk/getfem/doc/sphinx/source/userdoc/model_nonlinear_elasticity.rst
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/doc/sphinx/source/userdoc/model_nonlinear_elasticity.rst?rev=4568&r1=4567&r2=4568&view=diff
==============================================================================
--- trunk/getfem/doc/sphinx/source/userdoc/model_nonlinear_elasticity.rst
(original)
+++ trunk/getfem/doc/sphinx/source/userdoc/model_nonlinear_elasticity.rst
Sat Mar 29 21:12:57 2014
@@ -339,7 +339,15 @@
(md, mim, varname, multname, region = -1)
-
-
where ``md`` is the model, ``mim`` the integration method, ``varname`` the
variable of the model on which the incompressibility condition is added,
``multanme`` the multiplier variable corresponding to the pressure (be aware
that at least a linear Ladyzhenskaja-Babuska-Brezzi inf-sup condition is
satisfied between the f.e.m. of the variable and the one of the multiplier).
``region`` is an optional parameter correponding to the mesh region on which
the term is considered (by default, all the mesh).
+
+High-level generic assembly versions
+++++++++++++++++++++++++++++++++++++
+
+For incompressibility ::
+
+ ind = add_finite_strain_incompressibility_brick
+ (md, mim, varname, multname, region = -1);
+
+In fact this brick just add the term ``p*(1-Det(Id(meshdim)+Grad_u))`` if
``p`` is the multiplier and ``u`` the variable which represent the displacement.
Modified: trunk/getfem/interface/src/gf_model_set.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/src/gf_model_set.cc?rev=4568&r1=4567&r2=4568&view=diff
==============================================================================
--- trunk/getfem/interface/src/gf_model_set.cc (original)
+++ trunk/getfem/interface/src/gf_model_set.cc Sat Mar 29 21:12:57 2014
@@ -1554,6 +1554,32 @@
);
+ /address@hidden ind = ('add finite strain incompressibility brick', @tmim
mim, @str varname, @str multname_pressure[, @int region])
+ Add an finite strain incompressibility condition on `variable` (for large
+ strain elasticity). `multname_pressure`
+ is a variable which represent the pressure. Be aware that an inf-sup
+ condition between the finite element method describing the pressure and the
+ primal variable has to be satisfied. `region` is an optional mesh region on
+ which the term is added. If it is not specified, it is added on the
+ whole mesh. Return the brick index in the model.
+ This brick is equivalent to the ``nonlinear incompressibility brick`` but
+ uses the high-level generic assembly adding the term
+ ``p*(1-Det(Id(meshdim)+Grad_u))`` if ``p`` is the multiplier and
+ ``u`` the variable which represent the address@hidden/
+ sub_command
+ ("add finite strain incompressibility brick", 3, 4, 0, 1,
+ getfemint_mesh_im *gfi_mim = in.pop().to_getfemint_mesh_im();
+ std::string varname = in.pop().to_string();
+ std::string multname = in.pop().to_string();
+ size_type region = size_type(-1);
+ if (in.remaining()) region = in.pop().to_integer();
+ size_type ind
+ = getfem::add_finite_strain_incompressibility_brick
+ (md->model(), gfi_mim->mesh_im(), varname, multname, region)
+ + config::base_index();
+ workspace().set_dependance(md, gfi_mim);
+ out.pop().from_integer(int(ind));
+ );
/address@hidden ind = ('add bilaplacian brick', @tmim mim, @str varname,
@str dataname [, @int region])
Add a bilaplacian brick on the variable
Modified: trunk/getfem/interface/tests/matlab/demo_nonlinear_elasticity.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_nonlinear_elasticity.m?rev=4568&r1=4567&r2=4568&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_nonlinear_elasticity.m
(original)
+++ trunk/getfem/interface/tests/matlab/demo_nonlinear_elasticity.m Sat Mar
29 21:12:57 2014
@@ -95,15 +95,15 @@
%
'((Id(meshdim)+Grad_u)*(Trace(Green_Lagrangian(Id(meshdim)+Grad_u))*Id(meshdim)+2*Green_Lagrangian(Id(meshdim)+Grad_u))):Grad_Test_u');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
% 'Grad_u:Grad_Test_u');
-gf_model_set(md, 'add nonlinear generic assembly brick', mim,
'Saint_Venant_Kirchhoff_potential(Grad_u,params)');
+% gf_model_set(md, 'add nonlinear generic assembly brick', mim,
'Saint_Venant_Kirchhoff_potential(Grad_u,params)');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
%
'((Id(meshdim)+Grad_u)*(Ciarlet_Geymonat_sigma(Grad_u,params))):Grad_Test_u');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
% 'Ciarlet_Geymonat_potential(Grad_u,params)');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
%
'((Id(meshdim)+Grad_u)*(Incompressible_Mooney_Rivlin_sigma(Grad_u,params))):Grad_Test_u');
-% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
-% 'Incompressible_Mooney_Rivlin_potential(Grad_u,params)');
+gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
+ 'Incompressible_Mooney_Rivlin_potential(Grad_u,params)');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
%
'((Id(meshdim)+Grad_u)*(Saint_Venant_Kirchhoff_sigma(Grad_u,params))):Grad_Test_u');
@@ -113,8 +113,9 @@
gf_mesh_fem_set(mfp, 'classical discontinuous fem', 1);
gf_model_set(md, 'add fem variable', 'p', mfp);
% gf_model_set(md, 'add nonlinear incompressibility brick', mim, 'u', 'p');
- gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
- 'p*(1-Det(Id(meshdim)+Grad_u))');
+ gf_model_set(md, 'add finite strain incompressibility brick', mim, 'u',
'p');
+ % gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
+ % 'p*(1-Det(Id(meshdim)+Grad_u))');
% gf_model_set(md, 'add nonlinear generic assembly brick', mim, ...
%
'-p*Det(Id(meshdim)+Grad_u)*(Inv(Id(meshdim)+Grad_u))'':Grad_Test_u +
Test_p*(1-Det(Id(meshdim)+Grad_u))');
end
Modified: trunk/getfem/src/getfem/getfem_nonlinear_elasticity.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_nonlinear_elasticity.h?rev=4568&r1=4567&r2=4568&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_nonlinear_elasticity.h (original)
+++ trunk/getfem/src/getfem/getfem_nonlinear_elasticity.h Sat Mar 29
21:12:57 2014
@@ -633,7 +633,20 @@
(model &md, const mesh_im &mim, const std::string &varname,
const std::string &multname, size_type region = size_type(-1));
-
+ /** Add a finite strain incompressibility term (for large strain elasticity)
+ to the model with respect to the variable
+ `varname` (the displacement) and `multname` (the pressure).
+ High-level generic assembly version.
+ */
+ inline size_type add_finite_strain_incompressibility_brick
+ (model &md, const mesh_im &mim, const std::string &varname,
+ const std::string &multname, size_type region = size_type(-1)) {
+ std::string expr = "(" + multname + ")*(1-Det(Id(meshdim)+Grad_"
+ + varname + "))";
+ return add_nonlinear_generic_assembly_brick
+ (md, mim, expr, region, true, false,
+ "Finite strain incompressibility brick");
+ }
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r4568 - in /trunk/getfem: doc/sphinx/source/userdoc/ interface/src/ interface/tests/matlab/ src/getfem/,
Yves . Renard <=