aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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[];