Skip to content

Commit

Permalink
Merge branch 'fenicsx' into time_as_Constant
Browse files Browse the repository at this point in the history
  • Loading branch information
RemDelaporteMathurin committed Oct 17, 2023
2 parents 4902cdd + 2ce0c38 commit d43954a
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 36 deletions.
66 changes: 33 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,40 @@ name: CI
on: [pull_request, push]

jobs:
run-on-conda:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: myenv
mamba-version: "*"
channels: conda-forge, defaults

- name: Create Conda environment
shell: bash -l {0}
run: |
mamba install -c conda-forge fenics-dolfinx
- name: Install local package and dependencies
shell: bash -l {0}
run: |
pip install .[test]
- name: Run tests
shell: bash -l {0}
run: |
pytest test/ --cov festim --cov-report xml --cov-report term
# run-on-conda:
# runs-on: ubuntu-latest

# steps:
# - name: Checkout code
# uses: actions/checkout@v2

# - name: Set up Conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# activate-environment: myenv
# mamba-version: "*"
# channels: conda-forge, defaults

# - name: Create Conda environment
# shell: bash -l {0}
# run: |
# mamba install -c conda-forge fenics-dolfinx

# - name: Install local package and dependencies
# shell: bash -l {0}
# run: |
# pip install .[test]

# - name: Run tests
# shell: bash -l {0}
# run: |
# pytest test/ --cov festim --cov-report xml --cov-report term

- name: Upload to codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
# - name: Upload to codecov
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: ./coverage.xml

run-on-docker:
runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions festim/hydrogen_transport_problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,12 +292,10 @@ def run(self, final_time: float):
mobile_xdmf.write_function(self.u, float(self.t))

cm = self.species[0].solution
# TODO this should be a property of Mesh
n = FacetNormal(self.mesh.mesh)
D = self.subdomains[0].material.get_diffusion_coefficient(
self.mesh.mesh, self.temperature
)
surface_flux = form(D * dot(grad(cm), n) * self.ds(2))
surface_flux = form(D * dot(grad(cm), self.mesh.n) * self.ds(2))
flux = assemble_scalar(surface_flux)
flux_values.append(flux)
times.append(float(self.t))
Expand Down
8 changes: 8 additions & 0 deletions festim/mesh/mesh.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import ufl


class Mesh:
"""
Mesh class
Expand All @@ -9,6 +12,7 @@ class Mesh:
mesh (dolfinx.mesh.Mesh): the mesh
vdim (int): the dimension of the mesh cells
fdim (int): the dimension of the mesh facets
n (ufl.FacetNormal): the normal vector to the facets
"""

def __init__(self, mesh=None):
Expand All @@ -32,3 +36,7 @@ def vdim(self):
@property
def fdim(self):
return self.mesh.topology.dim - 1

@property
def n(self):
return ufl.FacetNormal(self.mesh)

0 comments on commit d43954a

Please sign in to comment.