-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migration of mprans to xtensor (#1068)
* Added xtensor-python to environment.yaml * AddedMass based on xtensor * xtensor * SedClosure based on xtensor * VOF3P based on xtensor * NCLS3P based on xtensor * Moved mprans2/setup.py into proteus/setup.py * MCorr3P based on xtensor * Install xtensor for hashdist * Add PROTEUS_OPT compilation options for xtensor-based extensions * mprans.RANS3PSed * mprans.RANS3PSed2D * Moved RANS3PSed to mprans * Add calculateVelocityAverage * Dissipation2D * VOS3P * PresInc * Dissipation * CLSVOF * NCLS * MCorr * RANS2P * RANS2P2D * RANS2P_IB * Travis parallel compilation disabled * RDLS * VOF * MoveMesh * MoveMesh2D * SW2D * SW2DCV * GN_SW2DCV * Fixed AddedMass * Fixed VOF3P * Fixed NCLS3P * Fixed MCorr3P * Kappa and Kappa2D * RANS3PF * SedClosure.h * Splitted RANS3PF.h and RANS3PF2D.h * Disabled optimizations * Fixed build after rebase * Reverted RANS3PF and enabled optimizations again Co-authored-by: David Brochart <[email protected]> Co-authored-by: Alvin Zhang <[email protected]>
- Loading branch information
1 parent
5ee9138
commit cf9c7f9
Showing
140 changed files
with
41,153 additions
and
49,521 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,4 +41,5 @@ dependencies: | |
- ipyparallel | ||
- pillow | ||
- recordtype | ||
- xtensor-python | ||
- git-lfs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ dependencies: | |
- cython | ||
- pillow | ||
- pip | ||
- xtensor-python | ||
- pip: | ||
- recordtype |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
rm -rf proteus/xtensor | ||
mkdir -p proteus/xtensor | ||
cd proteus/xtensor | ||
mkdir xtl xtensor-python xtensor pybind11 | ||
wget https://github.com/QuantStack/xtl/archive/0.6.11.tar.gz -O xtl.tar.gz | ||
wget https://github.com/QuantStack/xtensor-python/archive/0.24.1.tar.gz -O xtensor-python.tar.gz | ||
wget https://github.com/xtensor-stack/xtensor/archive/0.21.2.tar.gz -O xtensor.tar.gz | ||
wget https://github.com/pybind/pybind11/archive/v2.4.3.tar.gz -O pybind11.tar.gz | ||
tar zxf xtl.tar.gz --strip-components=1 -C xtl | ||
tar zxf xtensor-python.tar.gz --strip-components=1 -C xtensor-python | ||
tar zxf xtensor.tar.gz --strip-components=1 -C xtensor | ||
tar zxf pybind11.tar.gz --strip-components=1 -C pybind11 | ||
rm *.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "pybind11/pybind11.h" | ||
#include "pybind11/stl_bind.h" | ||
|
||
#define FORCE_IMPORT_ARRAY | ||
#include "ADR.h" | ||
|
||
#if defined(__GNUC__) && !defined(__clang__) | ||
namespace workaround | ||
{ | ||
inline void define_allocators() | ||
{ | ||
std::allocator<int> a0; | ||
std::allocator<double> a1; | ||
} | ||
} | ||
#endif | ||
|
||
namespace py = pybind11; | ||
using proteus::cppADR_base; | ||
|
||
PYBIND11_MODULE(ADR, m) | ||
{ | ||
xt::import_numpy(); | ||
|
||
py::class_<cppADR_base>(m, "ADR") | ||
.def(py::init(&proteus::newADR)) | ||
.def("calculateResidual", &cppADR_base::calculateResidual) | ||
.def("calculateJacobian", &cppADR_base::calculateJacobian); | ||
} |
Oops, something went wrong.