Skip to content

Commit

Permalink
Merge branch 'master' into pbrubeck/cache-basis-evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrubeck committed Dec 12, 2024
2 parents aab3455 + 17c4106 commit 8db60cb
Show file tree
Hide file tree
Showing 15 changed files with 431 additions and 66 deletions.
13 changes: 6 additions & 7 deletions docker/Dockerfile.env
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ RUN bash -c 'cd petsc; \
--download-suitesparse \
--download-superlu_dist \
PETSC_ARCH=packages; \
mv packages/include/petscconf.h packages/include/old_petscconf.nope;'
mv packages/include/petscconf.h packages/include/old_petscconf.nope; \
rm -rf /home/firedrake/petsc/**/externalpackages; \
rm -rf /home/firedrake/petsc/src/docs; \
rm -f /home/firedrake/petsc/src/**/tutorials/output/*; \
rm -f /home/firedrake/petsc/src/**/tests/output/*'
# Don't run make here, we only want MPICH and HWLOC
# It is also necessary to move `petscconf.h` so packages isn't treated like a working PETSc
# Cleaned up unnecessary files

# Build default Firedrake PETSc
RUN bash -c 'export PACKAGES=/home/firedrake/petsc/packages; \
Expand Down Expand Up @@ -149,12 +154,6 @@ RUN bash -c 'export PETSC_DIR=/home/firedrake/petsc; \
./configure; \
make SLEPC_DIR=/home/firedrake/slepc PETSC_DIR=/home/firedrake/petsc PETSC_ARCH=complex;'

# Clean up unnecessary files
RUN rm -rf /home/firedrake/petsc/**/externalpackages \
&& rm -rf /home/firedrake/petsc/src/docs \
&& rm -f /home/firedrake/petsc/src/**/tutorials/output/* \
&& rm -f /home/firedrake/petsc/src/**/tests/output/*

# Set some useful environment variables
ENV PETSC_DIR /home/firedrake/petsc
ENV SLEPC_DIR /home/firedrake/slepc
Expand Down
10 changes: 9 additions & 1 deletion docs/source/events.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,18 @@
Firedrake events
----------------

Firedrake USA'25
~~~~~~~~~~~~~~~~

The ninth Firedrake user and developer workshop will be held 28 February
and 1 March 2025 at Baylor University in Texas, USA. For more information
see :doc:`the workshop page <firedrake_usa_25>`.


Firedrake '24
~~~~~~~~~~~~~

The eighth Firedrake user and developer workshop will be held
The eighth Firedrake user and developer workshop was held
between 16-18 September 2024 at the University of Oxford. For more
information see :doc:`the workshop page <firedrake_24>`.

Expand Down
103 changes: 103 additions & 0 deletions docs/source/firedrake_usa_25.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
:orphan: true

.. title:: Firedrake USA '25

.. image:: images/baylor.jpg
:alt: Baylor University
:width: 100%
:align: center

Firedrake USA'25
----------------

The ninth Firedrake user and developer workshop will be held at
`Baylor University
<https://math.artsandsciences.baylor.edu>`__ from 28 February-1 March 2025.

The workshop will be an opportunity for Firedrake users and developers
to discuss the latest developments in the
project, anticipated future developments, and how Firedrake can be used
in the numerical solution of partial differential equations. The event
will provide Firedrake users with the opportunity to interact directly
with developers and with other users.

The conference will begin with a tutorial session on the morning of 28 February and end on the evening of 1 March.


Conference venue
----------------

The conference will take place in the Bill Daniel Student Center in Room 202 in the heart of the Baylor campus.


Accommodation
-------------

We will be reserving a room block in a hotel near campus. More information to follow.


Conference dinner
-----------------

The conference dinner will be held Friday night at the Baylor Club in McLane Stadium. The dinner is included with the registration fee.


Registration
------------

Registration will be open soon.

The registration fees are as follows:

.. list-table::
:widths: 25 50
:header-rows: 0

* - Student
- $50
* - Non-student
- $200

The `SIAM Texas-Louisiana Section <https://www.siam.org/get-involved/connect-with-a-community/sections/siam-texas-louisiana-section/>`__ is providing some support for students currently attending universities in Texas or Louisiana to attend.
Conference registration is coming soon.



Abstract submission
-------------------

Abstract submission will open soon via Easy Chair.



Support
-------

The conference has been kindly supported by the SIAM TX-LA Section and EPSRC.


Travel to Waco
--------------

* By air

Waco has a small airport. There is daily service between Waco and Dallas/Fort Worth International Airport via American Airlines.

* By ground

We are less than two hours by car from the Dallas and Austin airports, and just under three hours from Bush Intercontinental Airport in Houston. Additionally, Waco is reachable by bus services such as Greyhound and FlixBus.

* Parking on campus

Baylor has plenty of visitor parking for your personal or rental vehicle, but conslut `these instructions <https://dps.web.baylor.edu/parking-transportation/visitors>__` and make sure to `register your vehicle <https://dps.web.baylor.edu/parking-transportation/visitors/visitor-parking-permit>__`.



Organising committee
--------------------

* `Robert Kirby <https://sites.baylor.edu/robert_kirby/>`__, Baylor University
* `David Ham <https://profiles.imperial.ac.uk/david.ham>`__, Imperial College London



Binary file added docs/source/images/baylor.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 43 additions & 4 deletions firedrake/adjoint/ensemble_reduced_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ class EnsembleReducedFunctional(ReducedFunctional):
operation is employed to sum the functionals and their gradients over an ensemble
communicator.
If gather_functional is present, then all the values of J are communicated to all ensemble ranks, and passed in a list to gather_functional, which is a reduced functional that expects a list of that size of the relevant types.
If gather_functional is present, then all the values of J are communicated to all ensemble
ranks, and passed in a list to gather_functional, which is a reduced functional that expects
a list of that size of the relevant types.
Parameters
----------
Expand All @@ -45,7 +47,33 @@ class EnsembleReducedFunctional(ReducedFunctional):
``Ensemble.ensemble comm``.
gather_functional : An instance of the :class:`pyadjoint.ReducedFunctional`.
that takes in all of the Js.
derivative_components : list of int
The indices of the controls that the derivative should be computed with respect to.
If present, it overwrites ``derivative_cb_pre`` and ``derivative_cb_post``.
scale : float
A scaling factor applied to the functional and its gradient(with respect to the control).
tape : pyadjoint.Tape
A tape object that the reduced functional will use to evaluate the functional and
its gradients (or derivatives).
eval_cb_pre : :func:
Callback function before evaluating the functional. Input is a list of Controls.
eval_cb_pos : :func:
Callback function after evaluating the functional. Inputs are the functional value
and a list of Controls.
derivative_cb_pre : :func:
Callback function before evaluating gradients (or derivatives). Input is a list of
gradients (or derivatives). Should return a list of Controls (usually the same list as
the input) to be passed to :func:`pyadjoint.compute_gradient`.
derivative_cb_post : :func:
Callback function after evaluating derivatives. Inputs are the functional, a list of
gradients (or derivatives), and controls. All of them are the checkpointed versions.
Should return a list of gradients (or derivatives) (usually the same list as the input)
to be returned from ``self.derivative``.
hessian_cb_pre : :func:
Callback function before evaluating the Hessian. Input is a list of Controls.
hessian_cb_post : :func:
Callback function after evaluating the Hessian. Inputs are the functional, a list of
Hessian, and controls.
See Also
--------
Expand All @@ -59,8 +87,19 @@ class EnsembleReducedFunctional(ReducedFunctional):
<https://www.firedrakeproject.org/parallelism.html#id8>`_.
"""
def __init__(self, J, control, ensemble, scatter_control=True,
gather_functional=None):
super(EnsembleReducedFunctional, self).__init__(J, control)
gather_functional=None, derivative_components=None,
scale=1.0, tape=None, eval_cb_pre=lambda *args: None,
eval_cb_post=lambda *args: None,
derivative_cb_pre=lambda controls: controls,
derivative_cb_post=lambda checkpoint, derivative_components, controls: derivative_components,
hessian_cb_pre=lambda *args: None, hessian_cb_post=lambda *args: None):
super(EnsembleReducedFunctional, self).__init__(
J, control, derivative_components=derivative_components,
scale=scale, tape=tape, eval_cb_pre=eval_cb_pre,
eval_cb_post=eval_cb_post, derivative_cb_pre=derivative_cb_pre,
derivative_cb_post=derivative_cb_post,
hessian_cb_pre=hessian_cb_pre, hessian_cb_post=hessian_cb_post)

self.ensemble = ensemble
self.scatter_control = scatter_control
self.gather_functional = gather_functional
Expand Down
8 changes: 3 additions & 5 deletions firedrake/bcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class BCBase(object):
def __init__(self, V, sub_domain):

self._function_space = V
self.sub_domain = sub_domain
self.sub_domain = (sub_domain, ) if isinstance(sub_domain, str) else as_tuple(sub_domain)
# If this BC is defined on a subspace (IndexedFunctionSpace or
# ComponentFunctionSpace, possibly recursively), pull out the appropriate
# indices.
Expand Down Expand Up @@ -289,11 +289,9 @@ def __init__(self, V, g, sub_domain, method=None):
warnings.simplefilter('always', DeprecationWarning)
warnings.warn("Selecting a bcs method is deprecated. Only topological association is supported",
DeprecationWarning)
if len(V.boundary_set):
subs = [sub_domain] if type(sub_domain) in {int, str} else sub_domain
if any(sub not in V.boundary_set for sub in subs):
raise ValueError(f"Sub-domain {sub_domain} not in the boundary set of the restricted space.")
super().__init__(V, sub_domain)
if len(V.boundary_set) and not set(self.sub_domain).issubset(V.boundary_set):
raise ValueError(f"Sub-domain {self.sub_domain} not in the boundary set of the restricted space {V.boundary_set}.")
if len(V) > 1:
raise ValueError("Cannot apply boundary conditions on mixed spaces directly.\n"
"Apply to the components by indexing the space with .sub(...)")
Expand Down
Loading

0 comments on commit 8db60cb

Please sign in to comment.