scalar fields intended to be FIELD_TYPE_CONSTANT not allocated as constant in Populate_State

Bug #897337 reported by Brendan Tollit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fluidity
In Progress
Wishlist
Brendan Tollit

Bug Description

In Populate_State when a scalar field is allocated in allocate_and_insert_scalar_field it calls the routine allocate_tensor_field_as_constant rather than allocate_scalar_field_as_constant. These will check the options tree from the given option path but are different for scalar and tensor such that scalar fields being allocated via this routine that are intended to be constant are not allocated as such.

Quickly fixing this by putting the correct call causes some short test cases to fail! This would appear to be because the python state doesnt deal with constant fields and for the fields using the enforce_discrete_properties/solenoidal_lagrange_update related options (cannot add a normal field to a constant field). Other electro.... test cases also fail.

Also, routines called allocate_field_as_constant_tensor, allocate_field_as_constant_vector and allocate_field_as_constant_scalar exist with the interface allocate_field_as_constant which never appear to be called from anywhere.

Revision history for this message
Patrick Farrell (pefarrell) wrote :

Good catch!

The right thing to do wrt the Python state is to make a numpy vector where every entry is the same. This shouldn't be too hard to special-case, I think. Is it possible to make a numpy vector read-only?

Tim Bond (timothy-bond)
Changed in fluidity:
assignee: nobody → Brendan Tollit (btollit)
Jon Hill (jon-hill)
Changed in fluidity:
status: New → In Progress
Tim Bond (timothy-bond)
Changed in fluidity:
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.