コード例 #1
0
unsigned Mesh_GetOwner( void* mesh, MeshTopology_Dim topodim, unsigned remote ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );

	return Sync_GetOwner( IGraph_GetDomain( self->topo, topodim ), remote );
}
コード例 #2
0
Sync* Mesh_GetSync( void* mesh, MeshTopology_Dim topodim ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );

	return (Sync*)IGraph_GetDomain( self->topo, topodim );
}
コード例 #3
0
unsigned Mesh_SharedToLocal( void* mesh, MeshTopology_Dim topodim, unsigned shared ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	return Sync_SharedToLocal( IGraph_GetDomain( self->topo, topodim ), shared );
}
コード例 #4
0
Bool Mesh_LocalToShared( void* mesh, MeshTopology_Dim topodim, unsigned domain, unsigned* shared ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	return Sync_TryLocalToShared( IGraph_GetDomain( self->topo, topodim ), domain, shared );
}
コード例 #5
0
/*@
  Mesh_DomainToGlobal
  -maps a locally numbered entity to that entity's global number.
   (e.g. entity is a node if topodim=MT_VERTEX (see StgDomain/Mesh/src/types.h))
  Example:

  globalNodeNumber=Mesh_DomainToGlobal( feMesh, MT_VERTEX, localNodeNumber);
  
  Note:
  "Local" refers to entities on local processor that are in the domain of that the current processor.
  "Domain" refers to "Local" entities as well as entities from the shadowed region.
  So Domain is a superset of Local.

  This function can be used with "Local" indices as well as "Domain" indices
  because it is generally assumed that any Shadow entity is always numbered after a Local
  entity. So the Local and Domain indices are equal for all "Local" indices.

  @*/
unsigned Mesh_DomainToGlobal( void* mesh, MeshTopology_Dim topodim, unsigned domain ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	return Sync_DomainToGlobal( IGraph_GetDomain( self->topo, topodim ), domain );
}
コード例 #6
0
Bool Mesh_GlobalToDomain( void* mesh, MeshTopology_Dim topodim, unsigned global, unsigned* domain ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	return Sync_TryGlobalToDomain( IGraph_GetDomain( self->topo, topodim ), global, domain );
}
コード例 #7
0
unsigned Mesh_GetSharedSize( void* mesh, MeshTopology_Dim topodim ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	return Sync_GetNumShared( IGraph_GetDomain( self->topo, topodim ) );
}
コード例 #8
0
/*@
  Mesh_GetLocalSize
  -returns number of entities on local processor
  Example:
  to get the number of nodes on local processor in Mesh
  numLocalNodes = Mesh_GetLocalSize( Mesh,  MT_VERTEX);
  
  MT_VERTEX is a MeshTopology_Dim and denotes a node as opposed to an edge say.
  (see StgDomain/Mesh/src/types.h)

  Note:
  "Local" refers to entities on local processor that are in the domain of that the current processor.
  "Domain" refers to "Local" entities as well as entities from the shadowed region.
  So Domain is a superset of Local.

  @*/
unsigned Mesh_GetLocalSize( void* mesh, MeshTopology_Dim topodim ) {
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

        return Decomp_GetNumLocals( Sync_GetDecomp( IGraph_GetDomain( self->topo, topodim ) ) );
}
コード例 #9
0
void Mesh_GetSharers(
	void*					mesh,
	MeshTopology_Dim	topodim,
	unsigned				shared, 
	unsigned*			nSharers,
	unsigned**			sharers )
{
	Mesh*	self = (Mesh*)mesh;

	assert( self );
	assert( self->topo );

	Sync_GetSharers( IGraph_GetDomain( self->topo, topodim ), shared, nSharers, sharers );
}
コード例 #10
0
/*--------------------------------------------------------------------------------------------
** Public Functions
*/
void LinearSpaceAdaptor_Generate( void* _self, void* _mesh, void* data ) {
  LinearSpaceAdaptor* self = (LinearSpaceAdaptor*)_self;
  Mesh* mesh = (Mesh*)_mesh;
  const Sync* sync;
  double	x;
  Index  n_i;

  /* Build base mesh (assumed to be cartesian) */
  MeshGenerator_Generate( self->generator, mesh, data );

  if( self->loadFromCheckPoint )
    return;

  /* Loop over domain nodes. */
  sync = IGraph_GetDomain( mesh->topo, MT_VERTEX );
  
  if( self->nSegmentsx > 0 ) {
    for( n_i = 0; n_i < Sync_GetNumDomains( sync ); n_i++ ) {
      /* get the x coord */
      x = Mesh_GetVertex( mesh, n_i )[I_AXIS];

      if( x != self->minX && x != self->maxX ) {	      
		  /* normalize the x coord*/
		  x = (x - self->minX) / (self->maxX - self->minX);
		  /* map the normalized point */
		  x = LinearSpaceAdaptor_MapPoint( self->tablex, self->nSegmentsx, x  );
		  /* denormalize mapped point */
		  x = (self->maxX - self->minX)*x + self->minX;
		  /* move the node */
		  Mesh_GetVertex( mesh, n_i )[I_AXIS] = x;
      }
    }
  }

  if( self->nSegmentsy > 0 ) {
    for( n_i = 0; n_i < Sync_GetNumDomains( sync ); n_i++ ) {
      /* get the y coord */
      x = Mesh_GetVertex( mesh, n_i )[J_AXIS];

      if( x != self->minY && x != self->maxY ) {
		  /* normalize the y coord*/
		  x = (x - self->minY) / (self->maxY - self->minY);
		  /* map the normalized point */
		  x = LinearSpaceAdaptor_MapPoint( self->tabley, self->nSegmentsy, x  );
		  /* denormalize mapped point */
		  x = (self->maxY - self->minY)*x + self->minY;
		  /* move the node */
		  Mesh_GetVertex( mesh, n_i )[J_AXIS] = x;
      }
    }
  }  

  if( self->nSegmentsz > 0 ) {
    for( n_i = 0; n_i < Sync_GetNumDomains( sync ); n_i++ ) {
      /* get the x coord */
      x = Mesh_GetVertex( mesh, n_i )[K_AXIS];

      if( x != self->minZ && x != self->maxZ ) {	      
		  /* normalize the z coord*/
		  x = (x - self->minZ) / (self->maxZ - self->minZ);
		  /* map the normalized point */
		  x = LinearSpaceAdaptor_MapPoint( self->tablez, self->nSegmentsz, x  );
		  /* denormalize mapped point */
		  x = (self->maxZ - self->minZ)*x + self->minZ;
		  /* move the node */
		  Mesh_GetVertex( mesh, n_i )[K_AXIS] = x;
      }
    }
  }
}