aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@0cbbb82d-14ec-4423-a1fb-2ab18257ecaa>2004-02-05 13:18:04 +0000
committerschnetter <schnetter@0cbbb82d-14ec-4423-a1fb-2ab18257ecaa>2004-02-05 13:18:04 +0000
commit167567e5b54492965d02b94976f48ca60524bc73 (patch)
treebc5cd3fa744cb2cff2caf759fe3d1e2ac7c0cb4f
parent501b3bb424fd9ba19a00c4e20088a6407d25a3d1 (diff)
Add function aliases for the conversion routines between the physical
and conformal metric. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/StaticConformal/trunk@18 0cbbb82d-14ec-4423-a1fb-2ab18257ecaa
-rw-r--r--doc/documentation.tex71
-rw-r--r--interface.ccl32
-rw-r--r--src/ConfPhys.c93
3 files changed, 80 insertions, 116 deletions
diff --git a/doc/documentation.tex b/doc/documentation.tex
index 73b24c6..6f74bdf 100644
--- a/doc/documentation.tex
+++ b/doc/documentation.tex
@@ -25,8 +25,8 @@ Base thorn to provide the variables for the static conformal factor
This thorn provides the variables defining a static conformal factor
which is used to transform the physical metric. If this thorn is
-active and the {\tt ADMBase::metric\_type} parameter is set to
-``{\tt static conformal}'' then the {\tt ADMBase::g...} variables are the
+active and the {\tt ADMBase::metric\_type} parameter is set to {\tt
+static conformal}, then the {\tt ADMBase::g...} variables are the
conformal values as opposed to the physical values.
The transformation is
@@ -58,7 +58,8 @@ actually been calculated before using the conformal factor:
\begin{description}
\item[{\tt conformal\_state=0}]
No conformal factor has been calculated --- thorns may
-assume the conformal factor is 1 at all points. (I.e., the metric is physical.)
+assume the conformal factor is 1 at all points.
+(I.e., the metric is physical.)
\item[{\tt conformal\_state=1}]
The conformal factor has been calulated, but no derivatives.
\item[{\tt conformal\_state=2}]
@@ -68,14 +69,21 @@ The conformal factor and its first and second derivatives have been calculated.
\end{description}
Note that this means that if you only want to know whether {\tt psi} contains
-the values for the conformal factor you can check for {\tt conformal\_state > 0}.
+the values for the conformal factor you can check for {\tt
+conformal\_state > 0}.
\section{Utilities}
-{\tt StaticConformal} provides functions to convert between physical and conformal 3-metric values. It is very important to understand that these functions
-apply the conversion {\it in place}. That is, if {\tt gxx} contains the conformal metric value, when the routine is exited it will now contain the physical metric value. These functions {\it do not} change the value of {\tt conformal\_state} and should be used with due care. (These functions are for example used
-by some analysis thorns who work only with the physical metric, they apply the
-transformation on entry to the analysis routine and switch it back on exit).
+{\tt StaticConformal} provides aliased functions to convert between
+physical and conformal 3-metric values. It is very important to
+understand that these functions apply the conversion {\em in place}.
+That is, if {\tt gxx} contains the conformal metric value, when the
+routine is exited it will now contain the physical metric value.
+These functions {\em do not} change the value of {\tt
+conformal\_state} and should be used with due care. (These functions
+are for example used by some analysis thorns who work only with the
+physical metric, they apply the transformation on entry to the
+analysis routine and switch it back on exit).
\begin{description}
@@ -84,17 +92,14 @@ transformation on entry to the analysis routine and switch it back on exit).
{\tt
\begin{verbatim}
-
-StaticConf_ConfToPhysInPlace (cctk_lsh(1),
- cctk_lsh(2),
- cctk_lsh(3),
+subroutine ConfToPhysInPlace (nx, ny, nz,
psi,
- gxx,
- gxy,
- gxz,
- gyy,
- gyz,
- gzz)
+ gxx, gxy, gxz, gyy, gyz, gzz)
+ implicit none
+ CCTK_INT, intent(in) :: nx, ny, nz
+ CCTK_REAL, dimension(nx, ny, nz), intent(in) :: psi
+ CCTK_REAL, dimension(nx, ny, nz), intent(inout) :: gxx, gxy, gxz, gyy, gyz, gzz
+end subroutine ConfToPhysInPlace
\end{verbatim}
}
@@ -103,17 +108,14 @@ StaticConf_ConfToPhysInPlace (cctk_lsh(1),
{\tt
\begin{verbatim}
-
-StaticConf_PhysToConfInPlace (cctk_lsh(1),
- cctk_lsh(2),
- cctk_lsh(3),
+subroutine PhysToConfInPlace (nx, ny, nz,
psi,
- gxx,
- gxy,
- gxz,
- gyy,
- gyz,
- gzz)
+ gxx, gxy, gxz, gyy, gyz, gzz)
+ implicit none
+ CCTK_INT, intent(in) :: nx, ny, nz
+ CCTK_REAL, dimension(nx, ny, nz), intent(in) :: psi
+ CCTK_REAL, dimension(nx, ny, nz), intent(inout) :: gxx, gxy, gxz, gyy, gyz, gzz
+end subroutine ConfToPhysInPlace
\end{verbatim}
}
@@ -127,14 +129,15 @@ factor, but does initialise the {\tt conformal\_state} variable to 0.
Please note, no thorn should use the {\tt conformal\_state} variable
unless the parameter {\tt metric\_type} is {\tt "static conformal"}.
The {\tt conformal\_state} variable is not assigned storage or
-initialised by the \texttt{StaticConformal} thorn in any other case.
+initialised by the {\tt StaticConformal} thorn in any other case.
However, thorns are free to themselves assign storage for {\tt
conformal\_state} and initialise it to zero if {\tt metric\_type} is
-``physical''. In this one case it is safe for them to use the
-\texttt{conformal\_state} variable if \texttt{metric\_type} is not
-``static conformal''. This method allows them to use just one set of
-ifs rather than first checking the metric\_type and then the
-conformal\_state variable if the metric\_type is ``static conformal''.
+{\tt physical}. In this one case it is safe for them to use the {\tt
+conformal\_state} variable if {\tt metric\_type} is not {\tt static
+conformal}. This method allows them to use just one set of ifs rather
+than first checking the {\tt metric\_type} and then the {\tt
+conformal\_state} variable if the {\tt metric\_type} is {\tt static
+conformal}.
% Do not delete next line
% END CACTUS THORNGUIDE
diff --git a/interface.ccl b/interface.ccl
index 3af82a3..e3686e0 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -35,14 +35,28 @@ REAL confac_2derivs TYPE = GF tags='Prolongation="None"'
# psi_11, psi_12, psi_13, psi_22, psi_23, psi_33
#} "Second spatial derivatives of conformal factor divided by psi"
-#void FUNCTION StaticConf_ConfToPhysInPlace CCTK_INT nx, CCTK_INT ny, CCTK_INT nz, \
-# CCTK_REAL:ARRAY gxx, CCTK_REAL:ARRAY gxy, CCTK_REAL:ARRAY gxz, \
-# CCTK_REAL:ARRAY gyy, CCTK_REAL:ARRAY gyz, CCTK_REAL:ARRAY gzz,
-#PROVIDES FUNCTION StaticConf_ConfToPhysInPlace WITH StaticConformali_ConfToPhysInPlace
-#void FUNCTION StaticConf_PhysToConfInPlace CCTK_INT nx, CCTK_INT ny, CCTK_INT nz, \
-# CCTK_REAL:ARRAY gxx, CCTK_REAL:ARRAY gxy, CCTK_REAL:ARRAY gxz, \
-# CCTK_REAL:ARRAY gyy, CCTK_REAL:ARRAY gyz, CCTK_REAL:ARRAY gzz,
-
-#PROVIDES FUNCTION StaticConf_PhysToConfInPlace WITH StaticConformali_PhysToConfInPlace
+void FUNCTION ConfToPhysInPlace (CCTK_INT IN nx, \
+ CCTK_INT IN ny, \
+ CCTK_INT IN nz, \
+ CCTK_REAL ARRAY IN psi, \
+ CCTK_REAL ARRAY INOUT gxx, \
+ CCTK_REAL ARRAY INOUT gxy, \
+ CCTK_REAL ARRAY INOUT gxz, \
+ CCTK_REAL ARRAY INOUT gyy, \
+ CCTK_REAL ARRAY INOUT gyz, \
+ CCTK_REAL ARRAY INOUT gzz)
+PROVIDES FUNCTION ConfToPhysInPlace WITH StaticConf_ConfToPhysInPlace LANGUAGE C
+
+void FUNCTION PhysToConfInPlace (CCTK_INT IN nx, \
+ CCTK_INT IN ny, \
+ CCTK_INT IN nz, \
+ CCTK_REAL ARRAY IN psi, \
+ CCTK_REAL ARRAY INOUT gxx, \
+ CCTK_REAL ARRAY INOUT gxy, \
+ CCTK_REAL ARRAY INOUT gxz, \
+ CCTK_REAL ARRAY INOUT gyy, \
+ CCTK_REAL ARRAY INOUT gyz, \
+ CCTK_REAL ARRAY INOUT gzz)
+PROVIDES FUNCTION PhysToConfInPlace WITH StaticConf_PhysToConfInPlace LANGUAGE C
diff --git a/src/ConfPhys.c b/src/ConfPhys.c
index c0e29cc..23ff5a8 100644
--- a/src/ConfPhys.c
+++ b/src/ConfPhys.c
@@ -34,27 +34,6 @@ CCTK_FILEVERSION(CactusEinstein_StaticConformal_ConfPhys_c)
********************* Other Routine Prototypes *********************
********************************************************************/
-void CCTK_FCALL CCTK_FNAME (StaticConf_PhysToConfInPlace) (int *nx,
- int *ny,
- int *nz,
- CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz);
-void CCTK_FCALL CCTK_FNAME (StaticConf_ConfToPhysInPlace) (int *nx,
- int *ny,
- int *nz,
- CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz);
-
/********************************************************************
********************* Local Data *****************************
********************************************************************/
@@ -63,7 +42,6 @@ void CCTK_FCALL CCTK_FNAME (StaticConf_ConfToPhysInPlace) (int *nx,
********************* External Routines **********************
********************************************************************/
-
/*@@
@routine StaticConf_ConfToPhysInPlace
@date September 3rd 1999
@@ -118,16 +96,16 @@ void CCTK_FCALL CCTK_FNAME (StaticConf_ConfToPhysInPlace) (int *nx,
@vio inout
@@*/
-void StaticConf_ConfToPhysInPlace (int nx,
- int ny,
- int nz,
- const CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz)
+void StaticConf_ConfToPhysInPlace (CCTK_INT const nx,
+ CCTK_INT const ny,
+ CCTK_INT const nz,
+ const CCTK_REAL * restrict const psi,
+ CCTK_REAL * restrict const gxx,
+ CCTK_REAL * restrict const gxy,
+ CCTK_REAL * restrict const gxz,
+ CCTK_REAL * restrict const gyy,
+ CCTK_REAL * restrict const gyz,
+ CCTK_REAL * restrict const gzz)
{
CCTK_REAL psi4;
int index;
@@ -151,22 +129,6 @@ void StaticConf_ConfToPhysInPlace (int nx,
}
}
-
-void CCTK_FCALL CCTK_FNAME (StaticConf_ConfToPhysInPlace) (int *nx,
- int *ny,
- int *nz,
- CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz)
-{
- StaticConf_ConfToPhysInPlace (*nx, *ny, *nz, psi, gxx, gxy, gxz, gyy, gyz, gzz);
-}
-
-
/*@@
@routine StaticConf_PhysToConfInPlace
@date September 3rd 1999
@@ -221,16 +183,16 @@ void CCTK_FCALL CCTK_FNAME (StaticConf_ConfToPhysInPlace) (int *nx,
@vio inout
@@*/
-void StaticConf_PhysToConfInPlace (int nx,
- int ny,
- int nz,
- const CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz)
+void StaticConf_PhysToConfInPlace (CCTK_INT const nx,
+ CCTK_INT const ny,
+ CCTK_INT const nz,
+ const CCTK_REAL * restrict const psi,
+ CCTK_REAL * restrict const gxx,
+ CCTK_REAL * restrict const gxy,
+ CCTK_REAL * restrict const gxz,
+ CCTK_REAL * restrict const gyy,
+ CCTK_REAL * restrict const gyz,
+ CCTK_REAL * restrict const gzz)
{
int index;
CCTK_REAL psi4;
@@ -257,21 +219,6 @@ void StaticConf_PhysToConfInPlace (int nx,
}
}
-
-void CCTK_FCALL CCTK_FNAME (StaticConf_PhysToConfInPlace) (int *nx,
- int *ny,
- int *nz,
- CCTK_REAL *psi,
- CCTK_REAL *gxx,
- CCTK_REAL *gxy,
- CCTK_REAL *gxz,
- CCTK_REAL *gyy,
- CCTK_REAL *gyz,
- CCTK_REAL *gzz)
-{
- StaticConf_PhysToConfInPlace (*nx, *ny, *nz, psi, gxx, gxy, gxz, gyy, gyz, gzz);
-}
-
/********************************************************************
********************* Local Routines *************************
********************************************************************/