getfem-users
[Top][All Lists]

## [Getfem-users] Problem specifying Dirichlet conditions

 From: Mai Linh Doan Subject: [Getfem-users] Problem specifying Dirichlet conditions Date: Mon, 29 Mar 2010 12:25:27 +0200

```Hello,
I am a new user of GetFem++, working with the matlab interface.
It seems very clearly structured. Thanks for the good job.

```
I am beginning with simple cases, such like the attached test2.m. However, it crashes during the assembling of the Dirichlet condition. I do not see why: the syntax seems ok and I put the same mesh_fem structure for both the multiplier and the variable. The reason is certainly very simple but I cannot find out why.
```Can you help me ?
Thanks
```
-- Mai
```Code:
------------------------------------------------------------------
gf_workspace('clear all');

L=100;H=100;
m=gfMesh('regular simplices',0:10:L, 0:10:H);

mfd=gfMeshFem(m,1);
mfd.set('fem',gfFem('FEM_PK(2,1)'));
mim=gf_mesh_im(m,gf_integ('IM_TRIANGLE(3)'));

pts=m.pts;
top_pid=find(abs(pts(2,:)-L)<=1e-6);
bot_pid=find(abs(pts(2,:)-0)<=1e-6);

top =gf_mesh_get(m,'faces from pid',top_pid);
bot =gf_mesh_get(m,'faces from pid',bot_pid);
all=gf_mesh_get(m,'outer faces');

m.set('region',101,top);
m.set('region',102,bot);
m.set('region',103,setdiff(all',union(top',bot','rows'),'rows')');

gf_plot_mesh(m,'regions',[103]);

md=gf_model('real');

disp('1')
```
gf_model_set(md,'add Dirichlet condition with multipliers',mim,'V',mfd, 101,'V0');
```disp('2')
```
gf_model_set(md,'add Dirichlet condition with multipliers',mim,'V',mfd, 102,'V1');
```disp('3')

disp('solve')
gf_model_get(md,'solve');
------------------------------------------------------------------

Call:
-------------------------------------------------------------------
\$ matlab -nojvm

< M A T L A B >
Version 7.5.0.338 (R2007b)
August 9, 2007

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

>> test2
1
2
3
solve
```
Trace 2 in getfem_models.cc, line 1497: Source term assembly for Dirichlet condition Assertion failed: (rn.size() == s.size()), function update_childs_required_shape, file getfem_assembling_tensors.cc, line 153.
```Abort trap
-----------------------------------------------------------------------

Full Crash report is attached, but I put the line concerning GetFem++ :

------------------------------------------------------------------

```
0 libSystem.B.dylib 0x92979fd6 usleep\$NOCANCEL \$UNIX2003 + 0
```1   libSystem.B.dylib                   0x92991685 abort + 85
2   libSystem.B.dylib                   0x929863db __assert_rtn + 101
```
3 gf_matlab.mexmaci 0x17460aa6 getfem::ATN_reduced_tensor::update_childs_required_shape() + 1750 4 gf_matlab.mexmaci 0x1743df54 getfem::generic_assembly::exec(unsigned long, unsigned char) + 340 5 gf_matlab.mexmaci 0x1744aee6 getfem::generic_assembly::assembly(getfem::mesh_region const&) + 1910 6 gf_matlab.mexmaci 0x1707c221 void getfem::asm_real_or_complex_1_param_<std::vector<double, std::allocator<double> >, std::vector<double, std::allocator<double> >, double>(std::vector<double, std::allocator<double> > const&, getfem::mesh_im const&, getfem::mesh_fem const&, getfem::mesh_fem const&, std::vector<double, std::allocator<double> > const&, getfem::mesh_region const&, char const*, double) + 337 7 gf_matlab.mexmaci 0x174d6e04 getfem ::Dirichlet_condition_brick::asm_real_tangent_terms(getfem::model const&, unsigned long, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, std::vector<getfem::mesh_im const*, std::allocator<getfem::mesh_im const*> > const&, std::vector<gmm::col_matrix<gmm::wsvector<double> >, std::allocator<gmm::col_matrix<gmm::wsvector<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, std::vector<std::vector<double, std::allocator<double> >, std::allocator<std::vector<double, std::allocator<double> > > >&, unsigned long, getfem::model::build_version) const + 5268 8 gf_matlab.mexmaci 0x17488727 getfem::model::brick_call(unsigned long, getfem::model::build_version, unsigned long) const + 295 9 gf_matlab.mexmaci 0x174889e0 getfem::model::update_brick(unsigned long, getfem::model::build_version) const + 656 10 gf_matlab.mexmaci 0x17492f33 getfem::model::actualize_sizes() const + 4355 11 gf_matlab.mexmaci 0x1716acd8 std ::auto_ptr <getfem::abstract_linear_solver<gmm::col_matrix<gmm::wsvector<double> >, std::vector<double, std::allocator<double> > > > getfem::default_linear_solver<gmm::col_matrix<gmm::wsvector<double> >, std::vector<double, std::allocator<double> > >(getfem::model const&) + 312 12 gf_matlab.mexmaci 0x1716bc29 std ::auto_ptr <getfem::abstract_linear_solver<gmm::col_matrix<gmm::wsvector<double> >, std::vector<double, std::allocator<double> > > > getfem::select_linear_solver<gmm::col_matrix<gmm::wsvector<double> >, std::vector<double, std::allocator<double> > >(getfem::model const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) + 1097 13 gf_matlab.mexmaci 0x17169f25 gf_model_get(getfemint::mexargs_in&, getfemint::mexargs_out&) + 9029 14 gf_matlab.mexmaci 0x16f7d9e5 getfem_interface_main + 6101 15 gf_matlab.mexmaci 0x16f791e5 call_getfem_interface + 149
```16  gf_matlab.mexmaci                   0x16f79488 mexFunction + 248

------------------------------------------------------------------

```

test2.m
Description: Binary data

test2_crash_report.txt
Description: Text document

```

```