Re: [deal.II] AMR , how to pass solution vector to refined mesh

2017-03-15 Thread Wolfgang Bangerth

On 03/15/2017 02:37 PM, Jaekwang Kim wrote:


I wonder if it is possible to pass solution vector to refined-meshed

I am solving non-linear problem with iterative method.

I'd like to use coarse mesh solution as a initial solution to find accurate
solution fast.

However, my present code sets up system again on every refinement cycle.
So, I lose all solution that I had in coarse mesh.

I think it is really helpful for me if I knew a way to pass the previous
solution to as a initial solution for next iterative method.

I think it might be complicated... first vector size of solution might
different when mesh is refined

is there anyone who has idea on this ?


Take a look at step-15 -- it does exactly this, using the SolutionTransfer 
class.

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.


[deal.II] AMR , how to pass solution vector to refined mesh

2017-03-15 Thread Jaekwang Kim
Hi, all. 

I wonder if it is possible to pass solution vector to refined-meshed

I am solving non-linear problem with iterative method. 

I'd like to use coarse mesh solution as a initial solution to find accurate 
solution fast. 

However, my present code sets up system again on every refinement cycle. 
So, I lose all solution that I had in coarse mesh. 

I think it is really helpful for me if I knew a way to pass the previous 
solution to as a initial solution for next iterative method. 

I think it might be complicated... first vector size of solution might 
different when mesh is refined

is there anyone who has idea on this ?

Thanks, 

Jaekwang Kim 

template 

void nonlinear::run ()

{

unsigned int cycle_control=4;



for (unsigned int cycle=0; cycleface(f)->at_boundary() == true)

{

if ( std::abs(cell->face(f)->center()[0]-0.5)< 1e-12 
)

{

cell->face(f)->set_boundary_id(10);

}



// Boundary faces

static const double tol = 1e-12;

if ( std::abs(cell->face(f)->center()[0]-0.0)< tol )

{

cell->face(f)->set_boundary_id(1);

}

if ( std::abs(cell->face(f)->center()[0]-1.0)< tol )

{

cell->face(f)->set_boundary_id(1);

}

if ( std::abs(cell->face(f)->center()[1]-0.0)< tol )

{

cell->face(f)->set_boundary_id(1);

}

if ( std::abs(cell->face(f)->center()[1]-1.0)< tol )

{

cell->face(f)->set_boundary_id(1);

}

}

}

}





std::ofstream out ("grid-1.ucd");

GridOut grid_out;

grid_out.write_ucd (triangulation, out);





}



else



refine_grid ();



std::cout << "   Number of active cells:   "<< 
triangulation.n_active_cells() << std::endl;



setup_system ();

int iteration=0;

 

assemble_system ();

solve ();   



Vector difference(dof_handler.n_dofs());

Vector temp_vector(dof_handler.n_dofs());

Vector temp_difference(dof_handler.n_dofs());



difference=solution; // std::cout << " ||u_k-u_{k-1}||" << 
difference.l2_norm() << std::endl;

previous_solution = solution ;



double omega = 0.5; //relxation control number



int success_step=0 ;



do{



assemble_system();

solve();





difference = solution;

difference -= previous_solution; //This is temporary step



  

temp_vector=solution;

temp_vector.add(omega,difference);



temp_difference = temp_vector;

temp_difference -= solution; //Calculate different again



if (temp_difference.l2_norm()< difference.l2_norm())  
//temp_difference 
= temp_vector - solution , difference=solution-previous_solution

{



success_step+=1;



difference=temp_vector;

difference-=solution ;

solution=temp_vector;

}





previous_solution=solution ;



iteration+=1;



std::ofstream outerror2("iter_error.dat",std::ios::app);

outerror2 << degree << " " << triangulation.n_active_cells() << " 
" << iteration << " " << difference.l2_norm() << " " << error << std::endl;



}while (difference.l2_norm() > 0.1);



std::cout << "   ||u_k-u_{k-1}|| = " << difference.l2_norm() <<  " 
  Iteration Number: " << iteration << std::endl;



error_evaluation();




Re: [deal.II] fixing one component of solution to the same value

2017-03-15 Thread Wolfgang Bangerth



I am using deal.ii to solve a 3D solid mechanics problem which uses
p::d::triangulation.

I am solving equilibrium equations to solve for the displacement in the domain.
The domain of the problem is a cylinder with the z-axis aligned along the axis
of the cylinder.

To avoid the warping, I want constraints such that
displacement in the z direction is same for all nodes on the +z surface.


Choose one degree of freedom for the vertical displacement on one processor 
(say, it is u_42), and then on all other processors you want to go through all 
vertical displacements at the boundary in question and set

  u_i = u_42
This is a straightforward constraint to add to the ConstraintMatrix class. 
Take a look at step-11 to see how constraints are added.


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] Can't build deal ii tutorials or program which uses deal ii libraries due to unresolved external symbol _compress2 and _compressBound errors

2017-03-15 Thread Wolfgang Bangerth

On 03/15/2017 08:31 AM, mbranag wrote:


1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external symbol
_compress2 referenced in function "...


This is a function in zlib, a compression library. We only call it if we could 
find zlib during the run of cmake, and have the following code at the top of 
the file:


#ifdef DEAL_II_WITH_ZLIB
#  include 
#endif

The fact that this code compiled to begin with means that the header file 
zlib.h exists on your system. It's not clear to me, however, why it doesn't link.


When you compile the tutorial program, can you do
  make VERBOSE=1
to get the complete command line for the linker? Or get this information in 
some other way when linking the tutorial? I'm asking because there should be 
an indication that it actually links with the zlib and I'd like to understand 
how exactly it does that and what may go wrong in the process.


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: Internal instability of the GMRES Solver / Trilinos

2017-03-15 Thread Martin Kronbichler

Dear Pascal,

This problem seems related to a problem we recently worked around in 
https://github.com/dealii/dealii/pull/4043


Can you check what happens if you call 
GrowingVectorMemory::release_unused_memory()


between your optimization steps? If a communicator gets stack in those 
places it is likely a stale object somewhere that we fail to work around 
for some reason.


Best,
Martin


On 15.03.2017 14:10, Pascal Kraft wrote:

Dear Timo,

I have done some more digging and found out the following. The 
problems seem to happen in trilinos_vector.cc between the lines 240 
and 270.
What I see on the call stacks is, that one process reaches line 261 
( ierr = vector->GlobalAssemble (last_action); ) and then waits inside 
this call at an MPI_Barrier with the following stack:

20  7fffd4d18f56
19 opal_progress()  7fffdc56dfca
18 ompi_request_default_wait_all()  7fffddd54b15
17 ompi_coll_tuned_barrier_intra_recursivedoubling()  7fffcf9abb5d
16 PMPI_Barrier()  7fffddd68a9c
15 Epetra_MpiDistributor::DoPosts()  7fffe4088b4f
14 Epetra_MpiDistributor::Do()  7fffe4089773
13 Epetra_DistObject::DoTransfer()  7fffe400a96a
12 Epetra_DistObject::Export()  7fffe400b7b7
11 int Epetra_FEVector::GlobalAssemble()  7fffe4023d7f
10 Epetra_FEVector::GlobalAssemble()  7fffe40228e3

The other (in my case three) processes are stuck in the head of the 
if/else-f statement leading up to this point, namely in the line
if(vector->Map().SameAs(v.vector 
->Map()) 
== false)

inside the call to SameAs(...) with stacks like
15 opal_progress() 7fffdc56dfbc 14 ompi_request_default_wait_all() 
7fffddd54b15 13 ompi_coll_tuned_allreduce_intra_recursivedoubling() 
7fffcf9a4913 12 PMPI_Allreduce() 7fffddd6587f 11 
Epetra_MpiComm::MinAll() 7fffe408739e 10 Epetra_BlockMap::SameAs() 
7fffe3fb9d74
Maybe this helps. Producing a smaller example will likely not be 
possible in the coming two weeks but if there are no solutions until 
then I can try.

Greetings,
Pascal
--
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: Can't build deal ii tutorials or program which uses deal ii libraries due to unresolved external symbol _compress2 and _compressBound errors

2017-03-15 Thread Jean-Paul Pelteret
Hi Michael,

That output looks very strange. Which operating system and compiler are you 
using?

Kind regards,
Jean-Paul

On Wednesday, March 15, 2017 at 2:31:54 PM UTC, mbranag wrote:
>
> Hi all,
>
> I am new to trying to work with deal II and have had trouble getting it 
> working. I currently have been able to compile the deal ii libraries but 
> when I try to build either the first tutorial (step-1) or my own code which 
> is just creating a simple grid mesh similar to that found in step-1 one I 
> get the following error: 
>
> 1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external 
> symbol _compress2 referenced in function "void __cdecl dealii::`anonymous 
> namespace'::write_compressed_block(class 
> std::vector > const 
> &,struct dealii::DataOutBase::VtkFlags const &,class 
> std::basic_ostream &)" 
> (??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)
> 1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external 
> symbol _compressBound referenced in function "void __cdecl 
> dealii::`anonymous namespace'::write_compressed_block(class 
> std::vector > const 
> &,struct dealii::DataOutBase::VtkFlags const &,class 
> std::basic_ostream &)" 
> (??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)
>
> I have google extensively for similar problems but am unable to come up 
> with any solutions. Any help would be greatly appreciated.
>
> Please let me know if you need any more information.
>
> Thanks,
> Michael
>

-- 
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] Can't build deal ii tutorials or program which uses deal ii libraries due to unresolved external symbol _compress2 and _compressBound errors

2017-03-15 Thread mbranag
Hi all,

I am new to trying to work with deal II and have had trouble getting it 
working. I currently have been able to compile the deal ii libraries but 
when I try to build either the first tutorial (step-1) or my own code which 
is just creating a simple grid mesh similar to that found in step-1 one I 
get the following error: 

1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external 
symbol _compress2 referenced in function "void __cdecl dealii::`anonymous 
namespace'::write_compressed_block(class 
std::vector > const 
&,struct dealii::DataOutBase::VtkFlags const &,class 
std::basic_ostream &)" 
(??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)
1>deal_II.g.lib(data_out_base.obj) : error LNK2019: unresolved external 
symbol _compressBound referenced in function "void __cdecl 
dealii::`anonymous namespace'::write_compressed_block(class 
std::vector > const 
&,struct dealii::DataOutBase::VtkFlags const &,class 
std::basic_ostream &)" 
(??$write_compressed_block@E@?A0xd9bac495@dealii@@YAXABV?$vector@EV?$allocator@E@std@@@std@@ABUVtkFlags@DataOutBase@1@AAV?$basic_ostream@DU?$char_traits@D@std@@@3@@Z)

I have google extensively for similar problems but am unable to come up 
with any solutions. Any help would be greatly appreciated.

Please let me know if you need any more information.

Thanks,
Michael

-- 
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: Internal instability of the GMRES Solver / Trilinos

2017-03-15 Thread Pascal Kraft
Dear Timo,

I have done some more digging and found out the following. The problems 
seem to happen in trilinos_vector.cc between the lines 240 and 270.
What I see on the call stacks is, that one process reaches line 261 ( ierr 
= vector->GlobalAssemble (last_action); ) and then waits inside this call 
at an MPI_Barrier with the following stack:
20  7fffd4d18f56 
19 opal_progress()  7fffdc56dfca 
18 ompi_request_default_wait_all()  7fffddd54b15 
17 ompi_coll_tuned_barrier_intra_recursivedoubling()  7fffcf9abb5d 
16 PMPI_Barrier()  7fffddd68a9c 
15 Epetra_MpiDistributor::DoPosts()  7fffe4088b4f 
14 Epetra_MpiDistributor::Do()  7fffe4089773 
13 Epetra_DistObject::DoTransfer()  7fffe400a96a 
12 Epetra_DistObject::Export()  7fffe400b7b7 
11 int Epetra_FEVector::GlobalAssemble()  7fffe4023d7f 
10 Epetra_FEVector::GlobalAssemble()  7fffe40228e3 

The other (in my case three) processes are stuck in the head of the 
if/else-f statement leading up to this point, namely in the line 
if (vector->Map().SameAs(v.vector 
->Map())
 
== false)
inside the call to SameAs(...) with stacks like

15 opal_progress() 7fffdc56dfbc 14 ompi_request_default_wait_all() 
7fffddd54b15 13 ompi_coll_tuned_allreduce_intra_recursivedoubling() 
7fffcf9a4913 12 PMPI_Allreduce() 7fffddd6587f 11 Epetra_MpiComm::MinAll() 
7fffe408739e 10 Epetra_BlockMap::SameAs() 7fffe3fb9d74 

Maybe this helps. Producing a smaller example will likely not be possible 
in the coming two weeks but if there are no solutions until then I can try.

Greetings,
Pascal

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