An efficient micromagnetic algorithm for modeling magnetization processes of interacting ferromagnetic particles in three dimensions has been developed. Introducing a magnetic vector potential to treat the demagnetizing field eliminates long-range interactions from the total magnetic Gibb's free energy. Thus its minimization can be effectively performed using finite element techniques. Numerical results obtained for equivalent microstructures in two and three dimensions show that 2D micromagnetic calculations provide reasonable lower bounds for the nucleation field of hard magnetic microstructures.