Peano
Loading...
Searching...
No Matches
prepare-test-datastructures.py
Go to the documentation of this file.
1"""
2 This Python script uses/invokes DaStGen2 to generate all the datatypes
3 required by the unit tests for the stack component. The file is part of
4 the Peano 4 code base. For details (copyright) consult the project's
5 webpage. For further information on how to use this file, please study
6 the documentation of the class STDVectorStackOverObjectsWithSmartPointersTest.
7"""
8import dastgen2
10
11
12test_object = dastgen2.DataModel("peano4::stacks::tests::GeneratedTestObject")
13
14test_object.add_attribute(dastgen2.attributes.Integer("id"))
15test_object.add_attribute(peano4.api.dastgen2.Peano4SmartPointerDoubleArray( "data", "256" ))
16
17test_object.add_aspect( dastgen2.aspects.MPIForSmartPointers(test_object) )
18test_object.add_aspect( peano4.api.dastgen2.MPIAndStorageAspect(peano4.api.datamodel.DoFAssociation.Generic) )
19
20test_object.write_header_file("GeneratedTestObject.h")
21test_object.write_implementation_file("GeneratedTestObject.cpp")
22
23
24flattened_test_object = dastgen2.DataModel("peano4::stacks::tests::GeneratedTestObject_Flattened")
25
26flattened_test_object.add_attribute(dastgen2.attributes.Integer("id"))
27flattened_test_object.add_attribute(peano4.api.dastgen2.Peano4DoubleArray( "data", "256" ))
28
29flattened_test_object.add_aspect( dastgen2.aspects.MPI() )
30flattened_test_object.add_aspect( peano4.api.dastgen2.MPIAndStorageAspect(peano4.api.datamodel.DoFAssociation.Generic) )
31
32flattened_test_object.write_header_file("GeneratedTestObject_Flattened.h")
33flattened_test_object.write_implementation_file("GeneratedTestObject_Flattened.cpp")
34
35
Represents on DaStGen2 object, i.e.
Definition DataModel.py:8
Represents the MPI aspect injected into a DaStGen model.
Represents the MPI aspect injected into a DaStGen model.
Definition MPI.py:9
Represents Peano's MPI and storage aspect injected into a DaStGen model.
Specialisation of array using Peano's tarch.
Specialisation of array using Peano's tarch with a smart pointer.