Timo Heister [Tue, 17 Nov 2015 21:33:14 +0000 (16:33 -0500)]
fix expand_instantiation split logic
We optionally split instantiations in the generated .inst files based on
two macros SPLIT_INSTANTIATIONS_COUNT and SPLIT_INSTANTIATIONS_INDEX.
Intel 14 generates an error with an invalid % 0 in the old solution,
which happens if _COUNT is undefined. Fix this by defining a macro at
the beginning of the .inst file.
David Wells [Wed, 18 Nov 2015 16:52:04 +0000 (11:52 -0500)]
Revert deprecation of Vector::add(scalar).
This commit partially reverts commit a45f633f0fc797a499559887d2b5d6be6bf1a508. The un-deprecated functions
were found to be useful an Aspect application, where one subtracted the
mean value from a vector of pressure values.
Timo Heister [Mon, 16 Nov 2015 13:32:13 +0000 (08:32 -0500)]
make Trilinos ML deterministic
Trilinos version 12.2 and older initialize a random seed every time the
ML preconditioner is constructed leading to non-deterministic behavior.
Reported in 2011, this has been finally fixed in 12.4 with the new
"initialize random seed" parameter. Yay!
The updated documentation makes it clearer what implementations are
supposed to do if they overload these functions, and what the default
implementation already does. It also fixes incorrect references in
shape_3rd/4th_derivatives().
This allows finite elements to already fill certain output data elements
at the time the get_data() function is called, rather than having to later
figure out whether this is the first time (or not) they get into
fill_fe_*_values().
In its current form, the patch only adds that possibility to passing the
same output object to FiniteElement::get_*_data() that will later be used
when FiniteElement::fill_fe_*_values() will be called. The patch does not
actually implement any of the elements using this -- I will leave this
to a later patch addressing #1824.
This is a simplified test of FESystems whose base elements are again FESystems.
The test helped me debug a couple of issues, and might be of help again
at a later time. It is a simpler version of fe/shapes_system.
Reshuffle the argument list of FE::fill_fe_*_values().
This brings the argument list in line with the changes made to Mapping in #1204.
In essence, it is all about sorting the list in a halfway reasonable order. No
functional changes.
The patch changes all of the derived finite element classes as well. In some cases
it changes the name of arguments to match a uniform style.
We had a number of places of the form
for (...tight loop...)
if (constant condition)
data update;
The compiler almost certainly can hoist the condition out of the loop,
but why make it this complicated for the compiler. I also find the code
easier to read because the loop is really only over a counting index
and does not carry any particular meaning at a level higher than the
if-statement.
Replace update_once/each by requires_update_flags() in FiniteElement.
The purpose of this patch is to align the finite element classes with the way the
mapping classes have already been converted. Specifically, there is no need for
any of the users of finite element classes to actually know whether a FE implementation
wants to treat a particular flags as update_once or update_each. This is an internal
decision. Rather, all we need to know is what flags they need overall. This is now
communicated by the new FiniteElement::requires_update_flags() function.
The update_once() and update_each() functions have been retained -- for now -- as
internal functions individual elements can implement, but they are no longer virtual.
At least in cases where we know that the output vector of one function
has the same type as the result type of the current one, we can avoid
allocating a temporary vector.
Timo Heister [Thu, 5 Nov 2015 14:02:50 +0000 (09:02 -0500)]
fix tests
- use std_cxx11::bind instead of std::bind
- require Trilinos if we use it
- fe/bdm_*: do not set matrix entries <1e-14 to zero (different on
different machines) and always print 0 entries
- use check_solver_within_range where needed