Re: [deal.II] Function objects and problem parameters

2023-10-11 Thread Wolfgang Bangerth



On 10/11/23 13:44, Aiden Huffman wrote:


I was trying to create a child of the Function class but this resulted 
in compiler errors or what seemed like deal.II panicking. I am more 
happy to share what I tried. But to be honest I am not sure how to 
construct the right object, or even if I am thinking about it correctly. 
Is there a tutorial step I should go back and review? I am still new to 
C++, so I appreciate any advice.


Pro tip: If you get "compiler errors or what seemed like deal.II 
panicking", show us what exactly it is you did and what is happening :-)


Basically, your question is of the form "I did a thing, but it doesn't 
work; can you help?" But we really can't, unless you show us what you 
did and what happens when you give it to the compiler!


Best
 W.

--
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/667c652d-bb4c-4f26-92fe-350fd4227403%40colostate.edu.


[deal.II] Function objects and problem parameters

2023-10-11 Thread Aiden Huffman
Hi everyone,

Thanks for your time, I'd love any feedback you have. I wrote a very simple 
reaction-diffusion problem inspired by Step-23 here:

https://github.com/aiden-huffman/reactionDiffusion-dealii/blob/main/code/main.cc
 

I am trying to figure out the best way to replace the implementation in line 
202 

 with 
something that returns the steady-state, in this case (a+b, b/(a+b)^2) for 
Q and R respectively, plus a small random number.

I was trying to create a child of the Function class but this resulted in 
compiler errors or what seemed like deal.II panicking. I am more happy to 
share what I tried. But to be honest I am not sure how to construct the 
right object, or even if I am thinking about it correctly. Is there a 
tutorial step I should go back and review? I am still new to C++, so I 
appreciate any advice.

-- 
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/b64d9eeb-2b35-4c9d-986e-17f4cc20f81dn%40googlegroups.com.


Re: [deal.II] An error occurred in line <1467> of file in function dealii::IndexSet dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const

2023-10-11 Thread Daniel Arndt
Yi,

How are you initializing your TrilinosWrappers::MPI::BlockVector? It looks
like you are calling the constructor with only one std::vector
but some of the index sets are overlapping.
You should use the constructor taking two std::vector objects
with the first one containing the locally owned indices and the second one
the locally relevant indices, see
https://www.dealii.org/current/doxygen/deal.II/classTrilinosWrappers_1_1MPI_1_1BlockVector.html#a13d7be7dd540e34e89559e9ff6a0d779
.

Best,
Daniel

On Tue, Oct 10, 2023 at 11:30 PM Tiny Y  wrote:

> Hi al,
> I am a freshman in dealii. I have installed Dealii 9.4.2 on 22.04. The
> senior wrote code on the old version of dealii, so I made changes to his
> code to adapt to the new version of dealii, but I encountered some
> problems. The function(locally_owned_elements()) where the error code is
> located has been deleted, but this error still occurs. I want to know where
> this problem comes from and how I can solve it. Thanks in advance!
> Regard,
> Yi
> Error Message
>
> qincai@qincai-OMEN:~/桌面/cracks-master_mod版本更新$ mpirun -n 8 ./cracks
> parameters_ring.prm
> Running on 8 cores
> Cells: 442
>
> DoFs: 5440 solid + 2720 phase + 2720 pressure = 10880
>
> ===
> Parameters
> ==
> h (min): 0.0415041
> k: 4.15041e-12
> eps: 0.166016
> G_c: 1.2
> gamma penal: 0
> Poisson nu: 0.2
> E modulus: 1
> Lame mu: 4166.67
> Lame lambda: 2777.78
>
>
> 
> An error occurred in line <1467> of file
> 
> in function
> dealii::IndexSet
> dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const
> The violated condition was:
> owned_elements.size() == size()
> Additional information:
> The locally owned elements have not been properly initialized! This
> happens for example if this object has been initialized with exactly
> one overlapping IndexSet.
>
> Stacktrace:
> ---
> #0 ./cracks:
> dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const
> #1 /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> #2  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> dealii::internal::DataOutImplementation::DataEntry<2, 2,
> double>::DataEntry(dealii::DoFHandler<2,
> 2> const*, dealii::TrilinosWrappers::MPI::BlockVector const*,
> dealii::DataPostprocessor<2> const*)
> #3  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> std::__detail::_MakeUniq 2, double> >::__single_object
> std::make_unique double>, dealii::DoFHandler<2, 2> const*,
> dealii::TrilinosWrappers::MPI::BlockVector const*,
> dealii::DataPostprocessor<2> const*>(dealii::DoFHandler<2, 2> const*&&,
> dealii::TrilinosWrappers::MPI::BlockVector const*&&,
> dealii::DataPostprocessor<2> const*&&)
> #4  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> void dealii::DataOut_DoFData<2, 2, 2,
> 2>::add_data_vector(dealii::DoFHandler<2,
> 2> const&, dealii::TrilinosWrappers::MPI::BlockVector const&,
> dealii::DataPostprocessor<2> const&)
> #5  ./cracks: void dealii::DataOut_DoFData<2, 2, 2,
> 2>::add_data_vector(dealii::TrilinosWrappers::MPI::BlockVector
> const&, dealii::DataPostprocessor<2> const&)
> #6  ./cracks: FracturePhaseFieldProblem<2>::output_results() const
> #7  ./cracks: FracturePhaseFieldProblem<2>::run()
> #8  ./cracks: main
> 
>
> Calling MPI_Abort now.
> To break execution in a GDB session, execute 'break MPI_Abort' before
> running. You can also put the following into your ~/.gdbinit:
>   set breakpoint pending on
>   break MPI_Abort
>   set breakpoint pending auto
>
> 
> An error occurred in line <1467> of file
> 
> in function
> dealii::IndexSet
> dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const
> The violated condition was:
> owned_elements.size() == size()
> Additional information:
> The locally owned elements have not been properly initialized! This
> happens for example if this object has been initialized with exactly
> one overlapping IndexSet.
>
> Stacktrace:
> ---
> #0  ./cracks:
> dealii::TrilinosWrappers::MPI::Vector::locally_owned_elements() const
> #1  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> #2 /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> dealii::internal::DataOutImplementation::DataEntry<2, 2,
> double>::DataEntry(dealii::DoFHandler<2,
> 2> const*, dealii::TrilinosWrappers::MPI::BlockVector const*,
> dealii::DataPostprocessor<2> const*)
> #3 /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2:
> std::__detail::_MakeUniq 2, double> >::__single_object
> std::make_unique double>, dealii::DoFHandler<2, 2> const*,
> dealii::TrilinosWrappers::MPI::BlockVector const*,
> dealii::DataPostprocessor<2> const*>(dealii::DoFHandler<2, 2>