For the function $f(x)$, if $f\left(x_{0}\right)=$ $x_{0}$, then $x_{0}$ is called a fixed point of $f(x)$. Given the function
$$
f(x)=\frac{x}{a x+b}(b>0), f(2)=1,
$$

and it has a unique fixed point in its domain.
(1) Find the expression for $f(x)$;
(2) If the sequence $\left\{a_{n}\right\}$ satisfies
$$
a_{1}=\pi, a_{n+1}=f\left(a_{n}\right)(n \geqslant 1),
$$

find $S_{2011}=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{2011}}$.
(1) Given $f(2)=1$, we have
$$
2 a+b=2 \text {. }
$$

Also, since $f(x)$ has a unique fixed point, the equation
$$
x(a x+b-1)=0
$$

has a unique root (obviously 0).
We will discuss this in two cases.
(i) When $a=0$, from equation (1) we get $b=2$, hence
$$
f(x)=\frac{x}{2} \text {. }
$$
(ii) When $a \neq 0$, from equation (2) we get
$$
a \cdot 0+b-1=0 \Rightarrow b=1 \text {. }
$$

Substituting into equation (1) gives $a=\frac{1}{2}$, hence $f(x)=\frac{2 x}{x+2}$.
(2) Since $f(x)$ has two expressions, the sum can also be calculated in two cases.
(i) When $f(x)=\frac{x}{2}$, the sequence $\left\{a_{n}\right\}$ satisfies
$$
a_{1}=\pi, a_{n+1}=\frac{a_{n}}{2}(n \geqslant 1),
$$

then $\left\{\frac{1}{a_{n}}\right\}$ is a geometric sequence with the first term $\frac{1}{\pi}$ and common ratio 2.
Thus, $S_{2011}=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{2011}}$
$$
=\frac{\frac{1}{\pi}\left(2^{2011}-1\right)}{2-1}=\frac{2^{2011}-1}{\pi} \text {. }
$$
(ii) When $f(x)=\frac{2 x}{x+2}$, the sequence $\left\{a_{n}\right\}$ satisfies
$$
a_{1}=\pi, a_{n+1}=\frac{2 a_{n}}{a_{n}+2}(n \geqslant 1),
$$

we have $\frac{1}{a_{1}}=\frac{1}{\pi}, \frac{1}{a_{n+1}}-\frac{1}{a_{n}}=\frac{1}{2}(n \geqslant 1)$, then $\left\{\frac{1}{a_{n}}\right\}$ is an arithmetic sequence with the first term $\frac{1}{\pi}$ and common difference $\frac{1}{2}$.
Thus, $S_{2011}=\frac{1}{a_{1}}+\frac{1}{a_{2}}+\cdots+\frac{1}{a_{2011}}$
$$
\begin{array}{l}
=\frac{2011\left(\frac{1}{\pi}+\frac{1}{\pi}+\frac{2010}{2}\right)}{2} \\
=\frac{2011(2+1005 \pi)}{2 \pi} .
\end{array}
$$