How to calculate the divergence of matrix? The divergence of a vector field in Cartesian coordinate system (CCS) is defined as follows
$$ \mathrm{div}(\mathbf v) =  \nabla \cdot \mathbf v = 
\begin{bmatrix}
\frac{\partial}{\partial x} \\
\frac{\partial}{\partial y} \\
\frac{\partial}{\partial z}
\end{bmatrix}
\cdot 
\begin{bmatrix}
v_1 \\
v_2 \\
v_3
\end{bmatrix} 
=
\begin{bmatrix}
\frac{\partial}{\partial x} \\
\frac{\partial}{\partial y} \\
\frac{\partial}{\partial z}
\end{bmatrix}^T
\begin{bmatrix}
v_1 \\
v_2 \\
v_3
\end{bmatrix} 
=
\begin{bmatrix}
\frac{\partial}{\partial x} &
\frac{\partial}{\partial y} &
\frac{\partial}{\partial z}
\end{bmatrix}
\begin{bmatrix}
v_1 \\
v_2 \\
v_3
\end{bmatrix} 
=\frac{\partial v_1}{\partial x}+ 
\frac{\partial v_2}{\partial y}+
\frac{\partial v_3}{\partial z}
$$
where $\cdot$ denotes the dot product; it was changed to transposition with matrix multiplication. Now lets define some matrix
$$A = 
\begin{bmatrix}
a_{11} && a_{12} && a_{13} \\
a_{21} && a_{22} && a_{23} \\
a_{31} && a_{32} && a_{33} \\
\end{bmatrix}
$$
How to calculate divergence of matrix in CCS and how looks its 'dot' product and 'matrix multiplication' form?
$$\mathrm{div}(A) = ?$$
 A: In this answer I use $x=x_1, y=x_2, z=x_3$ and Einstein notation. On wikipedia in this article I found following information (in article they use S instead A) for CCS:
$$
\nabla\cdot A = \cfrac{\partial A_{ki}}{\partial x_k}~\mathbf{e}_i = A_{ki,k}~\mathbf{e}_i = 
\begin{bmatrix}
\frac{\partial a_{11}}{\partial x} + \frac{\partial a_{21}}{\partial y} + \frac{\partial a_{31}}{\partial z} \\
\frac{\partial a_{12}}{\partial x} + \frac{\partial a_{22}}{\partial y} + \frac{\partial a_{32}}{\partial z} \\
\frac{\partial a_{13}}{\partial x} + \frac{\partial a_{23}}{\partial y} + \frac{\partial a_{33}}{\partial z} \\
\end{bmatrix}
$$
The result is contravariant (column) vector. But in this article is mention that $\mathrm{div}(A) \neq \nabla\cdot A$ and
$$
\mathrm{div}(A) = \nabla\cdot A^T = \cfrac{\partial A_{ik}}{\partial x_k}~\mathbf{e}_i = A_{ik,k}~\mathbf{e}_i = 
\begin{bmatrix}
\frac{\partial a_{11}}{\partial x} + \frac{\partial a_{12}}{\partial y} + \frac{\partial a_{13}}{\partial z} \\
\frac{\partial a_{21}}{\partial x} + \frac{\partial a_{22}}{\partial y} + \frac{\partial a_{23}}{\partial z} \\
\frac{\partial a_{31}}{\partial x} + \frac{\partial a_{32}}{\partial y} + \frac{\partial a_{33}}{\partial z} \\
\end{bmatrix}
$$
When A is symetric: $a_{ij}=a_{ji}$ then $\mathrm{div}(A) = \nabla\cdot A$
Wiki also mention that some authors use alternative definition: $\nabla\cdot A = \cfrac{\partial A_{ik}}{\partial x_k}~\mathbf{e}_i $ probably only for case when A is symmetric (for which that alternative definition is equal to original). However alternative definition is NOT compatible with general curvilinear definition which I found on wiki too:
$$
\nabla\cdot A
        = \left(\cfrac{\partial A_{ki}}{\partial x_k}- A_{li}~\Gamma_{kk}^l - A_{kl}~\Gamma_{ki}^l\right)~\mathbf{g}^i
$$
