I am getting warning messages when using periodic boundary conditions

Asked by Sergey Alyaev

I am using periodic boundary conditions and I am getting the following warning message:

*** Warning: GenericVector::get is redirected to GenericVector::get_local. Use GenericVector::gather for get off-process entries. GenericVector::get will be removed.

The GenericVector::get is never called explicitly in my code so it should come from overload of methods in Subdomains class.

Does it still work correctly?
Is there any other way to create periodic boundary condition which is going to be supported?

Question information

Language:
English Edit question
Status:
Answered
For:
DOLFIN Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Anders Logg (logg) said :
#1

On Wed, Nov 30, 2011 at 01:55:57PM -0000, Sergey Alyaev wrote:
> New question #180500 on DOLFIN:
> https://answers.launchpad.net/dolfin/+question/180500
>
> I am using periodic boundary conditions and I am getting the following warning message:
>
> *** Warning: GenericVector::get is redirected to GenericVector::get_local. Use GenericVector::gather for get off-process entries. GenericVector::get will be removed.
>
> The GenericVector::get is never called explicitly in my code so it should come from overload of methods in Subdomains class.
>
> Does it still work correctly?
> Is there any other way to create periodic boundary condition which is going to be supported?

This is because get_local is used internally in the implementation of
periodic boundary conditions in DOLFIN (so nothing you can change in
your code). PeriodicBC is up for redesign in the future, in particular
to get it to work in parallel

--
Anders

Revision history for this message
Praveen C (cpraveen) said :
#2

How to suppress the warning messages from being printed to screen everytime ?

praveen

Revision history for this message
Anders Logg (logg) said :
#3

On Sat, Jan 21, 2012 at 06:45:43AM -0000, Praveen C wrote:
> Question #180500 on DOLFIN changed:
> https://answers.launchpad.net/dolfin/+question/180500
>
> Praveen C posted a new comment:
> How to suppress the warning messages from being printed to screen
> everytime ?

You can increase the log level. Try something like

set_log_level(ERROR)

--
Anders

Revision history for this message
Glen D. Granzow (ggranzow) said :
#4

As a hack to eliminate the warning messages about GenericVector::get while still displaying other (useful) information generated by FEniCS I wrote the following script, "filter.py":

# This script filters out the warnings about GenericVector::get.
# Written by Glen Granzow on November 15, 2012.

while True:
    try:
        line = raw_input()
    except EOFError:
        break
    if line.lstrip()[0:31] != "*** Warning: GenericVector::get":
        print line

Piping the output from my python program that uses FEniCS into this script displays all of the output except the warnings about GenericVector::get. I also wrote an example script, "testfilter.py", to test "filter.py":

from sys import stdout

for i in range(10):
    print i
    print " *** Warning: GenericVector::get is directed to"
print 'Press ENTER'
stdout.flush()
raw_input('Thank you')

Running

python testfilter.py | python filter.py

eliminates the warning lines seen when running just

python testfilter.py

Can you help with this problem?

Provide an answer of your own, or ask Sergey Alyaev for more information if necessary.

To post a message you must log in.