aboutsummaryrefslogtreecommitdiff
path: root/Tools/CodeGen
diff options
context:
space:
mode:
authorIan Hinder <ian.hinder@aei.mpg.de>2012-01-23 21:56:20 -0600
committerIan Hinder <ian.hinder@aei.mpg.de>2012-01-23 21:56:20 -0600
commit6d3c1bdb15d8f976625dbd5b84af92cbb1c162b8 (patch)
treef9cab5535fbd3278150c006219a9610021810f4f /Tools/CodeGen
parent0e97f724382a3c83f18db9dbd33bf04856dc8d04 (diff)
CodeGenCactus.m: Add CCLBlock function
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r--Tools/CodeGen/CodeGenCactus.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m
index 082f8f5..d9dc3f0 100644
--- a/Tools/CodeGen/CodeGenCactus.m
+++ b/Tools/CodeGen/CodeGenCactus.m
@@ -79,6 +79,8 @@ NameRoot::usage = "";
PartitionVarList::usage = "";
DataType::usage = "DataType[] returns a string for the grid function data type (e.g. CCTK_REAL)";
SetDataType::usage = "SetDataType[type] sets a string for the grid function data type (e.g. CCTK_REAL)";
+CCLBlock;
+
Begin["`Private`"];
@@ -706,6 +708,14 @@ DefFn[
(* Print[rhs//FullForm];*)
rhs]];
+DefFn[
+ CCLBlock[type_String, name_String, attrs:{(_String -> _String)...},
+ contents:CodeGenBlock,comment_String:""] :=
+ {type, " ", name,
+ Map[" "<>#[[1]]<>"="<>#[[2]] &, attrs], "\n",
+ CBlock[contents],
+ If[comment === "", "", Quote[comment]],"\n"}];
+
End[];
EndPackage[];