MCPcopy Create free account
hub / github.com/OpenFOAM/OpenFOAM-dev / New

Function New

src/OpenFOAM/meshes/MeshObject/MeshObject.C:81–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79template<class Mesh, template<class> class MeshObjectType, class Type>
80template<class Data1>
81const Type& Foam::MeshObject<Mesh, MeshObjectType, Type>::New
82(
83 const Mesh& mesh,
84 const Data1& d
85)
86{
87 if
88 (
89 mesh.thisDb().objectRegistry::template foundObject<Type>
90 (
91 Type::typeName
92 )
93 )
94 {
95 return mesh.thisDb().objectRegistry::template lookupObject<Type>
96 (
97 Type::typeName
98 );
99 }
100 else
101 {
102 if (meshObject::debug)
103 {
104 Pout<< "MeshObject::New(const " << Mesh::typeName
105 << "&, const Data1&) : constructing " << Type::typeName
106 << " for region " << mesh.name() << endl;
107 }
108
109 Type* objectPtr = new Type(mesh, d);
110
111 regIOobject::store(static_cast<MeshObjectType<Mesh>*>(objectPtr));
112
113 return *objectPtr;
114 }
115}
116
117
118template<class Mesh, template<class> class MeshObjectType, class Type>

Callers 3

MeshObject.CFile · 0.70
polyPatchNew.CFile · 0.50

Calls 2

TypeEnum · 0.85
nameMethod · 0.45

Tested by

no test coverage detected