[deal.II] New nonzero at (3,3) caused a malloc when changing area of triangulation

2017-03-31 Thread Loylick
Hello!

I was experimenting with Dealii examples and stumbled on some error I can 
not find a reason for.
I modified the example step-36 by defining an area like a pyramid on top of 
a truncated pyramid.
I constructed the truncated pyramid from 5 simplexes and top pyramid of 2 
simplexes by merging
these 7 triangulations.
At running the program stops with the error:
./step-36.exe
   Number of active cells:   224
   Number of degrees of freedom: 327
[0]PETSC ERROR: - Error Message 
--
[0]PETSC ERROR: Argument out of range
[0]PETSC ERROR: New nonzero at (3,3) caused a malloc
Use MatSetOption(A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_FALSE) to turn 
off this check
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for 
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.7.5, Jan, 01, 2017
[0]PETSC ERROR: H:\Dev\install\solid\Release\step-36.exe on a 
arch-mswin-c-debug named LILA by loylick Sat Apr  1 06:46:54 2017
[0]PETSC ERROR: Configure options --with-cc="win32fe cl" --with-fc=0 
--with-mpi=0 --with-debugging=1 --download-f2cblaslapack=1
[0]PETSC ERROR: #1 MatSetValues_SeqAIJ() line 485 in 
H:\Dev\PETSC-~1.5\src\mat\impls\aij\seq\aij.c
[0]PETSC ERROR: #2 MatSetValues() line 1190 in 
H:\Dev\PETSC-~1.5\src\mat\INTERF~1\matrix.c



Exception on processing:


An error occurred in line <1403> of file 
 in function
add
The violated condition was:
ierr == 0
Additional information:
deal.II encountered an error while calling a PETSc function.
The description of the error provided by PETSc is "Argument out of range".
The numerical value of the original error code is 63.


Please give me a clue about what is going wrong in the program. I put the 
code into attach.

P.S. the same program with the truncated pyramid area constructed from 5 
simplexes (without top pyramid) works fine.

-- 
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.
/* -
 *
 * Copyright (C) 2009 - 2016 by the deal.II authors
 *
 * This file is part of the deal.II library.
 *
 * The deal.II library is free software; you can use it, redistribute
 * it, and/or modify it under the terms of the GNU Lesser General
 * Public License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * The full text of the license can be found in the file LICENSE at
 * the top level of the deal.II distribution.
 *
 * -

 *
 * Authors: Toby D. Young, Polish Academy of Sciences,
 *  Wolfgang Bangerth, Texas A University
 */

// @sect3{Include files}

// As mentioned in the introduction, this program is essentially only a
// slightly revised version of step-4. As a consequence, most of the following
// include files are as used there, or at least as used already in previous
// tutorial programs:
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

// IndexSet is used to set the size of PETScWrappers::Vector:
#include 

// PETSc appears here because SLEPc depends on this library:
#include 
#include 

// And then we need to actually import the interfaces for solvers that SLEPc
// provides:
#include 

// We also need some standard C++:
#include 
#include 

// Finally, as in previous programs, we import all the deal.II class and
// function names into the namespace into which everything in this program
// will go:
namespace Step36
{
  using namespace dealii;

  // @sect3{The EigenvalueProblem class template}

  // Following is the class declaration for the main class template. It looks
  // pretty much exactly like what has already been shown in step-4:
  template 
  class EigenvalueProblem
  {
  public:
EigenvalueProblem (const std::string _file);
void run ();

  private:
void make_grid_and_dofs ();
void assemble_system ();
unsigned int solve ();
void output_results () const;

Triangulation triangulation;
FE_Q  fe;
DoFHandlerdof_handler;

// With these exceptions: For our eigenvalue problem, we need both a
// stiffness matrix for the left hand side as well as a 

Re: [deal.II] Fe_values->shape_grad() wrt to reference mesh

2017-03-31 Thread RAJAT ARORA
Hello,

Since I am moving the mesh physically, the current coordinates are of the 
current configuration. I am trying to make a new fe_values object with 
mapping as shown below but I am getting an error 

An error occurred in line <114> of file  in 
function
virtual dealii::Subscriptor::~Subscriptor()
The violated condition was: 
counter == 0
The name and call sequence of the exception was:
ExcInUse (counter, object_info->name(), infostring)
Additional Information: 
Object of class N6dealii6VectorIdEE is still used by 1 other objects.


(Additional information: )


See the entry in the Frequently Asked Questions of deal.II (linked to from 
http://www.dealii.org/) for a lot more information on what this error means 
and how to fix programs in which it happens.


Stacktrace:
---
#0 
 
/home/rajat/Documents/Code-Libraries/deal/dealii8.3/installed-dealii/lib/libdeal_II.g.so.8.3.0:
 
dealii::Subscriptor::~Subscriptor()
#1  ./fdm: dealii::Vector::~Vector()
#2  ./fdm: VelocityEquation<3>::doutput_velocity()
#3  ./fdm: AdiabaticShearBand<3>::Run_QuasiStatic()
#4  ./fdm: AdiabaticShearBand<3>::run()
#5  ./fdm: main



The code I use is:

doutput_velocity()
{
DataOut data_out;

data_out.attach_dof_handler (this->dof_handler);
 
//LA::MPI::Vector displacement_vector is defined in the header file of 
the class.
displacement_vector.reinit(this->locally_owned_dofs, mpi_communicator);


displacement_vector = X; // X is reference coordinates.


displacement_vector -= fdm->x; // negative of displacement, x is 
current coordinates


MappingQEulerian eulerian_mapping(2, dof_handler, 
displacement_vector); // mapping to map the mesh to reference configuration


FEValues euler_fe_values(eulerian_mapping, this->fe, fdm->
quadrature_formula, update_values | 
  update_quadrature_points | 
update_JxW_values);

}

Also, If I comment the last two lines, there is no error. I am not sure 
what is wrong. 

Any suggestions will be appreciated. Thanks.

On Thursday, March 30, 2017 at 1:31:35 PM UTC-4, Jean-Paul Pelteret wrote:
>
> Either that or create an inverse mapping that maps back from the current 
> to the reference configuration. This method could potentially introduce to 
> some numerical error though.
>
> On Thursday, March 30, 2017 at 6:57:12 PM UTC+2, Wolfgang Bangerth wrote:
>>
>>
>> Rajat, 
>>
>> > I am updating my mesh after every time-increment. So, cell->vertex(v) 
>> > contains the current coordinates of the mesh. I know the coordinates of 
>> > the cell (and whole mesh) at t = 0, I wanted 
>> > to know how I can initialize the fe_values object wrt to the 
>> coordinates 
>> > of the cell at t = 0. 
>> > 
>> > If possible, this will enable me to use 
>> > fe_values->get_function_gradients() and fe_values->shape_grad() to get 
>> > the gradients wrt to reference mesh. 
>>
>> You can't. The FEValues classes only consider the mesh as it is right 
>> now, not how it was a while ago. 
>>
>> But you could consider leaving the mesh as it is (i.e., in reference 
>> coordinates) and using MappingQEulerian to describe the displacement. 
>> Then, if you use an FEValues without a mapping, you get everything with 
>> regard to the original (reference) configuration. If you use an FEValues 
>> with the mapping, you get the current configuration. 
>>
>> 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] Re: is there a way to refine mesh only in one direction

2017-03-31 Thread Wolfgang Bangerth

On 03/31/2017 01:30 PM, Jaekwang Kim wrote:


I found that what was the problem.

I was using 'maximum' Meshsmoothing which does not allow

So, It was not a bug of deal.ii but I was using wrong smoothing method
that does not go along with anisotropy,


Well, it is still a bug that the library did not handle this in a more 
gracefully way, i.e., that you did not get a polite error that suggests 
what is happening here and why.


So I would still be interested in having a small testcase that shows the 
problem and that would allow us to look into this some more...


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: is there a way to refine mesh only in one direction

2017-03-31 Thread Jaekwang Kim
Thanks Bruno ! and Dr. Wolfgang! 

I found that what was the problem.

I was using 'maximum' Meshsmoothing which does not allow 

So, It was not a bug of deal.ii but I was using wrong smoothing method that 
does not go along with anisotropy, 

I just changed my Meshsmoothing Method, that allow anisotropy refinement. 

For my problem, anisotropy refinement still works very well!




Thank you agains all of you 

Jaekwang


2017년 3월 31일 금요일 오후 2시 22분 37초 UTC-5, Bruno Turcksin 님의 말:
>
> Jaekwang, 
>
> 2017-03-30 17:39 GMT-04:00 Jaekwang Kim : 
>
> > //This one is problematic 
> > triangulation.prepare_coarsening_and_refinement (); 
> It could be a bug in the library, most people don't use anisotropic 
> refinement. This function is not always necessary (and it is not used 
> in step-30). So what happens if you remove it? For us to really help 
> you, we need a small code that triggers the error. 
>
> Best, 
>
> Bruno 
>

-- 
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: is there a way to refine mesh only in one direction

2017-03-31 Thread Bruno Turcksin
Jaekwang,

2017-03-30 17:39 GMT-04:00 Jaekwang Kim :
> //This one is problematic
> triangulation.prepare_coarsening_and_refinement ();
It could be a bug in the library, most people don't use anisotropic
refinement. This function is not always necessary (and it is not used
in step-30). So what happens if you remove it? For us to really help
you, we need a small code that triggers the error.

Best,

Bruno

-- 
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: Timo Heister and I on a podcast, talking about deal.II

2017-03-31 Thread Jaekwang Kim
Nice interview. 
I really enjoyed the cast. 

-- 
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: Crack propagation

2017-03-31 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Thomas,

I would like to check the elastic energy you compute and compare it to my 
results. For a single element the computation in an elastic regime should 
be independent from the phase-field approach in primary steps.

BR,
Seyed Ali 

-- 
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: Crack propagation

2017-03-31 Thread Thomas Wick

Dear Seyed Ali,

what do you mean by "one element test"?

Really to compute on one single element ?

This can never work:

1. First of all the phase-field will not be resolved
because of the regularization parameter eps.

2. This contradicts any idea of numerical methods
to have a reasonable number of mesh elements
and then do mesh refinement with as many mesh elements as possible
(w.r.t. to memory and computational cost)
in order to approach the underlying continuous problem.


Therefore, the short answer is: no - a one element test is not possible
and it is also not reasonable to envisage it.

Best regards,

Thomas

--
++++
Dr. Thomas Wick
Maitre de conferences / Assistant Professor

Centre de Mathematiques Appliquees (CMAP)
Ecole Polytechnique
91128 Palaiseau cedex, France

Email:  thomas.w...@cmap.polytechnique.fr
Phone:  0033 1 69 33 4579
www:http://www.cmap.polytechnique.fr/~wick/
++++
--

On 03/31/2017 04:39 PM, 'Seyed Ali Mohseni' via deal.II User Group wrote:

Dear Thomas,

I tried what you suggested and it works. Thank you :)
There is a slight problem though when I try to compute the same 
example with the same boundary conditions for the unit_square_4.inp 
file. I am trying to run a one element test using your phase-field 
approach. It works, but there is no residual value and next to it I 
obtain a -nan below Reduction. Is it possible to run a one element 
test with the same settings or do I have to modify something (such as 
rhs computations or boundary value functions)?


Kind regards,
Seyed Ali

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


[deal.II] Re: Crack propagation

2017-03-31 Thread 'Seyed Ali Mohseni' via deal.II User Group
Dear Thomas,

I tried what you suggested and it works. Thank you :)
There is a slight problem though when I try to compute the same example 
with the same boundary conditions for the unit_square_4.inp file. I am 
trying to run a one element test using your phase-field approach. It works, 
but there is no residual value and next to it I obtain a -nan below 
Reduction. Is it possible to run a one element test with the same settings 
or do I have to modify something (such as rhs computations or boundary 
value functions)?

Kind regards,
Seyed Ali

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