Many Houston streets remain four or more feet underwater after being pelted by 50 or more inches of rain over the past week. Flooding has knocked out the water systems of Beaumont, Tex., which has a population of nearly 120,000, and local officials said they had no idea when service could be restored.

Late Friday, a chemical fire tore through a plant near Houston, sending a huge column of thick, black, noxious smoke into a sky finally clearing of clouds after days of rain.

Nonetheless, Mr. Trump seemed to embrace the role of cheerleader in chief. The president, who has not been known to enjoy sharing credit during his business, entertainment or political careers, spent most of Saturday thanking others: volunteers, emergency medical workers, local elected officials, his own staff and, above all, the helicopter crews that plucked stranded Houston residents from rooftops despite rising tides and howling winds.

He was in an optimistic, nearly exuberant mood during his stop at the NRG Center. Touring the facility with television cameras in tow, Mr. Trump sympathized with residents, posed for selfies and hoisted one young girl in ponytails in his arms.

“There’s a lot of love. As tough as it’s been, it’s been a wonderful thing to watch,” Mr. Trump told reporters before heading into a room where he handed out cardboard boxes with hot dogs and potato chips to residents. “I’m going to do a little bit of help over here.”

He added, “Have a good time, everybody!”

The reaction inside the shelter to Mr. Trump’s visit was mostly positive, with a quieter undercurrent of anxiety and skepticism.

“Is he going to help? Can he help?” asked Devin Harris, 37, a construction worker. “I lost my home. My job is gone. My tools are gone. My car is gone. My life is gone. What is Trump going to do?”