[deal.II] error: cannot declare variable ‘postprocessor’ to be of abstract type ‘FracturePhaseFieldProblem<2>::Postprocessor’

2024-01-30 Thread Tiny Y
Hi,
I built a class called  FracturePhaseFieldProblem   , which contains a 
subclass called  class Postprocessor,

template 

class FracturePhaseFieldProblem

{

public:

…

private:

  …

void output_results () const;

class Postprocessor;

…

};

However when I want to declare a variable as the type 
FracturePhaseFieldProblem<2>::Postprocessor in function output_results (),I 
got the error: 

error: cannot declare variable ‘postprocessor’ to be of abstract type 
‘FracturePhaseFieldProblem<2>::Postprocessor’

Thank you very much.

Best,

Yu


-- 
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/614d3444-46ca-4d32-9172-a7a5e3bf7a7bn%40googlegroups.com.


[deal.II] Dimension 5440 not equal to 8160

2023-11-03 Thread Tiny Y


Hi,


My code, although there were errors before the change, could run under 
single core mode. However, after I made some modifications, the following 
error message appeared. When I run the code before the change again, the 
following error message will also appear. 

I just tried to change the error reported in the previous code and added a 
few parameter definitions. Why do the same code produce different results?

Any advice on this issue would be appreciated.


Best regard,

Yu

===
Timestep 0: 0 (0.001)   Cells: 2560   DoFs: 10880
---

It. #A.Set Residual Reduction LSrch #LinIts
0 1.056223e+00
1 1363

An error occurred in line <162> of file 

 
in function
void 
dealii::TrilinosWrappers::PreconditionAMG::AdditionalData::set_operator_null_space(Teuchos::ParameterList&,
 
std::unique_ptr&, const Epetra_RowMatrix&) const
The violated condition was: 
constant_modes[d].size() == expected_mode_size
Additional information: 
Dimension 5440 not equal to 8160.

Stacktrace:
---
#0  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2: 
dealii::TrilinosWrappers::PreconditionAMG::AdditionalData::set_operator_null_space(Teuchos::ParameterList&,
 
std::unique_ptr 
>&, Epetra_RowMatrix const&) const
#1  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2: 
dealii::TrilinosWrappers::PreconditionAMG::AdditionalData::set_parameters(Teuchos::ParameterList&,
 
std::unique_ptr 
>&, Epetra_RowMatrix const&) const
#2  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2: 
dealii::TrilinosWrappers::PreconditionAMG::initialize(Epetra_RowMatrix 
const&, dealii::TrilinosWrappers::PreconditionAMG::AdditionalData const&)
#3  /home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2: 
dealii::TrilinosWrappers::PreconditionAMG::initialize(dealii::TrilinosWrappers::SparseMatrix
 
const&, dealii::TrilinosWrappers::PreconditionAMG::AdditionalData const&)
#4  ./cracks: FracturePhaseFieldProblem<2>::assemble_system(bool)
#5  ./cracks: FracturePhaseFieldProblem<2>::newton_active_set()
#6  ./cracks: FracturePhaseFieldProblem<2>::run()
#7  ./cracks: main


[qincai-OMEN:37046] *** Process received signal ***
[qincai-OMEN:37046] Signal: Aborted (6)
[qincai-OMEN:37046] Signal code:  (-6)
[qincai-OMEN:37046] [ 0] 
/lib/x86_64-linux-gnu/libc.so.6(+0x3c460)[0x7f475f83c460]
[qincai-OMEN:37046] [ 1] 
/lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x11b)[0x7f475f89152b]
[qincai-OMEN:37046] [ 2] 
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x16)[0x7f475f83c3b6]
[qincai-OMEN:37046] [ 3] 
/lib/x86_64-linux-gnu/libc.so.6(abort+0xd7)[0x7f475f82287c]
[qincai-OMEN:37046] [ 4] 
/home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2(_ZN6dealii18deal_II_exceptions9internals22do_issue_error_nothrowERKNS_13ExceptionBaseE+0x0)[0x7f47788c4264]
[qincai-OMEN:37046] [ 5] 
./cracks(_ZN6dealii18deal_II_exceptions9internals20issue_error_noreturnINS_18StandardExceptions20ExcDimensionMismatchEEEvNS1_17ExceptionHandlingEPKciS7_S7_S7_T_+0x8c)[0x555c60715cc0]
[qincai-OMEN:37046] [ 6] 
/home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2(_ZNK6dealii16TrilinosWrappers15PreconditionAMG14AdditionalData23set_operator_null_spaceERN7Teuchos13ParameterListERSt10unique_ptrI18Epetra_MultiVectorSt14default_deleteIS7_EERK16Epetra_RowMatrix+0x3c2)[0x7f47782f1602]
[qincai-OMEN:37046] [ 7] 
/home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2(_ZNK6dealii16TrilinosWrappers15PreconditionAMG14AdditionalData14set_parametersERN7Teuchos13ParameterListERSt10unique_ptrI18Epetra_MultiVectorSt14default_deleteIS7_EERK16Epetra_RowMatrix+0xf19)[0x7f47782f0b55]
[qincai-OMEN:37046] [ 8] 
/home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2(_ZN6dealii16TrilinosWrappers15PreconditionAMG10initializeERK16Epetra_RowMatrixRKNS1_14AdditionalDataE+0x72)[0x7f47782f1d94]
[qincai-OMEN:37046] [ 9] 
/home/qincai/dealii-candi/deal.II-v9.4.2/lib/libdeal_II.g.so.9.4.2(_ZN6dealii16TrilinosWrappers15PreconditionAMG10initializeERKNS0_12SparseMatrixERKNS1_14AdditionalDataE+0x45)[0x7f47782f1d1f]
[qincai-OMEN:37046] [10] 
./cracks(_ZN25FracturePhaseFieldProblemILi2EE15assemble_systemEb+0x23202)[0x555c60791ece]
[qincai-OMEN:37046] [11] 
./cracks(_ZN25FracturePhaseFieldProblemILi2EE17newton_active_setEv+0x996)[0x555c6074dfc4]
[qincai-OMEN:37046] [12] 
./cracks(_ZN25FracturePhaseFieldProblemILi2EE3runEv+0x127c)[0x555c607322e6]
[qincai-OMEN:37046] [13] ./cracks(main+0x44c)[0x555c606e04f3]
[qincai-OMEN:37046] [14] 
/lib/x86_64-linux-gnu/libc.so.6(+0x23a90)[0x7f475f823a90]
[qincai-OMEN:37046] [15] 
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x89)[0x7f475f823b49]
[qincai-OMEN:37046] [16] ./cracks(_start+0x25)[0x555c606cb4d5]
[qincai-OMEN:37046] *** End of 

Re: [deal.II] Using KINSOL with distributed vectors

2023-10-31 Thread Tiny Y
Hi Nori,

I'm sorry to bother you again. I would like to know which function you used 
to obtain vectors without ghost element from vectors with ghost element. If 
convenient, could you please share the code in this area or your ideas for 
implementing this process.  Thank you very much for your kind help.

Best,
Yu

在2023年10月27日星期五 UTC+8 11:51:06 写道:

> Hi Nori,
>
> Thank you for your reply. Your method is very enlightening to me.
>
> Best,
> Yu
> 在2023年10月27日星期五 UTC+8 10:41:27 写道:
>
>> Hi Yu,
>>
>> Sorry,  what I wrote above is not correct at some part.
>> Whe using KINSOL, one needs to prepare call back functions to assemble 
>> residual and jacobian. At the beginning of these functions, I made a copy 
>> of the non-ghosted solution to a ghosted vector because KINSOL passes a 
>> non-ghosted solution vector to these functions. The following assembly part 
>> is done with the ghosted solution vector.
>> In addition, when calling KINSOL::solve(), I changed my code to pass a 
>> non-ghosted solution vector instead of a ghosted one.
>>
>> Best,
>> Nori
>>
>> 2023年10月27日金曜日 11:22:28 UTC+9 Norihiro Watanabe:
>>
>>> Hi Yu,
>>>
>>> Though I'm not sure this is optimum, how I solved the problem was
>>> 1) prepare two MPI vectors for stroring initial solutions. One is with 
>>> ghost elements and another one is without ghost (I guess you have alredy 
>>> one of them). Values of the vectors should be same.
>>> 2) assemble residual and/or jacobian using the solution vector with ghost
>>> 3) pass the non-ghosted solution vector to KINSOL and solve the nonlinear
>>> 4) copy the KINSOL's returned non-ghosed solution vector to the ghosted 
>>> solution vector  
>>> 5) go back to step 2 to evalulate new residual
>>>
>>> Details about ghosted vectors are explained in, for example,
>>>
>>> https://www.dealii.org/current/doxygen/deal.II/DEALGlossary.html#GlossGhostedVector
>>> https://www.dealii.org/current/doxygen/deal.II/group__distributed.html
>>>
>>> Best,
>>> Nori
>>>
>>> 2023年10月27日金曜日 11:10:44 UTC+9 Tiny Y:
>>>
>>>> HI Norihiro Watanabe,
>>>> Hello, I am a novice in Dealii. I have encountered a similar problem to 
>>>> yours. Have you solved this problem? How did you solve it?Can you explain 
>>>> what do you mean by ' create a ghosted copy in the assemble '.Thank you 
>>>> very much!
>>>> Best,
>>>> Yu
>>>>
>>>>

-- 
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/6f5ae035-292a-42c9-989e-666d89088680n%40googlegroups.com.


Re: [deal.II] Using KINSOL with distributed vectors

2023-10-26 Thread Tiny Y
Hi Nori,

Thank you for your reply. Your method is very enlightening to me.

Best,
Yu
在2023年10月27日星期五 UTC+8 10:41:27 写道:

> Hi Yu,
>
> Sorry,  what I wrote above is not correct at some part.
> Whe using KINSOL, one needs to prepare call back functions to assemble 
> residual and jacobian. At the beginning of these functions, I made a copy 
> of the non-ghosted solution to a ghosted vector because KINSOL passes a 
> non-ghosted solution vector to these functions. The following assembly part 
> is done with the ghosted solution vector.
> In addition, when calling KINSOL::solve(), I changed my code to pass a 
> non-ghosted solution vector instead of a ghosted one.
>
> Best,
> Nori
>
> 2023年10月27日金曜日 11:22:28 UTC+9 Norihiro Watanabe:
>
>> Hi Yu,
>>
>> Though I'm not sure this is optimum, how I solved the problem was
>> 1) prepare two MPI vectors for stroring initial solutions. One is with 
>> ghost elements and another one is without ghost (I guess you have alredy 
>> one of them). Values of the vectors should be same.
>> 2) assemble residual and/or jacobian using the solution vector with ghost
>> 3) pass the non-ghosted solution vector to KINSOL and solve the nonlinear
>> 4) copy the KINSOL's returned non-ghosed solution vector to the ghosted 
>> solution vector  
>> 5) go back to step 2 to evalulate new residual
>>
>> Details about ghosted vectors are explained in, for example,
>>
>> https://www.dealii.org/current/doxygen/deal.II/DEALGlossary.html#GlossGhostedVector
>> https://www.dealii.org/current/doxygen/deal.II/group__distributed.html
>>
>> Best,
>> Nori
>>
>> 2023年10月27日金曜日 11:10:44 UTC+9 Tiny Y:
>>
>>> HI Norihiro Watanabe,
>>> Hello, I am a novice in Dealii. I have encountered a similar problem to 
>>> yours. Have you solved this problem? How did you solve it?Can you explain 
>>> what do you mean by ' create a ghosted copy in the assemble '.Thank you 
>>> very much!
>>> Best,
>>> Yu
>>>
>>>

-- 
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/21667ae0-5073-452b-ab33-af9bd6b425aan%40googlegroups.com.


Re: [deal.II] Using KINSOL with distributed vectors

2023-10-26 Thread Tiny Y
HI Norihiro Watanabe,
Hello, I am a novice in Dealii. I have encountered a similar problem to 
yours. Have you solved this problem? How did you solve it?Can you explain 
what do you mean by ' create a ghosted copy in the assemble '.Thank you 
very much!
Best,
Yu

-- 
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/78572b83-d689-44b8-aeb6-0c43f88a04f6n%40googlegroups.com.


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

2023-10-10 Thread Tiny Y
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 >::__single_object 
std::make_unique, 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 >::__single_object 
std::make_unique, 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