Re: [deal.II] Periodic Boundary conditions on Step-3 tutorial with dim != spacedim

2020-11-23 Thread Timo Heister
> Thank you for your reply. Yeah, I would definitely like try and make it work. 
> So, what I did was, I made some small changes in the file 
> 'dof_tools_constraints.inst.in '.
> I just added spacedim loop for the first two 'for loop' blocks.

Yes, this is probably all that is needed.

> Although the build was successful, I am not sure how to check if its 
> implemented correctly or not.

I would typically go about this in the following ways:
1. Look over the implementation and think about if the operations make sense.
2. Create a small test, run it, and make sure you are not running into
Assert/crashes.
3. Set up a test problem where you can verify that things work correctly.

It sounds like you should be able to make 2) and 3) work with the
modified step-3 that you posted.

 One more slightly basic question, do I need to build all the other
files if I only changed this one file? Does it not detect that only
one file was changed? This is the way one goes about changing stuff
right?

If you run "make", we automatically detect everything that needs to be
rebuilt and do exactly that. You might need a "make install" as well,
depending on how you specify the location of your deal.II library.

> Also, I will be sure to put a pull request if it works.

Awesome! Let us know if you need help at any point.



-- 
Timo Heister
http://www.math.clemson.edu/~heister/

-- 
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/CAMRj59Gc-JzaPsQjp13x9d7yvDk6noO_YdUAtL9xnT_hLFHQWQ%40mail.gmail.com.


Re: [deal.II] Periodic Boundary conditions on Step-3 tutorial with dim != spacedim

2020-11-23 Thread Malhar T.
Hello Timo, 
Thank you for your reply. Yeah, I would definitely like try and make it 
work. So, what I did was, I made some small changes in the file 
'dof_tools_constraints.inst.in 
'. 
I just added spacedim loop for the first two 'for loop' blocks. 
This is how it looks after the changes, 

for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
  {
#if deal_II_dimension <= deal_II_space_dimension
template void DoFTools::make_periodicity_constraints(
  const DoFHandler::face_iterator &,
  const DoFHandler::face_iterator &,
  AffineConstraints &,
  const ComponentMask &,
  bool,
  bool,
  bool,
  const FullMatrix &,
  const std::vector &,
 const double);
#ifdef DEAL_II_WITH_COMPLEX_VALUES
template void DoFTools::make_periodicity_constraints(
  const DoFHandler::face_iterator &,
  const DoFHandler::face_iterator &,
  AffineConstraints> &,
  const ComponentMask &,
  bool,
  bool,
  bool,
  const FullMatrix &,
  const std::vector &,
  std::complex);#endif
#endif
  }
for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
  {
#if deal_II_dimension <= deal_II_space_dimension

template void DoFTools::make_periodicity_constraints(
  const std::vector::cell_iterator>> 
&,
  AffineConstraints &,
  const ComponentMask &,
  const std::vector &,
  const double);
#ifdef DEAL_II_WITH_COMPLEX_VALUES
template void DoFTools::make_periodicity_constraints>(
  const std::vector::cell_iterator>> 
&,
  AffineConstraints> &,
  const ComponentMask &,
  const std::vector &,
  const std::complex);#endif

template void DoFTools::make_periodicity_constraints(
  const DoFHandler &,
  const types::boundary_id,
  const types::boundary_id,
  const unsigned int,
  AffineConstraints &,
  const ComponentMask &,
  const double);
#ifdef DEAL_II_WITH_COMPLEX_VALUES
template void DoFTools::make_periodicity_constraints(
  const DoFHandler &,
  const types::boundary_id,
  const types::boundary_id,
  const unsigned int,
  AffineConstraints> &,
  const ComponentMask &,
  const std::complex);#endif

template void DoFTools::make_periodicity_constraints(
  const DoFHandler &,
  const types::boundary_id,
  const unsigned int,
  AffineConstraints &,
  const ComponentMask &,
  const double);
#ifdef DEAL_II_WITH_COMPLEX_VALUES
template void DoFTools::make_periodicity_constraints(
  const DoFHandler &,
  const types::boundary_id,
  const unsigned int,
  AffineConstraints> &,
  const ComponentMask &,
  const std::complex);
#endif#endif
  }

Although the build was successful, I am not sure how to check if its 
implemented correctly or not. One more slightly basic question, do I need 
to build all the other files if I only changed this one file? Does it not 
detect that only one file was changed? This is the way one goes about 
changing stuff right? 

Also, I will be sure to put a pull request if it works.

Thank You

On Monday, November 23, 2020 at 6:14:26 AM UTC+5:30 Timo Heister wrote:

> Hi Malhar,
>
> if you look at
>
> https://github.com/dealii/dealii/blob/a56c8585863b774de9dce5f7dd5c334ef56f3a51/source/dofs/dof_tools_constraints.inst.in#L69
>
> you can see that it is only instantiated for
> DoFHandler
> meaning only for dim=spacedim (the second argument is the default right 
> now).
>
> Instead, we would need to move the instantiation down into a loop that
> has two loops over dim and instantiate it for all pairs like it is
> done for
>
> https://github.com/dealii/dealii/blob/a56c8585863b774de9dce5f7dd5c334ef56f3a51/source/dofs/dof_tools_constraints.inst.in#L123
>
> Do you want to try if you can make this work? I am not sure if the
> implementation will work correctly, but we can check that in a second
> step.
> If this works, we would appreciate a pull request from you to fix this!
>
> Best,
> Timo
>
>
>
> On Sun, Nov 22, 2020 at 4:11 PM Malhar T.  wrote:
> >
> > Hello All !
> >
> > I was trying the step-3 with periodic boundary conditions and dim = 2 
> and spacedim = 3. The main reason behind this is I want to test periodic 
> boundary conditions for dim != spacedim. I have tested the code for dim = 
> spacedim = 2 and the periodic boundary conditions and it works (never mind 
> the results for now !). I have also tested the code for dim = 2 and 
> spacedim = 3 without periodic boundary conditions and it works too. But 
> only when I add periodic conditions for that case, the issue arises.
> >
> > I got the following error,
> >
> > error: undefined reference to 'void 
> dealii::DoFTools::make_periodicity_constraints<2, 3, 
> double>(dealii::DoFHandler<2, 3> const&, unsigned int, unsigned int, 
> unsigned int, dealii::AffineConstraints&, dealii::ComponentMask 
> const&, double)'
> > collect2: error: ld returned 1 exit status
> > make[2]: *** 

Re: [deal.II] Periodic Boundary conditions on Step-3 tutorial with dim != spacedim

2020-11-22 Thread Timo Heister
Hi Malhar,

if you look at
https://github.com/dealii/dealii/blob/a56c8585863b774de9dce5f7dd5c334ef56f3a51/source/dofs/dof_tools_constraints.inst.in#L69

you can see that it is only instantiated for
DoFHandler
meaning only for dim=spacedim (the second argument is the default right now).

Instead, we would need to move the instantiation down into a loop that
has two loops over dim and instantiate it for all pairs like it is
done for
https://github.com/dealii/dealii/blob/a56c8585863b774de9dce5f7dd5c334ef56f3a51/source/dofs/dof_tools_constraints.inst.in#L123

Do you want to try if you can make this work? I am not sure if the
implementation will work correctly, but we can check that in a second
step.
If this works, we would appreciate a pull request from you to fix this!

Best,
Timo



On Sun, Nov 22, 2020 at 4:11 PM Malhar T.  wrote:
>
> Hello All !
>
> I was trying the step-3 with periodic boundary conditions and dim = 2 and 
> spacedim = 3. The main reason behind this is I want to test periodic boundary 
> conditions for dim != spacedim. I have tested the code for dim = spacedim = 2 
> and the periodic boundary conditions and it works (never mind the results for 
> now !). I have also tested the code for dim = 2 and spacedim = 3 without 
> periodic boundary conditions and it works too. But only when I add periodic 
> conditions for that case, the issue arises.
>
> I got the following error,
>
> error: undefined reference to 'void 
> dealii::DoFTools::make_periodicity_constraints<2, 3, 
> double>(dealii::DoFHandler<2, 3> const&, unsigned int, unsigned int, unsigned 
> int, dealii::AffineConstraints&, dealii::ComponentMask const&, 
> double)'
> collect2: error: ld returned 1 exit status
> make[2]: *** [CMakeFiles/step1.dir/build.make:139: step1] Error 1
> make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/step1.dir/all] Error 2
> make: *** [Makefile:84: all] Error 2
>
> The version that I am using is 9.3.0-pre. Although I am not really great at 
> C++ but according to the template and source, it should have worked, but I 
> could not find anything here. I tried running it without template arguments 
> or with only '2' as a template argument, but couldn't make it work. I have 
> attached the code which I have tried, and also the code dim = 2 and spacedim 
> = 3 without periodic boundary conditions. Any help will be greatly 
> appreciated.
>
> Thank You
>
> --
> 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/e11a9f41-4750-459d-bedc-ef0b3ae83dddn%40googlegroups.com.



-- 
Timo Heister
http://www.math.clemson.edu/~heister/

-- 
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/CAMRj59ELhotRHV1KPeRgaX2MbCo4_4ihnZw3hiHMpz-E1BntMw%40mail.gmail.com.