Efficient self-consistent calculations of dynamically one-dimensional electron gas systems using the finite element method with nonuniform mesh of triangular elements have been implemented. Both self-consistent semiclassical and self-consistent quantum mechanical calculations are carried out. In the semiclassical treatment, Poisson's equation is solved self-consistently with the induced electron density determined by the Thomas-Fermi continuum formalism. Newton's method is implemented to ensure fast convergence. In the quantum mechanical treatment, quasi-one-dimensional subband levels are determined by solving the effective mass Schrödinger equation and the induced electron density is determined by filling the occupied subbands according to Fermi-Dirac statistics for zero temperature. Self-consistency is achieved using Newton's method with an approximate Jacobian derived from the Thomas-Fermi approximation. Etched ridge and split gate semiconductor quantum wires based on selectively doped AlGaAs/GaAs heterostructures are studied. The results of the semiclassical and quantum mechanical calculations are compared. We find that the two approaches predict similar lineal densities of induced electrons for a range of cases but that the dependence of electron density on external parameters can differ significantly. The resulting potential shapes and electron distributions can also be quite different. Specifically, the semiclassical approach results in shallower confining potential wells and less spread of the electron distribution in the direction perpendicular to the heterointerface than is found in the quantum mechanical approach.