Nina Hoss works with director Christian Petzold for the fifth time in “Barbara.”

German actress Nina Hoss seems to specialize in playing resilient women in harsh situations. In “Barbara,” opening Friday, she’s the title character, an East German doctor banished to a provincial hospital after becoming politically suspect.

This follows roles as an abused wife who plots to kill her husband in 2008’s “Jerichow,” and as a woman repeatedly raped by Soviet occupiers in “A Woman in Berlin,” also from that year.

“In film, I must say I’m kind of the one who takes care of the dark side of life,” Hoss says. The darkness isn’t what links her characters together in her mind, though. “They fight for something. They don’t give up. And they are always full of hope.

“That maybe has something to do with myself,” she adds. “That I am also willing to take risks.”

“Barbara” never specifies what its heroine did — or refused to do — that got her classified as an enemy of  the East German government. To play the part, Hoss invented her own backstory.

“In her school days, I always thought, she let someone down. Her really best friend. And she saw what the state did to that girl. She always carried that guilt within her. That made her go against certain decisions in her job that were made by the state. And she said things that you weren’t allowed to say.”

“Barbara” is Hoss’ fifth movie with director Christian Petzold, who also directed “Jerichow.” She extols his techniques, which include frequent rehearsals and limited shooting. “We rehearse until we reach that magic moment, which we can’t give away without the camera.”

Petzold’s methodical approach may explain why Hoss found making “Barbara” a pleasure, despite its grim story of punishment, isolation and dread.

“While you are working on comedies,” the actress says, “you can have the worst time of your life. It’s tough work. When we do tragedies, you have to laugh. We’re laughing a lot on set, because otherwise you can’t take it.”

West End Cinema, 2301 M St. NW; opens Fri.; 202-419-3456. (Foggy Bottom)