[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Getfem-commits] r5082 - in /trunk/getfem: interface/tests/matlab/ src/
From: |
Yves . Renard |
Subject: |
[Getfem-commits] r5082 - in /trunk/getfem: interface/tests/matlab/ src/ src/getfem/ |
Date: |
Sat, 05 Sep 2015 14:33:04 -0000 |
Author: renard
Date: Sat Sep 5 16:33:03 2015
New Revision: 5082
URL: http://svn.gna.org/viewcvs/getfem?rev=5082&view=rev
Log:
minor corrections
Modified:
trunk/getfem/interface/tests/matlab/demo_crack.m
trunk/getfem/src/getfem/getfem_mesh_im.h
trunk/getfem/src/getfem_mesh_im.cc
trunk/getfem/src/getfem_models.cc
Modified: trunk/getfem/interface/tests/matlab/demo_crack.m
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/interface/tests/matlab/demo_crack.m?rev=5082&r1=5081&r2=5082&view=diff
==============================================================================
--- trunk/getfem/interface/tests/matlab/demo_crack.m (original)
+++ trunk/getfem/interface/tests/matlab/demo_crack.m Sat Sep 5 16:33:03 2015
@@ -25,8 +25,13 @@
variant = 4;
% variant : 1 : a single crack with cutoff enrichement
% 2 : a single crack with a fixed size area Xfem enrichment
-% 3 : a branching crack with a fixed size area Xfem enrichment
+% 3 : a suppl?mentary crossing crack with a fixed size area
+% Xfem enrichment
% 4 : variant 3 with the second crack closed by a penalisation of
+% the jump (exemple of use of xfem_plus and xfem_minus).
+% 5 : variant 3 with the first crack closed by a penalisation of
+% the jump (exemple of use of xfem_plus and xfem_minus).
+% 6 : variant 3 with the two cracks closed by a penalisation of
% the jump (exemple of use of xfem_plus and xfem_minus).
@@ -106,7 +111,7 @@
% Exact solution for a single crack
mf_ue = gf_mesh_fem('global function',m,ls,{ck0,ck1,ck2,ck3});
A = 2+2*Mu/(Lambda+2*Mu);
-B=-2*(Lambda+Mu)/(Lambda+2*Mu)
+B = -2*(Lambda+Mu)/(Lambda+2*Mu);
Ue = zeros(2,4);
Ue(1,1) = 0; Ue(2,1) = A-B; % sin(theta/2)
Ue(1,2) = A+B; Ue(2,2) = 0; % cos(theta/2)
@@ -129,10 +134,15 @@
gf_model_set(md,'add_initialized_fem_data','DirichletData', mf_ue, Ue);
gf_model_set(md,'add_Dirichlet_condition_with_penalization',mim,'u', 1e12,
DIRICHLET, 'DirichletData');
-if (variant == 4)
- mim_bound = gf_mesh_im('levelset', mls, 'boundary(b)',
gf_integ('IM_STRUCTURED_COMPOSITE(IM_TRIANGLE(6),3)'));
- % gf_asm('generic', mim_bound, 0, '1', -1)
- gf_model_set(md, 'add linear generic assembly brick', mim_bound,
'1e15*(Xfem_plus(u)-Xfem_minus(u)).(Xfem_plus(Test_u)-Xfem_minus(Test_u))');
+if (variant == 5 || variant == 6) % Penalisation of the jump over the first
crack
+ mim_bound1 = gf_mesh_im('levelset', mls, 'boundary(a)',
gf_integ('IM_STRUCTURED_COMPOSITE(IM_TRIANGLE(6),3)'));
+ % gf_asm('generic', mim_bound, 0, '1', -1) % length of the crack
+ gf_model_set(md, 'add linear generic assembly brick', mim_bound1,
'1e17*(Xfem_plus(u)-Xfem_minus(u)).(Xfem_plus(Test_u)-Xfem_minus(Test_u))');
+end
+
+if (variant == 4 || variant == 6) % Penalisation of the jump over the second
crack
+ mim_bound2 = gf_mesh_im('levelset', mls, 'boundary(b)',
gf_integ('IM_STRUCTURED_COMPOSITE(IM_TRIANGLE(6),3)'));
+ gf_model_set(md, 'add linear generic assembly brick', mim_bound2,
'1e17*(Xfem_plus(u)-Xfem_minus(u)).(Xfem_plus(Test_u)-Xfem_minus(Test_u))');
end
% assembly of the linear system and solve:
Modified: trunk/getfem/src/getfem/getfem_mesh_im.h
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem/getfem_mesh_im.h?rev=5082&r1=5081&r2=5082&view=diff
==============================================================================
--- trunk/getfem/src/getfem/getfem_mesh_im.h (original)
+++ trunk/getfem/src/getfem/getfem_mesh_im.h Sat Sep 5 16:33:03 2015
@@ -49,6 +49,7 @@
static mesh dummy_mesh;
protected :
+ bool is_lower_dim;
dal::dynamic_array<pintegration_method> ims;
dal::bit_vector im_convexes;
mesh *linked_mesh_;
@@ -71,6 +72,8 @@
*/
inline const dal::bit_vector &convex_index(void) const
{ return im_convexes; }
+
+ bool is_lower_dimensional(void) const { return is_lower_dim; }
/// Give a reference to the linked mesh of type mesh.
mesh &linked_mesh(void) const
Modified: trunk/getfem/src/getfem_mesh_im.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_mesh_im.cc?rev=5082&r1=5081&r2=5082&view=diff
==============================================================================
--- trunk/getfem/src/getfem_mesh_im.cc (original)
+++ trunk/getfem/src/getfem_mesh_im.cc Sat Sep 5 16:33:03 2015
@@ -122,13 +122,14 @@
mesh_im::mesh_im(void) {
linked_mesh_ = 0; auto_add_elt_pim = 0;
+ is_lower_dim = false;
v_num_update = v_num = act_counter();
}
mesh_im::mesh_im(const mesh_im &mim) : context_dependencies() {
GMM_ASSERT1(mim.linked_mesh_ == 0,
"Copy constructor is not allowed for non void mesh_im");
- linked_mesh_ = 0; auto_add_elt_pim = 0;
+ linked_mesh_ = 0; auto_add_elt_pim = 0; is_lower_dim = false;
v_num_update = v_num = act_counter();
}
@@ -139,7 +140,7 @@
}
mesh_im::mesh_im(mesh &me)
- { linked_mesh_ = 0; init_with_mesh(me); }
+ { linked_mesh_ = 0; init_with_mesh(me); is_lower_dim = false; }
mesh_im::~mesh_im() {}
Modified: trunk/getfem/src/getfem_models.cc
URL:
http://svn.gna.org/viewcvs/getfem/trunk/getfem/src/getfem_models.cc?rev=5082&r1=5081&r2=5082&view=diff
==============================================================================
--- trunk/getfem/src/getfem_models.cc (original)
+++ trunk/getfem/src/getfem_models.cc Sat Sep 5 16:33:03 2015
@@ -3266,6 +3266,7 @@
struct gen_linear_assembly_brick : public virtual_brick {
std::string expr;
+ bool is_lower_dim;
model::varnamelist vl_test1, vl_test2;
virtual void asm_real_tangent_terms(const model &md, size_type ib,
@@ -3315,16 +3316,18 @@
virtual std::string declare_volume_assembly_string
(const model &, size_type, const model::varnamelist &,
const model::varnamelist &) const {
- return expr;
- }
-
- gen_linear_assembly_brick(const std::string &expr_, bool is_sym,
+ return is_lower_dim ? std::string() : expr;
+ }
+
+ gen_linear_assembly_brick(const std::string &expr_, const mesh_im &mim,
+ bool is_sym,
bool is_coer, std::string brickname,
const model::varnamelist &vl_test1_,
const model::varnamelist &vl_test2_)
: vl_test1(vl_test1_), vl_test2(vl_test2_) {
if (brickname.size() == 0) brickname = "Generic linear assembly brick";
expr = expr_;
+ is_lower_dim = mim.is_lower_dimensional();
set_flags(brickname, true /* is linear*/,
is_sym /* is symmetric */, is_coer /* is coercive */,
true /* is real */, false /* is complex */);
@@ -3385,7 +3388,7 @@
"Split the brick.");
if (vl_test1.size()) {
- pbrick pbr = new gen_linear_assembly_brick(expr, is_sym, is_coercive,
+ pbrick pbr = new gen_linear_assembly_brick(expr, mim,is_sym, is_coercive,
brickname,
vl_test1, vl_test2);
model::termlist tl;
@@ -3407,6 +3410,7 @@
struct gen_nonlinear_assembly_brick : public virtual_brick {
std::string expr;
+ bool is_lower_dim;
virtual void real_post_assembly_in_serial(const model &md, size_type ,
const model::varnamelist &,
@@ -3430,10 +3434,12 @@
}
- gen_nonlinear_assembly_brick(const std::string &expr_, bool is_sym,
+ gen_nonlinear_assembly_brick(const std::string &expr_, const mesh_im &mim,
+ bool is_sym,
bool is_coer, std::string brickname = "") {
if (brickname.size() == 0) brickname = "Generic linear assembly brick";
expr = expr_;
+ is_lower_dim = mim.is_lower_dimensional();
set_flags(brickname, false /* is linear*/,
is_sym /* is symmetric */, is_coer /* is coercive */,
true /* is real */, false /* is complex */);
@@ -3455,8 +3461,8 @@
if (md.is_true_data(ddl[i])) dl.push_back(ddl[i]);
else vl.push_back(ddl[i]);
if (order == 0) { is_coercive = is_sym = true; }
- pbrick pbr = new gen_nonlinear_assembly_brick(expr, is_sym, is_coercive,
- brickname);
+ pbrick pbr = new gen_nonlinear_assembly_brick(expr, mim, is_sym,
+ is_coercive, brickname);
model::termlist tl; // No term
// tl.push_back(model::term_description(true, is_sym));
// TODO to be changed.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Getfem-commits] r5082 - in /trunk/getfem: interface/tests/matlab/ src/ src/getfem/,
Yves . Renard <=