def loadcad(self): # Method which imports the CAD file to be processed into a mesh. # Configs are chosen from the C++ side. loadcad = Module.Create(ModuleType.Process, "loadcad", self.mesh) loadcad.RegisterConfig("filename", self.infile) loadcad.RegisterConfig("verbose", " ") self.def_and_process(loadcad)
def create_octree(self, mindel, maxdel, eps): # Creates an octree, which is a way of dividing a cube into equal # parts. octree = Module.Create(ModuleType.Process, "loadoctree", self.mesh) octree.RegisterConfig("mindel", mindel) octree.RegisterConfig("maxdel", maxdel) octree.RegisterConfig("eps", eps) self.def_and_process(octree)
def volume_mesh(self): volmesh = Module.Create(ModuleType.Process, "volumemesh", self.mesh) # volmesh.RegisterConfig("blsurfs", self.blsurfs) # volmesh.RegisterConfig("blthick", self.blthick) # volmesh.RegisterConfig("bllayers", self.bllayers) # volmesh.RegisterConfig("blprog", self.blprog) self.mesh.expDim = 3 self.mesh.spaceDim = 3 self.def_and_process(volmesh)
def outcad(self, outfile): # Method which saves the file as an .xml file. output = Module.Create(ModuleType.Output, "xml", self.mesh) output.RegisterConfig("outfile", self.outfile) self.def_and_process(output)
def ho_surface_mesh(self): # Method generating a high-order mesh, only called if the order # is greater than 1. homesh = Module.Create(ModuleType.Process, "hosurface", self.mesh) self.def_and_process(homesh)
def surface_mesh(self): # Method generates a linear mesh surfmesh = Module.Create(ModuleType.Process, "surfacemesh", self.mesh) self.def_and_process(surfmesh) self.mesh.expDim = 2
config, [nodes[y][x], nodes[y][x + 1], nodes[y + 1][x + 1]], [comp_ID])) def _call_module(self): # Call the Module functions to create all of the edges, faces and # composites. self.ProcessVertices() self.ProcessEdges() self.ProcessFaces() self.ProcessElements() self.ProcessComposites() # Register our TestInput module with the factory. Module.Register(ModuleType.Input, "test", TestInput) # Create a 'pipeline' of the input and output modules. mesh = Mesh() mod1 = Module.Create(ModuleType.Input, "test", mesh) mod2 = Module.Create(ModuleType.Output, "xml", mesh) # Print out config options that we registered in TestInput, just for fun and to # test they registered correctly! # mod1.PrintConfig() # Now register some sample input configuration options with the module, so that # it will know the appropriate parameters to generate a mesh for. mod1.RegisterConfig("nx", input("Number of nodes in x direction: ")) mod1.RegisterConfig("ny", input("Number of nodes in y direction: ")) mod1.RegisterConfig("coord_1x", input("Coord_1x: "))