Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Nektar-Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nektar
Nektar-Python
Commits
62e0cc07
Commit
62e0cc07
authored
Jun 15, 2017
by
Dave Moxey
Browse files
Options
Downloads
Patches
Plain Diff
Tidying
parent
6916179e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+13
-11
13 additions, 11 deletions
README.md
with
13 additions
and
11 deletions
README.md
+
13
−
11
View file @
62e0cc07
...
...
@@ -5,36 +5,38 @@ spectral/_hp_ element framework. **As a disclaimer, thhese wrappings are
_experimental_
and _incomplete_.
**
You should not rely on their current
structure and API remaining unchanged.
Currently, representative classes from the
`LibUtilities`
,
`StdRegions`
and
`SpatialDomains`
class
es have been wrapped in order to show
the
proof-of-concept.
This allows us to write scripts such as
Currently, representative classes from the
`LibUtilities`
,
`StdRegions`
,
`SpatialDomains`
and
`LocalRegions`
librari
es have been wrapped in order to show
the
proof-of-concept.
# Features and functionality
`NekPy`
uses the
`Boost.Python`
library to provide a set of high-quality,
hand-written Python bindings for selected functions and classes in Nektar++. A
typical snippet could look something like
typical snippet could look something like
:
```
python
from
NekPy.LibUtilities
import
PointsKey
,
PointsType
,
BasisKey
,
BasisType
from
NekPy.
LibUtilitie
s
import
StdQuadExp
from
NekPy.
StdRegion
s
import
StdQuadExp
import
numpy
as
np
numModes
=
8
numPts
=
9
ptsKey
=
PointsKey
(
numPts
,
PointsType
.
GaussLobattoLegendre
)
basisKey
=
BasisKey
(
BasisType
.
Modified_A
,
numModes
,
ptsKey
)
quadExp
=
StdQuadExp
(
basisKey
,
basisKey
)
x
,
y
=
StdQ
uadExp
.
GetCoords
()
x
,
y
=
q
uadExp
.
GetCoords
()
fx
=
np
.
sin
(
x
)
*
np
.
cos
(
y
)
proj
=
quadExp
.
FwdTrans
(
fx
)
```
`NekPy`
also
uses the
`Boost.NumPy`
library, contained in Boost 1.63+, to
`NekPy`
uses the
`Boost.NumPy`
library, contained in Boost 1.63+, to
automatically convert C++
`Array<OneD, >`
objects to and from the commonly-used
`numpy.ndarray`
object, which makes the integration more se
e
mless between Python
`numpy.ndarray`
object, which makes the integration more se
a
mless between Python
and C++.
# How do I wrap things?
`Boost.Python`
is pretty comprehensive package and an extended discussion is
`Boost.Python`
is
a
pretty comprehensive package and an extended discussion is
really beyond the scope of this project. See
`doc/wrapping-guide.md`
for some
basic concepts and frequently-encountered issues.
...
...
@@ -140,8 +142,8 @@ with a sample mesh `newsquare_2x2.xml`:
-
`StdProject.py`
shows how to use some of the
`StdRegions`
wrappers and
duplicates the functionality of
`Basis.py`
using the
`StdExpansion`
class. Run
this as
`python StdProject.py`
.
-
Finally,
`MeshGraph.py`
loads a mesh and prints out some basic properties of
its
quadrilateral elements. Run it as
`python MeshGraph.py newsquare_2x2.xml`
.
-
`MeshGraph.py`
loads a mesh and prints out some basic properties of
its
quadrilateral elements. Run it as
`python MeshGraph.py newsquare_2x2.xml`
.
If you want to modify the source files, it's advisable to edit them in the
`examples`
directory and re-run
`make install`
, otherwise local changes will be
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment