plt.xlabel('Position')
plt.ylabel('Value')
plt.title('1D finite elements \n for Laplace operator')
-plt.savefig('FiniteElements1DPoisson_ResultField_'+str(nbNodes) + '_nodes'+'.png')
+plt.savefig("FiniteElements1DPoisson_ResultField_"+str(nbNodes) + '_nodes'+".png")
print("Numerical solution of the 1D Poisson equation using finite elements done")
Ck=my_mesh.getCell(k)
distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
coeff=Fj.getMeasure()/Ci.getMeasure()/distance
- Rigidite.addValue(i,k,-coeff) # terme extradiagonal
+ Rigidite.setValue(i,k,-coeff) # terme extradiagonal
else:
coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter())
#For the particular case where the mesh boundary does not coincide with the domain boundary
Ck=my_mesh.getCell(k)
distance=Ci.getBarryCenter().distance(Ck.getBarryCenter())
coeff=Fj.getMeasure()/Ci.getMeasure()/distance
- Rigidite.setValue(i,k,-coeff) # terme extradiagonal
+ Rigidite.addValue(i,k,-coeff) # terme extradiagonal
else:
coeff=Fj.getMeasure()/Ci.getMeasure()/Ci.getBarryCenter().distance(Fj.getBarryCenter())
Rigidite.addValue(i,i,coeff) # terme diagonal
../ressources/
)
-file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/tests/ressources)
+file(COPY ${MESH_MED2} DESTINATION ${CMAKE_BINARY_DIR}/CDMATH/tests/ressources)
install(DIRECTORY ${MESH_MED2} DESTINATION share/meshes)