petsctools.citation module

Module containing functions for registering citations through PETSc.

The functions in this module may be used to record Bibtex citation information and then register that a particular citation is relevant for a particular computation. It hooks up with PETSc’s citation registration mechanism, so that running with -citations does the right thing.

Example usage:

petsctools.add_citation("key", "bibtex-entry-for-my-funky-method")

...

if using_funky_method:
    petsctools.cite("key")
petsctools.citation.add_citation(cite_key: str, entry: str) → None

Add a paper to the database of possible citations.

Parameters:
  • cite_key – The key to use.

  • entry – The bibtex entry.

petsctools.citation.cite(cite_key: str) → None

Cite a paper.

The paper should already have been added to the citations database using add_citation.

Parameters:

cite_key – The key of the relevant citation.

Raises:

KeyError : – If no such citation is found in the database.

petsctools.citation.print_citations_at_exit() → None

Print citations at the end of the program.