- Thank you received: 1
Can someone explain how BaseVectors work in compound spaces?
3 years 9 months ago #3536
by JSR
Can someone explain how BaseVectors work in compound spaces? was created by JSR
Apologies for what is probably and incredibly basic question, but I can't seem to find anything about this in the documentation, and the "help" function isn't helping. Could someone clarify what gfu.vec and gfu.vec.data represent for functions in a CompoundFESpace?
For a non-compound space, I gather that gfu.vec is a BaseVector object which stores the raw coefficient values of gfu in gfu.vec.data. When you work in a compound space, you have a new attribute, gfu.vecs, which as far as I can tell is just a list of BaseVectors.
The thing that confuses me is that GridFunctions in CompoundFESpaces still have a "vec" attribute. What do gfu.vec and gfu.vec.data represent in a compound space? Are they just a convenient concatenation of the individual BaseVectors stored in gfu.vecs, or is there something else going on?
For a non-compound space, I gather that gfu.vec is a BaseVector object which stores the raw coefficient values of gfu in gfu.vec.data. When you work in a compound space, you have a new attribute, gfu.vecs, which as far as I can tell is just a list of BaseVectors.
The thing that confuses me is that GridFunctions in CompoundFESpaces still have a "vec" attribute. What do gfu.vec and gfu.vec.data represent in a compound space? Are they just a convenient concatenation of the individual BaseVectors stored in gfu.vecs, or is there something else going on?
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
3 years 8 months ago - 3 years 8 months ago #3545
by christopher
Replied by christopher on topic Can someone explain how BaseVectors work in compound spaces?
Hi,
for a compound space gfu.vec also stores the values of the coefficient values for the compound space. The first ndof components are of the first space then second space and so on. You can get the individual vectors from the component gridfunction.
gives you the i-th vector. This gives you the slice belonging the i-th component.
gfu.vecs is for multidim GridFunctions (a gridfunction with many vectors) used for example in eigenvector computation. Each entry then is an eigenvector. The GridFunction needs to be created using the multidim argument for this, see for example docu.ngsolve.org/latest/i-tutorials/unit...well/Maxwellevp.html
Best
Christopher
for a compound space gfu.vec also stores the values of the coefficient values for the compound space. The first ndof components are of the first space then second space and so on. You can get the individual vectors from the component gridfunction.
Code:
gfu.components[i].vec
gfu.vecs is for multidim GridFunctions (a gridfunction with many vectors) used for example in eigenvector computation. Each entry then is an eigenvector. The GridFunction needs to be created using the multidim argument for this, see for example docu.ngsolve.org/latest/i-tutorials/unit...well/Maxwellevp.html
Best
Christopher
Last edit: 3 years 8 months ago by christopher.
3 years 8 months ago - 3 years 8 months ago #3546
by joachim
Replied by joachim on topic Can someone explain how BaseVectors work in compound spaces?
Hi,
also the compound space allocates one linear vector.
It is equivalent whether
(a) you read/write to a range (interval) of the long vector, or
(b) access the vector of one of its component gridfunctions
Here an example,
Joachim
also the compound space allocates one linear vector.
It is equivalent whether
(a) you read/write to a range (interval) of the long vector, or
(b) access the vector of one of its component gridfunctions
Here an example,
Joachim
Attachments:
Last edit: 3 years 8 months ago by joachim.
Time to create page: 0.107 seconds