void _RateFieldTimeIntegrator_Initialise( void* rateFieldTimeIntegrator, void* data ) {
   RateFieldTimeIntegrator* self  = (RateFieldTimeIntegrator*) rateFieldTimeIntegrator;

   Stg_Component_Initialise( self->swarm          , data, False );
   Stg_Component_Initialise( self->rateField, data, False );

}
void _ParticleMelting_Initialise( void* _self, void* data ) {
	ParticleMelting* self = (ParticleMelting*) _self;
   unsigned par_i, lpartCount;
   MaterialPoint *particle;
   ParticleMelting_ParExt *parExt;

	Stg_Component_Initialise( self->temperatureField, data, False );
	Stg_Component_Initialise( self->materialSwarm, data, False );
	if( self->pressureField )
	  Stg_Component_Initialise( self->pressureField, data, False );
	if( self->scaling )
	  Stg_Component_Initialise( self->scaling, data, False );

	
	if( !self->context->loadFromCheckPoint ) {

	  lpartCount = self->materialSwarm->particleLocalCount;
	  
	  for( par_i = 0 ; par_i < lpartCount ; par_i++  ) {
		 particle = (MaterialPoint*)Swarm_ParticleAt( self->materialSwarm, par_i );
		 parExt = ExtensionManager_Get( self->materialSwarm->particleExtensionMgr, particle, self->particleExtHandle );
		 
		 /* initialise all */
		 parExt->melt = 0;
		 parExt->F = 0;
		 parExt->prevF = 0;
		 parExt->maxTheta = 0;
	  }
	}
}
void _DruckerPrager_Extra_Initialise( void* rheology, void* data ) {
    DruckerPrager_Extra*                  self                  = (DruckerPrager_Extra*) rheology;
    Particle_Index                  lParticle_I;
    Particle_Index                  particleLocalCount;
    XYZ                             slip                  = { 0.0,0.0,0.0 };
    double*                         ptr;
    _VonMises_Initialise( self, data );

    /* We should only set initial conditions if in regular non-restart mode. If in restart mode, then
    the particle-based variables will be set correcty when we re-load the Swarm. */
    if ( self->context->loadSwarmsFromCheckpoint == False ) {
        Stg_Component_Initialise( self->tensileFailure, data, False );
        Stg_Component_Initialise( self->slip, data, False );
        Stg_Component_Initialise( self->slipRate, data, False );
        Stg_Component_Initialise( self->fullySoftened, data, False );
        /* We don't need to Initialise hasYieldedVariable because it's a parent variable and _YieldRheology_Initialise
         * has already been called */
        particleLocalCount = self->hasYieldedVariable->variable->arraySize;

        for ( lParticle_I = 0 ; lParticle_I < particleLocalCount ; lParticle_I++ ) {

            Variable_SetValueChar( self->hasYieldedVariable->variable, lParticle_I, False );
            Variable_SetValueChar( self->tensileFailure->variable,lParticle_I, False );
            Variable_SetValueDouble( self->plasticStrainRate->variable,     lParticle_I, 0.0 );
            Variable_SetValueDouble( self->backgroundStrainRate->variable,     lParticle_I, 0.0 );
            ptr = Variable_GetPtrDouble( self->slip->variable, lParticle_I );
            memcpy( ptr, slip, sizeof(Coord) );
            Variable_SetValueDouble( self->slipRate->variable, data, 0.0 );
            Variable_SetValueInt( self->fullySoftened->variable, data, 0 );

        }
    }
}
Ejemplo n.º 4
0
void _Mesh_Initialise( void* mesh, void* data ) {
	Mesh*	self = (Mesh*)mesh;

	if( self->algorithms ) Stg_Component_Initialise( self->algorithms, data, False );
	if( self->generator ) Stg_Component_Initialise( self->generator, data, False );


}
void _Trubitsyn2006_Initialise( void* analyticSolution, void* data ) {
   Trubitsyn2006* self = (Trubitsyn2006*)analyticSolution;

   Stg_Component_Initialise(self->velocityField, data, False);
   Stg_Component_Initialise(self->pressureField, data, False);

   _Codelet_Initialise( self, data );
}
void _MeshAdaptor_Initialise( void* _adaptor, void* data ) {
   MeshAdaptor*      self = (MeshAdaptor*)_adaptor;
	if( self->generator )
	  Stg_Component_Initialise( self->generator, data, False );
	if( self->srcMesh )
	  Stg_Component_Initialise( self->srcMesh, data, False );
   _MeshGenerator_Initialise( self, data );
   
}
Ejemplo n.º 7
0
void _SwarmAdvector_Initialise( void* swarmAdvector, void* data ) {
	SwarmAdvector*	self = (SwarmAdvector*) swarmAdvector;

   Stg_Component_Initialise( self->velocityField, data, False );
   Stg_Component_Initialise( self->swarm, data, False );
	if ( self->periodicBCsManager )
		Stg_Component_Initialise( self->periodicBCsManager, data, False );
	_TimeIntegrand_Initialise( self, data );
}
void _Spherical_CubedSphereNusselt_Initialise( void* component, void* data ) {
   Spherical_CubedSphereNusselt*   self = (Spherical_CubedSphereNusselt*)component;

   Stg_Component_Initialise( self->gaussSwarm, data, False );
   Stg_Component_Initialise( self->advectiveHeatFluxField, data, False );
   Stg_Component_Initialise( self->temperatureTotalDerivField, data, False );
   
   _Codelet_Initialise( component, data );
}
void _StoreVisc_Initialise( void* _self, void* data ) {
	StoreVisc*  self               = (StoreVisc*) _self;

	/* Initialise parent */
	_Rheology_Initialise( self, data );

	Stg_Component_Initialise(	self->swarmVariable, data, False);	
	Stg_Component_Initialise(	self->materialPointsSwarm, data, False);

}
void _SUPGAdvDiffTermPpc_Initialise( void* residual, void* data ) {
   SUPGAdvDiffTermPpc* self = (SUPGAdvDiffTermPpc*)residual;

   _ForceTerm_Initialise( self, data );

   //Stg_Component_Initialise( self->sle, data, False );
   Stg_Component_Initialise( self->velocityField, data, False );
   Stg_Component_Initialise( self->phiField, data, False );
   Stg_Component_Initialise( self->mgr, data, False );
}
Ejemplo n.º 11
0
void _Underworld_Vrms_Initialise( void* component, void* data ) {
   Underworld_Vrms* self = (Underworld_Vrms*)component;

   assert( self );

   Stg_Component_Initialise( self->gaussSwarm, data, False );
   Stg_Component_Initialise( self->velocityField, data, False );
   Stg_Component_Initialise( self->velocitySquaredField, data, False );
   
   _Codelet_Initialise( self, data );
}
void _StiffnessMatrixTerm_Initialise( void* stiffnessMatrixTerm, void* data ) {
	StiffnessMatrixTerm* self = (StiffnessMatrixTerm*)stiffnessMatrixTerm;
	
	Journal_DPrintf( self->debug, "In %s - for %s\n", __func__, self->name );
	Stream_IndentBranch( StgFEM_Debug );

	Stg_Component_Initialise( self->integrationSwarm, data, False );
	if ( self->extraInfo ) 
		Stg_Component_Initialise( self->extraInfo, data, False );
	
	Stream_UnIndentBranch( StgFEM_Debug );
}
void ElementCellLayoutSuite_Setup( ElementCellLayoutSuiteData* data ) {
   Journal_Enable_AllTypedStream( False );

   /* MPI Initializations */   
   data->comm = MPI_COMM_WORLD;  
   MPI_Comm_rank( data->comm, &data->rank );
   MPI_Comm_size( data->comm, &data->nProcs );

   data->nDims = 3;
   data->meshSize[0] = 2;
   data->meshSize[1] = 3;
   data->meshSize[2] = 2;
   data->minCrds[0] = 0.0;
   data->minCrds[1] = 0.0;
   data->minCrds[2] = 0.0;
   data->maxCrds[0] = 300.0;
   data->maxCrds[1] = 12.0;
   data->maxCrds[2] = 300.0;

   /* Init mesh */
   data->extensionMgr_Register = ExtensionManager_Register_New();
   data->mesh = ElementCellLayout_BuildMesh( data->nDims, data->meshSize, data->minCrds, data->maxCrds, data->extensionMgr_Register );
   
   /* Configure the element-cell-layout */
   data->elementCellLayout = ElementCellLayout_New( "elementCellLayout", NULL, data->mesh );
   Stg_Component_Build( data->elementCellLayout, NULL, False );
   Stg_Component_Initialise( data->elementCellLayout, NULL, False );
}
void _NonNewtonianAbs_Initialise( void* _self, void* data ){
	NonNewtonianAbs*  self = (NonNewtonianAbs*)_self;

   _Rheology_Initialise( self, data );

   Stg_Component_Initialise( self->strainRateInvField, data, False );
}
void _IntegrationPointsSwarm_Initialise( void* integrationPoints, void* data ) {
   IntegrationPointsSwarm* self = (IntegrationPointsSwarm*) integrationPoints;

   Journal_DPrintf( self->debug, "In %s(): for swarm \"%s\":\n", __func__, self->name );
   Stream_IndentBranch( Swarm_Debug );

   _Swarm_Initialise( self, data );

   Stg_Component_Initialise( self->localCoordVariable, data, False );
   Stg_Component_Initialise( self->weightVariable, data, False );
   Stg_Component_Initialise( self->mesh, data, False );

   Stream_UnIndentBranch( Swarm_Debug );
   Journal_DPrintf( self->debug, "...done in %s() for swarm \"%s\".\n",
      __func__, self->name );
}
void _PpcFeVariable_Initialise( void* _self, void* data ) {
	PpcFeVariable*      self = (PpcFeVariable*) _self;

   Stg_Component_Initialise( self->ppcMan, data, False );

   _ParticleFeVariable_Initialise( self, data );
}
Ejemplo n.º 17
0
Variable* Mesh_GenerateElGlobalIdVar( void* mesh ) {
    /* Returns a Variable that stores the global element indices.
     * Assumes the number of mesh elements never changes.
     */

    Mesh* self = (Mesh*)mesh;
    char* name;
    unsigned dim;

    // if variable already exists return it
    if( self->eGlobalIdsVar ) return self->eGlobalIdsVar;

    dim = Mesh_GetDimSize(mesh);
    // Create the Variable data structure, int[local node count] 
    self->lEls = Mesh_GetLocalSize( self, dim );
    self->elgid = Memory_Alloc_Array( int, self->lEls, "Mesh::vertsgid" );
    Stg_asprintf( &name, "%s-%s", self->name, "verticesGlobalIds" );
    self->eGlobalIdsVar = Variable_NewScalar( name, NULL, Variable_DataType_Int, &self->lEls, NULL, (void**)&self->elgid, NULL );
    Stg_Component_Build(self->eGlobalIdsVar, NULL, False);
    Stg_Component_Initialise(self->eGlobalIdsVar, NULL, False);
    free(name);

    // Evaluate the global indices for the local nodes
    int ii, gid;
    for( ii=0; ii<self->lEls; ii++ ) {
        gid = Mesh_DomainToGlobal( self, dim, ii );
        Variable_SetValue( self->eGlobalIdsVar, ii, (void*)&gid );
    }

    // return new variable
    return self->eGlobalIdsVar;
}
void _GALENonNewtonian_Initialise( void* _self, void* data ){
	GALENonNewtonian*  self = (GALENonNewtonian*)_self;

   _Rheology_Initialise( self, data );

   Stg_Component_Initialise( self->strainRateInvField, data, False );
}
void _BelowHeightField_Initialise( void* belowHeightField, void* data ) {
   BelowHeightField* self = (BelowHeightField*)belowHeightField;

   Stg_Component_Initialise( self->heightField, NULL, False ); 

   _Stg_Shape_Initialise( self, data );
}
Ejemplo n.º 20
0
void _MeshParticleLayout_Initialise( void* meshParticleLayout, void* data ) {
	MeshParticleLayout*       self = (MeshParticleLayout*)meshParticleLayout;

	assert( self );

	Stg_Component_Initialise( self->mesh, NULL, False );
}
void _VariableCondition_Initialise( void* variableCondition, void* data ) {
	VariableCondition*	self = (VariableCondition*)variableCondition;
	Index						i;
	Index                       cf_I;

	/* lets init any condition functions that require it */
	if(self->conFunc_Register){
	    for( cf_I = 0; cf_I < self->conFunc_Register->count; cf_I++ ) {
	       if( self->conFunc_Register->_cf[cf_I]->init )
	          ConditionFunction_InitFunc(self->conFunc_Register->_cf[cf_I], self->context);
	    }
	}
	
	for( i = 0; i < self->indexCount; i++ ) {
		VariableCondition_VariableIndex	vcVar_I;
		
		for( vcVar_I = 0; vcVar_I < self->vcVarCountTbl[i]; vcVar_I++ ) {
			Variable* var;
			
			/* Force the building of the variable (to be safe) */
			var = self->variable_Register->_variable[self->vcTbl[i][vcVar_I].varIndex];
			Stg_Component_Initialise( var, data, False );
		}
	}
}
Ejemplo n.º 22
0
void Stg_ComponentFactory_InitialiseComponents( Stg_ComponentFactory* self, void* data ) {
   Stg_Component*                         component                    = NULL;
   Index                                  component_I;
   Stream*                                stream;
   
   assert( self );
   
   stream = self->infoStream;

   if( self->componentDict ){
      Journal_Printf( stream, "\nInitialising Stg_Components from the live-component register\n\n" );
      Stream_Indent( stream );
   
      for( component_I = 0; component_I < LiveComponentRegister_GetCount( self->LCRegister ); component_I++ ){
         /* Grab component from register */
         component = LiveComponentRegister_At( self->LCRegister, component_I );
         if( component && !component->isInitialised ){
            Stg_Component_Initialise( component, data, True );
         }
      }
      Stream_UnIndent( stream );
   }
   else{
      Journal_Printf( stream, "No Stg_ComponentList found..!\n" );
   }
}
Ejemplo n.º 23
0
void _HeatingForce_Initialise( void* heatingForce, void* data ) {
	HeatingForce*		self			= (HeatingForce*)heatingForce;

	if( self->cmm ) Stg_Component_Initialise( self->cmm, data, False );

	_ParticleFeVariable_Initialise( self, data );
}
void _MultigridSolver_Initialise( void* matrixSolver, void* data ) {
	MultigridSolver*	self = (MultigridSolver*)matrixSolver;

	assert( self && Stg_CheckType( self, MultigridSolver ) );

	if( self->opGen )
		Stg_Component_Initialise( self->opGen, data, False );
}
Ejemplo n.º 25
0
void _SwarmDump_Initialise( void* swarmDump, void* data ) {
	SwarmDump*	 self                = (SwarmDump*)     swarmDump;
	Index        swarm_I;

	for ( swarm_I = 0 ; swarm_I < self->swarmCount ; swarm_I++ ) {
		Stg_Component_Initialise( self->swarmList[ swarm_I ], data, False );
	}
}
void _PETScMGSolver_Initialise( void* matrixSolver, void* data ) {
	PETScMGSolver*	self = (PETScMGSolver*)matrixSolver;

	assert( self && Stg_CheckType( self, PETScMGSolver ) );

	if( self->opGen )
		Stg_Component_Initialise( self->opGen, data, False );
}
Ejemplo n.º 27
0
void _Remesher_Initialise( void* remesher, void* data ) {
    Remesher*	self = (Remesher*)remesher;

    assert( self );

    /*Stg_Component_Initialise( self->remeshFunc, data, False );*/
    Stg_Component_Initialise( self->mesh, data, False );
}
void _Ppc_IsInsideShape_Initialise( void* _self, void* data ) {
   Ppc_IsInsideShape* self = (Ppc_IsInsideShape*)_self;

	/* Initialize parent */
	_Ppc_Initialise( self, data );

   Stg_Component_Initialise( self->shape, NULL, False );
}
Ejemplo n.º 29
0
void _SwarmVariable_Initialise( void* swarmVariable, void* data ) {
	SwarmVariable*	        self         = (SwarmVariable*)swarmVariable;

	if ( self->variable ) {
		Variable_Update( self->variable );
		Stg_Component_Initialise( self->variable, data, False );
	}
}
void _ElementCellLayout_Initialise( void *elementCellLayout, void *data ){
	ElementCellLayout* self = (ElementCellLayout*)elementCellLayout;
	Stg_Component_Initialise( self->mesh, data, False );

	if( !self->mesh->isRegular ) {
	   self->_cellOf = _ElementCellLayout_CellOf_Irregular;
	}

}