aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhaas <rhaas@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2013-12-06 01:39:30 +0000
committerrhaas <rhaas@578cdeb0-5ea1-4b81-8215-5a3b8777ee0b>2013-12-06 01:39:30 +0000
commitf08f3c3f772dc233e07da7dac508c528857fbd67 (patch)
treedd828ff9b183b578f892969a2029701f192e450c
parentd9e0aa0a1a5e2b8026519940cddfc34713ba1234 (diff)
add comments describing LinearCombination function
git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/MoL/trunk@204 578cdeb0-5ea1-4b81-8215-5a3b8777ee0b
-rw-r--r--interface.ccl2
-rw-r--r--src/Operators.c52
2 files changed, 54 insertions, 0 deletions
diff --git a/interface.ccl b/interface.ccl
index 94a4bb7..51d9647 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -211,6 +211,8 @@ PROVIDES FUNCTION MoLNumIntegratorSubsteps WITH MoL_NumIntegratorSubsteps \
### to override low-level grid variable operations. ###
##############################################################
+# Computes:
+# var = scale * var + \sum_i^nsrcs facts[i] * scrcs[i][tls[i]]
CCTK_INT FUNCTION LinearCombination \
(CCTK_POINTER_TO_CONST IN cctkGH, \
CCTK_INT IN var, \
diff --git a/src/Operators.c b/src/Operators.c
index fa78524..21ff8b2 100644
--- a/src/Operators.c
+++ b/src/Operators.c
@@ -145,6 +145,58 @@ op_real_update_3(CCTK_REAL *restrict const varptr,
+ /*@@
+ @routine MoL_LinearCombination
+ @date Tue Jan 22 16:00:28 EST 2013
+ @author Erik Schnetter
+ @desc
+ MoL's low level operator. Computes linear combination of grid functions.
+ Computes:
+ var = scale * var + \sum_i^nsrcs facts[i] * scrcs[i][tls[i]]
+ @enddesc
+ @var GH
+ @vdesc Pointer to CCTK GH
+ @vtype const cGH *
+ @vio in
+ @endvar
+ @var var
+ @vdesc global index of target variable
+ @vtype int
+ @vio inout
+ @endvar
+ @var scale
+ @vdesc scale target by this
+ @vtype CCTK_REAL
+ @vio in
+ @endvar
+ @var srcs
+ @vdesc global index of variable
+ @vtype int[]
+ @vio in
+ @endvar
+ @var tls
+ @vdesc time levels of srcs variables to use
+ @vtype int[]
+ @vio in
+ @endvar
+ @var facts
+ @vdesc scale factors for srcs variables
+ @vtype CCTK_REAL[]
+ @vio in
+ @endvar
+ @var nsrcs
+ @vdesc number of srcs variables
+ @vtype int
+ @vio in
+ @endvar
+
+ @returntype CCTK_INT
+ @returndesc
+ 0 for success, or<BR>
+ @endreturndesc
+
+@@*/
+
CCTK_INT
MoL_LinearCombination(cGH const *const cctkGH,
CCTK_INT const var,