Wave Functionals, Boundary Conditions and Casimir Effect