[deal.II] Doubt regarding constraints

2016-09-05 Thread RAJAT ARORA
Hello all,

I have a question regarding use of constraints when using parallel 
programming.

Suppose I want to constraint dof1 owned by processor 1 to be equal to dof2 
owned by processor 2.


I can do that by calling 


ConstraintMatrix constraints;
constraints.reinit(locally_relevant_dofs);
constraints.add_line(dof1);
constraints.add_entry(dof2); 

Q1. Should it only be called on one processor ? 

Q2. My question is, what happens when this is called on both the processors 
(processor 1 and processor 2) ?

Q3. What happens when the processor 2 calls the same thing but in the other 
order ?

ConstraintMatrix constraints;
constraints.reinit(locally_relevant_dofs);
constraints.add_line(*dof2*);
constraints.add_entry(*dof1*);


If this is wrong, how should the constraint be applied ?

-- 
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] merging geometries(geo files) in gmsh for computational geometry definition

2016-09-05 Thread Wolfgang Bangerth


Marek,


I have prepared slightly better mesh - without "doubling" in the intersection,
see attachment.
However I got error on reading in the mesh file.

n error occurred in line <1447> of file

in function
void dealii::GridIn::read_msh(std::istream&) [with int dim
= 3; int spacedim = 3; std::istream = std::basic_istream]
The violated condition was:
false
The name and call sequence of the exception was:
ExcInvalidVertexIndex(cell, subcelldata.boundary_lines.back().vertices[i])
Additional Information:
While creating cell 55, you are referencing a vertex with index 0 but no
vertex with this index has been described in the input file.


Do You have any advice, how to cope with this problem.


The error message is correct. If you look at the file, it starts with

$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
9708
1 0 0 0
2 1 0 0
3 0 1 0
...

That is, it starts numbering vertices at 1 (first column). But then, later on, 
it describes cells as follows:


$Elements
11703
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
...
56 1 2 0 5 0 52
...

Here, each line corresponds to an point, edge, face, or cell with properties. 
Column 1 has the number of the object, column 2 the type of the object 
(line=1, quadrangle=2, hexahedron=5, point=15). After the type is a number 
that indicates how many properties there are for this object (here, 2 
properties for points and lines), followed by this many property values, 
followed by the vertex indices. Indeed, object 56 (a line, with two properties 
with values 0 and 5) consists of vertices 0 and 52. But we don't have a vertex 
with number 0, since they were numbered starting at 1.


I don't know how this mesh was created, but the content of the file indeed 
does not seem correct to me. You probably need to talk to the people who wrote 
gmsh what this is supposed to mean.


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: Creating my own constraints matrix for applying dirichlet bc

2016-09-05 Thread Wolfgang Bangerth


On 09/05/2016 09:32 AM, Praveen C wrote:

So if I loop over all non-artificial cells instead of locally owned cells to
build the dirichlet map, then it seems to work correctly.


Yes, that is the correct solution -- you need all locally owned or ghost cells.

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: Creating my own constraints matrix for applying dirichlet bc

2016-09-05 Thread Praveen C
So if I loop over all non-artificial cells instead of locally owned cells
to build the dirichlet map, then it seems to work correctly.

Best
praveen

On Mon, Sep 5, 2016 at 7:37 PM, Praveen C  wrote:

> Dear all
> I have to create a constraint matrix to apply dirichlet bc by taking the
> values from an existing solution (in vector “x" below) on the same mesh.
>
>   for(typename DoFHandler::active_cell_iterator
>   cell = dof_handler.begin_active(),
>   endc = dof_handler.end();
>   cell!=endc; ++cell)
>  if(cell->is_locally_owned())
>  {
> for (unsigned int f=0; f ++f)
>if (cell->face(f)->at_boundary())
>{
>   cell->face(f)->get_dof_indices(dof_indices);
>   for(unsigned int i=0; i   {
>  // search if index exists in boundary map
>  const unsigned int global_i = dof_indices[i];
>  std::map::iterator
> it = boundary_values_x.find(global_i);
>  if(it == boundary_values_x.end()) // Did not find
> index, so add it
>  {
>boundary_values_x.insert(std:
> :pair(global_i,x(global_i)));
>  }
>   }
>}
>  }
>
>   add_dirichlet_constraints (boundary_values_x, constraints_x);
> constraints_x.close();
>
> The function add_dirichlet_constraints is same as here
>
> https://groups.google.com/forum/#!searchin/dealii/add_
> dirichlet_constraints%7Csort:relevance/dealii/r9C8n1aU3zc/DmtfwWkDAgAJ
>
> This is a parallel code using Trilinos MPI vectors. I have doubts about
> the correctness of this procedure.
>
> In particular, should I include ghost dofs while creating the boundary
> condition map. I am looping over locally owned cells and collecting
> whatevar boundary dofs I find into the map.
>
> Best
> praveen
>

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