On the use of MappingFEField

63 views
Skip to first unread message

Praveen C

unread,
Jun 25, 2016, 12:57:29 AM6/25/16
to Deal.II Googlegroup
Dear all

I am trying to use MappingFEField on a parallel::distributed::Triangulation with TrilinosWrappers::MPI::Vector.

In this case, how should the euler vector be created ?

Should the euler vector use locally owned dofs or locally relevant dofs ?

I tried the following

      unsigned int degree = 4;
      const FE_Q<dim> fe(QGaussLobatto<1>(degree+1));
      const FESystem<dim> fesystem(fe, dim);
      DoFHandler<dim> dh_euler (triangulation);
      dh_euler.distribute_dofs (fesystem);
      IndexSet locally_owned_dofs;
      IndexSet locally_relevant_dofs;
      locally_owned_dofs = dh_euler.locally_owned_dofs ();
      DoFTools::extract_locally_relevant_dofs (dh_euler,
                                               locally_relevant_dofs);
      TrilinosWrappers::MPI::Vector euler_vector (locally_owned_dofs, MPI_COMM_WORLD);
      compute_mapping (degree, triangulation, dh_euler, euler_vector);
      MappingFEField<dim> map(dh_euler, euler_vector);

When “map" is destroyed, I get some error

An error occurred in line <128> of file </Users/praveen/Applications/deal.II/git/source/base/subscriptor.cc> in function
    void dealii::Subscriptor::check_no_subscribers() const
The violated condition was: 
    counter == 0
The name and call sequence of the exception was:
    ExcInUse (counter, object_info->name(), infostring)
Additional Information: 
Object of class N6dealii6VectorIdEE is still used by 1 other objects.

Thanks
praveen

On 30-May-2016, at 11:32 AM, Praveen C <cpra...@gmail.com> wrote:

Dear all

I have problems involving airfoil geometry where the cells have high aspect ratio in the boundary layer. Due to this, it is not enough to just use curved boundaries but the interior faces also need to be curved. See the attached figure gridq1.pdf

I have implemented a method based on winslow equations, see


Using this winslow method, I can generate an euler vector that gives valid cells, see gridqk.pdf which uses degree=4.

Using this euler vector, I want to create a MappingFEField and use that in my Navier-Stokes DG code.

I have some doubts.

When I use a MappingFEField, do I still need to attach manifold descriptions to the curved boundaries ? Assume that I am not doing any grid adaptation.

If I want to adapt the grid, is there a way to use the MappingFEField to place the new points ?

Are there any functions in deal.II to measure the quality of the mesh ?

The Winslow eqn approach seems quite useful and one can write a general class that may be useful for many people. At present I only have a serial implementation.

The approach is as follows:

Start with a Q1 mesh
Attach manifolds
Solve the winslow eqn to get the euler vector
Create a MappingFEField

Thanks
praveen
<gridq1.pdf><gridqk.pdf>


Wolfgang Bangerth

unread,
Jun 25, 2016, 1:21:37 AM6/25/16
to dea...@googlegroups.com
On 06/24/2016 11:57 PM, Praveen C wrote:
> MappingFEField<dim> map(dh_euler, euler_vector);
>
> When “map" is destroyed, I get some error
>
> An error occurred in line <128> of file
> </Users/praveen/Applications/deal.II/git/source/base/subscriptor.cc
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__subscriptor.cc&d=CwMFaQ&c=ODFT-G5SujMiGrKuoJJjVg&r=bn1clvQAiDQrfAC4yKbN0PlSr7RWRs-U3WJ0zRBB2qM&m=Vf-2N0p6VmAXKK4t0RHa8AEgald8F3wLtzHtbbHTHDk&s=Q5qaqH8k_jfyOzP2rprL-TgG2uQe5NpA4zddILDSvuc&e=>>
> in function
> void dealii::Subscriptor::check_no_subscribers() const
> The violated condition was:
> counter == 0
> The name and call sequence of the exception was:
> ExcInUse (counter, object_info->name(), infostring)
> Additional Information:
> Object of class N6dealii6VectorIdEE is still used by 1 other objects.
>

What a coincidence -- I've explained this very error just 10 minutes to
someone sitting here next to me at the ASPECT hackathon :-)

The issue is that MappingFEField takes a dealii::Vector as second argument.
What you pass is a vector of a different class, so the constructor creates a
temporary vector to pass to the constructor, and then destroys it again after
the call. But the MappingFEField class has already taken its address, and so
you get the error above.

What you need to do is use the second template argument of the MappingFEField
class and set it to TrilinosWrappers::MPI::Vector. This should make it all work!

Best
Wolfgang

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@math.tamu.edu
www: http://www.math.tamu.edu/~bangerth/

Praveen C

unread,
Jun 25, 2016, 1:34:43 AM6/25/16
to Deal. II Googlegroup
Hello Wolfgang

I change to

MappingFEField<dim,dim,TrilinosWrappers::MPI::Vector> map(dh_euler, euler_vector);

But I get a linking error

Undefined symbols for architecture x86_64:
  "dealii::MappingFEField<2, 2, dealii::TrilinosWrappers::MPI::Vector, dealii::DoFHandler<2, 2> >::MappingFEField(dealii::DoFHandler<2, 2> const&, dealii::TrilinosWrappers::MPI::Vector const&, dealii::ComponentMask)", referenced from:
      _main in main.cc.o

Thanks
praveen

-- 
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.

Wolfgang Bangerth

unread,
Jun 25, 2016, 2:27:21 AM6/25/16
to dea...@googlegroups.com

Praveen,

> I change to
>
> MappingFEField<dim,dim,TrilinosWrappers::MPI::Vector> map(dh_euler, euler_vector);
>
> But I get a linking error
>
> Undefined symbols for architecture x86_64:
> "dealii::MappingFEField<2, 2, dealii::TrilinosWrappers::MPI::Vector,
> dealii::DoFHandler<2, 2> >::MappingFEField(dealii::DoFHandler<2, 2> const&,
> dealii::TrilinosWrappers::MPI::Vector const&, dealii::ComponentMask)",
> referenced from:
> _main in main.cc.o

Indeed. You need this patch:
https://github.com/dealii/dealii/pull/2717
Best
W.
Reply all
Reply to author
Forward
0 new messages