18 |
|
|
19 |
\begin{figure} |
\begin{figure} |
20 |
\includegraphics[width=\textwidth]{figures/EscriptDiagram1} |
\includegraphics[width=\textwidth]{figures/EscriptDiagram1} |
21 |
\caption{\label{ESCRIPT DEP}Dependency of Function Spaces. An arrow indicates that a function in the |
\caption{\label{ESCRIPT DEP}Dependency of Function Spaces in Finley. An arrow indicates that a function in the |
22 |
function space at the starting point can be interpreted as a function in the function space of the arrow target.} |
function space at the starting point can be interpolated to the function space of the arrow target. |
23 |
|
All functionspaces on the left side can be interpolated to any of the functionspaces on the right.} |
24 |
\end{figure} |
\end{figure} |
25 |
|
|
26 |
\escript is a Python module that allows you to represent the values of |
\escript is a Python module that allows you to represent the values of |
65 |
solving saddle point problems \index{saddle point problems}, eg. the Stokes equation. |
solving saddle point problems \index{saddle point problems}, eg. the Stokes equation. |
66 |
A discontinuity \index{discontinuity} is a region within the domain across which functions may be discontinuous. |
A discontinuity \index{discontinuity} is a region within the domain across which functions may be discontinuous. |
67 |
The location of discontinuity is defined in the \Domain object. |
The location of discontinuity is defined in the \Domain object. |
68 |
\fig{ESCRIPT DEP} shows the dependency between the types of function spaces. |
\fig{ESCRIPT DEP} shows the dependency between the types of function spaces in Finley (other libraries may have different relationships). |
69 |
|
|
70 |
The solution of a PDE is a continuous function. Any continuous function can be seen as a general function |
The solution of a PDE is a continuous function. Any continuous function can be seen as a general function |
71 |
on the domain and can be restricted to the boundary as well as to one side of |
on the domain and can be restricted to the boundary as well as to one side of |
84 |
functions and allows abstraction from the actual representation |
functions and allows abstraction from the actual representation |
85 |
of the function in the context of a particular application. For instance, |
of the function in the context of a particular application. For instance, |
86 |
in the FEM context a |
in the FEM context a |
87 |
function of the \Function type |
function of the \Function type (written as \emph{Function()} in Figure~\ref{ESCRIPT DEP}) |
88 |
is usually represented by its values at the element center, |
is usually represented by its values at the element center, |
89 |
but in a finite difference scheme the edge midpoint of cells is preferred. |
but in a finite difference scheme the edge midpoint of cells is preferred. |
90 |
By changing its function space you can use the same function in a Finite Difference |
By changing its function space you can use the same function in a Finite Difference |
271 |
\Data objects can be written to disk files and read with \var{dump} and \var{load}, both of which use \netCDF. |
\Data objects can be written to disk files and read with \var{dump} and \var{load}, both of which use \netCDF. |
272 |
Use these to save data for visualization, checkpoint/restart or simply to save and reuse data that was expensive to compute. |
Use these to save data for visualization, checkpoint/restart or simply to save and reuse data that was expensive to compute. |
273 |
|
|
274 |
For instance to save the coordinates of the data points of the \FunctionSpace |
For instance to save the coordinates of the data points of the |
275 |
\ContinuousFunction to the file {\tt x.nc} use |
\ContinuousFunction to the file {\tt x.nc} use |
276 |
\begin{python} |
\begin{python} |
277 |
x=ContinuousFunction(mydomain).getX() |
x=ContinuousFunction(mydomain).getX() |
286 |
\var{domain=ReadMesh(fileName)} and \var{domain.write(fileName)}. |
\var{domain=ReadMesh(fileName)} and \var{domain.write(fileName)}. |
287 |
|
|
288 |
The function space of the \Data is stored in {\tt x.nc}, though. |
The function space of the \Data is stored in {\tt x.nc}, though. |
|
That means that \Data objects that are constant or tagged can be recovered with a different \Domain\footnote{This is provided that the domains use the same \FunctionSpace types.}. |
|
289 |
If the \Data object |
If the \Data object |
290 |
is expanded, the number of data points in the file and of the \Domain for the particular \FunctionSpace must match. |
is expanded, the number of data points in the file and of the \Domain for the particular \FunctionSpace must match. |
291 |
Moreover, the ordering of the values is checked using the reference identifiers provided by |
Moreover, the ordering of the values is checked using the reference identifiers provided by |
348 |
Otherwise \False is returned. |
Otherwise \False is returned. |
349 |
\end{methoddesc} |
\end{methoddesc} |
350 |
|
|
351 |
\begin{methoddesc}[Domain]{__str__}{g} |
\begin{methoddesc}[Domain]{__str__}{arg} |
352 |
(python str() function) returns string representation of the \Domain. |
(python str() function) returns string representation of the \Domain. |
353 |
\end{methoddesc} |
\end{methoddesc} |
354 |
|
|
355 |
|
\begin{methoddesc}[Domain]{onMasterProcessor}{} |
356 |
|
returns \True if executed on the MPI master processor, \False otherwise. |
357 |
|
This can be used in conjunction with MPIBarrier to ensure commands only run once. |
358 |
|
\end{methoddesc} |
359 |
|
|
360 |
|
\begin{methoddesc}[Domain]{MPIBarrier}{} |
361 |
|
executes an MPIBarrier command. If MPI support is not enabled, this command does nothing. |
362 |
|
\end{methoddesc} |
363 |
|
|
364 |
|
\begin{methoddesc}[Domain]{MPIBarrier}{} |
365 |
|
executes an MPIBarrier command. If MPI support is not enabled, this command does nothing. |
366 |
|
\end{methoddesc} |
367 |
|
|
368 |
|
\begin{methoddesc}[Domain]{getMPISize}{} |
369 |
|
returns the number of MPI processors used for this domain. |
370 |
|
\end{methoddesc} |
371 |
|
|
372 |
|
\begin{methoddesc}[Domain]{getMPIRank}{} |
373 |
|
returns the rank of the processor executing the statement. |
374 |
|
\end{methoddesc} |
375 |
|
|
376 |
\subsection{\FunctionSpace class} |
\subsection{\FunctionSpace class} |
377 |
\begin{classdesc}{FunctionSpace}{} |
\begin{classdesc}{FunctionSpace}{} |
378 |
\FunctionSpace objects are used to define properties of \Data objects, such as continuity. \FunctionSpace objects |
\FunctionSpace objects are used to define properties of \Data objects, such as continuity. \FunctionSpace objects |
379 |
are instantiated by generator functions. \Data objects in particular \FunctionSpace are |
are instantiated by generator functions. A \Data object in a particular \FunctionSpace is |
380 |
represented by their values at \DataSamplePoints which are defined by the type and the \Domain of the |
represented by its values at \DataSamplePoints which are defined by the type and the \Domain of the |
381 |
\FunctionSpace. |
\FunctionSpace. |
382 |
\end{classdesc} |
\end{classdesc} |
383 |
The following methods are available: |
The following methods are available: |
739 |
returns the minimum value over all components and all \DataSamplePoints of \var{a} |
returns the minimum value over all components and all \DataSamplePoints of \var{a} |
740 |
\end{funcdesc} |
\end{funcdesc} |
741 |
|
|
|
\begin{funcdesc}{sin}{a} |
|
|
applies sine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{cos}{a} |
|
|
applies cosine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{tan}{a} |
|
|
applies tangent function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{asin}{a} |
|
|
applies arc (inverse) sine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{acos}{a} |
|
|
applies arc (inverse) cosine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{atan}{a} |
|
|
applies arc (inverse) tangent function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{sinh}{a} |
|
|
applies hyperbolic sine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{cosh}{a} |
|
|
applies hyperbolic cosine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{tanh}{a} |
|
|
applies hyperbolic tangent function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{asinh}{a} |
|
|
applies arc (inverse) hyperbolic sine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{acosh}{a} |
|
|
applies arc (inverse) hyperbolic cosine function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{atanh}{a} |
|
|
applies arc (inverse) hyperbolic tangent function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{exp}{a} |
|
|
applies exponential function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{sqrt}{a} |
|
|
applies square root function to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{log}{a} |
|
|
applies the natural logarithm to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{log10}{a} |
|
|
applies the base-$10$ logarithm to \var{a}. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{sign}{a} |
|
|
applies the sign function to \var{a}, that is $1$ where \var{a} is positive, |
|
|
$-1$ where \var{a} is negative and $0$ otherwise. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{wherePositive}{a} |
|
|
returns a function which is $1$ where \var{a} is positive and $0$ otherwise. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{whereNegative}{a} |
|
|
returns a function which is $1$ where \var{a} is negative and $0$ otherwise. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{whereNonNegative}{a} |
|
|
returns a function which is $1$ where \var{a} is non--negative and $0$ otherwise. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{whereNonPositive}{a} |
|
|
returns a function which is $1$ where \var{a} is non--positive and $0$ otherwise. |
|
|
\end{funcdesc} |
|
|
|
|
|
\begin{funcdesc}{whereZero}{a\optional{, tol=0.}} |
|
|
returns a function which is $1$ where \var{a} equals zero with tolerance \var{tol} and $0$ otherwise. |
|
|
\end{funcdesc} |
|
742 |
|
|
|
\begin{funcdesc}{whereNonZero}{a\optional{, tol=0.}} |
|
|
returns a function which is $1$ where \var{a} different from zero with tolerance \var{tol} and $0$ otherwise. |
|
|
\end{funcdesc} |
|
743 |
|
|
744 |
\begin{funcdesc}{minval}{a} |
\begin{funcdesc}{minval}{a} |
745 |
returns at each \DataSamplePoints the minimum value over all components. |
returns at each \DataSamplePoints the minimum value over all components. |
993 |
\end{equation} |
\end{equation} |
994 |
\end{funcdesc} |
\end{funcdesc} |
995 |
|
|
996 |
|
The following functions operate ``point-wise''. That is, the operation is applied to each component of each point |
997 |
|
individually. |
998 |
|
|
999 |
|
\begin{funcdesc}{sin}{a} |
1000 |
|
applies sine function to \var{a}. |
1001 |
|
\end{funcdesc} |
1002 |
|
|
1003 |
|
\begin{funcdesc}{cos}{a} |
1004 |
|
applies cosine function to \var{a}. |
1005 |
|
\end{funcdesc} |
1006 |
|
|
1007 |
|
\begin{funcdesc}{tan}{a} |
1008 |
|
applies tangent function to \var{a}. |
1009 |
|
\end{funcdesc} |
1010 |
|
|
1011 |
|
\begin{funcdesc}{asin}{a} |
1012 |
|
applies arc (inverse) sine function to \var{a}. |
1013 |
|
\end{funcdesc} |
1014 |
|
|
1015 |
|
\begin{funcdesc}{acos}{a} |
1016 |
|
applies arc (inverse) cosine function to \var{a}. |
1017 |
|
\end{funcdesc} |
1018 |
|
|
1019 |
|
\begin{funcdesc}{atan}{a} |
1020 |
|
applies arc (inverse) tangent function to \var{a}. |
1021 |
|
\end{funcdesc} |
1022 |
|
|
1023 |
|
\begin{funcdesc}{sinh}{a} |
1024 |
|
applies hyperbolic sine function to \var{a}. |
1025 |
|
\end{funcdesc} |
1026 |
|
|
1027 |
|
\begin{funcdesc}{cosh}{a} |
1028 |
|
applies hyperbolic cosine function to \var{a}. |
1029 |
|
\end{funcdesc} |
1030 |
|
|
1031 |
|
\begin{funcdesc}{tanh}{a} |
1032 |
|
applies hyperbolic tangent function to \var{a}. |
1033 |
|
\end{funcdesc} |
1034 |
|
|
1035 |
|
\begin{funcdesc}{asinh}{a} |
1036 |
|
applies arc (inverse) hyperbolic sine function to \var{a}. |
1037 |
|
\end{funcdesc} |
1038 |
|
|
1039 |
|
\begin{funcdesc}{acosh}{a} |
1040 |
|
applies arc (inverse) hyperbolic cosine function to \var{a}. |
1041 |
|
\end{funcdesc} |
1042 |
|
|
1043 |
|
\begin{funcdesc}{atanh}{a} |
1044 |
|
applies arc (inverse) hyperbolic tangent function to \var{a}. |
1045 |
|
\end{funcdesc} |
1046 |
|
|
1047 |
|
\begin{funcdesc}{exp}{a} |
1048 |
|
applies exponential function to \var{a}. |
1049 |
|
\end{funcdesc} |
1050 |
|
|
1051 |
|
\begin{funcdesc}{sqrt}{a} |
1052 |
|
applies square root function to \var{a}. |
1053 |
|
\end{funcdesc} |
1054 |
|
|
1055 |
|
\begin{funcdesc}{log}{a} |
1056 |
|
applies the natural logarithm to \var{a}. |
1057 |
|
\end{funcdesc} |
1058 |
|
|
1059 |
|
\begin{funcdesc}{log10}{a} |
1060 |
|
applies the base-$10$ logarithm to \var{a}. |
1061 |
|
\end{funcdesc} |
1062 |
|
|
1063 |
|
\begin{funcdesc}{sign}{a} |
1064 |
|
applies the sign function to \var{a}, that is $1$ where \var{a} is positive, |
1065 |
|
$-1$ where \var{a} is negative and $0$ otherwise. |
1066 |
|
\end{funcdesc} |
1067 |
|
|
1068 |
|
\begin{funcdesc}{wherePositive}{a} |
1069 |
|
returns a function which is $1$ where \var{a} is positive and $0$ otherwise. |
1070 |
|
\end{funcdesc} |
1071 |
|
|
1072 |
|
\begin{funcdesc}{whereNegative}{a} |
1073 |
|
returns a function which is $1$ where \var{a} is negative and $0$ otherwise. |
1074 |
|
\end{funcdesc} |
1075 |
|
|
1076 |
|
\begin{funcdesc}{whereNonNegative}{a} |
1077 |
|
returns a function which is $1$ where \var{a} is non--negative and $0$ otherwise. |
1078 |
|
\end{funcdesc} |
1079 |
|
|
1080 |
|
\begin{funcdesc}{whereNonPositive}{a} |
1081 |
|
returns a function which is $1$ where \var{a} is non--positive and $0$ otherwise. |
1082 |
|
\end{funcdesc} |
1083 |
|
|
1084 |
|
\begin{funcdesc}{whereZero}{a\optional{, tol=0.}} |
1085 |
|
returns a function which is $1$ where \var{a} equals zero with tolerance \var{tol} and $0$ otherwise. |
1086 |
|
\end{funcdesc} |
1087 |
|
|
1088 |
|
\begin{funcdesc}{whereNonZero}{a\optional{, tol=0.}} |
1089 |
|
returns a function which is $1$ where \var{a} different from zero with tolerance \var{tol} and $0$ otherwise. |
1090 |
|
\end{funcdesc} |
1091 |
|
|
1092 |
\subsection{\Operator Class} |
\subsection{\Operator Class} |
1093 |
The \Operator class provides an abstract access to operators build |
The \Operator class provides an abstract access to operators build |
1094 |
within the \LinearPDE class. \Operator objects are created |
within the \LinearPDE class. \Operator objects are created |