Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 32 additions & 1 deletion bsplines2d/_class01_Mesh2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from . import _class01_cropping as _cropping
from . import _class01_select as _select
from . import _class01_sample as _sample
from . import _class01_sample3d as _sample3d
from . import _class01_outline as _outline
from . import _class01_plot as _plot

Expand Down Expand Up @@ -513,6 +514,36 @@ def get_sample_mesh(
kx1=kx1,
)

def get_sample_mesh_3d_func(
self,
key=None,
res_RZ=None,
mode=None,
res_phi=None,
):
""" Return 2 functions

Used for vos computation

func_RZphi_from_ind(ind)
where in = (3, npts) indices of a 3d sampled mesh
return R, Z, phi

func_ind_from_domain(DR, DZ, Dphi, pcross, phor)
where DR, DZ, Dphi define a rectangular domain (optional)
where (pcross0, pcross1) and (phor0, phor1) define ploygons
return ind (to be used by func_RZphi_from_ind)

"""

return _sample3d.main(
coll=self,
key=key,
res_RZ=res_RZ,
mode=mode,
res_phi=res_phi,
)

# -----------------
# outline
# ------------------
Expand Down Expand Up @@ -561,4 +592,4 @@ def plot_mesh(
fs=fs,
dleg=dleg,
connect=connect,
)
)
26 changes: 13 additions & 13 deletions bsplines2d/_class01_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from . import _generic_mesh


# ##############################################################
# ##############################################################
# Main
# ##############################################################
# ######################################################
# ######################################################
# Main
# ######################################################


def sample_mesh(
Expand Down Expand Up @@ -151,10 +151,10 @@ def sample_mesh(
return ddata


# ##################################################################
# ##################################################################
# checks
# ##################################################################
# ##########################################################
# ##########################################################
# checks
# ##########################################################


def _check(
Expand Down Expand Up @@ -500,10 +500,10 @@ def _sample_1d(
return xx


# ##################################################################
# ##################################################################
# sample 2d
# ##################################################################
# #########################################################
# #########################################################
# sample 2d
# #########################################################


def _sample_2d(
Expand Down Expand Up @@ -767,4 +767,4 @@ def _store(coll=None, dref=None, ddata=None):

# ddata
for k0, v0 in ddata.items():
coll.add_data(**v0)
coll.add_data(**v0)
Loading
Loading