예제 #1
0
  def SetGeometryI(self, n_vertices, vertex_coords, n_elements, n_vertex_type, vertex_num, vertex_type):
    self.n_elements_i    = n_elements
    self.vertex_num_i    = Commdomm.iarray( n_elements*n_vertex_type )
    self.vertex_type_i   = Commdomm.iarray( n_elements               )

    k = 0
    for i in range(n_elements):
      self.vertex_type_i[i]  = int(vertex_type[i])    
      for j in range(n_vertex_type): 
        self.vertex_num_i[k] = int(vertex_num[i][j])
        k += 1

    self.n_vertices_i    = n_vertices
    self.vertex_coords_i = Commdomm.darray( n_vertices*self.dim )

    k = 0 
    for i in range(n_vertices): 
      for j in range(self.dim): 
        self.vertex_coords_i[k] = vertex_coords[i][j]
        k += 1  
예제 #2
0
val = -1
if(local_rank==0): val = 69
val = local_comm.bcast(val, root=0) 

comm_size = CD.get_mpi_commij_size();

commij = MPI.COMM_NULL  
if(comm_size == 1):
  namej     = "MESH02"
  commij    = CD.get_mpi_commij(namej)
  print

  # sendrecv test 
  n_recv = 0
  n_send = 1
  recv   = Commdomm.iarray(n_recv)
  send   = Commdomm.iarray(n_send)

  send[0] = val
  CD.__mpi_sendrecv__(send, n_send, recv, n_recv, local_comm, commij)

  # init locator
  rooti = Commdomm.iarray(1)
  rootj = Commdomm.iarray(1)
  CD.__mpi_get_roots__(local_comm, commij, rooti, rootj); 

  n_rank    = local_size
  root_rank = rooti[0]
  CD.locator_create(commij, n_rank, root_rank, 1e-3)

  # init meshes
예제 #3
0
local_rank = local_comm.Get_rank()

val = -1
if (local_rank == 0): val = 69

commij = MPI.COMM_NULL
if (app_name == "CCCC"):
    namej = "AAAA"
    commij = CD.get_mpi_commij(namej)
    comm_size = CD.get_mpi_commij_size()
    print

    n_recv = 0
    n_send = 1
    recv = Commdomm.iarray(n_recv)
    send = Commdomm.iarray(n_send)

    send[0] = val
    CD.sendrecv_int(send, n_send, recv, n_recv, local_comm, commij)
    val = local_comm.bcast(val, root=0)

if (app_name == "AAAA"):
    namej = "CCCC"
    commij = CD.get_mpi_commij(namej)
    comm_size = CD.get_mpi_commij_size()
    print

    n_recv = 1
    n_send = 0
    recv = Commdomm.iarray(n_recv)
예제 #4
0
    tol = 0.1
    CD.locator_create2(local_comm, commij, tol)

    #==| init meshes |==#
    n_vertices_j = n_vertices
    vertex_coords_j = Commdomm.darray(len(vertex_coords))
    for i in range(len(vertex_coords)):
        vertex_coords_j[i] = vertex_coords[i]

    n_vertices_i = n_vertices
    vertex_coords_i = Commdomm.darray(len(vertex_coords))
    for i in range(len(vertex_coords)):
        vertex_coords_i[i] = vertex_coords[i]

    n_elements_i = n_elements
    vertex_num_i = Commdomm.iarray(len(vertex_num))
    for i in range(len(vertex_num)):
        vertex_num_i[i] = vertex_num[i]

    print "\t +\'%s\' 01<-----" % namei
    print "|_n_elements, n_vertices:", n_elements, n_vertices

    CD.locator_set_mesh(n_vertices_i, n_elements_i, vertex_coords_i,
                        vertex_num_i, n_vertices_j, vertex_coords_j)

    CD.save_dist_coords(local_rank)

    #==||==#
    send = 'coupling:start'
    n_send = len(send)
예제 #5
0
    n_recv = len(recv)

    CD.__mpi_sendrecv_char__(send, n_send, recv, n_recv, local_comm, commij)
    print "\'%s\'<-\'%s\'" % (namei, recv)

    #==| init locator |==#
    CD.locator_create2(local_comm, commij)

    #==| init meshes |==#
    n_vertices_i = n_vertices
    vertex_coords_i = Commdomm.darray(len(vertex_coords))
    for i in range(len(vertex_coords)):
        vertex_coords_i[i] = vertex_coords[i]

    n_elements_i = n_elements
    vertex_num_i = Commdomm.iarray(len(vertex_num))
    for i in range(len(vertex_num)):
        vertex_num_i[i] = vertex_num[i]

    print "\t +\'%s\' 01<-----" % namei

    print "|_n_elements, n_vertices:", n_elements, n_vertices

    CD.locator_set_mesh(n_vertices_i, n_elements_i, vertex_coords_i,
                        vertex_num_i, n_vertices_j, vertex_coords_j)

    CD.save_dist_coords(local_rank)

    print "\t +\'%s\' 02<-----" % namei

    #==||==#
예제 #6
0
n_vertices = n_pts
n_elements = n_elems

print "|_n_vertices, n_elements: %d %d " % (n_vertices, n_elements)
print "                        |_types:", Alya2Cs.print_types()
#-------------------------------------------------------------------------||---#

#================================================================| LOCATOR |===#
#-------------------------------------------------------------------------||---#
n_vertices_i = n_vertices
vertex_coords_i = Commdomm.darray(len(vertex_coords))
for i in range(len(vertex_coords)):
    vertex_coords_i[i] = vertex_coords[i]

n_elements_i = n_elements
vertex_num_i = Commdomm.iarray(len(vertex_num))
for i in range(len(vertex_num)):
    vertex_num_i[i] = vertex_num[i]

vertex_type_i = Commdomm.iarray(n_elements)
for i in range(n_elements):
    vertex_type_i[i] = vertex_type[i]
#-------------------------------------------------------------------------||---#

#-------------------------------------------------------------------------||---#
if (local_rank == 0):
    n_vertices_j = len(PTS)
    vertex_coords_j = Commdomm.darray(n_vertices_j * 3)

    k = 0
    for i in range(n_vertices_j):