Re: [deal.II] Re: using .vtk file as initial condition

2016-11-08 Thread Anup Basak
Hello all,

It seems that using block_write() and block_read would be easier to store 
data and reuse them 
as initial conditions on identical geometry and mesh compared to using 
boost:serialization. However,
I have some issues and quires (I do not use parallelization in my code). I 
shall be thankful if someone
clarifies the following things:

(i) Suppose I want to store my 'Solution' vector to the zeroth block of a 
BlockVector 'solution_save'.
For that I have used the following command (in blue) and I get error (in 
red). It seems that the first
line is not the correct way to store vectors in the block. Can you please 
let me know the correct command?

solution_save.block(0) = solution;
std::ofstream output_text("data.txt");
solution_save.block_write(output_text);

/home/abasak/Desktop/Anup/dealiicodes/myprogs/junks/step-26/step-26.cc:338:28: 
error: no match for ‘operator=’ (operand types are ‘const BlockType {aka 
const dealii::Vector}’ and ‘const dealii::Vector’)
 solution_save.block(0) = solution;

2. I am solving mechanics problem. So I need to store the stress and strain 
tensors at each node as well. I was wondering if it is possible to store
the tensors somehow. One possibility could be, I think, to store all nine 
(here six) components in different blocks and reunite them while reading. 
But is there a smarter way to store tensors?

3. Also, I must save the triangulation and all nodal and element 
information. How to go about it?

Many thanks,

Regards,
Anup.






On Monday, November 7, 2016 at 7:31:08 PM UTC-6, Wolfgang Bangerth wrote:
>
> On 11/07/2016 06:11 PM, Anup Basak wrote: 
> > 
> > It seems that to work with load() and save() one needs to work with 
> boost 
> > packages. 
> > I was wondering if it is already inbuilt in dealii packages or I need to 
> > install boost and build it 
> > separately. 
>
> It's all there already, ready for you to use :-) 
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] Re: using .vtk file as initial condition

2016-11-06 Thread Anup Basak
Hello all,

I shall be thankful if someone could tell me in details how to use 'save()' 
and 'load()' functions to save and load 
triangulation information and the nodal values of displacements, strains, 
stresses, and may be temperature
(similar to step44) so that they can be used as initial data in another 
simulations with the identical triangulation data.

Or if there is some other simpler way.

Thanks and regards,
Anup.

On Tuesday, November 1, 2016 at 6:23:09 PM UTC-5, Anup Basak wrote:
>
> Dear Jean-Paul and Timo,
>
> Thank you very much for your reply. 
>
> I would like to use 'save ()' and 'load() ' functions as both of you 
> suggested, but it is not
> fully clear to me how should they be used in the dealii code (I am using a 
> code similar to step-44
> large deformation problem). Suppose I need  to save all the trangulation 
> information and 
> data like displacements, stresses, strains, etc. and use them as initial 
> data on the saved
>  geometry.
>
> It would be very helpful if you kindly explain little elaborately and tell 
> me if any of the examples
> has used this idea (or some other reference).
>
> Thanks a lot.
>
> Regards,
> Anup.
>
>
>
>
> On Fri, Oct 14, 2016 at 1:51 PM, Timo Heister  wrote:
>
>> .vtk files are visualization output, which always involves some loss
>> of information (for example we interpolate linearly to the vertices of
>> each cell by default), so therefore it is
>> complicated/inaccurate/undesirable to reconstruct a finite element
>> solution vector from it. This is the reason nobody has implemented
>> this inside deal.II so far. You should consider storing the finite
>> element solution and read that back in or do what J-P suggests.
>>
>> On Wed, Oct 12, 2016 at 2:29 AM, Jean-Paul Pelteret
>>  wrote:
>> > Dear Anup.
>> >
>> > I notice that this question has been asked before, but remains without 
>> an
>> > answer. I'm not sure that this is possible - so far, save and load 
>> functions
>> > only read/write to boost archive data structures. You're probably 
>> better off
>> > investigating using these functions instead of a VTK file. That being 
>> said,
>> > if its an ASCII VTK file then it wouldn't be too difficult it wouldn't 
>> be
>> > too difficult to implement such functionality. But things could get 
>> tricky
>> > if you are using parallel data structures.
>> >
>> > Regards,
>> > J-P
>> >
>> >
>> > On Wednesday, October 12, 2016 at 12:59:49 AM UTC+2, Anup Basak wrote:
>> >>
>> >> Dear all,
>> >>
>> >> I have a solution saved in two .vtk files for a mechanics problem
>> >> (displacement, stress, strain, temperature etc.
>> >> at the nodal points). Now let us say I want to use this as initial
>> >> conditions for another problem (the domain,
>> >> boundary conditions, and meshes are identical for both the problems).
>> >> Could anyone please suggest that
>> >> how should I implement it.
>> >>
>> >> Thanks,
>> >> Anup.
>> >
>> > --
>> > The deal.II project is located at 
>> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=utGxqw4FA4GTJrqTHK-pMzDeWHX906ycL5y2BTDm5VU=
>> > For mailing list/forum options, see
>> > 
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_forum_dealii-3Fhl-3Den=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=NvnyBWAmMqXf1ji8zz6NQ9zrD-5tM-0RXGWHuI48rWQ=
>> > ---
>> > 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.
>> > For more options, visit 
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.google.com_d_optout=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=Cdt_SsJ9xS_vt6t8lyvpIFqOUHyn-imvC7IVOeNoZJs=
>>  
>> .
>>
>>
>>
>> --
>> 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.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 

Re: [deal.II] Re: using .vtk file as initial condition

2016-11-01 Thread Anup Basak
Dear Jean-Paul and Timo,

Thank you very much for your reply.

I would like to use 'save ()' and 'load() ' functions as both of you
suggested, but it is not
fully clear to me how should they be used in the dealii code (I am using a
code similar to step-44
large deformation problem). Suppose I need  to save all the trangulation
information and
data like displacements, stresses, strains, etc. and use them as initial
data on the saved
 geometry.

It would be very helpful if you kindly explain little elaborately and tell
me if any of the examples
has used this idea (or some other reference).

Thanks a lot.

Regards,
Anup.




On Fri, Oct 14, 2016 at 1:51 PM, Timo Heister  wrote:

> .vtk files are visualization output, which always involves some loss
> of information (for example we interpolate linearly to the vertices of
> each cell by default), so therefore it is
> complicated/inaccurate/undesirable to reconstruct a finite element
> solution vector from it. This is the reason nobody has implemented
> this inside deal.II so far. You should consider storing the finite
> element solution and read that back in or do what J-P suggests.
>
> On Wed, Oct 12, 2016 at 2:29 AM, Jean-Paul Pelteret
>  wrote:
> > Dear Anup.
> >
> > I notice that this question has been asked before, but remains without an
> > answer. I'm not sure that this is possible - so far, save and load
> functions
> > only read/write to boost archive data structures. You're probably better
> off
> > investigating using these functions instead of a VTK file. That being
> said,
> > if its an ASCII VTK file then it wouldn't be too difficult it wouldn't be
> > too difficult to implement such functionality. But things could get
> tricky
> > if you are using parallel data structures.
> >
> > Regards,
> > J-P
> >
> >
> > On Wednesday, October 12, 2016 at 12:59:49 AM UTC+2, Anup Basak wrote:
> >>
> >> Dear all,
> >>
> >> I have a solution saved in two .vtk files for a mechanics problem
> >> (displacement, stress, strain, temperature etc.
> >> at the nodal points). Now let us say I want to use this as initial
> >> conditions for another problem (the domain,
> >> boundary conditions, and meshes are identical for both the problems).
> >> Could anyone please suggest that
> >> how should I implement it.
> >>
> >> Thanks,
> >> Anup.
> >
> > --
> > The deal.II project is located at https://urldefense.proofpoint.
> com/v2/url?u=http-3A__www.dealii.org_=CwIBaQ=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=
> utGxqw4FA4GTJrqTHK-pMzDeWHX906ycL5y2BTDm5VU=
> > For mailing list/forum options, see
> > https://urldefense.proofpoint.com/v2/url?u=https-3A__groups.
> google.com_d_forum_dealii-3Fhl-3Den=CwIBaQ=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=
> NvnyBWAmMqXf1ji8zz6NQ9zrD-5tM-0RXGWHuI48rWQ=
> > ---
> > 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.
> > For more options, visit https://urldefense.proofpoint.
> com/v2/url?u=https-3A__groups.google.com_d_optout=CwIBaQ=Ngd-
> ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmE
> jX38S7JmlS9Vw=ItwOC0neOpqcosvpqST2azKxUqBCeihSaE71KljSX5k=Cdt_SsJ9xS_
> vt6t8lyvpIFqOUHyn-imvC7IVOeNoZJs= .
>
>
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.