|
From: | Nicolò Cambiaso |
Subject: | Re: [Getfem-users] Generic Bricks definition using gf_asm. |
Date: | Mon, 7 Oct 2019 12:21:44 +0200 |
Dear Nicolò,
'add nonlinear term' and 'add nonlinear generic assembly brick' are exactly the same commands, the name has been shortened for convenience.
Best regards,
Yves
----- Mail original -----
De: "Nicolò Cambiaso" <address@hidden>
À: "yves renard" <address@hidden>
Envoyé: Lundi 7 Octobre 2019 11:35:25
Objet: Re: [Getfem-users] Generic Bricks definition using gf_asm.
The test program are running, also the ones with 'add nonlinear generic
assembly brick' (like demo_continuation.and demo_crack). but I did not
see any test using 'add linear/nonlinear term' in gf_model_set.
Il giorno ven 4 ott 2019 alle ore 15:43 Yves Renard <
address@hidden> ha scritto:
>
> Dear Nicolò,
>
> Yes, of course, it can work. Normally the command 'add nonlinear term’ is
> also working of course.
> Are the test program running ?
>
> Best regards,
>
> Yves
>
>
> ----- Mail original -----
> De: "Nicolò Cambiaso" <address@hidden>
> À: "yves renard" <address@hidden>
> Cc: "getfem-users" <address@hidden>
> Envoyé: Jeudi 3 Octobre 2019 17:37:02
> Objet: Re: [Getfem-users] Generic Bricks definition using gf_asm.
>
> Thank you.
> Actually the model object was my first try, but the 'bad command name'
> error made me change the plans. every time I defined something using
> "gf_model_set ( modelM, ‘add nonlinear term’)" that error occurred. then I
> saw the 'add nonlinear generic assembly brick', but in the matlab_interface
> guide is defined as deprecated, so finally i'm trying with the assembly
> way.
> So the plans now are to create the Sparse Matrix SM = gf_spmat('empty', m);
> add the bricks one by one, gf_spmat_set(SM, 'add',...) , create the rhs
> vector; and then solve = gf_linsolve('superlu', SM, vec_b). Can this work?
>
> Thank you again, for your time and disponibility
> Nicolò Cambiaso
>
> Il giorno mer 2 ott 2019 alle ore 22:29 Yves Renard <
> address@hidden> ha scritto:
>
> >
> > Dear Nicolò,
> >
> > The command gf_asm just allows to compute some different matrices. Is you
> > use this strategy, then this is your own responsability to make a
> > resolution with the corresponding matrices. You can also use the more
> > integrated model object which will agregate all the terms and propose
> > directly a solve. For that, you can have a look to the tutorial, for
> > instance http://getfem.org/tutorial/thermo_coupling.html
> >
> > For source term, you can still use gf_asm('generic', ...) yes, with the
> > option gf_asm('generic', mim, 1, ...), the "1" indicating that this is a
> > vector assembly, not a matrix one. You can also use gf_asm('volumic
> > source', ...)
> >
> > Best regards,
> >
> > Yves
> >
> >
> >
> > ----- Mail original -----
> > De: "Nicolò Cambiaso" <address@hidden>
> > À: "yves renard" <address@hidden>
> > Cc: "getfem-users" <address@hidden>
> > Envoyé: Mercredi 2 Octobre 2019 15:58:16
> > Objet: Re: [Getfem-users] Generic Bricks definition using gf_asm.
> >
> > I'm sorry to bother you again, but a couple of questions raised.
> >
> > Some of the blocks are symmetric, so in my matrix i'll have the
> transposed
> > corresponding block. Do I need to create the transposed block too with
> the
> > command gf_asm('generic' ...) or it's going to do it by himself?
> >
> > Also,
> > From the equation, I have a term comprendig a test function and some
> static
> > initial data defined in the whole mesh, but no variables ('A*test_pv').
> > This term is gonig to be in the Right Hand Side of the linear system.
> Now,
> > my question is: which one of the functions (gf_asm('function', ...)) is
> the
> > correct one to use? Is again 'generic' going to understand it? Right now
> i
> > bet on 'volumic source', but i defined nowhere which test function i'm
> > using, so i'm not so sure about that.
> >
> > Thank you for your help and your time.
> > Have a nice day,
> > Nicolò Cambiaso
> >
> > Il giorno mer 2 ott 2019 alle ore 09:37 Nicolò Cambiaso <
> > address@hidden> ha scritto:
> >
> > > Thank you very much, now it works.
> > > to completeness to the future readers, I would like to correct a typo I
> > > made when asking for the command.
> > > K= --equation--
> > > gf_model_set(md, 'add initialized data', 'K', [K]);
> > > gf_asm('generic', mim3, 2, 'K*(Test_ut.*ut)', -1, 'ut', 1, mf3,
> > > zeros(gf_mesh_fem_get(mf3, 'nbdof'),1), 'K' , 0, K);
> > >
> > > Again, thank you,
> > > Have a nice day
> > > Nicolò Cambiaso
> > >
> > > Il giorno lun 30 set 2019 alle ore 22:19 Yves Renard <
> > > address@hidden> ha scritto:
> > >
> > >>
> > >> Dear Nicolo Cambiaso,
> > >>
> > >> You can use gf_asm to produce a mass matrix as you tried, but you have
> > to
> > >> specify a fem on which the variable is described. The correct syntax
> is
> > for
> > >> instance
> > >>
> > >> gf_asm('generic', mim3, 2, 'Grad_Test2_ut.Grad_Test_ut', -1, 'ut',1,
> mf,
> > >> zero(gf_mesh_fem_get(mf, 'nbdof'),1));
> > >>
> > >> where mf is the mesh_fem structure describing the fem.
> > >>
> > >> Best regards,
> > >>
> > >> Y.R.
> > >>
> > >> ----- Mail original -----
> > >> De: "Nicolò Cambiaso" <address@hidden>
> > >> À: "getfem-users" <address@hidden>
> > >> Envoyé: Lundi 30 Septembre 2019 12:25:51
> > >> Objet: [Getfem-users] Generic Bricks definition using gf_asm.
> > >>
> > >> Dear users,
> > >> I would like to solve a system of equations using Getfemm++ with
> Matlab
> > >> interface.
> > >> So I created a block matrix, and now i cannot create the corresponding
> > >> bricks.
> > >> I'm using the command "gf_asm", hoping it's the correct one.
> > >>
> > >> the block is the following:
> > >> Mtt=1/k u_t v_t. (v_t is the test function corresponding to u_t)
> > >> in full despair, i also removed the 1/k therm, and still nothing
> worked.
> > >> this is what i wrote:
> > >>
> > >> gf_asm('generic', mim3, 2, 'Grad_Test2_ut.Grad_Test_ut', -1, 'ut',1,
> U);
> > >>
> > >> And the error message is:
> > >>
> > >> "Error using gf_matlab
> > >> Error in getfem_generic_assembly.cc, line 9519 void
> > >> getfem::ga_node_analysis(const string&, getfem::ga_tree&, const
> > >> getfem::ga_workspace&, getfem::pga_tree_node, bgeot::size_type,
> > >> bgeot::size_type, bool, bool, int):
> > >> Error in assembly string
> > >>
> > >> Error in gf_asm (line 338)
> > >> [varargout{1:nargout}]=gf_matlab('asm', varargin{:});
> > >>
> > >> Error in Comeon (line 56)
> > >> Mtt=gf_asm('generic', mim3, 2, 'Grad_Test2_ut.Grad_Test_ut', -1,
> 'ut',1,
> > >> U); % M_tt, proviamo"
> > >>
> > >> with
> > >> mim3= gf_mesh_im( mf3, gf_integ('IM_NC(3,1)') )
> > >> mf3=gf_mesh_fem(OmegaM,3)
> > >> OmegaM=gf_mesh('regular simplices',vectX, vectY, vectZ, 'degree', 1)
> > >>
> > >> at his point, i defined U as ones(2,2,2,3), having the vectX(/Y/Z)
> only
> > 2
> > >> points each one, for now, and because u_t is a 3D vector.
> > >> I think that's not correct, but i have no idea of the correct
> dimension
> > of
> > >> U, and i tried everything that came to my mind ... and still nothing
> > >> worked.
> > >>
> > >> I found a lot of material dealing with this on c++ interface, but
> > >> unfortunately I cannot male it work in Matlab.
> > >>
> > >> thank you very much,
> > >> Nicolo Cambiaso.
> > >>
> > >
> >
>
[Prev in Thread] | Current Thread | [Next in Thread] |