Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions psydac/api/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def reduce_space_degrees(V, Vh, *, basis='B', sequence='DR'):

#==============================================================================
# TODO knots
def discretize_space(V, domain_h, *, degree=None, multiplicity=None, knots=None, basis='B', sequence='DR'):
def discretize_space(V, domain_h, *, degree=None, multiplicity=None, knots=None, basis='B', sequence='DR', pads=None):
"""
This function creates the discretized space starting from the symbolic space.

Expand Down Expand Up @@ -457,6 +457,9 @@ def discretize_space(V, domain_h, *, degree=None, multiplicity=None, knots=None,
min_coords = interior.min_coords
max_coords = interior.max_coords

if pads == None:
pads = [None] * len(degree_i)

assert len(ncells) == len(periodic) == len(degree_i) == len(multiplicity_i) == len(min_coords) == len(max_coords)

if knots is None:
Expand All @@ -465,10 +468,10 @@ def discretize_space(V, domain_h, *, degree=None, multiplicity=None, knots=None,
for xmin, xmax, ne in zip(min_coords, max_coords, ncells)]

# Create 1D finite element spaces and precompute quadrature data
spaces[i] = [SplineSpace( p, multiplicity=m, grid=grid , periodic=P) for p,m,grid,P in zip(degree_i, multiplicity_i,grids, periodic)]
spaces[i] = [SplineSpace( p, multiplicity=m, grid=grid , periodic=P, pads=pd) for p,m,grid,P,pd in zip(degree_i, multiplicity_i,grids, periodic, pads)]
else:
# Create 1D finite element spaces and precompute quadrature data
spaces[i] = [SplineSpace( p, knots=T , periodic=P) for p,T, P in zip(degree_i, knots[interior.name], periodic)]
spaces[i] = [SplineSpace( p, knots=T , periodic=P, pads=pd) for p,T,P,pd in zip(degree_i, knots[interior.name], periodic, pads)]


carts = create_cart(ddms, spaces)
Expand Down