Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some updates related to dualspace #39

Closed
wants to merge 51 commits into from
Closed

Some updates related to dualspace #39

wants to merge 51 commits into from

Conversation

nbouziani
Copy link

@nbouziani nbouziani commented Jul 18, 2023

This PR addresses a few issues related to the recent dual space changes in UFL (FEniCS#87).

The main changes are:

  • Equip BaseForm objects with a coefficients slot.
  • Equip BaseForm objects with a ufl_domain as they can be differentiated, which requires inferring the underlying domain.
  • Cofunctions now have one argument in the primal space as they map from V to R.
  • Coarguments now have two arguments. In fact, Coarguments map from V* to V*, i.e. V* -> V*, or equivalently V* x V -> R, hence they have one argument in the primal space and one in the dual space.
  • Add BaseFormCoordinateDerivative and fix the argument analysis for BaseFormDerivative objects.
  • Update Action differentiation rule
  • Remove support for Adjoint differentiation

ufl/adjoint.py Outdated Show resolved Hide resolved
Copy link
Member

@dham dham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the minor issues, repoint to upstream (probably need to rebase) and make sure we're not going to break FEniCSx

self.original_form = form

# --- Pass form integrands through some symbolic manipulation
def preprocess_form(form, complex_mode):

# Note: Default behaviour here will process form the way that is
# currently expected by vanilla FFC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be on compute_form_data

self.original_form = form

# --- Pass form integrands through some symbolic manipulation
def preprocess_form(form, complex_mode):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring

base_form_args = base_form.arguments() + tuple(arg for a in arguments for arg in extract_arguments(a))
base_form_coeffs = base_form.coefficients() + tuple(arg for a in arguments for arg in extract_coefficients(a))
self._arguments = tuple(OrderedDict.fromkeys(base_form_args))
self._coefficients = tuple(OrderedDict.fromkeys(base_form_coeffs))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain.

nbouziani and others added 6 commits August 1, 2023 12:29
* [feature][ElementTypes] Added 4d types pentatope (4d simplex) and tesseract (4d cube). (FEniCS#95)

Co-authored-by: Jack S. Hale <[email protected]>
Co-authored-by: David A. Ham <[email protected]>
Co-authored-by: Matthew Scroggs <[email protected]>

* fix merge, add test

---------

Co-authored-by: dr-robertk <[email protected]>
Co-authored-by: Jack S. Hale <[email protected]>
Co-authored-by: David A. Ham <[email protected]>
mrambausek and others added 24 commits September 12, 2023 10:02
* removed probably unneeded troublesome lines in VectorElement

The removed code overwrites some properties for whatever reason,
in particular, quad_scheme.
In TensorElement these two lines were not there at all.

* added back FiniteElementBase constructor but (re)use sub-element data properly

Note: the call to FiniteElementBase.__init__ overrides some properties set by the MixedElement
constructor. Essentially the same seems to be done in TensorElement, but more explicitly.

---------

Co-authored-by: rambausek <[email protected]>
Co-authored-by: Jørgen Schartum Dokken <[email protected]>
Co-authored-by: Matthew Scroggs <[email protected]>
* Add function determinant_expr_nxn

* Change the order of the assert expression

---------

Co-authored-by: Matthew Scroggs <[email protected]>
…ng coefficient derivative maps (FEniCS#124)

* A possible fix for taking the derivative of vector coefficients w.r.t. a scalar.

Also adding a test.

* A slightly neater version that handles scalar derivatives of vectors.

---------

Co-authored-by: Matthew Scroggs <[email protected]>
* return correct Sobolev space for FacetElement

* InteriorElement in L2

---------

Co-authored-by: Matthew Scroggs <[email protected]>
* Change perp to being a named operator

* PR FEniCS#184: fix behaviour when perp is Zero and expand testing

---------

Co-authored-by: Matthew Scroggs <[email protected]>
* Add trimmed serendipity

* Fix value shape for trimmed serendipity

* ufl plumbing update for trimmed serendipity.

* Plumbing for SminusDiv.py

* Adding in element stuff for SminusCurl.

* Fix typo

* remove spurioius names

---------

Co-authored-by: Rob Kirby <[email protected]>
Co-authored-by: Justincrum <[email protected]>
Co-authored-by: nbouziani <[email protected]>
Co-authored-by: ksagiyam <[email protected]>
Co-authored-by: ksagiyam <[email protected]>
Co-authored-by: Connor Ward <[email protected]>
---------

Co-authored-by: Igor Baratta <[email protected]>
Co-authored-by: Matthew Scroggs <[email protected]>
Co-authored-by: David A. Ham <[email protected]>
@nbouziani nbouziani closed this Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.