[Trilinos-Users] Trilinos-Users Digest, Vol 159, Issue 1

Amstad Patrick pamstad at student.ethz.ch
Mon May 13 13:45:18 EDT 2019


Thank you for the fast answer; the problem with the BlockMap is solved!

Best regards
Patrick
________________________________________
Von: Trilinos-Users [trilinos-users-bounces at trilinos.org]" im Auftrag von "trilinos-users-request at trilinos.org [trilinos-users-request at trilinos.org]
Gesendet: Montag, 13. Mai 2019 12:58
An: trilinos-users at trilinos.org
Betreff: Trilinos-Users Digest, Vol 159, Issue 1

Send Trilinos-Users mailing list submissions to
        trilinos-users at trilinos.org

To subscribe or unsubscribe via the World Wide Web, visit
        https://trilinos.org/mailman/listinfo/trilinos-users
or, via email, send a message with subject or body 'help' to
        trilinos-users-request at trilinos.org

You can reach the person managing the list at
        trilinos-users-owner at trilinos.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Trilinos-Users digest..."


Today's Topics:

   1. Announcement:  package deprecation in Trilinos (Devine, Karen D)
   2. Problem installing Trilinos (Gabriel Peters)
   3. Re: Problem installing Trilinos (Eric Bavier)
   4. Registration open: One-day European Trilinos User Group
      Meeting, June 11, 2019, ETH Zurich (Heroux, Michael A)
   5. Coupling NOX with deal.II for multiple MPI threads
      (Roland Richter)
   6. Memory Profiling (Frey Matthias (PSI))
   7. Re: Memory Profiling (Dmitry N. Mikushin)
   8. Re: [EXTERNAL] Re:  Memory Profiling (Gates, Jason Matthew)
   9. Re: [EXTERNAL] Re:  Memory Profiling (Frey Matthias (PSI))
  10. EpetraVector, BlockMap, GID and LID (Amstad  Patrick)
  11. Re: [EXTERNAL]  EpetraVector, BlockMap, GID and LID
      (Rizzi, Francesco NMN)
  12. Re: [EXTERNAL]  EpetraVector, BlockMap, GID and LID
      (Rizzi, Francesco NMN)


----------------------------------------------------------------------

Message: 1
Date: Wed, 10 Apr 2019 18:45:23 +0000
From: "Devine, Karen D" <kddevin at sandia.gov>
To: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>,
        "trilinos-announce at trilinos.org" <trilinos-announce at trilinos.org>
Subject: [Trilinos-Users] Announcement:  package deprecation in
        Trilinos
Message-ID: <1554921925146.87937 at sandia.gov>
Content-Type: text/plain; charset="iso-8859-1"


The following four packages are scheduled for deprecation and removal from the Trilinos repository:


   OptiPack

   GlobiPack

   Trios

   Claps


The packages will be deprecated in mid-April 2019, and will be removed from the Trilinos develop and master branches in mid-May 2019.


If you have questions or concerns about the deprecation and removal, please contact kddevin at sandia.gov.


Karen Devine

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190410/f68146e2/attachment-0001.html>

------------------------------

Message: 2
Date: Thu, 11 Apr 2019 10:37:18 +0200
From: "Gabriel Peters" <Gabriel.Peters at koeln.de>
To: trilinos-users at trilinos.org
Subject: [Trilinos-Users] Problem installing Trilinos
Message-ID:
        <trinity-69cd32f2-5854-43e9-af26-f9ed85c0038b-1554971838943 at 3c-app-webde-bap60>

Content-Type: text/plain; charset="us-ascii"

An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190411/ab3fa9ec/attachment-0001.html>

------------------------------

Message: 3
Date: Thu, 11 Apr 2019 15:36:46 +0000
From: Eric Bavier <bavier at cray.com>
To: Gabriel Peters <Gabriel.Peters at koeln.de>,
        "trilinos-users at trilinos.org"   <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] Problem installing Trilinos
Message-ID:
        <CY4PR1101MB232516299E353D53C9AB38B6B72F0 at CY4PR1101MB2325.namprd11.prod.outlook.com>

Content-Type: text/plain; charset="Windows-1252"

This is the issue reported in https://github.com/trilinos/Sundance/issues/3 and fixed by https://github.com/trilinos/Sundance/pull/1

Eric Bavier, Scientific Libraries, Cray Inc.

________________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Gabriel Peters <Gabriel.Peters at koeln.de>
Sent: Thursday, April 11, 2019 03:37
To: trilinos-users at trilinos.org
Subject: [Trilinos-Users] Problem installing Trilinos

Dear trilinos developers,

I have a problem, installing the current version of trilinos (12.12.1).

I configured the setup with cmake which worked fine (I didnt enable the matio package.
When I call make install or make -j install I get the following error at a progress of 87%:


[ 87%] Building CXX object packages/Sundance/Playa/src/CMakeFiles/sundancePlaya.dir/NOX_Playa_Group.cpp.o
/home/peters/Documents/trilinos-12.12.1-Source/packages/Sundance/Playa/src/NOX_Playa_Group.cpp: In constructor ?NOX::NOXPlaya::Group::Group(const Playa::Vector<double>&, const Playa::NonlinearOperator<double>&, const Playa::LinearSolver<double>&)?:
/home/peters/Documents/trilinos-12.12.1-Source/packages/Sundance/Playa/src/NOX_Playa_Group.cpp:71:70: error:

invalid new-expression of abstract class type ?NOX::NOXPlaya::Vector?
   xVector(rcp(new NOX::NOXPlaya::Vector(initcond, precision, DeepCopy))),


Can you tell me what went wrong?

Thanks a lot and best regards.

Gabriel


------------------------------

Message: 4
Date: Mon, 22 Apr 2019 19:02:24 +0000
From: "Heroux, Michael A" <maherou at sandia.gov>
To: Trilinos Users <trilinos-users at trilinos.org>, Trilinos Developers
        <trilinos-developers at trilinos.org>, Trilinos Announce
        <trilinos-announce at trilinos.org>
Cc: Ruefli Tatjana <ruefli at cscs.ch>,    De Lorenzi Michele
        <michele.delorenzi at cscs.ch>
Subject: [Trilinos-Users] Registration open: One-day European Trilinos
        User Group Meeting, June 11, 2019, ETH Zurich
Message-ID: <8CE1FDC1-5FBF-4FEC-951E-5BC25E63F6B2 at sandia.gov>
Content-Type: text/plain; charset="utf-8"


Dear colleagues,

Registration is open for the one-day European Trilinos User Group meeting on June 11, 2019 at ETH Zurich, Switzerland, co-sponsored by CSCS.  The meeting is one day before the 2019 Platform for Advanced Scientific Computing Conference (PASC 2019 - https://pasc19.pasc-conference.org) also held at ETH from June 12 ? 14.

Registration page: https://www.cscs.ch/events/upcoming-events/event-detail/european-trilinos-user-group-meeting/

Detailed agenda: https://trilinos.github.io/european_trilinos_user_group_meeting_2019.html

Thank you.

Mike Heroux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190422/5bae209c/attachment-0001.html>

------------------------------

Message: 5
Date: Fri, 26 Apr 2019 11:23:16 +0200
From: Roland Richter <roland.richter at ntnu.no>
To: trilinos-users at trilinos.org
Subject: [Trilinos-Users] Coupling NOX with deal.II for multiple MPI
        threads
Message-ID: <77549a1b-3a67-170e-b4a0-0e0875d4a4c7 at ntnu.no>
Content-Type: text/plain; charset=utf-8

Hei,

I am trying to couple NOX to my existing code, written using the library
deal.II. Here I try to solve my system using the JFNK-method by
supplying the residual. The residual is calculated using functions from
deal.II, thus I have to transfer data from deal.II-code to
Trilinos-variables, back to deal.II-code, back to NOX, and finally back
to deal.II. The way I do it is

??? bool computeF(const Epetra_Vector &x, Epetra_Vector &FVec,
NOX::Epetra::Interface::Required::FillType)
??? {
??????? f_vec.reinit(locally_relevant_dofs, mpi_communicator);
//deal.II-vector
??????? residual_vec.reinit(locally_relevant_dofs, mpi_communicator);
//deal.II-vector


??????? Epetra_Vector f_epetra_vec = Epetra_Vector(View,
f_vec.trilinos_vector(), 0);

??????? residual_vec = 0.;

??????? f_epetra_vec = x;

??????? residual_function(f_vec, residual_vec); //Function for
calculating the residual

??????? for(auto index : residual_vec.locally_owned_elements())
??????????? FVec[index] = residual_vec[index]; //Problem!

??????? return true;
??? }

This works quite well for a single MPI thread. But for running on two
MPI threads, and having 81 degrees of freedom, the length of FVec goes
down to 63 elements (which is the amount of relevant degrees of freedom,
including ghosted values, for f_vec for both threads), while the amount
of locally owned degrees of freedom for both f_vec-vectors is 45 and 36,
respectively (resulting in 81 dofs). Thus I am trying to write 81 values
into a vector with a length of 63, resulting in a segfault. Is there a
way to handle this correctly?

Thanks,

regards,

Roland



------------------------------

Message: 6
Date: Fri, 26 Apr 2019 10:57:42 +0000
From: "Frey Matthias (PSI)" <matthias.frey at psi.ch>
To: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: [Trilinos-Users] Memory Profiling
Message-ID:
        <C7DC16335AB32641857858CD7C7373CE475C7F7B at MBX214.d.ethz.ch>
Content-Type: text/plain; charset="iso-8859-1"

Hi

I'd like to profile the memory usage of Tpetra. I found on the website of Kokkos

https://github.com/kokkos/kokkos-tools/wiki/MemoryUsage

that you can do memory analysis. Is this also possible in Trilinos?

Thanks,
Matthias



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190426/5f542620/attachment-0001.html>

------------------------------

Message: 7
Date: Fri, 26 Apr 2019 21:05:52 +0300
From: "Dmitry N. Mikushin" <maemarcus at gmail.com>
To: "Frey Matthias (PSI)" <matthias.frey at psi.ch>
Cc: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] Memory Profiling
Message-ID:
        <CAGR4S9Gg+=w0PiCtSp1PBmjjyz+PcbXukNUwB5jiADCRTCjX2g at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi,

There is a general approach for profiling memory usage by wrapping the
standard *alloc/free functions using ld's wrap and/or LD_PRELOAD
techniques. You can find further information in man. Kokkos' MemoryUsage is
also doing something along these lines.

Kind regards,
- Dmitry.


??, 26 ???. 2019 ?. ? 13:59, Frey Matthias (PSI) <matthias.frey at psi.ch>:

> Hi
>
> I'd like to profile the memory usage of Tpetra. I found on the website of
> Kokkos
>
> https://github.com/kokkos/kokkos-tools/wiki/MemoryUsage
>
> that you can do memory analysis. Is this also possible in Trilinos?
>
> Thanks,
> Matthias
>
>
>
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at trilinos.org
> https://trilinos.org/mailman/listinfo/trilinos-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190426/0717c4f5/attachment-0001.html>

------------------------------

Message: 8
Date: Fri, 26 Apr 2019 19:08:51 +0000
From: "Gates, Jason Matthew" <jmgate at sandia.gov>
To: "Dmitry N. Mikushin" <maemarcus at gmail.com>
Cc: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] [EXTERNAL] Re:  Memory Profiling
Message-ID: <F2AE3069-9D27-46ED-A52F-BED82C096E26 at sandia.gov>
Content-Type: text/plain; charset="utf-8"

Matthias, kokkos-tools can be used within Trilinos.

Jason

On Apr 26, 2019, at 12:05 PM, Dmitry N. Mikushin <maemarcus at gmail.com<mailto:maemarcus at gmail.com>> wrote:

Hi,

There is a general approach for profiling memory usage by wrapping the standard *alloc/free functions using ld's wrap and/or LD_PRELOAD techniques. You can find further information in man. Kokkos' MemoryUsage is also doing something along these lines.

Kind regards,
- Dmitry.


??, 26 ???. 2019 ?. ? 13:59, Frey Matthias (PSI) <matthias.frey at psi.ch<mailto:matthias.frey at psi.ch>>:
Hi

I'd like to profile the memory usage of Tpetra. I found on the website of Kokkos

https://github.com/kokkos/kokkos-tools/wiki/MemoryUsage

that you can do memory analysis. Is this also possible in Trilinos?

Thanks,
Matthias



_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org<mailto:Trilinos-Users at trilinos.org>
https://trilinos.org/mailman/listinfo/trilinos-users
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org<mailto:Trilinos-Users at trilinos.org>
https://trilinos.org/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190426/272170ee/attachment-0001.html>

------------------------------

Message: 9
Date: Fri, 26 Apr 2019 20:39:27 +0000
From: "Frey Matthias (PSI)" <matthias.frey at psi.ch>
To: "Gates, Jason Matthew" <jmgate at sandia.gov>, "Dmitry N. Mikushin"
        <maemarcus at gmail.com>
Cc: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] [EXTERNAL] Re:  Memory Profiling
Message-ID:
        <C7DC16335AB32641857858CD7C7373CE475C7FDB at MBX214.d.ethz.ch>
Content-Type: text/plain; charset="koi8-r"

Hi Dmitry and Jason

Thanks. Yes, it works. After enabling KOKKOS_ENABLE_PROFILING and KOKKOS_ENABLE_PROFILE_LOAD_PRINT in the Trilinos
build, I could use the kokkos-tools.

Best,
Matthias


________________________________
Von: Gates, Jason Matthew [jmgate at sandia.gov]
Gesendet: Freitag, 26. April 2019 21:08
An: Dmitry N. Mikushin
Cc: Frey Matthias (PSI); trilinos-users at trilinos.org
Betreff: Re: [EXTERNAL] Re: [Trilinos-Users] Memory Profiling

Matthias, kokkos-tools can be used within Trilinos.

Jason

On Apr 26, 2019, at 12:05 PM, Dmitry N. Mikushin <maemarcus at gmail.com<mailto:maemarcus at gmail.com>> wrote:

Hi,

There is a general approach for profiling memory usage by wrapping the standard *alloc/free functions using ld's wrap and/or LD_PRELOAD techniques. You can find further information in man. Kokkos' MemoryUsage is also doing something along these lines.

Kind regards,
- Dmitry.


??, 26 ???. 2019 ?. ? 13:59, Frey Matthias (PSI) <matthias.frey at psi.ch<mailto:matthias.frey at psi.ch>>:
Hi

I'd like to profile the memory usage of Tpetra. I found on the website of Kokkos

https://github.com/kokkos/kokkos-tools/wiki/MemoryUsage

that you can do memory analysis. Is this also possible in Trilinos?

Thanks,
Matthias



_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org<mailto:Trilinos-Users at trilinos.org>
https://trilinos.org/mailman/listinfo/trilinos-users
_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org<mailto:Trilinos-Users at trilinos.org>
https://trilinos.org/mailman/listinfo/trilinos-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190426/e26db88f/attachment-0001.html>

------------------------------

Message: 10
Date: Sun, 12 May 2019 10:41:18 +0000
From: "Amstad  Patrick" <pamstad at student.ethz.ch>
To: "trilinos-users at trilinos.org" <trilinos-users at trilinos.org>
Subject: [Trilinos-Users] EpetraVector, BlockMap, GID and LID
Message-ID:
        <2B8E3A8B77C88249A183572E942D5A8132BF0237 at MBX115.d.ethz.ch>
Content-Type: text/plain; charset="iso-8859-1"

Hi everbody

I think I have a general problem with the understanding of BlockMaps, and EpetraVector and my last hope is this mailing list. My Goal is (as a simplified example):


  *   Let's assume I have a beam, discretised in a way that it has six nodes. Each node has two degrees of freedom (DOF); one in the x-direction and anotherone in the y-direction (I assume a cartesian coordinate system)

  *   My goal is now, that I can specify for each node a desired displacement. So let's say I want to displace node 3 by one unit in the x-direction and by 0.5 units in the y-direction. This information, by how much each node gets displaced, I want to store in the EpetraVector and want to access it later.
  *   My Problem is now; I have no idea how I can access these individual DOF from the BlockMap; any idea?

How do I get these informations from the BlockMap and how can fill my EpetraVector? A code snippet below, how I wanted to do this:

         // Create P1 VectorEpetra
        VectorEpetra p1PositionVector (p1dFESpace.map());


        Int p1nCompLocalDof = p1PositionVector.epetraVector().MyLength() / 3; //My Length returns length of EpetraVector on calling processor
        for (int j (0); j < p1nCompLocalDof; j++)
        {
            UInt iGID = p1PositionVector.blockMap().GID (j);
            UInt jGID = p1PositionVector.blockMap().GID (j + p1nCompLocalDof);
            UInt kGID = p1PositionVector.blockMap().GID (j + 2 * p1nCompLocalDof);

            p1PositionVector[iGID] = 1.0 ;
            p1PositionVector[jGID] = 0.5 ; //Here I want to specify the displacements of the nodes; for example displacement of 1.0 in x-direction; 0.5 in y-direction
            p1PositionVector[kGID] = 0.0 ;
        }


The result I get from this, is that for example node 5 instead of node 3 gets the displacement specified; so I have problems to access specific nodes.

Thanks for an answer.

Best regards
Patrick Amstad



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190512/6bd1ddca/attachment-0001.html>

------------------------------

Message: 11
Date: Mon, 13 May 2019 10:31:26 +0000
From: "Rizzi, Francesco NMN" <fnrizzi at sandia.gov>
To: "Amstad  Patrick" <pamstad at student.ethz.ch>,
        "trilinos-users at trilinos.org"   <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] [EXTERNAL]  EpetraVector, BlockMap, GID
        and LID
Message-ID: <1557743486325.9950 at sandia.gov>
Content-Type: text/plain; charset="iso-8859-1"

Hi Patrick,


Sharing this with trilinos-users too.

I came up with the attached code, running with 3 MPI ranks gives the output below.

I hope I interpreted correctly what you intended to do.

Please let me know if this is not right and/or some things are not clear.


Thanks.

Best,

Francesco Rizzi




1: Test timeout computed to be: 10000000
1: 1 3
1: 0 3
1: 2 3
1:
1: Number of Global Elements  = 6
1: Number of Global Points    = 18
1: Maximum of all GIDs        = 5
1: Minimum of all GIDs        = 0
1: Index Base                 = 0
1: Constant Element Size      = 3
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 1
1: Minimum of my GIDs         = 0
1:
1:          MyPID           Local Index        Global Index
1:              0                 0                 0
1:              0                 1                 1
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 3
1: Minimum of my GIDs         = 2
1:
1:          MyPID           Local Index        Global Index
1:              1                 0                 2
1:              1                 1                 3
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 5
1: Minimum of my GIDs         = 4
1:
1:          MyPID           Local Index        Global Index
1:              2                 0                 4
1:              2                 1                 5
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          1             2/0                       0
1:          1             2/1                       0
1:          1             2/2                       0
1:          1             3/0                       0
1:          1             3/1                       0
1:          1             3/2                       0
1:          2             4/0                       0
1:          2             4/1                       0
1:          2             4/2                       0
1:          2             5/0                       0
1:          2             5/1                       0
1:          2             5/2                       0
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          1             2/0                       1
1:          1             2/1                     0.5
1:          1             2/2                       0
1:          1             3/0                       0
1:          1             3/1                       0
1:          1             3/2                       0
1:          2             4/0                       0
1:          2             4/1                       0
1:          2             4/2                       0
1:          2             5/0                       0
1:          2             5/1                       0
1:          2             5/2                       0











________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Amstad Patrick <pamstad at student.ethz.ch>
Sent: Sunday, May 12, 2019 3:41 AM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] EpetraVector, BlockMap, GID and LID

Hi everbody

I think I have a general problem with the understanding of BlockMaps, and EpetraVector and my last hope is this mailing list. My Goal is (as a simplified example):


  *   Let's assume I have a beam, discretised in a way that it has six nodes. Each node has two degrees of freedom (DOF); one in the x-direction and anotherone in the y-direction (I assume a cartesian coordinate system)

  *   My goal is now, that I can specify for each node a desired displacement. So let's say I want to displace node 3 by one unit in the x-direction and by 0.5 units in the y-direction. This information, by how much each node gets displaced, I want to store in the EpetraVector and want to access it later.
  *   My Problem is now; I have no idea how I can access these individual DOF from the BlockMap; any idea?

How do I get these informations from the BlockMap and how can fill my EpetraVector? A code snippet below, how I wanted to do this:

         // Create P1 VectorEpetra
        VectorEpetra p1PositionVector (p1dFESpace.map());


        Int p1nCompLocalDof = p1PositionVector.epetraVector().MyLength() / 3; //My Length returns length of EpetraVector on calling processor
        for (int j (0); j < p1nCompLocalDof; j++)
        {
            UInt iGID = p1PositionVector.blockMap().GID (j);
            UInt jGID = p1PositionVector.blockMap().GID (j + p1nCompLocalDof);
            UInt kGID = p1PositionVector.blockMap().GID (j + 2 * p1nCompLocalDof);

            p1PositionVector[iGID] = 1.0 ;
            p1PositionVector[jGID] = 0.5 ; //Here I want to specify the displacements of the nodes; for example displacement of 1.0 in x-direction; 0.5 in y-direction
            p1PositionVector[kGID] = 0.0 ;
        }


The result I get from this, is that for example node 5 instead of node 3 gets the displacement specified; so I have problems to access specific nodes.

Thanks for an answer.

Best regards
Patrick Amstad



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190513/d518c673/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cc
Type: application/octet-stream
Size: 1091 bytes
Desc: main.cc
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190513/d518c673/attachment-0001.obj>

------------------------------

Message: 12
Date: Mon, 13 May 2019 10:58:09 +0000
From: "Rizzi, Francesco NMN" <fnrizzi at sandia.gov>
To: "Amstad  Patrick" <pamstad at student.ethz.ch>,
        "trilinos-users at trilinos.org"   <trilinos-users at trilinos.org>
Subject: Re: [Trilinos-Users] [EXTERNAL]  EpetraVector, BlockMap, GID
        and LID
Message-ID: <1557745089089.92390 at sandia.gov>
Content-Type: text/plain; charset="iso-8859-1"

Hi Patrick,


Sorry, in my previous email I shared the wrong version of the code :)

The main_revised.cc is the right one.

Running with 1 and 3 MPI ranks gives the outputs below. I hope I interpreted correctly what you intended to do.

I am printing the vector twice, after it is constructed and right after it is modified.

Please let me know if this is not right and/or some things are not clear.


Thanks.

Best,

Francesco Rizzi





------------------------------------

OUTPUT for 3 MPI ranks

------------------------------------
1: Test timeout computed to be: 10000000
1: 1 3
1: 0 3
1: 2 3
1:
1: Number of Global Elements  = 6
1: Number of Global Points    = 18
1: Maximum of all GIDs        = 5
1: Minimum of all GIDs        = 0
1: Index Base                 = 0
1: Constant Element Size      = 3
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 1
1: Minimum of my GIDs         = 0
1:
1:          MyPID           Local Index        Global Index
1:              0                 0                 0
1:              0                 1                 1
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 3
1: Minimum of my GIDs         = 2
1:
1:          MyPID           Local Index        Global Index
1:              1                 0                 2
1:              1                 1                 3
1:
1: Number of Local Elements   = 2
1: Number of Local Points     = 6
1: Maximum of my GIDs         = 5
1: Minimum of my GIDs         = 4
1:
1:          MyPID           Local Index        Global Index
1:              2                 0                 4
1:              2                 1                 5
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          1             2/0                       0
1:          1             2/1                       0
1:          1             2/2                       0
1:          1             3/0                       0
1:          1             3/1                       0
1:          1             3/2                       0
1:          2             4/0                       0
1:          2             4/1                       0
1:          2             4/2                       0
1:          2             5/0                       0
1:          2             5/1                       0
1:          2             5/2                       0
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          1             2/0                       0
1:          1             2/1                       0
1:          1             2/2                       0
1:          1             3/0                       1
1:          1             3/1                     0.5
1:          1             3/2                       0
1:          2             4/0                       0
1:          2             4/1                       0
1:          2             4/2                       0
1:          2             5/0                       0
1:          2             5/1                       0
1:          2             5/2                       0



------------------------------------

OUTPUT for 1 MPI rank

------------------------------------
1: Test timeout computed to be: 10000000
1: 0 1
1:
1: Number of Global Elements  = 6
1: Number of Global Points    = 18
1: Maximum of all GIDs        = 5
1: Minimum of all GIDs        = 0
1: Index Base                 = 0
1: Constant Element Size      = 3
1:
1: Number of Local Elements   = 6
1: Number of Local Points     = 18
1: Maximum of my GIDs         = 5
1: Minimum of my GIDs         = 0
1:
1:          MyPID           Local Index        Global Index
1:              0                 0                 0
1:              0                 1                 1
1:              0                 2                 2
1:              0                 3                 3
1:              0                 4                 4
1:              0                 5                 5
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          0             2/0                       0
1:          0             2/1                       0
1:          0             2/2                       0
1:          0             3/0                       0
1:          0             3/1                       0
1:          0             3/2                       0
1:          0             4/0                       0
1:          0             4/1                       0
1:          0             4/2                       0
1:          0             5/0                       0
1:          0             5/1                       0
1:          0             5/2                       0
1:      MyPID         GID/Point             Value
1:          0             0/0                       0
1:          0             0/1                       0
1:          0             0/2                       0
1:          0             1/0                       0
1:          0             1/1                       0
1:          0             1/2                       0
1:          0             2/0                       0
1:          0             2/1                       0
1:          0             2/2                       0
1:          0             3/0                       1
1:          0             3/1                     0.5
1:          0             3/2                       0
1:          0             4/0                       0
1:          0             4/1                       0
1:          0             4/2                       0
1:          0             5/0                       0
1:          0             5/1                       0
1:          0             5/2                       0









________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Amstad Patrick <pamstad at student.ethz.ch>
Sent: Sunday, May 12, 2019 3:41 AM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] EpetraVector, BlockMap, GID and LID

Hi everbody

I think I have a general problem with the understanding of BlockMaps, and EpetraVector and my last hope is this mailing list. My Goal is (as a simplified example):


  *   Let's assume I have a beam, discretised in a way that it has six nodes. Each node has two degrees of freedom (DOF); one in the x-direction and anotherone in the y-direction (I assume a cartesian coordinate system)

  *   My goal is now, that I can specify for each node a desired displacement. So let's say I want to displace node 3 by one unit in the x-direction and by 0.5 units in the y-direction. This information, by how much each node gets displaced, I want to store in the EpetraVector and want to access it later.
  *   My Problem is now; I have no idea how I can access these individual DOF from the BlockMap; any idea?

How do I get these informations from the BlockMap and how can fill my EpetraVector? A code snippet below, how I wanted to do this:

         // Create P1 VectorEpetra
        VectorEpetra p1PositionVector (p1dFESpace.map());


        Int p1nCompLocalDof = p1PositionVector.epetraVector().MyLength() / 3; //My Length returns length of EpetraVector on calling processor
        for (int j (0); j < p1nCompLocalDof; j++)
        {
            UInt iGID = p1PositionVector.blockMap().GID (j);
            UInt jGID = p1PositionVector.blockMap().GID (j + p1nCompLocalDof);
            UInt kGID = p1PositionVector.blockMap().GID (j + 2 * p1nCompLocalDof);

            p1PositionVector[iGID] = 1.0 ;
            p1PositionVector[jGID] = 0.5 ; //Here I want to specify the displacements of the nodes; for example displacement of 1.0 in x-direction; 0.5 in y-direction
            p1PositionVector[kGID] = 0.0 ;
        }


The result I get from this, is that for example node 5 instead of node 3 gets the displacement specified; so I have problems to access specific nodes.

Thanks for an answer.

Best regards
Patrick Amstad



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190513/9c5cca42/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main_revised.cc
Type: application/octet-stream
Size: 1122 bytes
Desc: main_revised.cc
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20190513/9c5cca42/attachment.obj>

------------------------------

Subject: Digest Footer

_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at trilinos.org
https://trilinos.org/mailman/listinfo/trilinos-users


------------------------------

End of Trilinos-Users Digest, Vol 159, Issue 1
**********************************************


More information about the Trilinos-Users mailing list