Skip to content

Instantly share code, notes, and snippets.

@Alchem334
Alchem334 / main.py
Created November 5, 2022 12:13
Periodic condition small element mesh test case
from mpi4py import MPI
from petsc4py import PETSc
from dolfinx.mesh import CellType, create_unit_square, create_rectangle
from dolfinx.fem import Function, FunctionSpace
import ufl
from dolfinx import fem, io
from ufl import dx, grad, inner, lhs, rhs
from dolfinx import cpp as _cpp
import numpy as np
@Alchem334
Alchem334 / main.py
Created November 4, 2022 06:57
Test case for dolfinx_mpc periodic condition bug
from mpi4py import MPI
from petsc4py import PETSc
from dolfinx.mesh import CellType, create_unit_square
from dolfinx.fem import Function, FunctionSpace
import ufl
from dolfinx import fem, io
from ufl import dx, grad, inner, lhs, rhs
from dolfinx import cpp as _cpp
import numpy as np
@Alchem334
Alchem334 / main.py
Created October 14, 2021 08:32
FEniCS periodic BC test on mixed space
# -*- coding: utf-8 -*-
import dolfinx
import sys
import numpy as np
import ufl
import json