In 3D reconstruction problems the number of design variables is large and the forward model is typically computationally expensive. Reconstruction using gradient-based optimization algorithms requires many gradient computations. For such problems the computational cost of a finite difference approach to gradient calculation is prohibitive since the number of forward model evaluations per gradient calculation is equal to the number of design variables. We introduce the adjoint method which drastically reduces the amount of computations required for gradient calculation. Also, we introduce COMSOL Multiphysics as a valuable modeling and prototyping tool to be used for forward model evaluation and gradient calculation through the adjoint method. An example in Electrical Impedance Tomography (EIT) is provided to illustrate the use of the adjoint method for practical problems.