Re: [deal.II] why locally_size() equal to size() for a Trilinos vector

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 05:53 PM, Yiyang Zhang wrote:


|

IndexSetglobal_active_cells(this->tria.n_active_cells());


global_active_cells.add_range(0,this->tria.n_active_cells());


IndexSetlocal_active_cells(this->tria.n_active_cells());


local_active_cells.clear();


intcount =0;


for(autocell =this->tria.begin_active();cell !=this->tria.end();++cell){


if(cell->is_locally_owned()){


local_active_cells.add_index(cell->active_cell_index());

|


This will not yield anything interesting. First, not all active cells on all 
processors are "interesting" (some active cells will be ghost or artificial 
cells). Second, tria.n_active_cells() only returns the number of active cells 
on each processor, not the number of *globally* active cells -- for which 
there is a different function, however. Finally, the 'active_cell_index' of 
each cell is a property of each processor and they are not globally unique -- 
so they have no relation with the *global* number of active cells mentioned above.


You'll have to think of a different way of doing whatever it is you're trying 
to do here :-)


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] why locally_size() equal to size() for a Trilinos vector

2017-10-26 Thread Yiyang Zhang

Hello,

I am using parallel::shared::Triangulation and 
TrilinosWrappers::MPI::Vector. It seems the refine_mesh procedure in Step 
-18 cannot be directly transferred to Trilinos... Is there any tutorials on 
this object? I appreciate if anyone can tell me some references...

Meanwhile, there is something I don't understand...

IndexSet global_active_cells(this->tria.n_active_cells());

global_active_cells.add_range(0, this->tria.n_active_cells());

IndexSet local_active_cells(this->tria.n_active_cells());

local_active_cells.clear();

int count = 0;

for(auto cell = this->tria.begin_active(); cell != this->tria.end(); ++cell
){

if(cell->is_locally_owned()){

 local_active_cells.add_index(cell->active_cell_index());

 count ++;

 }

}

TrilinosWrappers::MPI::Vector distributed_error_per_cell(local_active_cells, 
global_active_cells, this->mpi_communicator);

std::cout<<"Process No. "<
mpi_communicator) << " ; added "<
mpi_communicator) <<" ; Global size = " << distributed_error_per_cell.size
()<
mpi_communicator) <<" ; Local size = " << distributed_error_per_cell.
local_size()<mpi_communicator);
will have the size of the global dofs, given that I am using 
parallel::shared::Triangulation. looks weird

Best,
Yiyang

-- 
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] I installed deal.ii via spack and IDEs were unusable

2017-10-26 Thread Drew Davidson
Hi,

I am a beginner user.  This post is not a question; my intention is to
share possibly helpful information with other beginners like me.

I installed deal.ii via spack, because the README for deal.ii made the
manual installation look too hard and/or time-consuming, and I like conda
in Python, and spack seemed similar to conda.  I started through the
deal.ii video tutorials and got stuck in 7 and 8 with various problems in
Eclipse; lots of things were not working.  I then tried Qt Creator.  The
initial cmake step that runs automatically upon opening the CMakeLists.txt
file in Qt Creator would not work, so I could do nothing with Qt Creator.
Everything worked in the terminal (no IDE, just terminal); only the IDEs
were misbehaving.

I googled too much and tried different things, then realized it might be
the choice of installing deal.ii via spack that is a problem.  I gave a try
to installing deal.ii manually according to the README, and it wasn't as
bad as I was afraid of in terms of time or effort.

I just went through video 7 with Qt Creator instead of Eclipse, and things
work within Qt Creator so far.  I have not tried Eclipse again, since I
only need one IDE.

I'm using Ubuntu 16.04.

I wonder if the very long file paths generated by spack are a problem.

Thanks,
D.D.

-- 
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: Trilinos::MPI::Vector and inhomogeneous constraints

2017-10-26 Thread Yiyang Zhang
Hello Prof. Bangerth,

Thank you for the answer! Now things are clear to me.

Best,
Yiyang

On Thursday, October 26, 2017 at 11:00:39 AM UTC-5, Wolfgang Bangerth wrote:
>
> On 10/26/2017 09:50 AM, Yiyang Zhang wrote: 
> > 
> > It seems to me that both ways are fine.  Is there any particular reason 
> > that we prefer one than the other? 
>
> Yes, both ways are correct. 
>
> But you will need a constraint object to eliminate hanging node 
> constraints and boundary values from the newton_update equation before 
> you solve for the newton update, and these constraints need to be 
> homogeneous. 
>
> Since the constraints object you show for your second approach, that 
> means that you have to keep two constraints objects around. That's more 
> work, more memory, etc, so people usually prefer approach one. 
>
> 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] CellDataStorage with mesh refinement

2017-10-26 Thread Timo Heister
Frederik,

without looking at your code (sorry!), I think you can use
Triangulation::register_data_attach and notify_ready_to_unpack to work
with any kind of data that you want to transfer around (this is the
functionality that is used by SolutionTransfer and the
ContinuousQuadratureDataTransfer.

See 
https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_dealii_dealii_blob_master_tests_mpi_attach-5Fdata-5F01.cc=DwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=4zqq8LzalJka1USeMsXKUwuzA9ZYVYDocY6Qd-sHk98=nC5wgqjDzcurV-G_a89DWCjEZbxP9MHaiIWP1yIKd4w=
 
for an example.

On Thu, Oct 26, 2017 at 12:50 PM, 'Frederik S.' via deal.II User Group
 wrote:
> Hello!
>
> I've got a question on the usage of CellDataStorage for refined cells for a
> parallelized simulation. Below you'll find a sample of the code I use for
> refinement.
>
> I'm transferring the solution as stated in
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.dealii.org_8.5.0_doxygen_deal.II_classparallel-5F1-5F1distributed-5F1-5F1SolutionTransfer.html=DwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=4zqq8LzalJka1USeMsXKUwuzA9ZYVYDocY6Qd-sHk98=Nc9Mb-wVDF_hg0oMht1A43zN_F7kpOv6vDewaKyyvzI=
>  
> and I sadly can't use ContinuousQuadratureDataTransfer, because my CellData
> is discontinous. Therefore I'm iterating through all cells, look at each
> cells parent and copy the CellData of the parent to the child cells (the
> blue part below; in reality the copying process is much longer, but then the
> code would be unnecessarily complex for this example). If I run the code
> with just one cpu core, everything works perfectly fine, so in this example
> every child cell has it's parent's CellData. But for simulations with more
> than one core, I just copy zeros into the child cells CellData (but I do not
> get an runtime-error).
>
> Where did I make a mistake? Or is it just not possible to access parent
> cell's CellData for parallel meshes?
>
> Thanks in advance!
>
> 
>
> template 
> void TEST::refine_grid (){
> const unsigned int n_q_points= quadrature_formula.size();
> std::vector solution_vectors (2);
> solution_vectors[0] = 
> solution_vectors[1] = _solution;
> parallel::distributed::SolutionTransfer
> soltrans(dof_handler);
> typename parallel::distributed::Triangulation::active_cell_iterator
> cell = triangulation.begin_active(), endc = triangulation.end();
> for (; cell!=endc; ++cell){
> if (cell->subdomain_id() == this_mpi_process){
> cell->set_refine_flag();
> }
> }
> triangulation.prepare_coarsening_and_refinement();
> soltrans.prepare_for_coarsening_and_refinement(solution_vectors);
> triangulation.execute_coarsening_and_refinement();
> setup_system (0);
> typename parallel::distributed::Triangulation::active_cell_iterator
> cell2 = triangulation.begin_active(), endc2 = triangulation.end();
> for (; cell2!=endc2; ++cell2){
> point_history_accessor.initialize(cell2, n_q_points);
> }
> int highest_level_after_refinement=triangulation.n_global_levels()-1;
> PETScWrappers::MPI::Vector interpolated_solution(system_rhs);
> PETScWrappers::MPI::Vector interpolated_old_solution(system_rhs);
> std::vector tmp (2);
> tmp[0] = &(interpolated_solution);
> tmp[1] = &(interpolated_old_solution);
> soltrans.interpolate(tmp);
> cell2 = triangulation.begin_active(), endc2 = triangulation.end();
> for (; cell2!=endc2; ++cell2)
> if(cell2->level()==highest_level_after_refinement){
> typename parallel::distributed::Triangulation::cell_iterator
> cell_p=cell2->parent();
> const std::vector > point_history_p =
> point_history_accessor.get_data(cell_p);
> for (unsigned int child=0; child<8; child++){
> unsigned int q_point=0;
> std::vector > point_history =
> point_history_accessor.get_data(cell_p->child(child));
> for (unsigned int q_point=0;q_point point_history[q_point]->status=point_history_p[q_point]->status;
> }
> }
> }
> constraints.clear ();
> constraints.reinit (locally_relevant_dofs);
> DoFTools::make_hanging_node_constraints (dof_handler, constraints);
> constraints.close ();
> constraints.distribute(interpolated_solution);
> constraints.distribute(interpolated_old_solution);
> solution = interpolated_solution;
> old_solution = interpolated_old_solution;
> dof_handler.distribute_dofs (fe);
> }
>
> --
> The deal.II project is located at 
> https://urldefense.proofpoint.com/v2/url?u=http-3A__www.dealii.org_=DwIBaQ=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4=4k7iKXbjGC8LfYxVJJXiaYVu6FRWmEjX38S7JmlS9Vw=4zqq8LzalJka1USeMsXKUwuzA9ZYVYDocY6Qd-sHk98=vf2x5H8OxETNRY5Xkg_2UlqLPYffjI7fsx3-Ng2CfHo=
>  
> For mailing list/forum options, see
> 

[deal.II] CellDataStorage with mesh refinement

2017-10-26 Thread 'Frederik S.' via deal.II User Group
Hello!

I've got a question on the usage of CellDataStorage for refined cells for a 
parallelized simulation. Below you'll find a sample of the code I use for 
refinement. 

I'm transferring the solution as stated 
in 
https://www.dealii.org/8.5.0/doxygen/deal.II/classparallel_1_1distributed_1_1SolutionTransfer.html
 
and I sadly can't use ContinuousQuadratureDataTransfer, because my CellData 
is discontinous. Therefore I'm iterating through all cells, look at each 
cells parent and copy the CellData of the parent to the child cells (the 
blue part below; in reality the copying process is much longer, but then 
the code would be unnecessarily complex for this example). If I run the 
code with just one cpu core, everything works perfectly fine, so in this 
example every child cell has it's parent's CellData. But for simulations 
with more than one core, I just copy zeros into the child cells CellData 
(but I do not get an runtime-error).

Where did I make a mistake? Or is it just not possible to access parent 
cell's CellData for parallel meshes?

Thanks in advance!



template 
void TEST::refine_grid (){
const unsigned int n_q_points= quadrature_formula.size();
std::vector solution_vectors (2);
solution_vectors[0] = 
solution_vectors[1] = _solution;
parallel::distributed::SolutionTransfer 
soltrans(dof_handler);
typename parallel::distributed::Triangulation::active_cell_iterator 
cell = triangulation.begin_active(), endc = triangulation.end();
for (; cell!=endc; ++cell){
if (cell->subdomain_id() == this_mpi_process){
cell->set_refine_flag();
}
}
triangulation.prepare_coarsening_and_refinement();
soltrans.prepare_for_coarsening_and_refinement(solution_vectors); 
triangulation.execute_coarsening_and_refinement();
setup_system (0);
typename parallel::distributed::Triangulation::active_cell_iterator 
cell2 = triangulation.begin_active(), endc2 = triangulation.end(); 
for (; cell2!=endc2; ++cell2){
point_history_accessor.initialize(cell2, n_q_points);
}
int highest_level_after_refinement=triangulation.n_global_levels()-1;
PETScWrappers::MPI::Vector interpolated_solution(system_rhs);
PETScWrappers::MPI::Vector interpolated_old_solution(system_rhs);
std::vector tmp (2);
tmp[0] = &(interpolated_solution);
tmp[1] = &(interpolated_old_solution);
soltrans.interpolate(tmp);
* cell2 = triangulation.begin_active(), endc2 = triangulation.end(); *
* for (; cell2!=endc2; ++cell2)*
* if(cell2->level()==highest_level_after_refinement){*
* typename parallel::distributed::Triangulation::cell_iterator 
cell_p=cell2->parent(); *
* const std::vector > point_history_p = 
point_history_accessor.get_data(cell_p);*
* for (unsigned int child=0; child<8; child++){*
* unsigned int q_point=0;*
* std::vector > point_history = 
point_history_accessor.get_data(cell_p->child(child));*
* for (unsigned int q_point=0;q_pointstatus=point_history_p[q_point]->status;*
* }*
* }*
* }*
constraints.clear ();
constraints.reinit (locally_relevant_dofs);
DoFTools::make_hanging_node_constraints (dof_handler, constraints);
constraints.close ();
constraints.distribute(interpolated_solution);
constraints.distribute(interpolated_old_solution);
solution = interpolated_solution;
old_solution = interpolated_old_solution;
dof_handler.distribute_dofs (fe);
}

-- 
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: Trilinos::MPI::Vector and inhomogeneous constraints

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 09:50 AM, Yiyang Zhang wrote:


It seems to me that both ways are fine.  Is there any particular reason 
that we prefer one than the other?


Yes, both ways are correct.

But you will need a constraint object to eliminate hanging node 
constraints and boundary values from the newton_update equation before 
you solve for the newton update, and these constraints need to be 
homogeneous.


Since the constraints object you show for your second approach, that 
means that you have to keep two constraints objects around. That's more 
work, more memory, etc, so people usually prefer approach one.


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: Trilinos::MPI::Vector and inhomogeneous constraints

2017-10-26 Thread Yiyang Zhang
Hello Prof. Bangerth,

Thank you for your reply. I am sorry I didn't really follow...

Here are the two ways.
(i) 
set the inhomogeneity in the initial solution vector.
in the constraints object we only need to store homogeneous constraints: 
  
constraints.add_lines()

Then in the solve() function we have 
//...get the new newton_update vector from solving the equation
constraints.distribute(newton_update);
new_sln = old_sln + alpha* newton_update;


(ii)
do not touch the initial solution vector.
in the constraints object we add inhomogeneous constraints
constraints.add_lines() 
constraints.add_inhomogeneity() 

then in the solve() function we have
//...get the new newton_update vector from solving the equation
new_sln = old_sln + alpha* newton_update;
constraints.distribute(new_sln);


It seems to me that both ways are fine.  Is there any particular reason 
that we prefer one than the other?

Best,
Yiyang


On Thursday, October 26, 2017 at 10:23:43 AM UTC-5, Wolfgang Bangerth wrote:
>
> On 10/26/2017 09:16 AM, Yiyang Zhang wrote: 
> > 
> > I mean in the constraints objects, I also put the inhomogeneous 
> > constraints in, that is: 
> > 
> > constraints.add_lines() 
> > constraints.add_inhomogeneity() 
> > 
> > Then, if I use version A, every time I solve the equation, I will add 
> > the inhomogeneity to the newton_update. Is it the case? 
> > 
> > I assume what you means is putting the inhomogeneity directly into the 
> > initial solution, and then in the constraints object, we only have 
> > homogeneous constraints. Is this what you mean? 
> > 
>
> That is the correct way of doing things. step-15 does it that way, for 
> example. 
>
> 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] Using Sacado with example 15

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 09:19 AM, 'Maxi Miller' via deal.II User Group wrote:

No, but including it removes the compilation errors, thanks!
How do I know for the future which includes I should use?


This one was difficult, but in general when you get a compiler error for 
a function that the compiler can't find, you have to look up where that 
function is declared. The manual pages online can help with that as they 
list the file in question for each function.


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: Trilinos::MPI::Vector and inhomogeneous constraints

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 09:16 AM, Yiyang Zhang wrote:


I mean in the constraints objects, I also put the inhomogeneous 
constraints in, that is:


constraints.add_lines()
constraints.add_inhomogeneity()

Then, if I use version A, every time I solve the equation, I will add 
the inhomogeneity to the newton_update. Is it the case?


I assume what you means is putting the inhomogeneity directly into the 
initial solution, and then in the constraints object, we only have 
homogeneous constraints. Is this what you mean?




That is the correct way of doing things. step-15 does it that way, for 
example.


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] Using Sacado with example 15

2017-10-26 Thread 'Maxi Miller' via deal.II User Group
No, but including it removes the compilation errors, thanks! 
How do I know for the future which includes I should use?

Am Donnerstag, 26. Oktober 2017 17:03:40 UTC+2 schrieb Wolfgang Bangerth:
>
> On 10/26/2017 07:27 AM, Wolfgang Bangerth wrote: 
> > 
> > This looks reasonable. The code does not compile because of this error: 
> > 
> > /opt/dealII/include/deal.II/base/template_constraints.h:388:40: error: 
> > no match for 'operator*' (operand types are 'Sacado::Fad::DFad' 
> > and 'dealii::Tensor<1, 2, double>') 
> >   typedef decltype(std::declval() * std::declval()) type; 
> >~~^~~ 
>
> By the way, did you try to include 
>#include  
> at the top of your code? 
>
> 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] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 08:17 AM, 曾元圆 wrote:


Is there a record on how the template/class/function names are changed, 
so I can find it quickly in case one day in the future I found the code 
I wrote today can't run?


Yes, we list changes from each version to the next here:
  https://www.dealii.org/developer/doxygen/deal.II/pages.html
For each version, the drop-down menu at https://www.dealii.org also has 
an entry called "Changes" or similar that lists what has changed from 
the previous version of deal.II.


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] Using Sacado with example 15

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 07:27 AM, Wolfgang Bangerth wrote:


This looks reasonable. The code does not compile because of this error:

/opt/dealII/include/deal.II/base/template_constraints.h:388:40: error: 
no match for 'operator*' (operand types are 'Sacado::Fad::DFad' 
and 'dealii::Tensor<1, 2, double>')

  typedef decltype(std::declval() * std::declval()) type;
   ~~^~~


By the way, did you try to include
  #include 
at the top of your code?

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] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread 曾元圆
Wow, it's really surprising and exciting to see the original developer of 
the code I'm now runing answering this question! Thank you so much Prof. 
Praveen.This is greetings from remote China! I'm now a master student and 
am running and learning the DG code developed by you. So I really want to 
show my respect and gratitude to you. By the way, though I have leared 
deal.II for a few days, but still found it difficult to grasp this tool. I 
find it too difficult to handle that many classes/functions and assemble 
them to do something. When I try to use a class or a funtion I always try 
to understand what is going on underneath. But when I tried to go deep into 
the code, I found there are too many things to learn and too difficult to 
learn. Take the MeshWorker::DoFInfo/IntegrationInfoBox... as an example, 
it's always difficult for me to understand the designing philosophy and the 
logic behind it, though there are many tutorial examples and documentations 
already. Could you kindly introduce some experience and give advices on how 
to efficiently learn and master this tool and make it into use for a 
beginner like me. Best regards and many thanks!


在 2017年10月26日星期四 UTC+8下午9:07:56,Praveen C写道:
>
> step-39 should be of some help to you. 
>
> best 
> praveen 
>
> > On 26-Oct-2017, at 5:45 PM, 曾元圆 <2012...@gmail.com > 
> wrote: 
> > 
> > I am trying to run a open source code, but an error occurred. 
> > In the code it uses NamedData like this: 
> > NamedData< Vector  *> solution_data; 
> > Info_box.initialize(fe, mapping, solution_data); 
> > 
> > How should I use AnyData to replace it? 
> > Actually I am a new learner, I tried to read the documentation related 
> to AnyData class but didn't quite understand how to use it. 
> > 
> > -- 
> > 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+un...@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] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread 曾元圆
Sorry, I should have describe my problem more specificlly. The problem is, 
I'm running a code writen several years ago. In the code it used the class: 
NamedData< Vector  *>, but Deal.II has deleted this template class 
so I have no idea how it work and the way to use it. I searched in the 
mailing list and get to know that this class was replaced by a new class: 
AnyData. But AnyData is not a template class, so I don't know how to change 
from NameData to AnyData. I just looked up step 39 and solved the problem. 
It should be changed to like this:  

NamedData< Vector  *> solution_data;
solution_data.add (, "solution");
 -->
AnyData 
 
solution_data;
solution_data.add 

*>(, 
"solution");  

Is there a record on how the template/class/function names are changed, so 
I can find it quickly in case one day in the future I found the code I 
wrote today can't run?
Anyway, thank you so much for your reply Prof.Bangerth. Thank you! 

在 2017年10月26日星期四 UTC+8下午8:51:24,Wolfgang Bangerth写道:
>
> On 10/26/2017 06:15 AM, 曾元圆 wrote: 
> > I am trying to run a open source code, but an error occurred. 
> > In the code it uses NamedData like this: 
> > NamedData< Vector  *> solution_data; 
> > Info_box.initialize(fe, mapping, solution_data); 
>
> What is the error you get? The first step in fixing an error is to 
> carefully 
> read the error message. 
>
> 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] Using Sacado with example 15

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 02:18 AM, 'Maxi Miller' via deal.II User Group wrote:
I added the errors I get while compiling in the log file. My code for 
producing it is:


|
std::vector>grad_N_AD(n_q_points);std::vectorlocal_dof_values_AD(cell->get_fe().dofs_per_cell);


for(unsignedinti=0;i')

 typedef decltype(std::declval() * std::declval()) type;
  ~~^~~

This should, in principle, be covered by the following operator in tensor.h:

template 
inline
Tensor::type>

operator * (const Number   ,
const Tensor )
{
  // simply forward to the operator above
  return t * factor;
}


with Number=DFad and OtherNumber=double. You need to investigate 
whether either the ProductType or EnableIfScalar is not defined for this pair 
of operands. If you can figure this out, you should be in business.


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] Re: Trilinos::MPI::Vector and inhomogeneous constraints

2017-10-26 Thread Bruno Turcksin
Yiyang,

On Wednesday, October 25, 2017 at 8:07:46 PM UTC-4, Yiyang Zhang wrote:

> locally_relevant_sln_with_ghost_new = locally_relevant_sln_with_ghost_old; 
> //This and the following one are rarely seen in the tutorials. Does this 
> mean the vector is exactly copied? i.e. both locally_owned_dofs and the 
> ghost_dofs are all copied?
>
Yes. 

> distributed_sln_new = locally_relevant_sln_with_ghost_new; //Does this 
> mean the locally_owned_dofs are copied, while the ghosts are neglected?
>
That's correct. 

>
> ii) ConstraintMatrix::distribute() and Newton's method
> In a Newton's method solver, we have:
>
> version A:
> //...get the new newton_update vector from solving the equation
> constraints.distribute(newton_update);
> new_sln = old_sln + alpha* newton_update;
>
> version B:
> //...get the new newton_update vector from solving the equation
> new_sln = old_sln + alpha* newton_update;
> constraints.distribute(new_sln);
>
> In the tutorials it seems version A is more commonly used. However, it 
> seems to me that if there are inhomogeneous constraints, then only version 
> B is correct. Is it right? I don't know how the distribute() function is 
> implemented, but based on the documentation it seems version B is a more 
> logical and universal way.
>
Version A should work all the time. You impose the inhomogeneous 
constraints the first time you solve the problem, so now you don't want 
your newton_update to modify the solution where it is correct. So you 
impose _homogeneous_ constraints on your update, i.e, you add zero. Does 
that make sense?

>
> iii) solve system with inhomogeneous constraints
> I have a problem with inhomogeneous constraints. I did some tests and it 
> seems that sometimes the solver collapses due to convergence(?) while 
> sometimes it doesn't, for example depending on the mesh.
> May I ask, with inhomogeneous constraints, do I need to, say, choose 
> different preconditioner, or providing the preconditioner with 
> AdditionalData?
>
 The fact that you use inhomogeneous constraints is not a reason on itself 
to change the preconditioner. However, different meshes may make the 
problem harder to solve. You may also have a hard time capturing boundary 
layer. Without knowing anything about your problem it is hard to say why a 
solver fails.

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] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread Praveen C
step-39 should be of some help to you.

best
praveen

> On 26-Oct-2017, at 5:45 PM, 曾元圆 <2012zg...@gmail.com> wrote:
> 
> I am trying to run a open source code, but an error occurred. 
> In the code it uses NamedData like this:
> NamedData< Vector  *> solution_data;
> Info_box.initialize(fe, mapping, solution_data);
> 
> How should I use AnyData to replace it?
> Actually I am a new learner, I tried to read the documentation related to 
> AnyData class but didn't quite understand how to use it.
> 
> -- 
> 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.


Re: [deal.II] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread Wolfgang Bangerth

On 10/26/2017 06:15 AM, 曾元圆 wrote:

I am trying to run a open source code, but an error occurred.
In the code it uses NamedData like this:
NamedData< Vector  *> solution_data;
Info_box.initialize(fe, mapping, solution_data);


What is the error you get? The first step in fixing an error is to carefully 
read the error message.


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] NamedData is not supported, how to change NamedData to AnyData?

2017-10-26 Thread 曾元圆
I am trying to run a open source code, but an error occurred. 
In the code it uses NamedData like this:
NamedData< Vector  *> solution_data;
Info_box.initialize(fe, mapping, solution_data);

How should I use AnyData to replace it?
Actually I am a new learner, I tried to read the documentation related to 
AnyData class but didn't quite understand how to use it.

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