Thank you for the kind answer and for the really useful references. I have 
tried to obtain a triangulation on a domain for which the bottom boundary 
is a bump described by a sinusoidal function. Following the simplest 
examples with strings, I have defined a FunctionManifold instance with 
template parameter 'spacedim' equal to 2 and template parameter 'chardim' 
equal to 1.

void create_triangulation() {
  parallel::distributed::Triangulation<2> triangulation(MPI_COMM_WORLD,
                                                          
parallel::distributed::Triangulation<dim>::limit_level_difference_at_vertices);

  FunctionManifold<2, 2, 1> manifold("x; 0.1 + 0.1*cos(3.141592654*(x-2))", 
"x");

  Point<dim> p1, p2;
  p1[0] = 1.0;
  p2[0] = 3.0;
  p2[1] = 1.0;
  GridGenerator::subdivided_hyper_rectangle(triangulation, {100, 100}, p1, 
p2, true);

  for(typename Triangulation<dim>::cell_iterator cell = 
triangulation.begin(); cell != triangulation.end(); ++cell)
    cell->set_all_manifold_ids(111);
  triangulation.set_manifold(111, manifold);

  triangulation.refine_global(1);

  GridOut grid_out;
  std::string saving_dir = "SimTest";
  std::ofstream output_mesh("./" + saving_dir + "/mesh.vtu");
  GridOutFlags::Vtu flags;
  flags.write_higher_order_cells = true;
  grid_out.set_flags(flags);
  grid_out.write_vtu(triangulation, output_mesh);
}

and I obtain the following grid

[image: bump.PNG]

I guess this is probably due to the fact that the manifold is applied to 
the whole domain (and also the examples 
tests/fe/fe_values_function_manifold.cc and 
tests/mappings/mapping_q_manifold_02.cc seem to me that apply the same 
reasoning). Is there a way to apply it only to a boundary or am I missing 
something?

Thanks again and I apologize for any incovenience I may have caused.

Best regards,
Giuseppe

Il giorno lunedì 31 gennaio 2022 alle 16:34:59 UTC+1 d.arnd...@gmail.com ha 
scritto:

> Giuseppe,
>
> Searching for FunctionMnaifold in the tests folder should give you a 
> couple of examples on how to use FunctionManifold with an analytical 
> function. Most of them use std::strings but
> tests/fe/fe_values_function_manifold.cc and 
> tests/mappings/mapping_q_manifold_02.cc actually use Function objects.
>
> Best,
> Daniel
>
> Am Mo., 31. Jan. 2022 um 02:56 Uhr schrieb giuseppe orlando <
> gius...@gmail.com>:
>
>> Good morning everyone,
>> I would have a question about the creation of a triangulation. Is it 
>> possible to use the 'FunctionManifold' class to create a boundary described 
>> by an analytical function? If so, how can I attach this manifold and 
>> "substitute" for instance the default straight boundary of a hyperectangle?
>>
>> Thanks in advance,
>> Giuseppe 
>>
>> -- 
>> 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.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/dealii/f32dfb1a-375a-4771-a84e-1062fea391ffn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/dealii/f32dfb1a-375a-4771-a84e-1062fea391ffn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3ea2279d-b456-45c2-97ac-5799848e6632n%40googlegroups.com.

Reply via email to