Re: [deal.II] Calculate cell center distance from a boundary

2022-02-17 Thread vachan potluri
>
> Hello,
> Here is the PR https://github.com/dealii/dealii/pull/13394 that adds the
> new wrappers for ArborX
> Best,
> Bruno


Thank you very much! Didn't expect it to come so fast :) !

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/CALAVa_x244GfUP_fr7Di8eTPjtPhbkJ8vDdNX2fEgyL%2BdXYGDw%40mail.gmail.com.


Re: [deal.II] Re: MPI, synchronize processes

2022-02-17 Thread Wolfgang Bangerth

On 2/17/22 09:22, Uclus Heis wrote:


I still had problems as I first copy the array and then I store it in a matrix 
for diffeerent frequencies.The result I got was differet whene using few 
process compared to using 1 single process. I added the following code and now 
works, is it right?


It copies a vector into a row of a matrix. Whether that's what you want is a 
different question, so we can't tell you whether it's "right" :-)


You can simplify this by saying
  tmparray = locally_relevant_solution;

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3ea418af-1699-d448-6df9-7162a5fe0b72%40colostate.edu.


[deal.II] Re: MPI, synchronize processes

2022-02-17 Thread Uclus Heis
Dear Bruno, 

I still had problems as I first copy the array and then I store it in a 
matrix for diffeerent frequencies.The result I got was differet whene using 
few process compared to using 1 single process. I added the following code 
and now works, is it right?

{
static Utilities::MPI::CollectiveMutex mutex;
Utilities::MPI::CollectiveMutex::ScopedLock lock(mutex, mpi_communicator);
tmparray.operator=(locally_relevant_solution);
for ( int j= 0; j < dof_handler.n_dofs(); ++j)
sol_matrix(freq_iter, j)=tmparray(j);
}

Thank you
El jueves, 17 de febrero de 2022 a las 14:57:50 UTC+1, bruno.t...@gmail.com 
escribió:

> Hello,
>
> You don't need to synchronize anything the function has an MPI_Barrier. 
> This is the reason for the comment. If one processor call the function but 
> the others don't, the code will hang.
>
> Best,
>
> Bruno
>
>
> On Thursday, February 17, 2022 at 4:01:32 AM UTC-5 uclu...@gmail.com 
> wrote:
>
>> Dear all, 
>>
>> I am copying a distributed vector using the following function:
>>
>> Vector 
>> & Vector 
>> < 
>> Number >::operator=(const PETScWrappers::VectorBase 
>> 
>>  & v)
>>
>> In the documentation it is written:
>> "*Note that due to the communication model used in MPI, this operation 
>> can only succeed if all processes do it at the same time when v is a 
>> distributed vector: It is not possible for only one process to obtain a 
>> copy of a parallel vector while the other jobs do something else."*
>>
>>  I would like to ask how can I synchronize all the processes to call the 
>> function operator() at the same time. Is there a barrier function or 
>> similar?
>>
>> Thank you
>>
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/7160aa40-c7bb-430e-8d3a-82ebb70d1b65n%40googlegroups.com.


Re: [deal.II] Impose values inside a material/ not on the boundary

2022-02-17 Thread Wolfgang Bangerth

On 2/15/22 07:32, 'Markus Mehnert' via deal.II User Group wrote:


Thank you for your response. I identified the correct dofs by trial and error 
which worked (9 dofs for a scalar quantity with quadratic polyorder).  
However, when I use /"fe_face.system_to_base_index().first.first" /to 
identify, which base element these dofs belong to, it does not at all fit the 
theory as they should all belong to base 1, i.e. the electric potential (I 
copied the output from my terminal)


The base group of dof 3 is: 1
The base group of dof 10 is: 1
The base group of dof 17 is: 1
The base group of dof 24 is: 1
The base group of dof 31 is: 1
The base group of dof 41 is: 2
The base group of dof 51 is: 0
The base group of dof 61 is: 2
The base group of dof 71 is: 2

This explains, why my former code did not work, however it raises the 
question, why the dofs do not belong to the (correct) base element. Do you 
have any idea?


Markus -- I have to admit that I'm not sure I can follow the details. Can you 
create a small program that only creates the element and outputs what you are 
interested in, along with an explanation of what you *think* it should output?


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/d1d8e87b-9897-e2f7-375a-0cc731f7af96%40colostate.edu.


Re: [deal.II] Triangulation from lower-dimensional object

2022-02-17 Thread Wolfgang Bangerth

On 2/17/22 02:48, Konrad Simon wrote:


Can I somehow extract a Triangulation form a Triangulation by 
providing, for example, the boundary id on the Triangulation level?


Yes! Take a look at GridGenerator::extract_boundary_mesh().

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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/edf74346-d3c3-8417-ca0e-10b1b5a4e9ad%40colostate.edu.


Re: [deal.II] Coupled poroelastic-elastic problem

2022-02-17 Thread Wolfgang Bangerth

On 2/17/22 01:50, Мария Бронзова wrote:


I took the step-46 as an example for matching two physical domains, everything 
works fine, apart from the interface boundary condition. In my case I need to 
strongly enforce the continuity of the solid displacement vector. In other 
words I need to set the solid displacements on the poro-elastic interface 
equal to the displacements of the poroelastic media on the same interface.


Would you please give me a hint on how it can be best done? Would the 
"constraints.add_line" function be still any help in this case?


That's one way. If you can identify which elastic degrees of freedom need to 
match which poro-elastic degrees of freedom, then you can add continuity as a 
constraint.


The alternative is to weakly enforce continuity of displacements in the same 
way as DG formulations do, or as the Nitsche method does for boundary 
conditions. This may be the easier approach, in particular if the finite 
element spaces you use on both sides of the interface don't match.


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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/78929b58-47d9-2d7f-2522-d2eda67d0966%40colostate.edu.


Re: [deal.II] Calculate cell center distance from a boundary

2022-02-17 Thread Bruno Turcksin
Hello,

Here is the PR https://github.com/dealii/dealii/pull/13394 that adds the 
new wrappers for ArborX

Best,

Bruno

On Saturday, February 12, 2022 at 11:58:35 PM UTC-5 vachanpo...@gmail.com 
wrote:

> Drs. Bruno and Wolfgang,
> *Actually what Wolfgang is suggesting is very doable. We have wrappers for 
> the ArborX 
> library 
> https://dealii.org/current/doxygen/deal.II/classArborXWrappers_1_1BVH.html 
>  
> which 
> allows you to find the nearest neighbor between two point clouds very 
> efficiently. You should be able to find the closest vertex on the boundary 
> for 100,000 points in a couple of seconds on the CPU and for several 
> millions of points if you are using a GPU. Right now we only have wrappers 
> for the serial version of ArborX but I have actually started to work on the 
> wrappers for distributed tree. When it's done, you will be able to get the 
> nearest neighbor even if they are on different processors.*
> That would be great! I think it would be very useful for applications like 
> turbulent flows where this information is required.
>
>
>
> *The best methods for the eikonal equation are all in the class of 
> "fastmarching method". It has its own wikipedia 
> page:https://en.wikipedia.org/wiki/Fast_marching_method 
> *
> Thank you very much!
> On Friday, February 11, 2022 at 9:48:16 PM UTC+5:30 Wolfgang Bangerth 
> wrote:
>
>> On 2/10/22 22:51, vachan potluri wrote: 
>> > This is a very difficult operation to do even in sequential 
>> computations 
>> > unless you have an analytical description of the boundary. That's 
>> because in 
>> > principle you would have to compare the current position with all 
>> points (or 
>> > at least all vertices) on the boundary -- which is very expensive to do 
>> if you 
>> > had to do it for more than just a few points. The situation does not 
>> get 
>> > better if you are in parallel, because then you don't even know all of 
>> the 
>> > boundary vertices. 
>> > 
>> > Completely realise and agree. 
>>
>> I stand corrected by Bruno about this -- I learned something today :-) 
>>
>>
>> > The only efficient way to do this sort of operation is to solve an 
>> eikonal 
>> > equation in which the solution function equals the distance to the 
>> boundary. 
>> > You can't solve it exactly, and so whatever distance you get is going 
>> to be a 
>> > finite-dimensional approximation of the exact distance function. 
>> > 
>> > I have got a basic idea of the equation from Wikipedia. Can you kindly 
>> also 
>> > point me to any references which describe its numerical solution 
>> technique? I 
>> > have no background in mathematics, so I have difficulty 
>> in understanding any 
>> > high level content. 
>>
>> The best methods for the eikonal equation are all in the class of "fast 
>> marching method". It has its own wikipedia page: 
>> https://en.wikipedia.org/wiki/Fast_marching_method 
>>
>> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/eb91e358-299b-4e7e-9ce6-9734fe016379n%40googlegroups.com.


[deal.II] Re: MPI, synchronize processes

2022-02-17 Thread Bruno Turcksin
Hello,

You don't need to synchronize anything the function has an MPI_Barrier. 
This is the reason for the comment. If one processor call the function but 
the others don't, the code will hang.

Best,

Bruno


On Thursday, February 17, 2022 at 4:01:32 AM UTC-5 uclu...@gmail.com wrote:

> Dear all, 
>
> I am copying a distributed vector using the following function:
>
> Vector 
> & Vector 
> < Number 
> >::operator=(const PETScWrappers::VectorBase 
> 
>  & v)
>
> In the documentation it is written:
> "*Note that due to the communication model used in MPI, this operation 
> can only succeed if all processes do it at the same time when v is a 
> distributed vector: It is not possible for only one process to obtain a 
> copy of a parallel vector while the other jobs do something else."*
>
>  I would like to ask how can I synchronize all the processes to call the 
> function operator() at the same time. Is there a barrier function or 
> similar?
>
> Thank you
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/aaacd433-702e-46b6-9e46-0f2d8ecd0845n%40googlegroups.com.


Re: [deal.II] Way to use the erf function with MuParser?

2022-02-17 Thread blais...@gmail.com
Awesome,
I'll make a PR for it.


On Wednesday, February 16, 2022 at 11:33:58 p.m. UTC-5 Wolfgang Bangerth 
wrote:

> On 2/16/22 20:16, blais...@gmail.com wrote:
> > 
> > It seems MuParser does not, by default, allow for the use of the error 
> > function (erf). We are solving a Stefan problem right now and I'd like 
> to be 
> > able to compare the solution to the analytical one to make a unit test 
> out of 
> > it. Regrettably, the analytical solution is an ugly beast containing an 
> error 
> > function (e.g. erf (x) )
> > It seems that muparser does not allow for the usage of erf. Would any of 
> you 
> > have an idea how i could circumvent this issue? Everything works super 
> well, 
> > but i'd like to be able to monitor the convergence and, right now, this 
> is not 
> > exactly possibly because of this erf function.
>
> Strangely, we support erfc but not erf. But it should be easy enough to 
> implement if you're willing to extend deal.II. Take a look here:
>
>
> https://github.com/dealii/dealii/blob/master/source/base/function_parser.cc#L190-L192
>
> and
>
>
> https://github.com/dealii/dealii/blob/master/source/base/mu_parser_internal.cc#L114-L118
>
> 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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/3579eddb-ca46-4ecc-9efb-8525884f29a7n%40googlegroups.com.


[deal.II] Triangulation from lower-dimensional object

2022-02-17 Thread Konrad Simon
Dear all,

I was recently looking for a solution to the following problem:

I have a triangulation, e.g., of a unit cube. I need to solve a 
lower-dimensional (FEM-like) problem on all faces with BCs on edges and for 
each face I need to solve a problem on all edges with BCs at vertices.

Can I somehow extract a Triangulation form a Triangulation by 
providing, for example, the boundary id on the Triangulation level?

Best,
Konrad

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/ae0eae00-a572-4036-b20e-31f45dd70892n%40googlegroups.com.


[deal.II] MPI, synchronize processes

2022-02-17 Thread Uclus Heis
Dear all, 

I am copying a distributed vector using the following function:

Vector 
& Vector 
< Number 
>::operator=(const PETScWrappers::VectorBase 

 & v)

In the documentation it is written:
"*Note that due to the communication model used in MPI, this operation can 
only succeed if all processes do it at the same time when v is a 
distributed vector: It is not possible for only one process to obtain a 
copy of a parallel vector while the other jobs do something else."*

 I would like to ask how can I synchronize all the processes to call the 
function operator() at the same time. Is there a barrier function or 
similar?

Thank you

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/2218f9d7-2d0e-4602-9ed4-4a986e63ac6en%40googlegroups.com.


[deal.II] Coupled poroelastic-elastic problem

2022-02-17 Thread Мария Бронзова
Dear All,

I have been working with acoustic porous media and would like to extend my 
script to deal with two-layered acoustic absorbers, in this case I am 
interested in adding an elastic layer on top of my porous media.

I took the step-46 as an example for matching two physical domains, 
everything works fine, apart from the interface boundary condition. In my 
case I need to strongly enforce the continuity of the solid displacement 
vector. In other words I need to set the solid displacements on the 
poro-elastic interface equal to the displacements of the poroelastic media 
on the same interface.

Would you please give me a hint on how it can be best done? Would the 
"constraints.add_line" function be still any help in this case? 

Thank you a lot!

Kind regards,
Mariia 

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/de8acdb5-5d68-4064-85e2-b2c5ebab2f9cn%40googlegroups.com.