A monoenergetic neutron beam simulation study is carried out to determine the most suitable neutron energy for treatment of shallow and deep-seated brain tumors in the context of boron neutron capture therapy. Two figures-of-merit - the absorbed skin dose and the absorbed tumor dose at a given depth in the brain - are used to measure the neutron beam quality. Based on the results of this study, moderators, reflectors, and delimiters are designed and optimized to moderate the high-energy neutrons from the fusion reactions 2H(d,n)3He and 3H(d,n)4He down to a suitable energy spectrum. Two different computational models (MCNP and BNCT_RTPE) have been used to study the dose distribution in the brain. With the optimal beam-shaping assembly, a 1-A mixed deuteron/triton beam of energy 150 keV accelerated onto a titanium target leads to a treatment time of 1 h. The dose near the center of the brain obtained with this configuration is >65% higher than the dose from a typical spectrum produced by the Brookhaven Medical Research Reactor and is comparable to the dose obtained by other accelerator-produced neutron beams.