Re: [deal.II] Extension of Step-18

2023-09-14 Thread Wolfgang Bangerth

On 9/14/23 20:13, Raghunandan Pratoori wrote:


The above section of code gives an error during the compress operation. The 
error message is -
‘class std::vectorstd::allocator > >’ has no member named 
‘compress’


The above error message is expected as the compress operation is not defined 
for that datatype. However, I am unsure how to do the compress operation, as 
mentioned in Step-18. Please advice.


Well, as you already note, there is no compress() member function on 
std::vector. But you don't want to call compress() on the std::vector anyway, 
you want to call it on the individual TrilinosWrappers::MPI::Vector objects 
that are stored in the std::vector. The following should do:


  for (unsigned int i=0; ihttp://www.math.colostate.edu/~bangerth/


--
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/b694a626-536d-a5ff-4b9f-28105b8d222f%40colostate.edu.


Re: [deal.II] Extension of Step-18

2023-09-14 Thread Raghunandan Pratoori
Hello Dr. Bangerth,

I apologize for the poor communication from my side.
Below are the changes I made to the refinement process in Step-18 in red:

typedef TrilinosWrappers::MPI::Vector vectorType;
std::vector>   history_field (dim, std::vector< 
Vector >(dim));
std::vector< std::vector< Vector > >
 local_history_values_at_qpoints (dim, std::vector< 
Vector >(dim)),
 local_history_fe_values (dim, std::vector< Vector 
>(dim));
for (unsigned int i=0; i > >’ has no member 
named ‘compress’

The above error message is expected as the compress operation is not 
defined for that datatype. However, I am unsure how to do the compress 
operation, as mentioned in Step-18. Please advice.

Best,
Raghunandan.
On Thursday, September 14, 2023 at 6:49:11 PM UTC-5 Wolfgang Bangerth wrote:

> On 9/14/23 15:50, Raghunandan Pratoori wrote:
> > 
> > It took me some time to get around to trying it out. I am unable to 
> figure out 
> > how to compress the vector.
> > The simple 'history_field.compress(VectorOperation::add);' did not work 
> as 
> > expected. Can you tell me how to use it for type 
> > std::vector>?
>
> Pratoori:
> you will have to be more specific in explaining what doesn't work. "did 
> not 
> work" is not enough for me to understand what you are doing, nor what is 
> going 
> wrong. It's as if you were saying "I've tried to prove the Riemann 
> hypothesis, 
> but the proof doesn't work. Can you tell me how to fix it?" without 
> showing 
> what you already did :-)
>
> Show us the code and the error message, and then we can perhaps help!
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>
>

-- 
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/351857f8-b2fd-4c00-9463-1638a808b1a0n%40googlegroups.com.


Re: [deal.II] Extension of Step-18

2023-09-14 Thread Wolfgang Bangerth

On 9/14/23 15:50, Raghunandan Pratoori wrote:


It took me some time to get around to trying it out. I am unable to figure out 
how to compress the vector.
The simple 'history_field.compress(VectorOperation::add);' did not work as 
expected. Can you tell me how to use it for type 
std::vector>?


Pratoori:
you will have to be more specific in explaining what doesn't work. "did not 
work" is not enough for me to understand what you are doing, nor what is going 
wrong. It's as if you were saying "I've tried to prove the Riemann hypothesis, 
but the proof doesn't work. Can you tell me how to fix it?" without showing 
what you already did :-)


Show us the code and the error message, and then we can perhaps help!

Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/


--
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/8614306f-1a8e-5079-b16f-d4bbe361fff8%40colostate.edu.


Re: [deal.II] Extension of Step-18

2023-09-14 Thread Raghunandan Pratoori
Thank you, Dr. Bangerth, for the prompt reply.

It took me some time to get around to trying it out. I am unable to figure 
out how to compress the vector.
The simple 'history_field.compress(VectorOperation::add);' did not work as 
expected. Can you tell me how to use it for type  
std::vector>?

Best,
Raghunandan.

On Monday, September 4, 2023 at 9:59:49 PM UTC-5 Wolfgang Bangerth wrote:

> On 9/4/23 20:57, Raghunandan Pratoori wrote:
> > I want to clarify if the below is the correct implementation of it -
> > 
> > std::vector>> 
> > history_field_stress (dim, 
> > std::vector>(dim)),
> > 
> > 
> > history_field.compress(VectorOperation::add);
> > 
>
> A good first test is to try and see what happens! In fact, that's often 
> faster 
> than writing a question, and then waiting to see whether anyone answers it 
> :-)
>
> Best
> W.
>
> -- 
> 
> Wolfgang Bangerth email: bang...@colostate.edu
> www: http://www.math.colostate.edu/~bangerth/
>
>
>

-- 
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/cb7f90be-54fc-4ea5-a4ad-3e15cf78f355n%40googlegroups.com.


Re: [deal.II] Extension of Step-18

2023-09-04 Thread Wolfgang Bangerth

On 9/4/23 20:57, Raghunandan Pratoori wrote:

I want to clarify if the below is the correct implementation of it -

std::vector>> 
history_field_stress (dim, 
std::vector>(dim)),



history_field.compress(VectorOperation::add);



A good first test is to try and see what happens! In fact, that's often faster 
than writing a question, and then waiting to see whether anyone answers it :-)


Best
 W.

--

Wolfgang Bangerth  email: bange...@colostate.edu
   www: http://www.math.colostate.edu/~bangerth/


--
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/4df65aff-4280-71a4-4a1b-462254f2cbf4%40colostate.edu.


[deal.II] Extension of Step-18

2023-09-04 Thread Raghunandan Pratoori
Hello team,

I want to implement Refinement during timesteps 

 as 
described in Step-18, but for a much larger problem. I want to do this 
using a parallel vector for history_field. I want to clarify if the below 
is the correct implementation of it -

std::vector>> 
history_field_stress (dim, 
std::vector>(dim)),


history_field.compress(VectorOperation::add);


Thanks in advance,
Raghunandan.

-- 
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/e340ead9-505d-401c-aebb-c8fd2cc2a193n%40googlegroups.com.