Charles McCain groans in his cubicle, hunched over a large frayed chart that maps out the family tree of the protagonist in his upcoming novel about a royal naval officer in World War II. The 57-year-old writer is working in Suite 510, inside a drab 1958 Northwest Washington office building that looks like there might be a detective agency inside and a cigar stand in the lobby.

Next to him is Donna Lewis — a Department of Homeland Security lawyer by day whose comic strip “Reply All” runs around the country and in The Washington Post. Lewis, 50, tugs at her furry scarf as she works on a novel about life interrupting love. At the next workstation, nonfiction writer-activist Matteo Pistono, 42, reads over his research for an upcoming biography on a Tibetan Buddhist leader.

These nonfiction writers, novelists, editors and even a children’s storybook scribe have fastened themselves inside their quiet cubicles in this newly opened workspace called the Writers Room D.C., the first of its kind in a city better known for its wonky think tanks than its literary underground.

The 24-hour, 1,137-square-foot space sits just across from the Tenleytown Metro station and is built on the premise that if you join a gym — or a writers room — you feel compelled to go. There is such a thing as too much freedom, many of the writers here say, and they crave structure.

The cubicled and sequestered writer — more craftsman than artiste — defies the romantic myth of the booze-addled, depressive Ernest Hemingway type, who interrupts a bar crawl to pour out prose and poetry from a Parisian cafe in the middle of the night.

Customer Donna Lewis, center, talks with Charles Karelis, right, and his son, Alex, left, at the Writers Room DC, a quiet refuge for local writers, on December, 10, 2012 in Washington, D.C. (Bill O'Leary/The Washington Post)

“I really feel motivation is contagious,” says the room’s co-founder Charles Karelis, a longtime academic and author of the book “The Persistence of Poverty.”

About a year ago, Charles and his son Alex Karelis, also a writer, were sitting in the Tenleytown Starbucks. A roomful of people crammed into the space, fighting it out for electrical outlets and packing up every time they needed a bathroom break. “We were searching for a father-and-son project,” Charles says. “We thought: ‘They are selling coffee and giving space. What if we sold space and gave away coffee?’ ”

That thought led in October to the creation of the Writers Room D.C., which hosts about 30 writers and joins six similar membership-funded writers dens in New York, many with waiting lists; Los Angeles has one for screenwriters.

In Washington, the zenlike quiet of the writers room stands in stark contrast to the crowded coffeehouse scene. Each writer has an individual walled-off workstation — and outlets. Membership works almost exactly like a gym and runs about $130 per month for half a year. Cellphones are not allowed. Although there is Internet access, many writers say they don’t dare log on.

“E-mail is my enemy,” says Lewis, her notes splayed in front of her. “I feel like I can get more done here in two hours than all day at home, where I have a very playful puppy. This place saved me.”

There are mini-lockers so writers can store their notes. The New Yorker is stacked on end tables for inspiration. And there’s a common area called the “Procrastination Zone,” where a pot of coffee is always ready to be brewed. “That was a nonnegotiable,” says member and best-selling author Eric Weiner. “Writers, really, are machines that convert caffeine into words.”

Many of the writers know one another, but they tend to grab that cup of coffee in the Procrastination Zone and then get right back to their cubicles.

Donna Lewis, left, and Herta Feely, right, in the break room at the Writers Room DC, a quiet refuge for local writers, on December, 10, 2012 in Washington, D.C. (Bill O'Leary/The Washington Post)

“It’s very austere here,” said Pistono, who wrote the book “In the Shadow of the Buddha: Secret Journeys, Sacred Histories and Spiritual Discovery in Tibet.”

So, is this writers room really just a part of that whole Buddhist first noble truth thing — that all life is suffering?

“Maybe,” he said. “But there’s something really to be said about a shared intention.”

And the ability to be alone — together.

“I can’t tell you how many times I’ve found myself still in my pajamas at noon, staring at a blank screen and wondering what the cats are up to,” says Weiner, who wrote,“The Geography of Bliss: One Grump’s Search for the Happiest Places in the World.” His most recent book: “Man Seeks God: My Flirtations with the Divine.”

“The fact is: Humans crave human companionship. Why stare at a blank screen alone when you can stare at a blank screen with a room full of kindred spirits, equally stuck, and equally determined to get unstuck?” he adds. “We need a place to call home. Well, to call office. The Starbucks in Bethesda just isn’t the La Closerie des Lilas [one of Hemingway’s Paris writing haunts] no matter how much you squint and try to make it so.”