I want to get a set of nodes and take out the temperature values at those nodes to plot it:
here is part of my code:
from fenics import *
import matplotlib.pyplot as plt
import numpy as np
import csv
import os
mesh = Mesh()
with XDMFFile("mesh_5um/mesh_5um.xdmf") as infile:
infile.read(mesh)
H = FunctionSpace(mesh, 'P', 1)
t=150
T=Function(H)
timeseries_T = TimeSeries('Couple_heat_transfer/temperature_series')
timeseries_T.retrieve(T.vector(), t)
T = plot(T)
plt.colorbar(T)
plt.show()
nodes = np.concatenate([np.linspace(0 + DOLFIN_EPS, 3e-8 - DOLFIN_EPS, num=500),np.linspace(3e-8 + DOLFIN_EPS, 2e-6 - DOLFIN_EPS, num=200),np.linspace(2e-6 + DOLFIN_EPS, 10e-6 - DOLFIN_EPS, num=200)])
vertices = []
for i in nodes:
if i not in vertices:
vertices. append(i)
points = [(y_, 2.5e-6) for y_ in vertices]
T_line = np.array([T(point) for point in points])
Here is the error:
TypeError Traceback (most recent call last)
<ipython-input-2-78d0c7048095> in <module>
35 points = [(y_, 2.5e-6) for y_ in vertices]
36 #print('points',points)
---> 37 T_line = np.array([T(point) for point in points])
38
<ipython-input-2-78d0c7048095> in <listcomp>(.0)
35 points = [(y_, 2.5e-6) for y_ in vertices]
36 #print('points',points)
---> 37 T_line = np.array([T(point) for point in points])
38
TypeError: 'TriContourSet' object is not callable
I do not know how to remove this error.
Please help me.