[deal.II] Re: Function to output stress and strain

2016-11-03 Thread Denis Davydov
Hi Lisa,

To project from quadrature points to (continuous) FE space you can use this 
function in current master branch of GitHub: 
https://www.dealii.org/developer/doxygen/deal.II/namespaceVectorTools.html#a2fdbf33bdf8531ce0e4febf656cd92da

you would need to do for each component of stress and strains (of course, 
knowing that the two are symmetric).

Regards,
Denis.

On Thursday, November 3, 2016 at 9:38:49 PM UTC+1, Lisa Collins wrote:
>
> Hello,
>
> I solved a problem using deal ii and now in the out put step I have 
> problem exporting nodal stress and strain values.
> in each cell I can calculate stress and strains at Gauss points but I 
> don't know how to calculate the stress and strains at nodes because they 
> are not continues.
>
> Can you please help me and guide me to calculate stress and strains at 
> nodes and export them.
>
> Thanks.
> Lisa
>

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


[deal.II] Re: Help in value_list

2016-11-03 Thread Atanu Banerjee
Thanks a lot for the reference. I got the point. Please help in one more 
thing.
While defining the virtual member functions, e.g., RightHandSide::value, at 
the end of the function declaration "const" is added. Why is it so? Can you 
please give a reference?

Thanks 
Atanu
 

On Thursday, November 3, 2016 at 9:42:23 PM UTC+5:30, Jean-Paul Pelteret 
wrote:
>
> You're welcome. Since you say that you're a C++ beginner, I'm not sure how 
> much you know about polymorphism: just in case you need some further 
> clarification, here's an example 
>  that highlights 
> what's actually going on here with the base and derived classes (namely 
> virtual function overloading).
>
> On Thursday, November 3, 2016 at 4:54:39 PM UTC+1, Atanu Banerjee wrote:
>>
>> Ok... Thank you Jean.
>>
>

-- 
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: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Jack

>
> Dear Prof. Bangerth,
>
Many thanks for your suggestions and help!
>
I will try this with your reference of Aspect. I hope I can figure out this 
> smoothly.
>
Thanks again!
>
Regards,
>
Jack
>

在 2016年11月3日星期四 UTC+8下午10:54:44,Wolfgang Bangerth写道:
>
> On 11/03/2016 03:32 AM, Denis Davydov wrote: 
> > I see. In serial mode all is doable because u can go from current cell 
> to 
> > neighbors to quadrature data and do whatever. 
> > 
> > For the case of MPI you would still need to somehow ship the data to 
> ghost 
> > cells. Because at some point neighbors of locally owned cells will be 
> ghost cells. 
> > 
> > I think it is doable by looking closer at p::d::Tria. Essentially you 
> need a 
> > function which takes parallel triangulation, QPData including ghost 
> cells and 
> > does synchronization of data at ghost cells within the MPI communicator 
> by 
> > getting it from processors that own those cells and thereby the data. Do 
> you 
> > want to give it a try and create a work-in-progress Pull-request on 
> GitHub? 
> > One can start with a simple unit test of 4 cells in 2D and 2 MPI cores. 
>
> Just for reference, Rene Gassmoeller implemented something similar for 
> particles recently: There, we store particles on every locally owned cell, 
> but 
> there are times when one also wants to access particles on ghost cells. 
> This 
> is implemented here: 
>https://github.com/geodynamics/aspect/pull/1216 
>https://github.com/geodynamics/aspect/pull/1253 
>
> It's not terribly complicated because one just has to gather the 
> information 
> on cells that are ghosts on some other processor, and then send this 
> information to all relevant processors. 
>
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [deal.II] DWARF version?

2016-11-03 Thread Victor Eijkhout

>
> /work/00434/eijkhout/trilinos/installation-12.2.1/lib/cmake/STK/STKConfig.cmake
>  says that this file needs tot exist 
> /work/00434/eijkhout/trilinos/installation-12.2.1/lib/cmake/STK/../STKDoc_tests/STKDoc_testsConfig.cmake
>  Can you check if it is there?

Ok, I fixed this one by editing out a line in that trilinos config file. Now 
the deal cmake goes a bit further, but still complains about an error. Can you 
look at the attached?

Victor.

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


cmake.log
Description: cmake.log


CMakeError.log
Description: CMakeError.log


[deal.II] Re: Function to output stress and strain

2016-11-03 Thread Daniel Arndt
Lisa,

I solved a problem using deal ii and now in the out put step I have problem 
> exporting nodal stress and strain values.
> in each cell I can calculate stress and strains at Gauss points but I 
> don't know how to calculate the stress and strains at nodes because they 
> are not continues.
>
What exactly do you want to do? You can project these quantities to some 
FiniteElement space or use DataPostProcessor. For the latter one, have a 
look at step-29 [1] and step-33 [2].
It is easier to help if you can be some more specific in what you expect 
the output to be.

Best,
Daniel
[1] https://www.dealii.org/8.4.1/doxygen/deal.II/step_29.html
[2] https://www.dealii.org/8.4.1/doxygen/deal.II/step_32.html

-- 
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: hp convergence for non-linear solver.

2016-11-03 Thread Jaekwang Kim
Thanks for replying me ! 

I moved to squared domain to avoid other possible error when I imply 
boundary condition, but I still have same manufactured solution e^(-x^2-y^2)
I have to say that I have some changed error curve after moving to new mesh 
domain. 
Which is slightly better, but still unsatisfying results. 



To see error per cell, I referred step 27, and make estimated error data 
out. 

I used following code lines



 Vector estimated_error_per_cell (triangulation.n_active_cells());



KellyErrorEstimator::estimate (dof_handler,

QGauss(3),

typename FunctionMap::type(),

solution,

estimated_error_per_cell);


In fact, I don't know how kelly error estimator works...
but just checked that it usually works well with Poisson Equations.



Seeing pictures above,,, when p=2 solution looks seemingly good, but 
estimated error_per_cell should be wrong. 
Since, exact solution the closer points to x=(0,0) (or left down corner in 
pic) has  sharp gradient, thus the larger error is expected. 
Think estimated error case for p=1 is correct. 

Now, I confirmed that the code is not working at higher degree. (p>=2)...
but it is not because of boundary condition...since I have four boundary 
(top,bottom,right,left...) but the points which show highest error is some 
what irrealted to boundary...

Do you have any idea about this? 

Always thank you for your time and advice!

Best regards,
Jaekwang Kim 



2016년 11월 2일 수요일 오후 8시 30분 19초 UTC-5, Wolfgang Bangerth 님의 말:
>
> On 11/02/2016 07:17 PM, Jaekwang Kim wrote: 
> > 
> > I'd like check the visualized error per cell. 
> > Is there any module in deal.ii that enables this...? 
> > 
>
> Yes, you just need to create a vector with as many entries as there are 
> cell 
> (e.g., the output of VectorTools::integrate_difference) and attach that to 
> the 
> DataOut object you have. step-27 shows how to do that, but it in essence 
> works 
> just like for vectors that have as many entries as there are DoFs. 
>
> 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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Function to output stress and strain

2016-11-03 Thread Lisa Collins
Hello,

I solved a problem using deal ii and now in the out put step I have problem 
exporting nodal stress and strain values.
in each cell I can calculate stress and strains at Gauss points but I don't 
know how to calculate the stress and strains at nodes because they are not 
continues.

Can you please help me and guide me to calculate stress and strains at 
nodes and export them.

Thanks.
Lisa

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


[deal.II] Re: Help in value_list

2016-11-03 Thread Jean-Paul Pelteret
You're welcome. Since you say that you're a C++ beginner, I'm not sure how 
much you know about polymorphism: just in case you need some further 
clarification, here's an example 
 that highlights 
what's actually going on here with the base and derived classes (namely 
virtual function overloading).

On Thursday, November 3, 2016 at 4:54:39 PM UTC+1, Atanu Banerjee wrote:
>
> Ok... Thank you Jean.
>

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


[deal.II] Re: Help in value_list

2016-11-03 Thread Atanu Banerjee
Ok... Thank you Jean.

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


[deal.II] Re: Help in value_list

2016-11-03 Thread Jean-Paul Pelteret
Dear Atanu,

The RightHandSide 
 
class in step-7 derives from the Function 
 
class. This in turn defines the value_list 

 
function that, according to the documentation, calls the value 

 
function. Since this function is marked as virtual, when the base class 
calls the value() function, the derived class' definition (i.e. what is 
defined in the RightHandSide class) is invoked.

I hope that this helps to explain what's going on here.

Regards,
J-P

On Thursday, November 3, 2016 at 4:08:24 PM UTC+1, Atanu Banerjee wrote:
>
>
> Hi,
>
> This may be a trivial issue, but as a beginner in c++, I am unable to to 
> understand the following. Someone please explain. 
> In step-7, there is no member function named "value_list" is defined for 
> the "right_hand_side" object. Then how is it used in the assemble_system. 
>
> Thanks
> Atanu
>

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


[deal.II] Help in value_list

2016-11-03 Thread Atanu Banerjee

Hi,

This may be a trivial issue, but as a beginner in c++, I am unable to to 
understand the following. Someone please explain. 
In step-7, there is no member function named "value_list" is defined for 
the "right_hand_side" object. Then how is it used in the assemble_system. 

Thanks
Atanu

-- 
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: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Wolfgang Bangerth

On 11/03/2016 03:32 AM, Denis Davydov wrote:

I see. In serial mode all is doable because u can go from current cell to
neighbors to quadrature data and do whatever.

For the case of MPI you would still need to somehow ship the data to ghost
cells. Because at some point neighbors of locally owned cells will be ghost 
cells.

I think it is doable by looking closer at p::d::Tria. Essentially you need a
function which takes parallel triangulation, QPData including ghost cells and
does synchronization of data at ghost cells within the MPI communicator by
getting it from processors that own those cells and thereby the data. Do you
want to give it a try and create a work-in-progress Pull-request on GitHub?
One can start with a simple unit test of 4 cells in 2D and 2 MPI cores.


Just for reference, Rene Gassmoeller implemented something similar for 
particles recently: There, we store particles on every locally owned cell, but 
there are times when one also wants to access particles on ghost cells. This 
is implemented here:

  https://github.com/geodynamics/aspect/pull/1216
  https://github.com/geodynamics/aspect/pull/1253

It's not terribly complicated because one just has to gather the information 
on cells that are ghosts on some other processor, and then send this 
information to all relevant processors.


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


Re: [deal.II] Postprocessing output of TensorFunction<1,dim>

2016-11-03 Thread Wolfgang Bangerth

On 11/03/2016 07:54 AM, Julian Dorn wrote:



  template 
  class AdvectionField : public TensorFunction<1,dim>
  {
 // define 2D velocity vector field
  }

How to do its Paraview/GMV-output?


The easiest way is probably to create an FESystem(FE_Q, dim) (i.e., a 
finite element with as many components as the vector field), then create a 
DoFHandler, use VectorTools::interpolate to interpolate your vector field onto 
this DoFHandler, and then use DataOut to write the result into a file.


I think this would actually make for a nice self-contained example that one 
could put into the "Possibilities for extensions" of one of the tutorials. 
Want to give this a try and see whether you can come up with some code that 
does that?


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


[deal.II] Postprocessing output of TensorFunction<1,dim>

2016-11-03 Thread Julian Dorn
hello everybody, 

in (taken from the example 9):

  template 
  class AdvectionField : public TensorFunction<1,dim>
  {
 // define 2D velocity vector field
  }

How to do its Paraview/GMV-output? 
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.
For more options, visit https://groups.google.com/d/optout.


[deal.II] Re: Visit error...?

2016-11-03 Thread hanks0227
 
Oh, I see

I'm sorry I thought about it in the wrong way.

Thank you very much your kind reply.

Kyusik. 

>  
>

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


[deal.II] Re: Visit error...?

2016-11-03 Thread Bruno Turcksin
Kyusik,

On Thursday, November 3, 2016 at 5:51:20 AM UTC-4, hanks0...@gmail.com 
wrote:
>
>
> And, I also calculated the {l2_norm of (exact_solution - numeric_solution) 
> / sqrt(#cells)} (I divided l2norm by sqrt(#cell) Because I want to know 
> kind of average value of difference between two solution.)
>
> i.e. I want to calculate  sqrt{sum_i(exact_sol_i - sol_i)^2 / (#cell)} (I 
> think it is kind of average value of difference between two solutions)
>
This has only a meaning if all the cells have the same area. If your domain 
has 2 cells, a large one where the error is 0 and small one where the error 
is one, your average error will be 0.5 which is not true. 
 

> So, l2_norm(error) is 1.14461e-09 
>
> But the almost all values in the plot of error(Error_fe1.png) are about 
> 10^-4 that is 10^5 times higher than l2norm.
>
> I don't know what makes this big difference between 2 values.
>
I don't understand what's the problem here. Your average value is between 0 
and the the maximum value, so why is that a problem? The maximum error is 
only at a few points at the boundary, most of the domain has an error much 
smaller than the maximum. What is the error in the blue zone?

Best,

Brunon
 

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


[deal.II] Re: Visit error...?

2016-11-03 Thread hanks0227
Arndt,

First of all, Thank you very much for your reply.
 

> What do you mean by "average value" here? You probably just wnat to 
> compute the error in the L2-norm, isn't it?
>

I'm sorry this is not average, it is RMS value.
 
In deal.ii, from step7, L2 norm is calculated like this...
 L2_norm= sqrt (sum_i [error_i^2])

But What I want is 
L2_norm = sqrt(sum_i [error_i^2]) / sqrt(the number of cells)

  
  So, I thought most values in the plot Error_fe1.png sholud be order of 
L2_norm (that is  sqrt(sum_i [error_i^2]) / sqrt(the number of cells)) 
Because summation of error^2 is divided by the number of cells

  But the result is not... 

  most values in Error_fe1.png are 10^3 times higher than L2_norm (in this 
case 4.7163e-07)

  Is it wrong?

  Thank you.

   Kyusik. 

  
 

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


[deal.II] Re: Visit error...?

2016-11-03 Thread Daniel Arndt
Kyusik,



Am Donnerstag, 3. November 2016 10:51:20 UTC+1 schrieb hank...@gmail.com:
>
> Hi all,
>
> I'm trying to calculate absolute values of (exact_solution - 
> numeric_solution) and visualize it using Visit.
>
> So, I added the following in my code.
>
> error = solution;
> error -= exact_solution;
>
> for(unsigned it i=0;i error(i)=std::fabs(error(i));
>
> ...
> data_out.add_data_vector(solution,"solution");
> data_out.add_data_vector(exact_solution,"exact_solution");
> data_out.add_data_vector(error,"error");
>
Yes, this gives you a representation of the discretization error.

And, I also calculated the {l2_norm of (exact_solution - numeric_solution) 
> / sqrt(#cells)} (I divided l2norm by sqrt(#cell) Because I want to know 
> kind of average value of difference between two solution.)
>
> i.e. I want to calculate  sqrt{sum_i(exact_sol_i - sol_i)^2 / (#cell)} (I 
> think it is kind of average value of difference between two solutions)
>
What do you mean by "average value" here? You probably just wnat to compute 
the error in the L2-norm, isn't it?


> So, I added the following in my code
>
> Vector difference_per_cell (triangulation.n_active_cells());
> VectorTools::integrate_difference(dof_handler,
>   solution,
>   ExactSolution(),
>   difference_per_cell,
>   QGauss(2),
>   
> VectorTools::L2_norm);
> const double L2_error = difference_per_cell.l2_norm();
>
> std::cout<<"l2norm(error)="<
> So, l2_norm(error) is 1.14461e-09 
>
> But the almost all values in the plot of error(Error_fe1.png) are about 
> 10^-4 that is 10^5 times higher than l2norm.
>
If the error is O(1.e-4) you expect the L^2 error to be approximately 
\sqrt{\int_\Omega 1.e-8} = |\Omega|^{1/2} 1.e-4.
Assuming |\Omega|~1, this would suggest that you use approximately 
1.e-4/1.e-9=1.e5 cells.

What I want to say: Consider just the L2-norm! Due to |\Omega|~1, this 
should give you an error in the magnitude of what you are observing in the 
plot.

Best,
Daniel

-- 
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: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Jack


Hi Denis,

Thanks.

Yes, that’s right. For distributed MPI parallel computing, this is a big 
problem.

 

I have just learned deal.II for less than three months, so I’m still new. 
And also I’m not working on numerical mathematics, so it is difficult for 
me to solve such problem but I will try. If I figure out this problem I 
will post it to the forum. If you have made some progress on this problem, 
please tell me promptly.

 

Thanks so much.


Cheers,


Jack

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


[deal.II] Re: Visit error...?

2016-11-03 Thread hanks0227

I'm sorry, I missed the sqrt(#cell) in the calculation of L2norm

I did 
std::cout<<"l2norm(error)="

Re: [deal.II] Re: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Denis Davydov
Hi Jack,

One more approach:

you first loop over all locally owned cells and determine the local flag 
(tru/false).
Then you still need to ship this to ghost cells on other MPI processors.
On doing that you can do your assembly as usual.

Kind regards,
Denis 

> On 3 Nov 2016, at 10:12, Jack  wrote:
> 
> Dear Denis,
> 
>  
> 
> Thanks for your replies.
> 
>  
> 
> I do not have some data attached to ghost cells. But I have a variable that 
> changes with time and its change depends on the data of neighbor cells.
> 
> For example,
> 
> const double value1 = 1, value2 =-1;
> 
> for (cell = tr.begin_active(); cell != tr.end(); ++cell)
> 
> if (cell -> is_locally_owned()){
> 
> bool flag = false;
> 
> std::vector > qpd = data_storage.template 
> get_data(cell);
> 
> for (unsigned int q = 0; q < n_q_points; ++q)
> 
> if(qpd->value[q]> 0) {flag = true; break;}
> 
>  
> 
> if(!flag)
> 
> // finding the qpd values of neighbor cells and check all the values
> 
> //if one of them is positive, then flag = true;
> 
>  
> 
> //Setting the gpd values of present cell.
> 
> for (unsigned int q = 0; q < n_q_points; ++q)
> 
> {
> 
> if(flag) qpd->value[q] = value1;
> 
> else qpd->value[q] = value2;
> 
> }
> 
> ….
> 
> }
> 
> 
> 
> Thanks!
> 
> 
> -- 
> 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 a topic in the Google 
> Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/Rqg7gwmS0Rg/unsubscribe 
> .
> To unsubscribe from this group and all its topics, 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.


Re: [deal.II] Re: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Denis Davydov
I see. In serial mode all is doable because u can go from current cell to 
neighbors to quadrature data and do whatever.

For the case of MPI you would still need to somehow ship the data to ghost 
cells. Because at some point neighbors of locally owned cells will be ghost 
cells.

I think it is doable by looking closer at p::d::Tria. Essentially you need a 
function which takes parallel triangulation, QPData including ghost cells and 
does synchronization of data at ghost cells within the MPI communicator by 
getting it from processors that own those cells and thereby the data. Do you 
want to give it a try and create a work-in-progress Pull-request on GitHub? One 
can start with a simple unit test of 4 cells in 2D and 2 MPI cores.

Ps. Essentially, i would say it all has to do with the fact that your problem 
is non-local.

Cheers,
Denis

> 03 нояб. 2016 г., в 10:12, Jack  написал(а):
> 
> Dear Denis,
> 
>  
> 
> Thanks for your replies.
> 
>  
> 
> I do not have some data attached to ghost cells. But I have a variable that 
> changes with time and its change depends on the data of neighbor cells.
> 
> For example,
> 
> const double value1 = 1, value2 =-1;
> 
> for (cell = tr.begin_active(); cell != tr.end(); ++cell)
> 
> if (cell -> is_locally_owned()){
> 
> bool flag = false;
> 
> std::vector > qpd = data_storage.template 
> get_data(cell);
> 
> for (unsigned int q = 0; q < n_q_points; ++q)
> 
> if(qpd->value[q]> 0) {flag = true; break;}
> 
>  
> 
> if(!flag)
> 
> // finding the qpd values of neighbor cells and check all the values
> 
> //if one of them is positive, then flag = true;
> 
>  
> 
> //Setting the gpd values of present cell.
> 
> for (unsigned int q = 0; q < n_q_points; ++q)
> 
> {
> 
> if(flag) qpd->value[q] = value1;
> 
> else qpd->value[q] = value2;
> 
> }
> 
> ….
> 
> }
> 
> 
> 
> Thanks!
> 
> -- 
> 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 a topic in the Google 
> Groups "deal.II User Group" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/dealii/Rqg7gwmS0Rg/unsubscribe.
> To unsubscribe from this group and all its topics, 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.


[deal.II] Re: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Jack


Dear Denis,

 

Thanks for your replies.

 

I do not have some data attached to ghost cells. But I have a variable that 
changes with time and its change depends on the data of neighbor cells.

For example,

const double value1 = 1, value2 =-1; 

for (cell = tr.begin_active(); cell != tr.end(); ++cell)

if (cell -> is_locally_owned()){

bool flag = false;

std::vector > qpd = data_storage.template 
get_data(cell);

for (unsigned int q = 0; q < n_q_points; ++q)

if(qpd->value[q]> 0) {flag = true; break;}

 

if(!flag)

// finding the qpd values of neighbor cells and check all the values

//if one of them is positive, then flag = true;

 

//Setting the gpd values of present cell.

for (unsigned int q = 0; q < n_q_points; ++q)

{

if(flag) qpd->value[q] = value1;

else qpd->value[q] = value2;

}

….

}


Thanks!

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


[deal.II] Re: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Denis Davydov
Hi Jack,

Could you please elaborate why you need to read the data on ghost cells? 
The CellDataStorage and TransferableQuadraturePointData classes are 
designed to do assembly,
where we always loop over *locally owned cells* and calculate local 
matrices to be assembled. If the ownership of cells change during 
coarsening/refinement,
the quadrature data will be shipped to a new owner.

However when designing these classes we did not consider their usage with 
ghost cells.
You could theoretically have some data attached to ghost cells, but I am 
not sure you will be able to synrchonize it easily.
Namely, when the locally owned data belonging to some processor changes, 
you would need to ship this to other processors
for which this cell is a ghost cell. That's not implemented, if I recall 
correctly.

Cheers,
Denis.

On Thursday, November 3, 2016 at 8:24:11 AM UTC+1, Jack wrote:
>
> Dear Jean,
>
>  
>
> Thanks so much for your suggestions. I’m really very happy for such new 
> development.
>
>  
>
> I understand that using the CellDataStorage and 
> TransferableQuadraturePointData classes  is better than user_pointer when 
> the mesh requires coarsening and refining. 
>
> *Yet I do not understand how can I read the data of a neighbor quadrature 
> point that happens to in a ghost cell. Could you give me some clues?*
>
>  
>
> Thanks!
>

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


[deal.II] Re: Problems in handling the userdata of Distributed Triangulation

2016-11-03 Thread Jack


Dear Jean,

 

Thanks so much for your suggestions. I’m really very happy for such new 
development.

 

I understand that using the CellDataStorage and 
TransferableQuadraturePointData classes  is better than user_pointer when 
the mesh requires coarsening and refining. 

*Yet I do not understand how can I read the data of a neighbor quadrature 
point that happens to in a ghost cell. Could you give me some clues?*

 

Thanks!

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