list<ImportStep *> * getImportStep() { string ImportNode = "Import"; TiXmlElement *pNode = NULL; vector<TiXmlElement *> Nodes; if (GetNodePointerByName(pProjectNodes,ImportNode,pNode)) { string name = "Name"; string url = "Url"; string importItem = "ImportItem"; GetNodePointer(pNode,&Nodes); list<ImportStep *> *importStep = new list<ImportStep *>(); for (int i=0;i<Nodes.size();i++) { ImportStep *step = new ImportStep(); vector<TiXmlElement *> tNodes; GetNodePointer(Nodes.at(i),&tNodes); step->SetName(tNodes.at(0)->GetText()); step->SetUrl(tNodes.at(1)->GetText()); list<ImportItem *> itemList; for(int i=2;i<tNodes.size();i++){ string source = "Source"; string target = "Target"; ImportItem *item = new ImportItem(); if (GetChildNodeByName(tNodes.at(i),source,pNode)) { item->SetSource(pNode->GetText()); }else return false; if (GetChildNodeByName(tNodes.at(i),target,pNode)) { item->SetTarget(pNode->GetText()); }else return false; itemList.push_back(item); //delete item; } step->setItem(itemList); importStep->push_back(step); //delete step; } //delete pNode; return importStep; }else return NULL; }
list<BuildStep *> *getBuildStep() { string ProcessNode = "Process"; TiXmlElement *pNode = NULL; vector<TiXmlElement *> Nodes; if (GetNodePointerByName(pProjectNodes,ProcessNode,pNode)) { string name = "Name"; string program = "Program"; string options = "Options"; GetNodePointer(pNode,&Nodes); list<BuildStep *> *buildStep = new list<BuildStep *>(); for (int i=0;i<Nodes.size();i++) { BuildStep *step = new BuildStep(); if (GetNodePointerByName(Nodes.at(i),name,pNode)) { step->SetName(pNode->GetText()); } else { return false; } if (GetChildNodeByName(Nodes.at(i),program,pNode)) { step->SetProgram(pNode->GetText()); }else return false; if (GetChildNodeByName(Nodes.at(i),options,pNode)) { if (pNode==NULL) { step->SetOptions(""); } else step->SetOptions(pNode->GetText()); }else return false; buildStep->push_back(step); //delete step; } //delete pNode; return buildStep; } else { return NULL; } }
Publish * getPublish() { string PublishNode = "Publish"; TiXmlElement *pNode = NULL; vector<TiXmlElement *> Nodes; if (GetNodePointerByName(pProjectNodes,PublishNode,pNode)) { string url = "Url"; string category = "Category"; string component = "Component"; string version = "Version"; string importItem = "ImportItem"; Publish *publish = new Publish(); TiXmlElement * pTempNode = pNode; GetNodePointer(pTempNode,&Nodes); publish->SetUrl(Nodes.at(0)->GetText()); publish->SetCategory(Nodes.at(1)->GetText()); publish->SetComponent(Nodes.at(2)->GetText()); publish->SetVersion(Nodes.at(3)->GetText()); list<ImportItem *> itemList ; for(int i=4;i<Nodes.size();i++){ string source = "Source"; string target = "Target"; ImportItem *item = new ImportItem(); if (GetChildNodeByName(Nodes.at(i),source,pNode)) { item->SetSource(pNode->GetText()); }else return false; if (GetChildNodeByName(Nodes.at(i),target,pNode)) { item->SetTarget(pNode->GetText()); }else return false; itemList.push_back(item); } publish->SetImportItem(itemList); return publish; } else { return NULL; } }
// Get mass matrix, find dimensionless particle locations, // and find grid momenta void MassAndMomentumTask::Execute(void) { CommonException *massErr = NULL; double fn[maxShapeNodes],xDeriv[maxShapeNodes],yDeriv[maxShapeNodes],zDeriv[maxShapeNodes]; int nds[maxShapeNodes]; #pragma mark ... UPDATE RIGID CONTACT PARTICLES // Set rigid BC contact material velocities first (so loop can be parallel) // GetVectorSetting() uses globals and therefore can't be parallel if(nmpmsRC>nmpmsNR) { Vector newvel; bool hasDir[3]; for(int p=nmpmsNR;p<nmpmsRC;p++) { MPMBase *mpmptr = mpm[p]; const RigidMaterial *matID = (RigidMaterial *)theMaterials[mpm[p]->MatID()]; if(matID->GetVectorSetting(&newvel,hasDir,mtime,&mpmptr->pos)) { // change velocity if functions being used, otherwise keep velocity constant if(hasDir[0]) mpmptr->vel.x = newvel.x; if(hasDir[1]) mpmptr->vel.y = newvel.y; if(hasDir[2]) mpmptr->vel.z = newvel.z; } } } // loop over non-rigid and rigid contact particles - this parallel part changes only particle p // mass, momenta, etc are stored on ghost nodes, which are sent to real nodes in next non-parallel loop //for(int pn=0;pn<4;pn++) #pragma omp parallel private(fn,xDeriv,yDeriv,zDeriv,nds) { // thread for patch pn int pn = GetPatchNumber(); // in case 2D planar for(int i=0;i<maxShapeNodes;i++) zDeriv[i] = 0.; #pragma mark ... EXTRAPOLATE NONRIGID PARTICLES try { for(int block=FIRST_NONRIGID;block<=FIRST_RIGID_CONTACT;block++) { MPMBase *mpmptr = patches[pn]->GetFirstBlockPointer(block); while(mpmptr!=NULL) { const MaterialBase *matID = theMaterials[mpmptr->MatID()]; // material object for this particle int matfld = matID->GetField(); // material velocity field // get nodes and shape function for material point p int i,numnds; const ElementBase *elref = theElements[mpmptr->ElemID()]; // element containing this particle if(fmobj->multiMaterialMode) elref->GetShapeGradients(&numnds,fn,nds,xDeriv,yDeriv,zDeriv,mpmptr); else elref->GetShapeFunctions(&numnds,fn,nds,mpmptr); // Add particle property to each node in the element short vfld; NodalPoint *ndptr; for(i=1;i<=numnds;i++) { // get node pointer ndptr = GetNodePointer(pn,nds[i]); // momentum vector (and allocate velocity field if needed) vfld = mpmptr->vfld[i]; ndptr->AddMassMomentum(mpmptr,vfld,matfld,fn[i],xDeriv[i],yDeriv[i],zDeriv[i], 1,block==FIRST_NONRIGID); } // next material point mpmptr = (MPMBase *)mpmptr->GetNextObject(); } } } catch(CommonException err) { if(massErr==NULL) { #pragma omp critical massErr = new CommonException(err); } } catch(...) { cout << "Unknown exception in MassAndMomentumTask()" << endl; } } // throw now - only possible error if too many CPDI nodes in 3D if(massErr!=NULL) throw *massErr; // reduction of ghost node forces to real nodes int totalPatches = fmobj->GetTotalNumberOfPatches(); if(totalPatches>1) { for(int pn=0;pn<totalPatches;pn++) patches[pn]->MassAndMomentumReduction(); } #pragma mark ... RIGID BOUNDARY CONDITIONS // undo dynamic velocity, temp, and conc BCs from rigid materials // and get pointer to first empty one in reuseRigid...BC UnsetRigidBCs((BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); UnsetRigidBCs((BoundaryCondition **)&firstTempBC,(BoundaryCondition **)&lastTempBC, (BoundaryCondition **)&firstRigidTempBC,(BoundaryCondition **)&reuseRigidTempBC); UnsetRigidBCs((BoundaryCondition **)&firstConcBC,(BoundaryCondition **)&lastConcBC, (BoundaryCondition **)&firstRigidConcBC,(BoundaryCondition **)&reuseRigidConcBC); // For Rigid BC materials create velocity BC on each node in the element for(int p=nmpmsRC;p<nmpms;p++) { MPMBase *mpmptr = mpm[p]; // pointer int matid0 = mpmptr->MatID(); const MaterialBase *matID = theMaterials[matid0]; // material object for this particle RigidMaterial *rigid=(RigidMaterial *)matID; const ElementBase *elref = theElements[mpmptr->ElemID()]; // element containing this particle int numnds=elref->NumberNodes(); double rvalue; for(int i=1;i<=numnds;i++) { int mi=elref->nodes[i-1]; // 1 based node // look for setting function in one to three directions // GetVectorSetting() returns true if function has set the velocity, otherwise it return FALSE bool hasDir[3]; Vector rvel; if(rigid->GetVectorSetting(&rvel,hasDir,mtime,&mpmptr->pos)) { // velocity set by 1 to 3 functions as determined by hasDir[i] if(hasDir[0]) { mpmptr->vel.x = rvel.x; SetRigidBCs(mi,matid0,X_DIRECTION,rvel.x,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } if(hasDir[1]) { mpmptr->vel.y = rvel.y; SetRigidBCs(mi,matid0,Y_DIRECTION,rvel.y,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } if(hasDir[2]) { mpmptr->vel.z = rvel.z; SetRigidBCs(mi,matid0,Z_DIRECTION,rvel.z,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } } else { // velocity set by particle velocity in selected directions if(rigid->RigidDirection(X_DIRECTION)) { SetRigidBCs(mi,matid0,X_DIRECTION,mpmptr->vel.x,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } if(rigid->RigidDirection(Y_DIRECTION)) { SetRigidBCs(mi,matid0,Y_DIRECTION,mpmptr->vel.y,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } if(rigid->RigidDirection(Z_DIRECTION)) { SetRigidBCs(mi,matid0,Z_DIRECTION,mpmptr->vel.z,0.,rigid->mirrored, (BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC, (BoundaryCondition **)&firstRigidVelocityBC,(BoundaryCondition **)&reuseRigidVelocityBC); } } // temperature if(rigid->RigidTemperature()) { if(rigid->GetValueSetting(&rvalue,mtime,&mpmptr->pos)) mpmptr->pTemperature=rvalue; SetRigidBCs(mi,matid0,TEMP_DIRECTION,mpmptr->pTemperature,0.,0, (BoundaryCondition **)&firstTempBC,(BoundaryCondition **)&lastTempBC, (BoundaryCondition **)&firstRigidTempBC,(BoundaryCondition **)&reuseRigidTempBC); } // concentration if(rigid->RigidConcentration()) { if(rigid->GetValueSetting(&rvalue,mtime,&mpmptr->pos)) mpmptr->pConcentration=rvalue; SetRigidBCs(mi,matid0,CONC_DIRECTION,mpmptr->pConcentration,0.,0, (BoundaryCondition **)&firstConcBC,(BoundaryCondition **)&lastConcBC, (BoundaryCondition **)&firstRigidConcBC,(BoundaryCondition **)&reuseRigidConcBC); } } } // if any left over rigid BCs, delete them now RemoveRigidBCs((BoundaryCondition **)&firstVelocityBC,(BoundaryCondition **)&lastVelocityBC,(BoundaryCondition **)&firstRigidVelocityBC); RemoveRigidBCs((BoundaryCondition **)&firstTempBC,(BoundaryCondition **)&lastTempBC,(BoundaryCondition **)&firstRigidTempBC); RemoveRigidBCs((BoundaryCondition **)&firstConcBC,(BoundaryCondition **)&lastConcBC,(BoundaryCondition **)&firstRigidConcBC); #ifdef COMBINE_RIGID_MATERIALS bool combineRigid = firstCrack!=NULL && fmobj->multiMaterialMode && fmobj->hasRigidContactParticles; #endif #pragma mark ... POST EXTRAPOLATION TASKS // Post mass and momentum extrapolation calculations on nodes #pragma omp parallel { // variables for each thread CrackNode *firstCrackNode=NULL,*lastCrackNode=NULL; MaterialInterfaceNode *firstInterfaceNode=NULL,*lastInterfaceNode=NULL; // Each pass in this loop should be independent #pragma omp for nowait for(int i=1;i<=nnodes;i++) { // node reference NodalPoint *ndptr = nd[i]; try { #ifdef COMBINE_RIGID_MATERIALS // combine rigid fields if necessary if(combineRigid) ndptr->CopyRigidParticleField(); #endif // Get total nodal masses and count materials if multimaterial mode ndptr->CalcTotalMassAndCount(); // multimaterial contact if(fmobj->multiMaterialMode) ndptr->MaterialContactOnNode(timestep,MASS_MOMENTUM_CALL,&firstInterfaceNode,&lastInterfaceNode); // crack contact if(firstCrack!=NULL) ndptr->CrackContact(FALSE,0.,&firstCrackNode,&lastCrackNode); // get transport values on nodes TransportTask *nextTransport=transportTasks; while(nextTransport!=NULL) nextTransport = nextTransport->GetNodalValue(ndptr); } catch(CommonException err) { if(massErr==NULL) { #pragma omp critical massErr = new CommonException(err); } } } #pragma omp critical { // link up crack nodes if(lastCrackNode != NULL) { if(CrackNode::currentCNode != NULL) firstCrackNode->SetPrevBC(CrackNode::currentCNode); CrackNode::currentCNode = lastCrackNode; } // link up interface nodes if(lastInterfaceNode != NULL) { if(MaterialInterfaceNode::currentIntNode != NULL) firstInterfaceNode->SetPrevBC(MaterialInterfaceNode::currentIntNode); MaterialInterfaceNode::currentIntNode = lastInterfaceNode; } } } // throw any errors if(massErr!=NULL) throw *massErr; #pragma mark ... IMPOSE BOUNDARY CONDITIONS // Impose transport BCs and extrapolate gradients to the particles TransportTask *nextTransport=transportTasks; while(nextTransport!=NULL) { nextTransport->ImposeValueBCs(mtime); nextTransport = nextTransport->GetGradients(mtime); } // locate BCs with reflected nodes if(firstRigidVelocityBC!=NULL) { NodalVelBC *nextBC=firstRigidVelocityBC; double mstime=1000.*mtime; //cout << "# Find Reflected Nodes" << endl; while(nextBC!=NULL) nextBC = nextBC->SetMirroredVelBC(mstime); } // used to call class methods for material contact and crack contact here // Impose velocity BCs NodalVelBC::GridMomentumConditions(TRUE); }
// Get total grid point forces (except external forces) // throws CommonException() void GridForcesTask::Execute(void) { CommonException *forceErr = NULL; // need to be private in threads #ifdef CONST_ARRAYS double fn[MAX_SHAPE_NODES],xDeriv[MAX_SHAPE_NODES],yDeriv[MAX_SHAPE_NODES],zDeriv[MAX_SHAPE_NODES]; int ndsArray[MAX_SHAPE_NODES]; #else double fn[maxShapeNodes],xDeriv[maxShapeNodes],yDeriv[maxShapeNodes],zDeriv[maxShapeNodes]; int ndsArray[maxShapeNodes]; #endif // loop over non-rigid particles - this parallel part changes only particle p // forces are stored on ghost nodes, which are sent to real nodes in next non-parallel loop #pragma omp parallel private(ndsArray,fn,xDeriv,yDeriv,zDeriv) { // in case 2D planar for(int i=0;i<maxShapeNodes;i++) zDeriv[i] = 0.; // patch for this thread int pn = GetPatchNumber(); try { MPMBase *mpmptr = patches[pn]->GetFirstBlockPointer(FIRST_NONRIGID); while(mpmptr!=NULL) { const MaterialBase *matref = theMaterials[mpmptr->MatID()]; // material class (read only) int matfld = matref->GetField(); // get transport tensors (if needed) TransportProperties t; if(transportTasks!=NULL) matref->GetTransportProps(mpmptr,fmobj->np,&t); // find shape functions and derviatives const ElementBase *elemref = theElements[mpmptr->ElemID()]; int *nds = ndsArray; elemref->GetShapeGradients(fn,&nds,xDeriv,yDeriv,zDeriv,mpmptr); int numnds = nds[0]; // Add particle property to buffer on the material point (needed to allow parallel code) short vfld; NodalPoint *ndptr; for(int i=1;i<=numnds;i++) { vfld = (short)mpmptr->vfld[i]; // crack velocity field to use // total force vector = internal + external forces // (in g mm/sec^2 or micro N) Vector theFrc; mpmptr->GetFintPlusFext(&theFrc,fn[i],xDeriv[i],yDeriv[i],zDeriv[i]); // add body forces (do in outside loop now) // add the total force to nodal point ndptr = GetNodePointer(pn,nds[i]); ndptr->AddFtotTask3(vfld,matfld,&theFrc); #ifdef CHECK_NAN if(theFrc.x!=theFrc.x || theFrc.y!=theFrc.y || theFrc.z!=theFrc.z) { #pragma omp critical (output) { cout << "\n# GridForcesTask::Execute: bad nodal force vfld = " << vfld << ", matfld = " << matfld; PrintVector(" theFrc = ",&theFrc); cout << endl; ndptr->Describe(); } } #endif // transport forces TransportTask *nextTransport=transportTasks; while(nextTransport!=NULL) nextTransport=nextTransport->AddForces(ndptr,mpmptr,fn[i],xDeriv[i],yDeriv[i],zDeriv[i],&t); } // next material point mpmptr = (MPMBase *)mpmptr->GetNextObject(); } } catch(CommonException& err) { if(forceErr==NULL) { #pragma omp critical (error) forceErr = new CommonException(err); } } catch(std::bad_alloc&) { if(forceErr==NULL) { #pragma omp critical (error) forceErr = new CommonException("Memory error","GridForcesTask::Execute"); } } catch(...) { if(forceErr==NULL) { #pragma omp critical (error) forceErr = new CommonException("Unexpected error","GridForcesTask::Execute"); } } } // throw errors now if(forceErr!=NULL) throw *forceErr; // reduction of ghost node forces to real nodes int totalPatches = fmobj->GetTotalNumberOfPatches(); if(totalPatches>1) { for(int pn=0;pn<totalPatches;pn++) patches[pn]->GridForcesReduction(); } }
// Get total grid point forces (except external forces) void UpdateStrainsLastContactTask::Execute(void) { CommonException *uslErr = NULL; int nds[maxShapeNodes]; double fn[maxShapeNodes],xDeriv[maxShapeNodes],yDeriv[maxShapeNodes],zDeriv[maxShapeNodes]; #pragma omp parallel private(nds,fn,xDeriv,yDeriv,zDeriv) { // in case 2D planar for(int i=0;i<maxShapeNodes;i++) zDeriv[i] = 0.; try { #pragma omp for // zero again (which finds new positions for contact rigid particle data on the nodes) for(int i=1;i<=nnodes;i++) nd[i]->RezeroNodeTask6(timestep); // zero ghost nodes on this patch int pn = GetPatchNumber(); patches[pn]->RezeroNodeTask6(timestep); // loop over non-rigid particles only - this parallel part changes only particle p // mass, momenta, etc are stored on ghost nodes, which are sent to real nodes in next non-parallel loop MPMBase *mpmptr = patches[pn]->GetFirstBlockPointer(FIRST_NONRIGID); while(mpmptr!=NULL) { const MaterialBase *matref = theMaterials[mpmptr->MatID()]; int matfld = matref->GetField(); // find shape functions (why ever need gradients?) const ElementBase *elref = theElements[mpmptr->ElemID()]; int numnds; if(fmobj->multiMaterialMode) { // Need gradients for volume gradient elref->GetShapeGradients(&numnds,fn,nds,xDeriv,yDeriv,zDeriv,mpmptr); } else elref->GetShapeFunctions(&numnds,fn,nds,mpmptr); short vfld; NodalPoint *ndptr; for(int i=1;i<=numnds;i++) { // get node pointer ndptr = GetNodePointer(pn,nds[i]); // add mass and momentum this task vfld = (short)mpmptr->vfld[i]; ndptr->AddMassMomentumLast(mpmptr,vfld,matfld,fn[i],xDeriv[i],yDeriv[i],zDeriv[i]); } // next non-rigid material point mpmptr = (MPMBase *)mpmptr->GetNextObject(); } } catch(CommonException err) { if(uslErr==NULL) { #pragma omp critical uslErr = new CommonException(err); } } } // throw errors now if(uslErr!=NULL) throw *uslErr; // reduction of ghost node forces to real nodes int totalPatches = fmobj->GetTotalNumberOfPatches(); if(totalPatches>1) { for(int pn=0;pn<totalPatches;pn++) patches[pn]->MassAndMomentumReductionLast(); } // grid temperature is never updated unless needed here // update nodal values for transport properties (when coupled to strain) TransportTask *nextTransport=transportTasks; while(nextTransport!=NULL) nextTransport=nextTransport->UpdateNodalValues(timestep); // adjust momenta for multimaterial contact if(fmobj->multiMaterialMode) { for(int i=1;i<=nnodes;i++) nd[i]->MaterialContactOnNode(timestep,UPDATE_STRAINS_LAST_CALL,NULL,NULL); } // adjust momenta for crack contact if(firstCrack!=NULL) CrackNode::ContactOnKnownNodes(); // impose grid boundary conditions NodalVelBC::GridMomentumConditions(FALSE); // update strains based on current velocities UpdateStrainsFirstTask::FullStrainUpdate(strainTimestep,(fmobj->mpmApproach==USAVG_METHOD),fmobj->np); }
// Get mass matrix, find dimensionless particle locations, // and find grid momenta void MassAndMomentumTask::Execute(void) { CommonException *massErr = NULL; double fn[maxShapeNodes],xDeriv[maxShapeNodes],yDeriv[maxShapeNodes],zDeriv[maxShapeNodes]; int nds[maxShapeNodes]; #pragma mark ... UPDATE RIGID CONTACT PARTICLES // Set rigid BC contact material velocities first (so loop can be parallel) // GetVectorSetting() uses globals and therefore can't be parallel if(nmpmsRC>nmpmsNR) { Vector newvel; bool hasDir[3]; for(int p=nmpmsNR;p<nmpmsRC;p++) { MPMBase *mpmptr = mpm[p]; const RigidMaterial *matID = (RigidMaterial *)theMaterials[mpm[p]->MatID()]; if(matID->GetVectorSetting(&newvel,hasDir,mtime,&mpmptr->pos)) { // change velocity if functions being used, otherwise keep velocity constant if(hasDir[0]) mpmptr->vel.x = newvel.x; if(hasDir[1]) mpmptr->vel.y = newvel.y; if(hasDir[2]) mpmptr->vel.z = newvel.z; } } } // loop over non-rigid and rigid contact particles - this parallel part changes only particle p // mass, momenta, etc are stored on ghost nodes, which are sent to real nodes in next non-parallel loop //for(int pn=0;pn<4;pn++) #pragma omp parallel private(fn,xDeriv,yDeriv,zDeriv,nds) { // thread for patch pn int pn = GetPatchNumber(); // in case 2D planar for(int i=0;i<maxShapeNodes;i++) zDeriv[i] = 0.; #pragma mark ... EXTRAPOLATE NONRIGID AND RIGID CONTACT PARTICLES try { for(int block=FIRST_NONRIGID;block<=FIRST_RIGID_CONTACT;block++) { MPMBase *mpmptr = patches[pn]->GetFirstBlockPointer(block); while(mpmptr!=NULL) { const MaterialBase *matID = theMaterials[mpmptr->MatID()]; // material object for this particle int matfld = matID->GetField(); // material velocity field // get nodes and shape function for material point p int i,numnds; const ElementBase *elref = theElements[mpmptr->ElemID()]; // element containing this particle if(fmobj->multiMaterialMode) elref->GetShapeGradients(&numnds,fn,nds,xDeriv,yDeriv,zDeriv,mpmptr); else elref->GetShapeFunctions(&numnds,fn,nds,mpmptr); // Add particle property to each node in the element short vfld; NodalPoint *ndptr; for(i=1;i<=numnds;i++) { // get node pointer ndptr = GetNodePointer(pn,nds[i]); // add mass and momentum (and maybe contact stuff) to this node vfld = mpmptr->vfld[i]; ndptr->AddMassMomentum(mpmptr,vfld,matfld,fn[i],xDeriv[i],yDeriv[i],zDeriv[i], 1,block==FIRST_NONRIGID); } // next material point mpmptr = (MPMBase *)mpmptr->GetNextObject(); } } } catch(CommonException err) { if(massErr==NULL) { #pragma omp critical massErr = new CommonException(err); } } catch(...) { cout << "Unknown exception in MassAndMomentumTask()" << endl; } } // throw now - only possible error if too many CPDI nodes in 3D if(massErr!=NULL) throw *massErr; // reduction of ghost node forces to real nodes int totalPatches = fmobj->GetTotalNumberOfPatches(); if(totalPatches>1) { for(int pn=0;pn<totalPatches;pn++) patches[pn]->MassAndMomentumReduction(); } }
list<Dependence *> * getDependences() { vector<TiXmlElement *> Nodes; TiXmlElement *pNode = NULL; string DependencesNode = "Dependences"; if (GetNodePointerByName(pProjectNodes,DependencesNode,pNode)) { string DependenceNode = "Dependence"; GetNodePointer(pNode, &Nodes); list<Dependence *> *depList = new list<Dependence *>(); for (int i=0;i<Nodes.size();i++) { TiXmlElement *pTempNode = Nodes.at(i); string server = "Server"; string flag = "Flag"; string repository = "Repository"; string name = "Name"; string version = "Version"; string path = "Path"; string localPath = "LocalPath"; Dependence *dep = new Dependence(); if (GetChildNodeByName(pTempNode,server,pNode)) { dep->SetServer(pNode->GetText()); }else { return false; } if (GetChildNodeByName(pTempNode,flag,pNode)) { dep->SetFlag(pNode->GetText()); }else { return false; } if (GetChildNodeByName(pTempNode,repository,pNode)) { dep->SetRepository(pNode->GetText()); }else { return false; } if (GetChildNodeByName(pTempNode,name,pNode)) { dep->SetName(pNode->GetText()); } else { return false; } if (GetChildNodeByName(pTempNode,version,pNode)) { dep->SetVersion(pNode->GetText()); }else { return false; } if(GetChildNodeByName(pTempNode,path,pNode)){ dep->SetPath(pNode->GetText()); }else { return false; } if (GetChildNodeByName(pTempNode,localPath,pNode)) { dep->SetLocalPath(pNode->GetText()); } else { return false; } depList->push_back(dep); //delete dep; //delete pTempNode; } //delete pNode; return depList; }else { return NULL; } }