Re: [deal.II] Memory loss in system solver

2020-07-24 Thread Wolfgang Bangerth

On 7/24/20 3:32 AM, Alberto Salvadori wrote:


It turns out that this code produces a memory loss, quite significant since I 
am solving my system thousands of times, eventually inducing the run to fail. 
I am not sure what is causing this issue and how to solve it, maybe more 
experienced users than myself can catch the problem with a snap of fingers.


I have verified the issue on my mac (Catalina) as well as on linux ubuntu 
(4.15.0), using deal.ii 9.1.1.
Apparently the issue reveals only when mpi is invoked with more than one 
processor, whereas it does not emerge when running in serial or by mpirun -np 1.


Alberto -- I've taken a look at the SolverBicgstab class and don't see 
anything glaringly obvious that would suggest where the memory is lost. It's 
also funny that that would only happen with more than one processor because 
the memory handling of PETSc vectors shouldn't be any different for one or 
more processors.


Do you think you could come up with a simple test case that illustrates the 
problem? In your case, I'd start with the code you have and remove basically 
everything you do: replace the assembly by a function that just fills the 
matrix with the identity matrix (or something similarly simple), remove 
everything that does anything useful with the solution, remove graphical 
output, etc. The only thing that should remain is the loop that repeatedly 
solves a linear system and illustrates the memory leak, but the program no 
longer has to do anything useful (in fact, it probably shouldn't -- it should 
only exercise the one part you suspect of causing the memory leak).


I think that would make finding the root cause substantially simpler!

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/5a63f6c5-48b7-a40a-36c8-5e0ef5bed327%40colostate.edu.


Re: [deal.II] Location for Boundary Condition Application

2020-07-24 Thread Wolfgang Bangerth

On 7/23/20 11:47 AM, Daniel Arndt wrote:

McKenzie,

I'm interested in applying a non-homogeneous Dirichlet boundary condition
to a specific edge. However, I'm unsure how to identify or specify a
particular edge or face to add the boundary condition to. Could you help
clear this up for me?


What do you know about that particular edge? You can always ask faces or 
edges, e.g., about their midpoints. Have a look at 
https://www.dealii.org/current/doxygen/deal.II/step_6.html#Abettermesh 
.


And here:
https://github.com/bangerth/dealii/blob/66/examples/step-19/step-19.cc#L303-L317
for an example where I'm setting different boundary indicators depending on 
the location of a face. These boundary conditions are then used when 
interpolating different boundary conditions here:

https://github.com/bangerth/dealii/blob/66/examples/step-19/step-19.cc#L340-L354
This is eventually going to become step-19.

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/8c48a006-dff5-4333-fc96-2c3a0a28d4e3%40colostate.edu.


Re: [deal.II] Accessing nodal values of a FEM solution

2020-07-24 Thread Wolfgang Bangerth

On 7/23/20 12:07 PM, Xuefeng Li wrote:


Well, the above function calculates the gradients of a finite element at the 
quadrature points of a cell, not at the nodal points of a cell.

Such a need arises in the following situation.

for ( x in vector_of_nodal_points )
   v(x) = g(x, u(x), grad u(x))


It's worth pointing out, however, that for the common FE_Q elements, the 
function values u(x) are continuous and so it doesn't matter how exactly you 
compute u(x) at node points. On the other hand, grad u(x) is in general 
discontinuous and so trying to evaluate it at node points is not actually 
possible: You will either get the values from one adjacent cell or the value 
from another.


In other words, if you want to compute a function that depends on 'grad u', 
you need to think about what exactly you mean by that. In the formulation 
above, v(x) will in general be a discontinuous function, and you need to think 
about whether using FE_Q (a continuous finite element space) is really what 
you want to do.


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/d2d54493-3b73-2f2f-8002-c3f9ef317177%40colostate.edu.


Re: [deal.II] Cannot find local compiled petsc library

2020-07-24 Thread yuesu jin
Dear all,
  This problem has been solved. I copied the petscversion.h file to the
arch/include folder therefore cmake found all petsc files and finished
compilation.
Best regards

On Fri, Jul 24, 2020 at 3:17 PM yuesu jin  wrote:

> Dear Daniel,
>  Thank you for the instruction! I gave the architecture directory, which
> is a sub-directory : /home/yjin6/petsc/arch-linux-c-debug. It returns
> message like this:
>
> ***
> -- Include
> /home/yjin6/Deal.II/dealii-9.2.0/cmake/configure/configure_3_petsc.cmake
> -- Found PETSC_LIBRARY
> -- Found PETSC_INCLUDE_DIR_ARCH
> -- PETSC_INCLUDE_DIR_COMMON not found! Call:
> -- FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h HINTS
> /home/yjin6/petsc/arch-linux-c-debug /home/yjin6/petsc/arch-linux-c-debug/
> PATH_SUFFIXES petsc include include/petsc)
> -- Found PETSC_PETSCVARIABLES
> -- Found PETSC_LIBRARY_flapack
> -- Found PETSC_LIBRARY_fblas
> -- Found PETSC_LIBRARY_X11
> -- Performing Test PETSC_LIBRARY_m
> -- Performing Test PETSC_LIBRARY_m - Success
> -- Performing Test PETSC_LIBRARY_dl
> -- Performing Test PETSC_LIBRARY_dl - Success
> -- Found PETSC_LIBRARY_mpi_usempif08
> -- Found PETSC_LIBRARY_mpi_usempi_ignore_tkr
> -- Found PETSC_LIBRARY_mpi_mpifh
> -- Found PETSC_LIBRARY_mpi
> -- Performing Test PETSC_LIBRARY_gfortran
> -- Performing Test PETSC_LIBRARY_gfortran - Success
> -- Performing Test PETSC_LIBRARY_quadmath
> -- Performing Test PETSC_LIBRARY_quadmath - Success
> -- Performing Test PETSC_LIBRARY_pthread
> -- Performing Test PETSC_LIBRARY_pthread - Success
> --   PETSC_LIBRARIES:
> /home/yjin6/petsc/arch-linux-c-debug/lib/libpetsc.so;/home/yjin6/petsc/arch-linux-c-debug/lib/libflapack.a;/home/yjin6/petsc/arch-linux-c-debug/lib/libfblas.a;/usr/lib/x86_64-linux-gnu/libX11.so;m;dl;/usr/local/lib/libmpi_usempif08.so;/usr/local/lib/libmpi_usempi_ignore_tkr.so;/usr/local/lib/libmpi_mpifh.so;/usr/local/lib/libmpi.so;gfortran;m;gfortran;m;quadmath;pthread;quadmath;dl
> --   PETSC_INCLUDE_DIRS: *** Required variable "PETSC_INCLUDE_DIR_COMMON"
> set to NOTFOUND ***
> --   PETSC_USER_INCLUDE_DIRS: *** Required variable
> "PETSC_INCLUDE_DIR_COMMON" set to NOTFOUND ***
> -- Could NOT find PETSC
> -- DEAL_II_WITH_PETSC has unmet external dependencies.
>
>
> On Fri, Jul 24, 2020 at 1:39 PM Daniel Arndt 
> wrote:
>
>> Yuesun,
>>
>> Apparently, CMake was able to find the file petscvariables, but not the
>> include directories or the library.
>> Can you search for "libpetsc.so" yourself? Our CMake find module tries to
>> find this library in {PETSC_DIR}/lib or {PETSC_DIR}/lib64.
>> See if you can adjust PETSC_DIR accordingly.
>>
>> Best,
>> Daniel
>>
>> Am Fr., 24. Juli 2020 um 01:18 Uhr schrieb yuesu jin <
>> jinyues...@gmail.com>:
>>
>>> Dear all,
>>>   I am installing deal.ii with petsc on a cluster. After I compiled the
>>> petsc library (The arch folder name is arch-linux-c-debug) and gave a cmake
>>> argument -DPETSC_DIR=/home/yjin6/petsc
>>> cmake cannot find the petsc library .so file(It is in the folder), but
>>> it founds the version is 3.13.
>>> Could you tell me what's the possible reason why cmake cannot find the
>>> library?
>>> Best regards
>>> ***
>>> --- Include
>>> /home/yjin6/Deal.II/dealii-9.2.0/cmake/configure/configure_3_petsc.cmake
>>> -- PETSC_LIBRARY not found! Call:
>>> -- FIND_LIBRARY(PETSC_LIBRARY NAMES petsc libpetsc HINTS
>>> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES lib lib64 lib)
>>> -- PETSC_INCLUDE_DIR_ARCH not found! Call:
>>> -- FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h HINTS
>>> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES petsc include
>>> include/petsc)
>>> -- Found PETSC_INCLUDE_DIR_COMMON
>>> -- Found PETSC_PETSCVARIABLES
>>> --   PETSC_VERSION: 3.13.3.0
>>> --   PETSC_LIBRARIES: *** Required variable "PETSC_LIBRARY" set to
>>> NOTFOUND ***
>>> --   PETSC_INCLUDE_DIRS: *** Required variable "PETSC_INCLUDE_DIR_ARCH"
>>> set to NOTFOUND ***
>>> --   PETSC_USER_INCLUDE_DIRS: *** Required variable
>>> "PETSC_INCLUDE_DIR_ARCH" set to NOTFOUND ***
>>> -- Could NOT find PETSC
>>> -- DEAL_II_WITH_PETSC has unmet external dependencies.
>>> --
>>> Yuesu Jin,
>>> Ph.D student,
>>> University of Houston,
>>> College of Natural Sciences and Mathematics,
>>> Department of Earth and Atmospheric Sciences,
>>> Houston, Texas 77204-5008
>>> 346-404-2062
>>>
>>> --
>>> 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
>>> 

Re: [deal.II] Cannot find local compiled petsc library

2020-07-24 Thread yuesu jin
Dear Daniel,
 Thank you for the instruction! I gave the architecture directory, which is
a sub-directory : /home/yjin6/petsc/arch-linux-c-debug. It returns message
like this:
***
-- Include
/home/yjin6/Deal.II/dealii-9.2.0/cmake/configure/configure_3_petsc.cmake
-- Found PETSC_LIBRARY
-- Found PETSC_INCLUDE_DIR_ARCH
-- PETSC_INCLUDE_DIR_COMMON not found! Call:
-- FIND_PATH(PETSC_INCLUDE_DIR_COMMON petscversion.h HINTS
/home/yjin6/petsc/arch-linux-c-debug /home/yjin6/petsc/arch-linux-c-debug/
PATH_SUFFIXES petsc include include/petsc)
-- Found PETSC_PETSCVARIABLES
-- Found PETSC_LIBRARY_flapack
-- Found PETSC_LIBRARY_fblas
-- Found PETSC_LIBRARY_X11
-- Performing Test PETSC_LIBRARY_m
-- Performing Test PETSC_LIBRARY_m - Success
-- Performing Test PETSC_LIBRARY_dl
-- Performing Test PETSC_LIBRARY_dl - Success
-- Found PETSC_LIBRARY_mpi_usempif08
-- Found PETSC_LIBRARY_mpi_usempi_ignore_tkr
-- Found PETSC_LIBRARY_mpi_mpifh
-- Found PETSC_LIBRARY_mpi
-- Performing Test PETSC_LIBRARY_gfortran
-- Performing Test PETSC_LIBRARY_gfortran - Success
-- Performing Test PETSC_LIBRARY_quadmath
-- Performing Test PETSC_LIBRARY_quadmath - Success
-- Performing Test PETSC_LIBRARY_pthread
-- Performing Test PETSC_LIBRARY_pthread - Success
--   PETSC_LIBRARIES:
/home/yjin6/petsc/arch-linux-c-debug/lib/libpetsc.so;/home/yjin6/petsc/arch-linux-c-debug/lib/libflapack.a;/home/yjin6/petsc/arch-linux-c-debug/lib/libfblas.a;/usr/lib/x86_64-linux-gnu/libX11.so;m;dl;/usr/local/lib/libmpi_usempif08.so;/usr/local/lib/libmpi_usempi_ignore_tkr.so;/usr/local/lib/libmpi_mpifh.so;/usr/local/lib/libmpi.so;gfortran;m;gfortran;m;quadmath;pthread;quadmath;dl
--   PETSC_INCLUDE_DIRS: *** Required variable "PETSC_INCLUDE_DIR_COMMON"
set to NOTFOUND ***
--   PETSC_USER_INCLUDE_DIRS: *** Required variable
"PETSC_INCLUDE_DIR_COMMON" set to NOTFOUND ***
-- Could NOT find PETSC
-- DEAL_II_WITH_PETSC has unmet external dependencies.


On Fri, Jul 24, 2020 at 1:39 PM Daniel Arndt  wrote:

> Yuesun,
>
> Apparently, CMake was able to find the file petscvariables, but not the
> include directories or the library.
> Can you search for "libpetsc.so" yourself? Our CMake find module tries to
> find this library in {PETSC_DIR}/lib or {PETSC_DIR}/lib64.
> See if you can adjust PETSC_DIR accordingly.
>
> Best,
> Daniel
>
> Am Fr., 24. Juli 2020 um 01:18 Uhr schrieb yuesu jin  >:
>
>> Dear all,
>>   I am installing deal.ii with petsc on a cluster. After I compiled the
>> petsc library (The arch folder name is arch-linux-c-debug) and gave a cmake
>> argument -DPETSC_DIR=/home/yjin6/petsc
>> cmake cannot find the petsc library .so file(It is in the folder), but it
>> founds the version is 3.13.
>> Could you tell me what's the possible reason why cmake cannot find the
>> library?
>> Best regards
>> ***
>> --- Include
>> /home/yjin6/Deal.II/dealii-9.2.0/cmake/configure/configure_3_petsc.cmake
>> -- PETSC_LIBRARY not found! Call:
>> -- FIND_LIBRARY(PETSC_LIBRARY NAMES petsc libpetsc HINTS
>> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES lib lib64 lib)
>> -- PETSC_INCLUDE_DIR_ARCH not found! Call:
>> -- FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h HINTS
>> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES petsc include
>> include/petsc)
>> -- Found PETSC_INCLUDE_DIR_COMMON
>> -- Found PETSC_PETSCVARIABLES
>> --   PETSC_VERSION: 3.13.3.0
>> --   PETSC_LIBRARIES: *** Required variable "PETSC_LIBRARY" set to
>> NOTFOUND ***
>> --   PETSC_INCLUDE_DIRS: *** Required variable "PETSC_INCLUDE_DIR_ARCH"
>> set to NOTFOUND ***
>> --   PETSC_USER_INCLUDE_DIRS: *** Required variable
>> "PETSC_INCLUDE_DIR_ARCH" set to NOTFOUND ***
>> -- Could NOT find PETSC
>> -- DEAL_II_WITH_PETSC has unmet external dependencies.
>> --
>> Yuesu Jin,
>> Ph.D student,
>> University of Houston,
>> College of Natural Sciences and Mathematics,
>> Department of Earth and Atmospheric Sciences,
>> Houston, Texas 77204-5008
>> 346-404-2062
>>
>> --
>> 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/CA%2B25a%3DJVitawqmwmYZ4-9XC8tcmc4EkgXC3_gTy6hjAcLL3Dxg%40mail.gmail.com
>> 
>> .
>>
> --
> 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 

Re: [deal.II] Re: Memory loss in system solver

2020-07-24 Thread Daniel Arndt
Alberto,

Have you tried running valgrind (in parallel) on your code? Admittedly, I
expect quite a bit of false-positives from the MPI library but it should
still help.

Best,
Daniel

Am Fr., 24. Juli 2020 um 12:07 Uhr schrieb Alberto Salvadori <
alberto.salvad...@unibs.it>:

> Dear community,
>
> if I am not mistaking my analysis, it turned out that the memory loss is
> caused by this call:
>
> BiCG.solve (this->system_matrix, distributed_incremental_displacement,
> this->system_rhs, preconditioner);
>
> because if I turn it off the top command shows no change in the RES at all.
>
> Maybe this is of use. Thanks in advance.
>
> Alberto
>
> Il giorno venerdì 24 luglio 2020 alle 11:32:13 UTC+2 Alberto Salvadori ha
> scritto:
>
>> Dear community
>>
>> I have written the simple code below for solving a system using PETSc,
>> having defined
>>
>> Vector incremental_displacement;
>> Vector accumulated_displacement;
>>
>> in the class LargeStrainMechanicalProblem_OneField.
>>
>> It turns out that this code produces a memory loss, quite significant
>> since I am solving my system thousands of times, eventually inducing the
>> run to fail. I am not sure what is causing this issue and how to solve it,
>> maybe more experienced users than myself can catch the problem with a snap
>> of fingers.
>>
>> I have verified the issue on my mac (Catalina) as well as on linux ubuntu
>> (4.15.0), using deal.ii 9.1.1.
>> Apparently the issue reveals only when mpi is invoked with more than one
>> processor, whereas it does not emerge when running in serial or by mpirun
>> -np 1.
>>
>> Thanks in advance
>>
>> Alberto
>>
>> =
>>
>>
>>
>>
>> template 
>> unsigned int LargeStrainMechanicalProblem_OneField
>> ::
>> solve (
>> const unsigned penaltyAmplification
>> )
>>
>> //
>> // this simplified version of solve has been written to find out
>> // the source of memory leak in parallel
>> //
>>
>> {
>>
>> PETScWrappers::MPI::Vector distributed_incremental_displacement
>> (this>locally_owned_dofs,this->mpi_communicator);
>>
>> distributed_incremental_displacement = incremental_displacement;
>>
>> size_t
>> bicgstab_max_iterations = 2 ;
>>
>> double
>> tolerance = 1e-10 * this->system_rhs.l2_norm() ;
>>
>> unsigned solver_control_last_step;
>>
>> SolverControl bicgstab_solver_control ( bicgstab_max_iterations ,
>> tolerance );
>>
>> PETScWrappers::PreconditionJacobi preconditioner( this->system_matrix );
>>
>> this->pcout << " Bicgstab " << std::flush ;
>>
>> PETScWrappers::SolverBicgstab BiCG (bicgstab_solver_control,
>> this->mpi_communicator);
>>
>> BiCG.solve (this->system_matrix, distributed_incremental_displacement,
>> this->system_rhs, preconditioner);
>>
>> solver_control_last_step = bicgstab_solver_control.last_step();
>>
>> incremental_displacement = distributed_incremental_displacement;
>> accumulated_displacement += incremental_displacement;
>> this->hanging_node_constraints.distribute (accumulated_displacement);
>>
>> return solver_control_last_step;
>>
>> }
>>
>
>
> Informativa sulla Privacy: http://www.unibs.it/node/8155
>
> --
> 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/24389a5b-59ba-4f32-8c4b-06d23d0fe2ban%40googlegroups.com
> 
> .
>

-- 
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/CAOYDWb%2BFzNpuJG5-TTjbNXTFZyzhMbaXAGoD7ENb%2BK2W_gbY0A%40mail.gmail.com.


Re: [deal.II] Cannot find local compiled petsc library

2020-07-24 Thread Daniel Arndt
Yuesun,

Apparently, CMake was able to find the file petscvariables, but not the
include directories or the library.
Can you search for "libpetsc.so" yourself? Our CMake find module tries to
find this library in {PETSC_DIR}/lib or {PETSC_DIR}/lib64.
See if you can adjust PETSC_DIR accordingly.

Best,
Daniel

Am Fr., 24. Juli 2020 um 01:18 Uhr schrieb yuesu jin :

> Dear all,
>   I am installing deal.ii with petsc on a cluster. After I compiled the
> petsc library (The arch folder name is arch-linux-c-debug) and gave a cmake
> argument -DPETSC_DIR=/home/yjin6/petsc
> cmake cannot find the petsc library .so file(It is in the folder), but it
> founds the version is 3.13.
> Could you tell me what's the possible reason why cmake cannot find the
> library?
> Best regards
> ***
> --- Include
> /home/yjin6/Deal.II/dealii-9.2.0/cmake/configure/configure_3_petsc.cmake
> -- PETSC_LIBRARY not found! Call:
> -- FIND_LIBRARY(PETSC_LIBRARY NAMES petsc libpetsc HINTS
> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES lib lib64 lib)
> -- PETSC_INCLUDE_DIR_ARCH not found! Call:
> -- FIND_PATH(PETSC_INCLUDE_DIR_ARCH petscconf.h HINTS
> /home/yjin6/petsc /home/yjin6/petsc/ PATH_SUFFIXES petsc include
> include/petsc)
> -- Found PETSC_INCLUDE_DIR_COMMON
> -- Found PETSC_PETSCVARIABLES
> --   PETSC_VERSION: 3.13.3.0
> --   PETSC_LIBRARIES: *** Required variable "PETSC_LIBRARY" set to
> NOTFOUND ***
> --   PETSC_INCLUDE_DIRS: *** Required variable "PETSC_INCLUDE_DIR_ARCH"
> set to NOTFOUND ***
> --   PETSC_USER_INCLUDE_DIRS: *** Required variable
> "PETSC_INCLUDE_DIR_ARCH" set to NOTFOUND ***
> -- Could NOT find PETSC
> -- DEAL_II_WITH_PETSC has unmet external dependencies.
> --
> Yuesu Jin,
> Ph.D student,
> University of Houston,
> College of Natural Sciences and Mathematics,
> Department of Earth and Atmospheric Sciences,
> Houston, Texas 77204-5008
> 346-404-2062
>
> --
> 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/CA%2B25a%3DJVitawqmwmYZ4-9XC8tcmc4EkgXC3_gTy6hjAcLL3Dxg%40mail.gmail.com
> 
> .
>

-- 
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/CAOYDWb%2BPuHRk%3DWAtNcwt8PPm469pUSeLR1iiqTa3HZ2FmED_oA%40mail.gmail.com.


[deal.II] Re: Memory loss in system solver

2020-07-24 Thread Alberto Salvadori
Dear community,

if I am not mistaking my analysis, it turned out that the memory loss is 
caused by this call:

BiCG.solve (this->system_matrix, distributed_incremental_displacement, 
this->system_rhs, preconditioner);

because if I turn it off the top command shows no change in the RES at all.

Maybe this is of use. Thanks in advance.

Alberto

Il giorno venerdì 24 luglio 2020 alle 11:32:13 UTC+2 Alberto Salvadori ha 
scritto:

> Dear community
>
> I have written the simple code below for solving a system using PETSc,
> having defined 
>
> Vector incremental_displacement;
> Vector accumulated_displacement;
>
> in the class LargeStrainMechanicalProblem_OneField.
>
> It turns out that this code produces a memory loss, quite significant 
> since I am solving my system thousands of times, eventually inducing the 
> run to fail. I am not sure what is causing this issue and how to solve it, 
> maybe more experienced users than myself can catch the problem with a snap 
> of fingers. 
>
> I have verified the issue on my mac (Catalina) as well as on linux ubuntu 
> (4.15.0), using deal.ii 9.1.1.
> Apparently the issue reveals only when mpi is invoked with more than one 
> processor, whereas it does not emerge when running in serial or by mpirun 
> -np 1.
>
> Thanks in advance
>
> Alberto
>
> =
>
>
>
>
> template  
> unsigned int LargeStrainMechanicalProblem_OneField 
> :: 
> solve ( 
> const unsigned penaltyAmplification 
> ) 
>
> // 
> // this simplified version of solve has been written to find out 
> // the source of memory leak in parallel 
> // 
>
> { 
>
> PETScWrappers::MPI::Vector distributed_incremental_displacement 
> (this>locally_owned_dofs,this->mpi_communicator); 
>
> distributed_incremental_displacement = incremental_displacement; 
>
> size_t 
> bicgstab_max_iterations = 2 ; 
>
> double 
> tolerance = 1e-10 * this->system_rhs.l2_norm() ; 
>
> unsigned solver_control_last_step; 
>
> SolverControl bicgstab_solver_control ( bicgstab_max_iterations , 
> tolerance ); 
>
> PETScWrappers::PreconditionJacobi preconditioner( this->system_matrix ); 
>
> this->pcout << " Bicgstab " << std::flush ; 
>
> PETScWrappers::SolverBicgstab BiCG (bicgstab_solver_control, 
> this->mpi_communicator); 
>
> BiCG.solve (this->system_matrix, distributed_incremental_displacement, 
> this->system_rhs, preconditioner); 
>
> solver_control_last_step = bicgstab_solver_control.last_step(); 
>
> incremental_displacement = distributed_incremental_displacement; 
> accumulated_displacement += incremental_displacement; 
> this->hanging_node_constraints.distribute (accumulated_displacement); 
>
> return solver_control_last_step; 
>
> }
>

-- 


Informativa sulla Privacy: http://www.unibs.it/node/8155 


-- 
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/24389a5b-59ba-4f32-8c4b-06d23d0fe2ban%40googlegroups.com.


Re: [deal.II] KDTree implementation error

2020-07-24 Thread heena patel
Dear Luca,
 Thank you very much. It now works in both
ways. Thanks for advice.

Regards,
Heena

On Fri, Jul 24, 2020 at 12:31 PM luca.heltai  wrote:

> KDTree needs nanoflann to be available. Did you compile deal.II with
> nanoflann exnabled? Check in the summary.log if DEAL_II_WITH_NANOFLANN is
> ON.
>
> RTree, on the other hand, does not require nanoflann, as it is included
> with boost (and it is faster than nanoflann).
>
> L.
>
> > On 24 Jul 2020, at 10:05, heena patel  wrote:
> >
> > Dear Luca,
> > I am using 9.2 version and the
> implementation I try to follow  from your presentation at SISSA 2018 but it
> gives me error. Following are the lines I added to step-1. I want to
> implement K nearest neighbor. I will work on your suggestion.
> > #include 
> > Point<2>  p;
> >KDTree<2> tree(10,triangulation.get_vertices());
> >auto w = tree.get_closest_points(p, 3);
> >
> > Regards,
> > Heena
> >
> >
> > On Fri, Jul 24, 2020 at 8:30 AM Luca Heltai 
> wrote:
> > If you are using version 9.3pre of deal.II, kdtree was removed. Use
> RTree instead, which is faster and more flexible.
> >
> > Luca
> >
> >> Il giorno 24 lug 2020, alle ore 05:41, heena patel 
> ha scritto:
> >>
> >> 
> >> Dear Bruno,
> >>I had already added kdree.h header file,
> check the question again. But it seems it does not read KDTree; something
> is not compatible between class and header file.
> >>
> >> Regards,
> >> Heena
> >>
> >> On Thu, Jul 23, 2020 at 9:03 PM Bruno Turcksin <
> bruno.turck...@gmail.com> wrote:
> >> Heena,
> >>
> >> You are missing an include. Try adding #include
> 
> >>
> >> Best,
> >>
> >> Bruno
> >>
> >> On Thursday, July 23, 2020 at 2:55:53 PM UTC-4, heena patel wrote:
> >>
> >> Dear all,
> >>   I had tried to implement KDTree in step_1
> tutoria and header file for kdtree is added to the codel. It is as follows:
> >>
> >> void first_grid()
> >> {
> >>
> >>   Triangulation<2> triangulation;
> >>
> >>   GridGenerator::hyper_cube(triangulation);
> >>   triangulation.refine_global(4);
> >>   Point<2>  p;
> >>KDTree<2> tree(10,triangulation.get_vertices());
> >>auto w = tree.get_closest_points(p, 3);
> >>   std::ofstream out("grid-1.svg");
> >>   GridOut   grid_out;
> >>   grid_out.write_svg(triangulation, out);
> >>   std::cout << "Grid written to grid-1.svg" << std::endl;
> >> }
> >>
> >>
> >>
> >> It gives me error as below
> >>
> >> /home/heena/Project/examples/step-1/step-1.cc:76:4: error: ‘KDTree’ was
> not declared in this scope
> >> KDTree<2> tree(10,triangulation.get_vertices());
> >> ^~
> >> /home/heena/Project/examples/step-1/step-1.cc:76:4: note: suggested
> alternative: ‘free’
> >> KDTree<2> tree(10,triangulation.get_vertices());
> >> ^~
> >> free
> >> /home/heena/Project/examples/step-1/step-1.cc:76:14: error: ‘tree’ was
> not declared in this scope
> >> KDTree<2> tree(10,triangulation.get_vertices());
> >>   ^~~~
> >> /home/heena/Project/examples/step-1/step-1.cc:76:14: note: suggested
> alternative: ‘free’
> >> KDTree<2> tree(10,triangulation.get_vertices());
> >>   ^~~~
> >>   free
> >>
> >>
> >>
> >> Is there something missing?
> >>
> >>
> >>
> >> Regards,
> >> Heena
> >>
> >> --
> >> 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/d761c989-ef92-4603-8c8e-85ec4eeb3766o%40googlegroups.com
> .
> >>
> >> --
> >> 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/CAG_OxbgYqw02b4TnJAvBgWo7dvjRvf7zr6V%2BcBDKE_5hafCDJA%40mail.gmail.com
> .
> >
> > --
> > 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
> 

Re: [deal.II] Accessing nodal values of a FEM solution

2020-07-24 Thread Xuefeng Li
On Thu, Jul 23, 2020 at 5:14 PM Daniel Arndt  wrote:

>
> You can do similarly,
>
> Quadrature q(fe.get_unit_support_points());
> FEValues fe_values (..., q, update_q_points);
> for (const auto& cell)
>   ...
>   points = fe_values.get_quadrature_points();
>   fe_values.get_function_values(values);
>   fe_values.get_function_gradients(gradients);
>   for (unsigned int i=0; i v(local_dof_indices[i]) = f(points[i],  values(i), gradients(i));
>
>
> Yes! Declaring a quadrature on support points is a great solution. Thanks
a lot!

-- 
Stay put, practice social distancing, and be safe!

Best,

--Xuefeng Li, (504)865-3340(phone)
   Like floating clouds, the heart rests easy
   Like flowing water, the spirit stays free
  Loyola University New Orleans
   New Orleans, Louisiana (504)865-2051(fax)

-- 
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/CAO2HPGW8067gaFaYx2QjVHc719xdUVSh%3Dyg2UdhrFa4U38cn5Q%40mail.gmail.com.


Re: [deal.II] KDTree implementation error

2020-07-24 Thread luca.heltai
KDTree needs nanoflann to be available. Did you compile deal.II with nanoflann 
exnabled? Check in the summary.log if DEAL_II_WITH_NANOFLANN is ON.

RTree, on the other hand, does not require nanoflann, as it is included with 
boost (and it is faster than nanoflann).

L.

> On 24 Jul 2020, at 10:05, heena patel  wrote:
> 
> Dear Luca,
> I am using 9.2 version and the implementation 
> I try to follow  from your presentation at SISSA 2018 but it gives me error. 
> Following are the lines I added to step-1. I want to implement K nearest 
> neighbor. I will work on your suggestion.
> #include 
> Point<2>  p;
>KDTree<2> tree(10,triangulation.get_vertices());
>auto w = tree.get_closest_points(p, 3);
> 
> Regards,
> Heena
> 
> 
> On Fri, Jul 24, 2020 at 8:30 AM Luca Heltai  wrote:
> If you are using version 9.3pre of deal.II, kdtree was removed. Use RTree 
> instead, which is faster and more flexible. 
> 
> Luca
> 
>> Il giorno 24 lug 2020, alle ore 05:41, heena patel  ha 
>> scritto:
>> 
>> 
>> Dear Bruno,
>>I had already added kdree.h header file, 
>> check the question again. But it seems it does not read KDTree; something is 
>> not compatible between class and header file.
>> 
>> Regards,
>> Heena
>> 
>> On Thu, Jul 23, 2020 at 9:03 PM Bruno Turcksin  
>> wrote:
>> Heena,
>> 
>> You are missing an include. Try adding #include 
>> 
>> Best,
>> 
>> Bruno
>> 
>> On Thursday, July 23, 2020 at 2:55:53 PM UTC-4, heena patel wrote:
>> 
>> Dear all,
>>   I had tried to implement KDTree in step_1 tutoria 
>> and header file for kdtree is added to the codel. It is as follows:
>> 
>> void first_grid()
>> {
>> 
>>   Triangulation<2> triangulation;
>> 
>>   GridGenerator::hyper_cube(triangulation);
>>   triangulation.refine_global(4);
>>   Point<2>  p;
>>KDTree<2> tree(10,triangulation.get_vertices());
>>auto w = tree.get_closest_points(p, 3);
>>   std::ofstream out("grid-1.svg");
>>   GridOut   grid_out;
>>   grid_out.write_svg(triangulation, out);
>>   std::cout << "Grid written to grid-1.svg" << std::endl;
>> }
>> 
>> 
>> 
>> It gives me error as below 
>> 
>> /home/heena/Project/examples/step-1/step-1.cc:76:4: error: ‘KDTree’ was not 
>> declared in this scope
>> KDTree<2> tree(10,triangulation.get_vertices());
>> ^~
>> /home/heena/Project/examples/step-1/step-1.cc:76:4: note: suggested 
>> alternative: ‘free’
>> KDTree<2> tree(10,triangulation.get_vertices());
>> ^~
>> free
>> /home/heena/Project/examples/step-1/step-1.cc:76:14: error: ‘tree’ was not 
>> declared in this scope
>> KDTree<2> tree(10,triangulation.get_vertices());
>>   ^~~~
>> /home/heena/Project/examples/step-1/step-1.cc:76:14: note: suggested 
>> alternative: ‘free’
>> KDTree<2> tree(10,triangulation.get_vertices());
>>   ^~~~
>>   free
>> 
>> 
>> 
>> Is there something missing?
>> 
>> 
>> 
>> Regards,
>> Heena
>> 
>> -- 
>> 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/d761c989-ef92-4603-8c8e-85ec4eeb3766o%40googlegroups.com.
>> 
>> -- 
>> 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/CAG_OxbgYqw02b4TnJAvBgWo7dvjRvf7zr6V%2BcBDKE_5hafCDJA%40mail.gmail.com.
> 
> -- 
> 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/82AC7F19-2444-4E74-90B0-DCAC8F3722C2%40gmail.com.
> 
> -- 
> 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 
> 

Re: [deal.II] KDTree implementation error

2020-07-24 Thread luca.heltai
Dear Heena, 

here is a snippet to achieve what you want:


#include 
namespace bgi = boost::geometry::index;

…


Point<2>  p0;
const auto tree = pack_rtree(tria.get_vertices());

for (const auto  : tree | bgi::adaptors::queried(bgi::nearest(p0, 3)))
// do something with p
std::cout << p << std::endl;

or, if you need the indices of the points:

const auto tree_of_indices = pack_rtree_of_indices(tria.get_vertices());

for (const auto  : tree_of_indices | bgi::adaptors::queried(bgi::nearest(p0, 
3)))
// do something with i
std::cout << “Closest vertex has index "<< i << std::endl;


see 

https://github.com/dealii/dealii/blob/master/tests/boost/rtree_03.cc

for the example above.

L.

> On 24 Jul 2020, at 10:05, heena patel  wrote:
> 
> Dear Luca,
> I am using 9.2 version and the implementation 
> I try to follow  from your presentation at SISSA 2018 but it gives me error. 
> Following are the lines I added to step-1. I want to implement K nearest 
> neighbor. I will work on your suggestion.
> #include 
> Point<2>  p;
>KDTree<2> tree(10,triangulation.get_vertices());
>auto w = tree.get_closest_points(p, 3);
> 
> Regards,
> Heena
> 
> 
> On Fri, Jul 24, 2020 at 8:30 AM Luca Heltai  wrote:
> If you are using version 9.3pre of deal.II, kdtree was removed. Use RTree 
> instead, which is faster and more flexible. 
> 
> Luca
> 
>> Il giorno 24 lug 2020, alle ore 05:41, heena patel  ha 
>> scritto:
>> 
>> 
>> Dear Bruno,
>>I had already added kdree.h header file, 
>> check the question again. But it seems it does not read KDTree; something is 
>> not compatible between class and header file.
>> 
>> Regards,
>> Heena
>> 
>> On Thu, Jul 23, 2020 at 9:03 PM Bruno Turcksin  
>> wrote:
>> Heena,
>> 
>> You are missing an include. Try adding #include 
>> 
>> Best,
>> 
>> Bruno
>> 
>> On Thursday, July 23, 2020 at 2:55:53 PM UTC-4, heena patel wrote:
>> 
>> Dear all,
>>   I had tried to implement KDTree in step_1 tutoria 
>> and header file for kdtree is added to the codel. It is as follows:
>> 
>> void first_grid()
>> {
>> 
>>   Triangulation<2> triangulation;
>> 
>>   GridGenerator::hyper_cube(triangulation);
>>   triangulation.refine_global(4);
>>   Point<2>  p;
>>KDTree<2> tree(10,triangulation.get_vertices());
>>auto w = tree.get_closest_points(p, 3);
>>   std::ofstream out("grid-1.svg");
>>   GridOut   grid_out;
>>   grid_out.write_svg(triangulation, out);
>>   std::cout << "Grid written to grid-1.svg" << std::endl;
>> }
>> 
>> 
>> 
>> It gives me error as below 
>> 
>> /home/heena/Project/examples/step-1/step-1.cc:76:4: error: ‘KDTree’ was not 
>> declared in this scope
>> KDTree<2> tree(10,triangulation.get_vertices());
>> ^~
>> /home/heena/Project/examples/step-1/step-1.cc:76:4: note: suggested 
>> alternative: ‘free’
>> KDTree<2> tree(10,triangulation.get_vertices());
>> ^~
>> free
>> /home/heena/Project/examples/step-1/step-1.cc:76:14: error: ‘tree’ was not 
>> declared in this scope
>> KDTree<2> tree(10,triangulation.get_vertices());
>>   ^~~~
>> /home/heena/Project/examples/step-1/step-1.cc:76:14: note: suggested 
>> alternative: ‘free’
>> KDTree<2> tree(10,triangulation.get_vertices());
>>   ^~~~
>>   free
>> 
>> 
>> 
>> Is there something missing?
>> 
>> 
>> 
>> Regards,
>> Heena
>> 
>> -- 
>> 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/d761c989-ef92-4603-8c8e-85ec4eeb3766o%40googlegroups.com.
>> 
>> -- 
>> 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/CAG_OxbgYqw02b4TnJAvBgWo7dvjRvf7zr6V%2BcBDKE_5hafCDJA%40mail.gmail.com.
> 
> -- 
> 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 

[deal.II] Memory loss in system solver

2020-07-24 Thread Alberto Salvadori
Dear community

I have written the simple code below for solving a system using PETSc,
having defined 

Vector incremental_displacement;
Vector accumulated_displacement;

in the class LargeStrainMechanicalProblem_OneField.

It turns out that this code produces a memory loss, quite significant since 
I am solving my system thousands of times, eventually inducing the run to 
fail. I am not sure what is causing this issue and how to solve it, maybe 
more experienced users than myself can catch the problem with a snap of 
fingers. 

I have verified the issue on my mac (Catalina) as well as on linux ubuntu 
(4.15.0), using deal.ii 9.1.1.
Apparently the issue reveals only when mpi is invoked with more than one 
processor, whereas it does not emerge when running in serial or by mpirun 
-np 1.

Thanks in advance

Alberto

=




template  
unsigned int LargeStrainMechanicalProblem_OneField 
:: 
solve ( 
const unsigned penaltyAmplification 
) 

// 
// this simplified version of solve has been written to find out 
// the source of memory leak in parallel 
// 

{ 

PETScWrappers::MPI::Vector distributed_incremental_displacement 
(this>locally_owned_dofs,this->mpi_communicator); 

distributed_incremental_displacement = incremental_displacement; 

size_t 
bicgstab_max_iterations = 2 ; 

double 
tolerance = 1e-10 * this->system_rhs.l2_norm() ; 

unsigned solver_control_last_step; 

SolverControl bicgstab_solver_control ( bicgstab_max_iterations , tolerance 
); 

PETScWrappers::PreconditionJacobi preconditioner( this->system_matrix ); 

this->pcout << " Bicgstab " << std::flush ; 

PETScWrappers::SolverBicgstab BiCG (bicgstab_solver_control, 
this->mpi_communicator); 

BiCG.solve (this->system_matrix, distributed_incremental_displacement, 
this->system_rhs, preconditioner); 

solver_control_last_step = bicgstab_solver_control.last_step(); 

incremental_displacement = distributed_incremental_displacement; 
accumulated_displacement += incremental_displacement; 
this->hanging_node_constraints.distribute (accumulated_displacement); 

return solver_control_last_step; 

}

-- 


Informativa sulla Privacy: http://www.unibs.it/node/8155 


-- 
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/a6abf4d8-ae28-4c74-a0be-3f47f046368an%40googlegroups.com.


Re: [deal.II] Re: KDTree implementation error

2020-07-24 Thread heena patel
Dear Luca,
I am using 9.2 version and the
implementation I try to follow  from your presentation at SISSA 2018 but it
gives me error. Following are the lines I added to step-1. I want to
implement K nearest neighbor. I will work on your suggestion.
*#include *


*Point<2>  p;   KDTree<2> tree(10,triangulation.get_vertices());   auto w =
tree.get_closest_points(p, 3);*

Regards,
Heena


On Fri, Jul 24, 2020 at 8:30 AM Luca Heltai  wrote:

> If you are using version 9.3pre of deal.II, kdtree was removed. Use RTree
> instead, which is faster and more flexible.
>
> Luca
>
> Il giorno 24 lug 2020, alle ore 05:41, heena patel 
> ha scritto:
>
> 
> Dear Bruno,
>I had already added kdree.h header file,
> check the question again. But it seems it does not read KDTree; something
> is not compatible between class and header file.
>
> Regards,
> Heena
>
> On Thu, Jul 23, 2020 at 9:03 PM Bruno Turcksin 
> wrote:
>
>> Heena,
>>
>> You are missing an include. Try adding #include <
>> deal.II/numerics/kdtree.h
>> >
>>
>> Best,
>>
>> Bruno
>>
>> On Thursday, July 23, 2020 at 2:55:53 PM UTC-4, heena patel wrote:
>>>
>>>
>>> Dear all,
>>>   I had tried to implement KDTree in step_1
>>> tutoria and header file for kdtree is added to the codel. It is as follows:
>>>
>>> void first_grid()
>>> {
>>>
>>>   Triangulation<2> triangulation;
>>>
>>>   GridGenerator::hyper_cube(triangulation);
>>>   triangulation.refine_global(4);
>>>
>>>
>>> *  Point<2>  p;   KDTree<2> tree(10,triangulation.get_vertices());
>>> auto w = tree.get_closest_points(p, 3);*
>>>   std::ofstream out("grid-1.svg");
>>>   GridOut   grid_out;
>>>   grid_out.write_svg(triangulation, out);
>>>   std::cout << "Grid written to grid-1.svg" << std::endl;
>>> }
>>>
>>>
>>>
>>> *It gives me error as below *
>>>
>>> /home/heena/Project/examples/step-1/step-1.cc:76:4: error: ‘KDTree’ was
>>> not declared in this scope
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>> ^~
>>> /home/heena/Project/examples/step-1/step-1.cc:76:4: note: suggested
>>> alternative: ‘free’
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>> ^~
>>> free
>>> /home/heena/Project/examples/step-1/step-1.cc:76:14: error: ‘tree’ was
>>> not declared in this scope
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>>   ^~~~
>>> /home/heena/Project/examples/step-1/step-1.cc:76:14: note: suggested
>>> alternative: ‘free’
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>>   ^~~~
>>>   free
>>>
>>>
>>>
>>> Is there something missing?
>>>
>>>
>>>
>>> Regards,
>>> Heena
>>>
>> --
>> 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/d761c989-ef92-4603-8c8e-85ec4eeb3766o%40googlegroups.com
>> 
>> .
>>
> --
> 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/CAG_OxbgYqw02b4TnJAvBgWo7dvjRvf7zr6V%2BcBDKE_5hafCDJA%40mail.gmail.com
> 
> .
>
> --
> 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/82AC7F19-2444-4E74-90B0-DCAC8F3722C2%40gmail.com
> 
> .
>

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

Re: [deal.II] Re: KDTree implementation error

2020-07-24 Thread Luca Heltai
If you are using version 9.3pre of deal.II, kdtree was removed. Use RTree 
instead, which is faster and more flexible. 

Luca

> Il giorno 24 lug 2020, alle ore 05:41, heena patel  ha 
> scritto:
> 
> 
> Dear Bruno,
>I had already added kdree.h header file, check 
> the question again. But it seems it does not read KDTree; something is not 
> compatible between class and header file.
> 
> Regards,
> Heena
> 
>> On Thu, Jul 23, 2020 at 9:03 PM Bruno Turcksin  
>> wrote:
>> Heena,
>> 
>> You are missing an include. Try adding #include 
>> 
>> Best,
>> 
>> Bruno
>> 
>>> On Thursday, July 23, 2020 at 2:55:53 PM UTC-4, heena patel wrote:
>>> 
>>> Dear all,
>>>   I had tried to implement KDTree in step_1 tutoria 
>>> and header file for kdtree is added to the codel. It is as follows:
>>> 
>>> void first_grid()
>>> {
>>> 
>>>   Triangulation<2> triangulation;
>>> 
>>>   GridGenerator::hyper_cube(triangulation);
>>>   triangulation.refine_global(4);
>>>   Point<2>  p;
>>>KDTree<2> tree(10,triangulation.get_vertices());
>>>auto w = tree.get_closest_points(p, 3);
>>>   std::ofstream out("grid-1.svg");
>>>   GridOut   grid_out;
>>>   grid_out.write_svg(triangulation, out);
>>>   std::cout << "Grid written to grid-1.svg" << std::endl;
>>> }
>>> 
>>> 
>>> 
>>> It gives me error as below 
>>> 
>>> /home/heena/Project/examples/step-1/step-1.cc:76:4: error: ‘KDTree’ was not 
>>> declared in this scope
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>> ^~
>>> /home/heena/Project/examples/step-1/step-1.cc:76:4: note: suggested 
>>> alternative: ‘free’
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>> ^~
>>> free
>>> /home/heena/Project/examples/step-1/step-1.cc:76:14: error: ‘tree’ was not 
>>> declared in this scope
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>>   ^~~~
>>> /home/heena/Project/examples/step-1/step-1.cc:76:14: note: suggested 
>>> alternative: ‘free’
>>> KDTree<2> tree(10,triangulation.get_vertices());
>>>   ^~~~
>>>   free
>>> 
>>> 
>>> 
>>> Is there something missing?
>>> 
>>> 
>>> 
>>> Regards,
>>> Heena
>> 
>> -- 
>> 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/d761c989-ef92-4603-8c8e-85ec4eeb3766o%40googlegroups.com.
> 
> -- 
> 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/CAG_OxbgYqw02b4TnJAvBgWo7dvjRvf7zr6V%2BcBDKE_5hafCDJA%40mail.gmail.com.

-- 
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/82AC7F19-2444-4E74-90B0-DCAC8F3722C2%40gmail.com.