def saveCurvaturesAndStrains(allFibers,CLNet,OutputFileName,wora='a'): Xf = allFibers.getX(); LinkStrains = CLNet.calcLinkStrains(allFibers.getUniformPoints(Xf), Dom); LinkStrainSqu = np.sum(LinkStrains**2); FibCurvatures = allFibers.calcCurvatures(Xf); writeArray('DynamicRheo/LinkStrains'+OutputFileName,[LinkStrainSqu],wora=wora) writeArray('DynamicRheo/FibCurves'+OutputFileName,FibCurvatures,wora=wora)
def saveCurvaturesAndStrains(nFib, nCL, allFibers, CLNet, rl, wora='a'): Xf = allFibers.getX() LinkStrains = CLNet.calcLinkStrains(allFibers.getUniformPoints(Xf), Dom) FibCurvatures = allFibers.calcCurvatures(Xf) if (nCL > 0): writeArray('SSLinkStrainsF' + str(nFib) + 'C' + str(nCL) + 'rl' + str(rl) + '.txt', LinkStrains, wora=wora) writeArray('SSFibCurvesF' + str(nFib) + 'C' + str(nCL) + 'rl' + str(rl) + '.txt', FibCurvatures, wora=wora)
def saveCurvaturesAndStrains(nFib, konCL, allFibers, CLNet, rl, OutputFileName, wora='a'): Xf = allFibers.getX() LinkStrains = CLNet.calcLinkStrains(allFibers.getUniformPoints(Xf), Dom) LinkStrainSqu = np.sum(LinkStrains**2) FibCurvatures = allFibers.calcCurvatures(Xf) writeArray('BundlingBehavior/LinkStrains' + OutputFileName, [LinkStrainSqu], wora=wora) writeArray('BundlingBehavior/FibCurvesF' + OutputFileName, FibCurvatures, wora=wora)
def saveCurvaturesAndStrains(omega, nFib, nCL, allFibers, CLNet, HydroStr, wora='a'): Xf = allFibers.getX() LinkStrains = CLNet.calcLinkStrains(allFibers.getUniformPoints(Xf), Dom) FibCurvatures = allFibers.calcCurvatures(Xf) if (nCL > 0): writeArray('DynamicLinkStrains' + HydroStr + 'Om' + str(omega) + 'F' + str(nFib) + 'C' + str(nCL) + '.txt', LinkStrains, wora=wora) writeArray('DynamicFibCurves' + HydroStr + 'Om' + str(omega) + 'F' + str(nFib) + 'C' + str(nCL) + '.txt', FibCurvatures, wora=wora)
numBundlesSep = np.zeros(numSaves, dtype=np.int64) numBundlesSep[0], labels[0, :] = CLNet.FindBundles(bunddist) AllOrders_Sep, NPerBundleAll_Sep, AllaverageBundleTangents = CLNet.BundleOrderParameters( allFibers, numBundlesSep[0], labels[0, :], minPerBundle=2) numBundlesSep[0] = len(AllOrders_Sep) avgBundleAlignment_Sep = np.zeros(numSaves) avgBundleAlignment_Sep[0] = CLNet.avgBundleAlignment( AllOrders_Sep, NPerBundleAll_Sep) LocalAlignment, numCloseBy = CLNet.LocalOrientations(1, allFibers) NumFibsConnected[0, :] = numCloseBy AllLocalAlignment[0, :] = LocalAlignment if (nonLocal == 3): writeArray('DynamicRheo/ItsNeeded' + outFile, [-1], wora='w') for iT in range(stopcount): wr = 0 if ((iT % saveEvery) == (saveEvery - 1)): print('Time %1.2E' % (float(iT) * dt)) wr = 1 mythist = time.time() doStress = False if ((iT % stressEvery) == (stressEvery - 1)): doStress = True maxX, itsneeded, stressArray = TIntegrator.updateAllFibers(iT,dt,stopcount,Dom,Ewald,\ outfile=of,write=wr,updateNet=updateNet,turnoverFibs=turnover,stress=doStress) if (nonLocal == 3): writeArray('DynamicRheo/ItsNeeded' + outFile, [itsneeded], wora='a') #print('MAIN Time step time %f ' %(time.time()-mythist));
stopcount, Dom, Ewald, grav / Lf, of, write=wr) Lamstress[iT], Elstress[iT], CLstress[iT] = TIntegrator.computeStress( Dom, iT, dt) #if (iT==699): # writeArray('Lambdas'+HydroStr+'.txt',TIntegrator._allFibers.getLambdas()); if (wr == 1): print('Max x: %f' % (maxX)) # saveCurvaturesAndStrains(omHz,nFib,nCL,allFibers,CLNet,HydroStr) writeArray( 'LambdaStress' + HydroStr + 'Om' + str(omHz) + 'F' + str(nFib) + 'C' + str(nCL) + 'REV.txt', Lamstress) writeArray( 'ElasticStress' + HydroStr + 'Om' + str(omHz) + 'F' + str(nFib) + 'C' + str(nCL) + 'REV.txt', Elstress) writeArray( 'CLStress' + HydroStr + 'Om' + str(omHz) + 'F' + str(nFib) + 'C' + str(nCL) + 'REV.txt', CLstress) #ofFinalX = prepareOutFile('DynamicSSLocationsOm'+str(omHz)+'F'+str(nFib)+'C'+str(nCL)+'REV.txt'); #allFibers.writeFiberLocations(ofFinalX); #ofFinalXs = prepareOutFile('DynamicTangentVecsOm'+str(omHz)+'F'+str(nFib)+'C'+str(nCL)+'REV.txt'); #allFibers.writeFiberTangentVectors(ofFinalXs); # Destruction and cleanup of.close()