LOS ANGELES — A survey of Muslim Americans released this week portrays a community largely content with its place in American society and optimistic about the country’s direction, despite concerns about anti-Muslim discrimination in the years since the Sept. 11 attacks.The poll by the Pew Forum on Religion and Public Life found that Muslims in the United States are more satisfied than other Americans with the way things are going in the country. A majority said that most Muslims who come to the U.S. want to adopt American customs and ways of life.Two-thirds of those surveyed said that life in the U.S. is better than in most Muslim countries.Nonetheless, nearly half of respondents said that being a Muslim in the U.S. has become more difficult since 2001. About a quarter of those surveyed reported being treated suspiciously, called offensive names, or feeling singled out by airport security.Conversely, 37 percent reported having someone express support for them and their faith, with nearly half believing that ordinary Americans are friendly.Pew surveyed 1,033 Muslim Americans between April 14 and June 22; the poll was conducted in English, Arabic, Farsi and Urdu.Two-thirds of those surveyed were immigrants, who represented 77 countries, said Greg Smith, a senior researcher with Pew. The other third, he said, included second- and third-generation Muslim Americans, as well as converts.The findings echoed other surveys, including one by Gallup this month that found similar levels of confidence and discrimination.Fears of homegrown Muslim extremism have been stirred by the 2009 shootings at Fort Hood and several thwarted terrorist attacks in recent years. But the survey found that only 4 percent of Muslim Americans believed support for extremism was growing in their community; 34 percent said there was no support for extremism in the community.Overall, Muslim Americans were more likely to express traditional American ideals than the public at large. Nearly three-quarters of U.S. Muslims, for example, believe that most people can get ahead if they work hard, compared with 62 percent of Americans overall.Salam Al-Marayati, president of the Los Angeles-based Muslim Public Affairs Council, said the survey’s findings are an accurate reflection of his community. Most American Muslims are able to blend into U.S. society, he said, without having to abandon their faith and their roots.“I think we, as Muslims, are blessed by God to live in America,” Al-Marayati said. “Besides the toxicity in our culture, we see the greatness of America. We see America as our home.”