SINTEF / Splipy

Spline modelling made easy.
GNU General Public License v3.0
100 stars 18 forks source link

SplineModel enhancements #78

Closed TheBB closed 6 years ago

TheBB commented 6 years ago

A short script to demonstrate:

(For extra fun, try reversing or swapping parametric directions on v or q.)

from splipy import *

v = Volume()
q = v + (1,0,0)

model = SplineModel(3, 3)
model.add([v, q])

model[v.section(u=0)].name = 'inflow'
model[q.section(u=-1)].name = 'outflow'
model.assign_boundary('wall')

model.summary()

model.generate_cp_numbers()

print(model.catalogue[v].node.cp_numbers)
print(model.catalogue[q].node.cp_numbers)

print(len(list(model.boundary('inflow'))))
print(len(list(model.boundary('outflow'))))
print(len(list(model.boundary('wall'))))
print(len(list(model.boundary())))
TheBB commented 6 years ago

I just realized the date... this is what you get when living in a country where May 1 is not a public holiday.

TheBB commented 6 years ago

Added function for getting faces, which is the major one for OpenFOAM output.

TheBB commented 6 years ago

Okay, tests are in. This is ready for review.

TheBB commented 6 years ago

To clarify: This adds global numbering of "cells" (defined as gaps in knot vectors, i.e. elements) and control points (what IFEM would call nodes). The face functionality assumes linear geometry, that is to say it equates control points with cell intersection points. I think that's enough for now.

TheBB commented 6 years ago

@VikingScientist I have updated.