Proper use of CompositionManifold

23 views
Skip to first unread message

Praveen C

unread,
Sep 21, 2016, 5:06:21 AM9/21/16
to Deal. II Googlegroup
Dear all

I am trying to compose two manifolds. I want to apply a 90 deg rotation about x-axis to PolarManifold to obtain description of surface of sphere and thereby avoid the poles.

So I try something like this

static PolarManifold<2,3> sphere;
static FunctionManifold<3,3,3> rotate("x,-z,y","x,z,-y”);

Now I am confused on how to compose these two. What I need is

sphere * rotate

In the documentation

https://www.dealii.org/developer/doxygen/deal.II/classCompositionManifold.html

is the result F*G or G*F ?

In the template parameters, could you explain the “first” and “second”. If you specify “F” or “G” instead of “first” and “second", it will be more clear I think.

Thanks
praveen

Praveen C

unread,
Sep 22, 2016, 12:33:58 AM9/22/16
to Deal. II Googlegroup
Hello

I think I understand this better after reading the code. Here is my attempt

      static const PolarManifold<2,3> sphere;

      static const FunctionManifold<3,3,3> rotate("x,-z,y","x,z,-y");

      static CompositionManifold<2,3,2,3,3,3> surface(sphere, rotate);


I use

dim=2The dimension of the resulting ChartManifold
spacedim=3The space dimension of the resulting ChartManifold
chartdim=2The chart dimension of the resulting ChartManifold
intermediate_dim=3The space dimension of the first ChartManifold
dim1=3The dimension of the first ChartManifold, which coincides also with the chart dimension of the second ChartManifold
dim2=3The dimension of the second ChartManifold

This gives following error

/Users/praveen/Applications/dgswm/src/swm.cc:279:47: error: no matching

      constructor for initialization of 'CompositionManifold<2, 3, 2, 3, 3, 3>'

      static CompositionManifold<2,3,2,3,3,3> surface(sphere, rotate);

                                              ^       ~~~~~~~~~~~~~~

/Users/praveen/Applications/deal.II/git/install/include/deal.II/grid/composition_manifold.h:75:3: note: 

      candidate constructor not viable: no known conversion from 'const

      PolarManifold<2, 3>' to 'const ChartManifold<3, 3, 2>' for 1st argument

  CompositionManifold(const ChartManifold<dim1, intermediate_dim, chartdim> &F,

  ^

/Users/praveen/Applications/deal.II/git/install/include/deal.II/grid/composition_manifold.h:68:7: note: 

      candidate constructor (the implicit copy constructor) not viable: requires

      1 argument, but 2 were provided

class CompositionManifold : public ChartManifold<dim, spacedim, chartdim>

      ^

/Users/praveen/Applications/deal.II/git/install/include/deal.II/grid/composition_manifold.h:68:7: note: 

      candidate constructor (the implicit move constructor) not viable: requires

      1 argument, but 2 were provided


Thanks
praveen

Praveen C

unread,
Sep 22, 2016, 1:01:11 AM9/22/16
to Deal. II Googlegroup
I was making a mistake. Reading the code of CompositionManifold clarified it. This is correct

      static const PolarManifold<2,3> sphere;

      static const FunctionManifold<3,3,3> rotate("x;-z;y","x;z;-y");

      static const CompositionManifold<2,3,3,3,2,3> rotated_sphere(sphere, rotate);


Thanks
praveen

luca.heltai

unread,
Sep 22, 2016, 2:51:08 AM9/22/16
to Deal.II Users
For future reference, if you are in doubt on how to use a single class/function, you can skim through the directory tests, i.e.,

tests/manifold/composition_manifold_*

would have shown to you an example which is identical to what you are trying to achieve, and in general it contains very simple pieces of codes that run very simple tests and show how to use almost every single class/function of the deal.II library.

This should be your second step, though, after reading carefully the documentation. ;)

If you think there are things that should be changed in the documentation to make the CompositionManifold class clearer (a very young class indeed), please feel free to make a pull request. We’d be happy to include your comments in the library!

Luca.
> --
> The deal.II project is located at http://www.dealii.org/
> For mailing list/forum options, see https://groups.google.com/d/forum/dealii?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "deal.II User Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to dealii+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Praveen C

unread,
Sep 22, 2016, 4:03:29 AM9/22/16
to Deal.II Googlegroup
Thanks Luca. I have been looking at tests also.

For CompositionManifold, if

H = CompositionManifold(F, G)

then 

H_pullback = F_pullback * G_pullback

H_pushforward = G_pushforward * F_pushforward

I think adding this to documentation will improve the description.

Also this line

dim1
The dimension of the first ChartManifold, which coincides also with the chart dimension of the second ChartManifold

does not seem to be correct in my case

       static const PolarManifold<2,3> sphere;
       static const FunctionManifold<3,3,3> rotate("x;-z;y","x;z;-y");
       static const CompositionManifold<2,3,3,3,2,3> rotated_sphere(sphere, rotate);

dimension of first manifold (sphere) = 2

but this is not equal to 

chart dimension of second manifold (rotate) = 3 ???

Best
praveen
Reply all
Reply to author
Forward
0 new messages