335 |
\end{python} |
\end{python} |
336 |
Setting the number of elements on a curve overwrites the global mesh size \code{element_size}. The result is shown in Figure~\ref{fig:PYCAD 5}. |
Setting the number of elements on a curve overwrites the global mesh size \code{element_size}. The result is shown in Figure~\ref{fig:PYCAD 5}. |
337 |
|
|
|
|
|
|
|
|
338 |
\section{\pycad Classes} |
\section{\pycad Classes} |
339 |
\declaremodule{extension}{esys.pycad} |
\declaremodule{extension}{esys.pycad} |
340 |
\modulesynopsis{Python geometry description and meshing interface} |
\modulesynopsis{Python geometry description and meshing interface} |
344 |
Some of the most commonly-used objects in \pycad are listed here. For a more complete |
Some of the most commonly-used objects in \pycad are listed here. For a more complete |
345 |
list see the full API documentation. |
list see the full API documentation. |
346 |
|
|
347 |
|
|
348 |
\begin{classdesc}{Point}{x=0.,y=0.,z=0.\optional{,local_scale=1.}} |
\begin{classdesc}{Point}{x=0.,y=0.,z=0.\optional{,local_scale=1.}} |
349 |
Create a point with from coordinates with local characteristic length \var{local_scale} |
Create a point with from coordinates with local characteristic length \var{local_scale} |
350 |
\end{classdesc} |
\end{classdesc} |
351 |
|
|
352 |
|
\begin{classdesc}{CurveLoop}{list} |
353 |
|
Create a closed curve from the \code{list}. of |
354 |
|
\class{Line}, \class{Arc}, \class{Spline}, \class{BSpline}, |
355 |
|
\class{BrezierSpline}. |
356 |
|
\end{classdesc} |
357 |
|
|
358 |
|
\begin{classdesc}{SurfaceLoop}{list} |
359 |
|
Create a loop of \class{PlaneSurface} or \class{RuledSurface}, which defines the shell of a volume. |
360 |
|
\end{classdesc} |
361 |
|
|
362 |
|
\subsubsection{Lines} |
363 |
\begin{classdesc}{Line}{point1, point2} |
\begin{classdesc}{Line}{point1, point2} |
364 |
Create a line with between starting and ending points. |
Create a line with between starting and ending points. |
365 |
\end{classdesc} |
\end{classdesc} |
376 |
no element distribution is set None is returned. |
no element distribution is set None is returned. |
377 |
\end{methoddesc} |
\end{methoddesc} |
378 |
|
|
379 |
|
\subsubsection{Splines} |
380 |
\begin{classdesc}{Spline}{point0, point1, ...} |
\begin{classdesc}{Spline}{point0, point1, ...} |
381 |
A spline curve defined by a list of points \var{point0}, \var{point1},.... |
A spline curve defined by a list of points \var{point0}, \var{point1},.... |
382 |
\end{classdesc} |
\end{classdesc} |
393 |
no element distribution is set None is returned. |
no element distribution is set None is returned. |
394 |
\end{methoddesc} |
\end{methoddesc} |
395 |
|
|
396 |
|
\subsubsection{BSplines} |
397 |
\begin{classdesc}{BSpline}{point0, point1, ...} |
\begin{classdesc}{BSpline}{point0, point1, ...} |
398 |
A B-spline curve defined by a list of points \var{point0}, \var{point1},.... |
A B-spline curve defined by a list of points \var{point0}, \var{point1},.... |
399 |
\end{classdesc} |
\end{classdesc} |
410 |
no element distribution is set None is returned. |
no element distribution is set None is returned. |
411 |
\end{methoddesc} |
\end{methoddesc} |
412 |
|
|
413 |
|
\subsubsection{Brezier Curves} |
414 |
\begin{classdesc}{BezierCurve}{point0, point1, ...} |
\begin{classdesc}{BezierCurve}{point0, point1, ...} |
415 |
A Brezier spline curve defined by a list of points \var{point0}, \var{point1},.... |
A Brezier spline curve defined by a list of points \var{point0}, \var{point1},.... |
416 |
\end{classdesc} |
\end{classdesc} |
427 |
no element distribution is set None is returned. |
no element distribution is set None is returned. |
428 |
\end{methoddesc} |
\end{methoddesc} |
429 |
|
|
430 |
|
\subsubsection{Arcs} |
431 |
\begin{classdesc}{Arc}{centre_point, start_point, end_point} |
\begin{classdesc}{Arc}{centre_point, start_point, end_point} |
432 |
Create an arc by specifying a centre for a circle and start and end points. An arc may subtend an angle of at most $\pi$ radians. |
Create an arc by specifying a centre for a circle and start and end points. An arc may subtend an angle of at most $\pi$ radians. |
433 |
\end{classdesc} |
\end{classdesc} |
444 |
no element distribution is set None is returned. |
no element distribution is set None is returned. |
445 |
\end{methoddesc} |
\end{methoddesc} |
446 |
|
|
|
\begin{classdesc}{CurveLoop}{list} |
|
|
Create a closed curve from the \code{list}. of |
|
|
\class{Line}, \class{Arc}, \class{Spline}, \class{BSpline}, |
|
|
\class{BrezierSpline}. |
|
|
\end{classdesc} |
|
447 |
|
|
448 |
|
|
449 |
|
\subsubsection{Plain surfaces} |
450 |
\begin{classdesc}{PlaneSurface}{loop, \optional{holes=[list]}} |
\begin{classdesc}{PlaneSurface}{loop, \optional{holes=[list]}} |
451 |
Create a plane surface from a \class{CurveLoop}, which may have one or more holes |
Create a plane surface from a \class{CurveLoop}, which may have one or more holes |
452 |
described by \var{list} of \class{CurveLoop}. |
described by \var{list} of \class{CurveLoop}. |
453 |
\end{classdesc} |
\end{classdesc} |
454 |
\begin{methoddesc}[PlaneSurface]{setRecombination}{max_deviation} |
\begin{methoddesc}[PlaneSurface]{setElementDistribution}{n\optional{,progression=1\optional{,createBump=\False}}} |
455 |
|
Defines the number of elements on all lines. |
456 |
|
\end{methoddesc} |
457 |
|
|
458 |
|
\begin{methoddesc}[PlaneSurface]{setRecombination}{\optional{max_deviation=45 * \var{DEG} }} |
459 |
the mesh generator will try to recombine triangular elements |
the mesh generator will try to recombine triangular elements |
460 |
into quadrilateral elements. \var{max_deviation} (in radians) defines the |
into quadrilateral elements. \var{max_deviation} (in radians) defines the |
461 |
maximum deviation of any angle in the quadrilaterals from the right angle. |
maximum deviation of any angle in the quadrilaterals from the right angle. |
472 |
|
|
473 |
|
|
474 |
|
|
475 |
|
\subsubsection{Ruled Surfaces} |
476 |
\begin{classdesc}{RuledSurface}{list} |
\begin{classdesc}{RuledSurface}{list} |
477 |
Create a surface that can be interpolated using transfinite interpolation. |
Create a surface that can be interpolated using transfinite interpolation. |
478 |
\var{list} gives a list of three or four lines defining the boundary of the |
\var{list} gives a list of three or four lines defining the boundary of the |
479 |
surface. |
surface. |
480 |
\end{classdesc} |
\end{classdesc} |
481 |
\begin{methoddesc}[RuledSurface]{setRecombination}{max_deviation} |
|
482 |
|
\begin{methoddesc}[RuledSurface]{setRecombination}{\optional{max_deviation=45 * \var{DEG} }} |
483 |
the mesh generator will try to recombine triangular elements |
the mesh generator will try to recombine triangular elements |
484 |
into quadrilateral elements. \var{max_deviation} (in radians) defines the |
into quadrilateral elements. \var{max_deviation} (in radians) defines the |
485 |
maximum deviation of any angle in the quadrilaterals from the right angle. |
maximum deviation of any angle in the quadrilaterals from the right angle. |
486 |
Set \var{max_deviation}=\var{None} to remove recombination. |
Set \var{max_deviation}=\var{None} to remove recombination. |
487 |
\end{methoddesc} |
\end{methoddesc} |
488 |
|
|
489 |
\begin{methoddesc}[RuledSurface]{setTransfiniteMeshing}{\optional{orientation="Left"}} |
\begin{methoddesc}[RuledSurface]{setTransfiniteMeshing}{\optional{orientation="Left"}} |
490 |
applies 2D transfinite meshing to the surface. |
applies 2D transfinite meshing to the surface. |
491 |
\var{orientation} defines the orientation of triangles. Allowed values |
\var{orientation} defines the orientation of triangles. Allowed values |
495 |
faces uses the same element distribution. No holes must be present. |
faces uses the same element distribution. No holes must be present. |
496 |
\end{methoddesc} |
\end{methoddesc} |
497 |
|
|
498 |
|
\begin{methoddesc}[RuledSurface]{setElementDistribution}{n\optional{,progression=1\optional{,createBump=\False}}} |
499 |
|
Defines the number of elements on all lines. |
500 |
|
\end{methoddesc} |
501 |
|
|
502 |
\begin{classdesc}{SurfaceLoop}{list} |
\subsubsection{Volumes} |
|
Create a loop of \class{PlaneSurface} or \class{RuledSurface}, which defines the shell of a volume. |
|
|
\end{classdesc} |
|
503 |
|
|
504 |
\begin{classdesc}{Volume}{loop, \optional{holes=[list]}} |
\begin{classdesc}{Volume}{loop, \optional{holes=[list]}} |
505 |
Create a volume given a \class{SurfaceLoop}, which may have one or more holes |
Create a volume given a \class{SurfaceLoop}, which may have one or more holes |
506 |
define by the list of \class{SurfaceLoop}. |
define by the list of \class{SurfaceLoop}. |
507 |
\end{classdesc} |
\end{classdesc} |
508 |
|
|
509 |
\begin{classdesc}{PropertySet}{list} |
\begin{methoddesc}[Volume]{setElementDistribution}{n\optional{,progression=1\optional{,createBump=\False}}} |
510 |
Create a PropertySet given a list of 1-D, 2-D or 3-D items. See the section on Properties below for more information. |
Defines the number of elements on all lines. |
511 |
\end{classdesc} |
\end{methoddesc} |
512 |
|
|
513 |
|
\begin{methoddesc}[Volume]{setRecombination}{\optional{max_deviation=45 * \var{DEG} }} |
514 |
|
the mesh generator will try to recombine triangular elements |
515 |
|
into quadrilateral elements. These meshes are then used to generate the volume mesh if possible. |
516 |
|
Together with transfinite meshing one can construct rectanglar meshes. |
517 |
|
\var{max_deviation} (in radians) defines the maximum deviation of any angle in the quadrilaterals from the right angle. |
518 |
|
Set \var{max_deviation}=\var{None} to remove recombination. |
519 |
|
\end{methoddesc} |
520 |
|
|
521 |
|
\begin{methoddesc}[Volume]{setTransfiniteMeshing}{\optional{orientation="Left"}} |
522 |
|
applies transfinite meshing to the volume and all surfaces (if \var{orientation} is not equal to \var{None}) |
523 |
|
\var{orientation} defines the orientation of triangles. Allowed values |
524 |
|
are \var{``Left''}, \var{``Right''} or \var{``Alternate''}. The |
525 |
|
boundary of the surface must be defined by three or four lines where an |
526 |
|
element distribution must be defined on all faces where opposite |
527 |
|
faces uses the same element distribution. |
528 |
|
If \var{orientation} is equal to \var{None} transfinite meshing is not switched on for the surfaces but needs |
529 |
|
to be set by the user.No holes must be present. |
530 |
|
\end{methoddesc} |
531 |
|
|
532 |
|
|
533 |
%============================================================================================================ |
%============================================================================================================ |
534 |
\subsection{Transformations} |
\subsection{Transformations} |