diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-06-04 12:04:12 +0200 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-06-04 12:04:12 +0200 |
commit | 23ca025ebcae909c230d1b9c57b911b2083552c0 (patch) | |
tree | 3ca2926303d34d58a1832a62cdfdc03c4e365e0d /Tools/CodeGen | |
parent | d9bccf4656d20e5e2c901055cc53eea6471aa88f (diff) |
KrancThorn.m: Fix messed up merge
Diffstat (limited to 'Tools/CodeGen')
-rw-r--r-- | Tools/CodeGen/KrancThorn.m | 133 |
1 files changed, 0 insertions, 133 deletions
diff --git a/Tools/CodeGen/KrancThorn.m b/Tools/CodeGen/KrancThorn.m index 4d53ccb..e27d425 100644 --- a/Tools/CodeGen/KrancThorn.m +++ b/Tools/CodeGen/KrancThorn.m @@ -333,138 +333,5 @@ createKrancMoLRegister[evolvedGroupNames_, nonevolvedGroupNames_, groups_, imple molregister = CreateMoLRegistrationSource[molspec, False]; Return[molregister]]; -<<<<<<< HEAD -(* -------------------------------------------------------------------------- - Tensors - -------------------------------------------------------------------------- *) - -(*Options[CreateKrancThornTT] = ThornOptions;*) - -CreateKrancThornTT[groups_, parentDirectory_, thornName_, opts___] := - Module[{calcs, expCalcs, expGroups, options, derivs, expDerivs, reflectionSymmetries, declaredGroups, consCalcs, expConsCalcs}, - InfoMessage[Terse, "Processing tensorial arguments"]; - calcs = lookup[{opts}, Calculations]; - consCalcs = lookupDefault[{opts}, ConservationCalculations, {}]; - derivs = lookupDefault[{opts}, PartialDerivatives, {}]; - Map[CheckCalculationTensors, calcs]; - expCalcs = Map[makeCalculationExplicit, calcs]; - expConsCalcs = Map[makeCalculationExplicit, consCalcs]; - - Print[expConsCalcs]; - - InfoMessage[Info, "Group definitions:", groups]; - - expDerivs = Flatten[Map[MakeExplicit,derivs],1]; - expGroups = Map[makeGroupExplicit, groups]; - options = {opts}; - options = Join[DeleteCases[options, Calculations -> _], {Calculations -> expCalcs}]; - options = Join[DeleteCases[options, ConservationCalculations -> _], - {ConservationCalculations -> expConsCalcs}]; - options = Join[DeleteCases[options, PartialDerivatives -> _], - {PartialDerivatives -> expDerivs}]; - - declaredGroups = lookupDefault[{opts}, DeclaredGroups, {}]; - evolutionTimelevels = lookupDefault[{opts}, EvolutionTimelevels, 3]; - defaultEvolutionTimelevels = lookupDefault[{opts}, DefaultEvolutionTimelevels, evolutionTimelevels]; - InfoMessage[Info, "Declared groups: " <> ToString[declaredGroups]]; - InfoMessage[Terse, "Computing reflection symmetries"]; - reflectionSymmetries = computeReflectionSymmetries[declaredGroups, groups]; - InfoMessage[Info, "Reflection symmetries: ", reflectionSymmetries]; - - InfoMessage[Terse, "Creating (component-based) Kranc thorn"]; - CreateKrancThorn[expGroups, parentDirectory, thornName, Apply[Sequence, options], - ReflectionSymmetries -> reflectionSymmetries]]; - -computeReflectionSymmetries[declaredGroups_, groups_] := - Module[{variables, syms}, - variables = variablesFromGroups[declaredGroups, groups]; - syms = Flatten[Map[ReflectionSymmetriesOfTensor, variables], 1]; - syms]; - -makeCalculationExplicit[calc_] := - mapValueMapMultiple[calc, - {Shorthands -> MakeExplicit, - CollectList -> MakeExplicit, - Equations -> MakeExplicit, - PrimitiveEquations -> MakeExplicit, - ConservedEquations -> MakeExplicit, - Primitives -> MakeExplicit}]; - -makeGroupExplicit[g_] := - Module[{variables, newVariables, newGroup}, - variables = groupVariables[g]; - newVariables = RemoveDuplicates[MakeExplicit[variables]]; - newGroup = SetGroupVariables[g, newVariables]; - newGroup]; - -tensorTypeString[k_, inds_] := - Module[{}, - InfoMessage[InfoFull, "Tensor attributes of " <> ToString[k], TensorAttributes[k]]; - If[HasTensorAttribute[k, TensorManualCartesianParities], - "ManualCartesian", - If[Length[inds] == 0, - "Scalar", - Apply[StringJoin, Map[If[IndexIsUpper[#], "U", "D"] &, inds]]]]]; - -CreateGroupFromTensor[T:Tensor[k_, is__]] := - CreateGroupFromTensor[k, {is}]; - -reflectionParityString[l_] := - Module[{chars}, - If[!ListQ[l] || !Length[l] == 3, - ThrowError["Expecting a list of three parities for TensorManualCartesianParities, must be 1 or -1"]]; - - chars= Map[Switch[#, -1, "-", +1, "+", _, - ThrowError["Expecting a list of three parities for TensorManualCartesianParities, must be 1 or -1"]] &, - l]; - - Apply[StringJoin, chars]]; - -CreateGroupFromTensor[k_, inds_] := - Module[{ttypeString, nInds, tags, group, vars}, - InfoMessage[InfoFull, "Creating group from tensor with kernel " <> ToString[k] <> " and indices " <> ToString[inds]]; - ttypeString = tensorTypeString[k, inds]; - InfoMessage[InfoFull, "Tensor type string: ", ttypeString]; - nInds = Length[inds]; - If[nInds == 2 && GetTensorAttribute[k, Symmetries] == {{2,1},1}, - ttypeString = ttypeString <> "_sym"]; - If[nInds == 3 && GetTensorAttribute[k, Symmetries] == {{1,3,2},1}, - ttypeString = ttypeString <> "_sym"]; - tags = {"tensortypealias" -> ttypeString, "tensorweight" -> GetTensorAttribute[k, TensorWeight]}; - If[HasTensorAttribute[k, TensorSpecial], - tags = Append[tags, "tensorspecial" -> GetTensorAttribute[k, TensorSpecial]]]; - If[HasTensorAttribute[k, TensorManualCartesianParities], - tags = Append[tags, "cartesianreflectionparities" -> - reflectionParityString[GetTensorAttribute[k, TensorManualCartesianParities]]]]; - If[HasTensorAttribute[k, TensorParity], - tags = Append[tags, "tensorparity" -> GetTensorAttribute[k, TensorParity]]]; - - If[HasTensorAttribute[k, Checkpoint], - tags = Append[tags, "checkpoint" -> GetTensorAttribute[k, Checkpoint]]]; - - vars = If[nInds == 0, {k}, {Apply[Tensor, {k, Apply[Sequence,inds]}]}]; - group = CreateGroup[ToString[k] <> "_group", vars, {Tags -> tags}]; - Return[group]]; - -CreateGroupFromTensor[x_] := - If[IsTensor[x], - CreateGroupFromTensor[x, {}], - ThrowError["CreateGroupFromTensor: Not a tensor", x]]; - -CheckEquationTensors[eq_] := - Module[{}, - CheckTensors[eq]]; - -CheckCalculationTensors[calc_] := - Module[{eqs}, - - If[mapContains[calc, Shorthands], - CheckTensors[lookup[calc, Shorthands]]]; - - eqs = lookup[calc, Equations]; - Map[CheckEquationTensors, eqs]]; - -======= ->>>>>>> origin/master End[]; EndPackage[]; |