(u) = TrialFunction(Magnetic) (p) = TrialFunction(Lagrange) (q) = TestFunction(Lagrange) a = inner(curl(u),curl(v))*dx + omega*inner(u,v)*dx L1 = inner(v, CurlMass)*dx # parameters['linear_algebra_backend'] = 'Epetra' Acurl,b = assemble_system(a,L1,bc) Anode = assemble(inner(grad(p),grad(q))*dx+omega*inner(p,q)*dx) bcu = DirichletBC(Lagrange, Expression(("0.0")), boundary) bcu.apply(Anode) MLList = Teuchos.ParameterList() ML.SetDefaults("maxwell",MLList) MLList.set("ML output", 10); MLList.set("repartition: enable",1); MLList.set("repartition: node max min ratio",1.1); MLList.set("repartition: node min per proc",20); MLList.set("repartition: max min ratio",1.1); MLList.set("repartition: min per proc",20); MLList.set("repartition: partitioner","Zoltan"); MLList.set("repartition: Zoltan dimensions",2); # MLList.set("node: x-coordinates", mesh.coordinates()[:,0].astype("float_")); # MLList.set("node: y-coordinates", mesh.coordinates()[:,1].astype("float_")); # MLList.set("y-coordinates", edge_coordinates + ML_Tmat->outvec_leng);
unbalanced_map = Epetra.Map(global_number_of_nodes, len(nodes), 0, comm) #Create and populate distributed Epetra vector to the hold the unbalanced #data. my_nodes = Epetra.MultiVector(unbalanced_map, 2) my_nodes[:] = nodes.T #Create and populate an Epetra mulitvector to store the families data max_family_length = comm.MaxAll(max_family_length) my_families = Epetra.MultiVector(unbalanced_map, max_family_length) my_families[:] = families.T #Load balance if rank == 0: print "Load balancing...\n" #Create Teuchos parameter list to pass parameter to ZOLTAN for load #balancing parameter_list = Teuchos.ParameterList() parameter_list.set("Partitioning Method","RCB") if not VERBOSE: parameter_sublist = parameter_list.sublist("ZOLTAN") parameter_sublist.set("DEBUG_LEVEL", "0") #Create a partitioner to load balance the grid partitioner = Isorropia.Epetra.Partitioner(my_nodes, parameter_list) #And a redistributer redistributer = Isorropia.Epetra.Redistributor(partitioner) #Redistribute nodes my_nodes_balanced = redistributer.redistribute(my_nodes) #The new load balanced map balanced_map = my_nodes_balanced.Map() #Create importer and exporters to move data between banlanced and #unbalanced maps importer = Epetra.Import(balanced_map, unbalanced_map)
#! /usr/bin/env python import PyFrensie.Data.Native as Native import PyFrensie.Utility as Utility import PyFrensie.Utility.Prng as Prng import PyFrensie.Utility.Interpolation as Interpolation import PyFrensie.MonteCarlo.Collision as Collision import PyTrilinos.Teuchos as Teuchos import numpy import matplotlib.pyplot as plt Utility.initFrensiePrng() #datadir = '/home/software/mcnpdata/' datadir = '/home/lkersting/frensie/src/packages/test_files/' source = Teuchos.FileInputSource( datadir + '/cross_sections.xml' ) xml_obj = source.getObject() cs_list = Teuchos.XMLParameterListReader().toParameterList( xml_obj ) data_list = cs_list.get( 'H-Native' ) ### -------------------------------------------------------------------------- ## ### Forward Elastic Unit Test Check ### -------------------------------------------------------------------------- ## native_file_name = datadir + data_list.get( 'electroatomic_file_path' ) native_data = Native.ElectronPhotonRelaxationDataContainer( native_file_name ) ### ### Brem Distribution/Reaction Unit Test Check ### interps = ["LinLinLog", "LogLogLog", "LinLinLin"] energies = [1.0e+5, 1e-3]
def createTimers(names): """@brief Creates Teuchos timers.""" timers_list = [] for name in names: timers_list.append(Teuchos.Time(name)) return timers_list