Re: [deal.II] condition number

2016-11-15 Thread Wolfgang Bangerth


Anup,


I wanted to know the condition number of my system_matrix and hence I have
used the line in blue (below) in my CG solve function.
It shows the condition number. But in the documentation the definition of this
is not mentioned.


You mean the documentation is missing a definition of what the condition 
number is?




I mean when I store
my system matrix and calculate its max and min eigenvalues in matlab and then
calculate the condition number as their ratio
(i.e, max_eigen_val/ min_eigen_val), this does not match with the one
calculated by connect_condition_number_slot.
The quantities differ by two order of magnitudes.


Which norm does Matlab use to define the condition number? And are you using a 
preconditioner when calling CG?


What CG can only provide you with is an *estimate* of the condition number of 
the (preconditioned) matrix. It does not actually compute the min and max 
eigenvalues, but gets the estimate for the condition number by computing the 
eigenvalues of the subspace in which it finds the current approximation. These 
estimates converge to the true condition number if you just take enough 
iterations, but you may also be stopping the iteration too quickly.


Best
 Wolfgang

--

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] Re: mesh quality during deformations using MappingQEulerian

2016-11-15 Thread Wolfgang Bangerth


Thomas,


My initial mesh is not great - here's where I begin:
|

|GridGenerator::hyper_sphere(triangulation,Point(0,0,0),1.0);

triangulation.set_all_manifold_ids(0);

triangulation.refine_global(initial_global_refinement);
|
|/* interpolate the map from triangulation to desired geometry for the first 
time
   a,b,c are the axes of an ellipsoid */|
|VectorTools::interpolate(bending_dof_handler,
   Initial_map_sphere_to_ellipsoid(a,b,c),
   global_euler_vector);
|
const MappingQEulerian mapping (2, dof_handler,
euler_vector);



doubleInitial_map_sphere_to_ellipsoid::value(constPoint,constunsignedintcomponent)
 const
{
  doublenorm_p =p.distance(Point(0,0,0));
  // return the difference between the point on the ellipse and the point on
the original geometry
  returnabc_coeffs[component]*p(component)/norm_p -p(component);
}

|

This gets me an ellipsoid, but the corners of the original hyper_sphere are
just translated onto the ellipsoid by euler_vector.  (The color map shows the
mean curvature of the surface.)






I want to deform this shape in response to a scalar function (illustrated by
the new colormap) on the surface, so I adaptively refine and then let the
evolution go forward (the deformation will reduce a global free energy on the
surface) - here's how that looks:






A few timesteps later the surface (and mesh) evolve to look like this: (the
color map shows the mean curvature again)






This eventually crashes as the quadrilaterals become distorted.


It's not my research field, but there should be literature on these sorts of 
phenomena. I think that ultimately, you need to find a way to relax mesh nodes 
in tangential directions.


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] Re: Publications based on deal.II

2016-11-15 Thread Wolfgang Bangerth

On 11/15/2016 10:10 AM, Michael Harmon wrote:

Not sure if its too late for this, but here are some publications thanks to
deal.ii!


Never too late!



@phdthesis{Harmon2016,
  Title= Numerical algorithms based on Galerkin methods
for the modeling of reactive interfaces in photoelectrochemical (PEC) solar
cells},
  Author   = {Michael Harmon},
  School  = {University of Texas at Austin},
  Year  = {2016}
}


Awesome, congratulations Dr Harmon!

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] Re: Error when plotting curved interior cells with vtk

2016-11-15 Thread Wolfgang Bangerth
Just to follow up on this, many moons later: The fix for this problem turns 
out to be only one line long. That didn't make it easier to find, though 
:-) It can be found at https://github.com/dealii/dealii/pull/3589 and 
should become part of the next release. 

Best
 Wolfgang 

-- 
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] meshworker getting gradient values

2016-11-15 Thread Sudarshan Kumar

dim=2

template 
void Step12::integrate_cell_term (DoFInfo& dinfo, CellInfo& info)
{
   const FEValuesBase& fe_v  = info.fe_values();
   
   const std::vector>& grad = info.gradients[0][0];

}


When   I call   grad[0][0]   it gives segmentation fault.

Could any one  tell how to access the gradient values?


Help is appreciated.

Thanks a lot 

-- 
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: Periodic Boundary Condition

2016-11-15 Thread Daniel Arndt
Hamed,

Am Dienstag, 15. November 2016 19:09:18 UTC+1 schrieb Hamed Babaei:
>
> Hi all,
>
> Following step-45, I am going to implement periodic boundary condition on 
> my code for a Thermo-elastic problem, in which the thermal and elastic 
> parts are solved separately (I have two different dof_handelers for 
> temprature and displacement fields without any block structure). I am 
> wondering how to apply periodic constrains, made in setup_system, in the 
> thermal field assemble_system for which I don't use 
> "constraints.distribute_local_to_global ()" function. Thermal 
> Assemble_system is the following: 
>
[...]
> 
> for (unsigned int i=0; i   {
> for (unsigned int j=0; j   {
>  mass_matrix.  add (local_dof_indices[i],
>  local_dof_indices[j],
>  cell_mass_matrix(i,j));
>
>laplace_matrix.add (local_dof_indices[i],
>local_dof_indices[j],
>  cell_laplace_matrix(i,j));
>
>nl_matrix. add (local_dof_indices[i],
>local_dof_indices[j],
>cell_nl_matrix(i,j));
>
>   }
> nl_term (local_dof_indices[i]) += cell_nl_term(i);
>   }
> I guessed perhaps I can replace the red part with the following, 
>
>  constraints.distribute_local_to_global (cell_mass_matrix,
>   
>  local_dof_indices,
>mass_matrix);
> constraints.distribute_local_to_global (cell_laplace_matrix,
>   
> local_dof_indices,
>laplace_matrix);
> constraints.distribute_local_to_global (cell_nl_matrix,
>   
> local_dof_indices,
>   nl_matrix);
> constraints.distribute_local_to_global (cell_nl_term,
> 
>  local_dof_indices,
>   nl_term);
>
Can you confirm that these approaches are the same if no constraints are 
specified? This should definitely hold.
 

>
> but the newton_rophson solver for thermal part diverged when I did so!!
>
It is difficult to help you with just this information. How do the 
constraints you are using actually look like?
Are they correct?

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.


[deal.II] Re: Periodic Boundary Condition

2016-11-15 Thread Hamed Babaei
In addition I just tried to apply periodic boundary condition constraints 
at the end of assembly using, void ConstraintMatrix::condense.
However, it seems this function doesn't work with 
TrilinosWrappers::sparsematrix but dealii ones. 

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] Periodic Boundary Condition

2016-11-15 Thread Hamed Babaei
Hi all,

Following step-45, I am going to implement periodic boundary condition on 
my code for a Thermo-elastic problem, in which the thermal and elastic 
parts are solved separately (I have two different dof_handelers for 
temprature and displacement fields without any block structure). I am 
wondering how to apply periodic constrains, made in setup_system, in the 
thermal field assemble_system for which I don't use 
"constraints.distribute_local_to_global ()" function. Thermal 
Assemble_system is the following:

  template 
  void Solid::assemble_system_eta ()
  {
system_matrix_eta = 0;
system_rhs_eta = 0;
mass_matrix = 0;
laplace_matrix = 0;
nl_matrix = 0;
nl_term = 0;

FEValues fe_values_eta (fe_eta, qf_cell_eta,
 update_values  | update_gradients |
update_quadrature_points | update_JxW_values);

FullMatrix   cell_mass_matrix(dofs_per_cell_eta, 
dofs_per_cell_eta);
FullMatrix   cell_laplace_matrix (dofs_per_cell_eta, 
dofs_per_cell_eta);
FullMatrix   cell_nl_matrix  (dofs_per_cell_eta, 
dofs_per_cell_eta);
Vector   cell_nl_term(dofs_per_cell_eta);

std::vector 
local_dof_indices(dofs_per_cell_eta);

std::vector phi (dofs_per_cell_eta);
std::vector >   grad_phi (dofs_per_cell_eta);

typename DoFHandler::active_cell_iterator
cell = dof_handler_eta.begin_active(),
endc = dof_handler_eta.end();
for (; cell!=endc; ++cell)
  if (cell->is_locally_owned())
  {
fe_values_eta.reinit(cell);

cell_mass_matrix = 0;
cell_laplace_matrix = 0;
cell_nl_matrix = 0;
cell_nl_term = 0;

PointHistory *lqph =
  
reinterpret_cast(cell->user_pointer());

   for (unsigned int q=0; qget_dof_indices (local_dof_indices);

for (unsigned int i=0; i

Re: [deal.II] question on doxygen

2016-11-15 Thread Timo Heister
> Anyone else have this issue?

If you inspect the page on chrome you will get:
index.html:1 Mixed Content: The page at
'https://urldefense.proofpoint.com/v2/url?u=https-3A__mdh266.github.io_PECS_index.html=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=jVKCL66Mbd5FdnRcib0pNZodZVOfqP_jvw9UoAQXN28=uO_cl_oqSESivpFJXySHg3zQ6zkUbVtenSPwGC0DlJE=
 ' was loaded over HTTPS, but
requested an insecure script
'https://urldefense.proofpoint.com/v2/url?u=http-3A__cdn.mathjax.org_mathjax_latest_MathJax.js=CwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=jVKCL66Mbd5FdnRcib0pNZodZVOfqP_jvw9UoAQXN28=wTFBZpXwMr0SriTHkD8qkG1M9xUYoYt-h7kDu1KRAFU=
 '. This request has
been blocked; the content must be served over HTTPS.

You should be able to fix this by selecting an https mathjax CDN url
in the doxygen settings.

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


[deal.II] Re: question on doxygen

2016-11-15 Thread 'Uwe Köcher' via deal . II User Group
Hej Mike,

sometimes I also use latex for code documentation with doxygen, for an 
equation line:

 \f[
   \partial_t u -\nabla \cdot \epsilon \nabla u + \boldsymbol b \cdot 
\nabla u = f\,,\quad \text{in } \Omega \times I\,,
 \f]

and

\f$ \Omega = (0,1)^d \f$ 

for latex within the text line.

I'm not sure, if statements like \begin{equation} etc. will work, the tex 
system behind doxygen is sometimes very poor. On you local machine it may 
take your (powerful) latex installation.

Kind regards
  Uwe

-- 
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: Publications based on deal.II

2016-11-15 Thread Michael Harmon
Not sure if its too late for this, but here are some publications thanks to 
deal.ii!


@Article{HaGaRe-JCP2016,
  Title= Numerical algorithms based on Galerkin methods 
for the modeling of reactive interfaces in photoelectrochemical (PEC) solar 
cells},
  Author   = {M. Harmon and I. M. Gamba and K. Ren.},
  Journal  = {Journal of Computational Physics},
  Year = {2016}
}

@phdthesis{Harmon2016,
  Title= Numerical algorithms based on Galerkin methods 
for the modeling of reactive interfaces in photoelectrochemical (PEC) solar 
cells},
  Author   = {Michael Harmon},
  School  = {University of Texas at Austin},
  Year  = {2016}
}
 


On Sunday, January 17, 2016 at 6:09:44 PM UTC-5, Wolfgang Bangerth wrote:
>
>
> All, 
>
> as you may know, we try to list all publications based on deal.II at 
>   http://dealii.org/publications.html 
> 
>  
> We use this list to justify the effort we spend on writing this software, 
> both 
> to our universities as well as the funding agencies that support its 
> development. 
>
> In anticipation of the next release, we would like to update this page. If 
> you 
> have (or know of) a publication that uses deal.II for numerical results 
> and 
> that isn't already listed, please let us know so we can put it on there. 
> For 
> this purpose, publications also include MSc, Diploma or PhD theses, or 
> anything else that may seem appropriate. 
>
> Thanks! 
>Wolfgang 
>
> -- 
>  
> Wolfgang Bangerth   email:bang...@math.tamu.edu 
>  
>  www: http://www.math.tamu.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] question on doxygen

2016-11-15 Thread Michael Harmon
Hi,

I used deal for my phd work, loved using it and wanted to put my code up on 
github.   I spent a lot of time documenting it with doxygen, but latex 
equations only work on my local machine and not on github:

https://mdh266.github.io/PECS/index.html

Anyone else have this issue?

Thanks!

Mike

-- 
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] condition number

2016-11-15 Thread Anup Basak
Hello all,

I wanted to know the condition number of my system_matrix and hence I have 
used the line in blue (below) in my CG solve function.
It shows the condition number. But in the documentation the definition of 
this is not mentioned. I mean when I store
my system matrix and calculate its max and min eigenvalues in matlab and 
then calculate the condition number as their ratio 
(i.e, max_eigen_val/ min_eigen_val), this does not match with the one 
calculated by connect_condition_number_slot.
The quantities differ by two order of magnitudes. 

I shall be thankful if someone puts some light on this.

   cg.connect_condition_number_slot(std_cxx11::bind(::print_cond, 
this, std_cxx11::_1));

Thanks,
Anup.

-- 
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] reuse FEEvaluation within a cell for RHS-like calculation

2016-11-15 Thread Denis Davydov
Hi Martin,

Cool, thanks for the prompt reply.

Kind regards,
Denis 

> On 15 Nov 2016, at 14:59, Martin Kronbichler  
> wrote:
> 
> Hi Denis,
> 
> 
> 
>> I wonder if it possible to re-use FEEvaluation within each cell to calculate 
>> integrals of multiple right-hand-side like vectors.
> Yes, you can re-use an FEEvaluation object. As soon as you call 
> submit_value(), you will write into the data field that is used by 
> integrate(), which in turn writes the data field that is read in 
> distribute_local_to_global. Re-using the same evaluators (shape functions, 
> scratch arrays) is the reason why we did not tie the FEEvaluation object to 
> the vector.
> 
>> Something along these lines:
>> 
>>   for (unsigned int cell=0; cell> {
>> fe_eval.reinit(cell);
>> for (unsigned int q=0; q>   // evaluate RHS functions and store results in values[q][i]
>> 
>> for (unsigned int i = 0; i < n_rhs; ++i)
>>  {
>>   for (unsigned int q= 0; q < n_q_points; ++q)
>>  fe_eval.submit_value(values[q][i], q);
>> 
>>   fe_eval.integrate (true,false);
>>   fe_eval.distribute_local_to_global (rhs_vectors[i]);
>>  }
>>  }
>> 
> This is exactly written as intended.
> 
> Best,
> Martin
> 
> -- 
> 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/VsIkogE1L40/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] reuse FEEvaluation within a cell for RHS-like calculation

2016-11-15 Thread Denis Davydov
I wonder if it possible to re-use FEEvaluation within each cell to 
calculate integrals of multiple right-hand-side like vectors.
Something along these lines:

  for (unsigned int cell=0; cell