13 void MeshAdaptPUMIDrvr::freeField(apf::Field*&
f)
26 void MeshAdaptPUMIDrvr::freeNumbering(apf::Numbering*&
n)
35 apf::destroyNumbering(
n);
55 assert(nN ==
static_cast<int>(m->count(0)));
56 apf::Field*
f = m->findField(name);
57 if (!strcmp(name,
"coordinates")) {
59 f = m->getCoordinateField();
63 assert(nVar == 1 || nVar == 3 || nVar == 9);
66 valueType = apf::SCALAR;
68 valueType = apf::MATRIX;
70 valueType = apf::VECTOR;
71 f = apf::createFieldOn(m, name, valueType);
73 apf::NewArray<double> tmp(nVar);
75 apf::MeshIterator* it = m->begin(0);
76 while ((
v = m->iterate(it))) {
78 for(
int j = 0; j < nVar; j++)
79 tmp[j] = inArray[i * nVar + j];
80 apf::setComponents(
f,
v, 0, &tmp[0]);
100 assert(nN ==
static_cast<int>(m->count(0)));
101 apf::Field*
f = m->findField(name);
103 fprintf(stderr,
"couldn't find field \"%s\"\n", name);
105 assert(apf::countComponents(
f) == nVar);
106 apf::NewArray<double> tmp(nVar);
108 apf::MeshIterator* it = m->begin(0);
109 while ((
v = m->iterate(it))) {
111 apf::getComponents(
f,
v, 0, &tmp[0]);
112 for(
int j = 0; j < nVar; j++)
113 outArray[i * nVar + j] = tmp[j];
131 nsd = m->getDimension();
135 rho = (
double*) calloc(m->count(m->getDimension()),
sizeof(double));
136 nu = (
double*) calloc(m->count(m->getDimension()),
sizeof(
double));
137 for(
int eID = 0; eID<m->count(m->getDimension()); eID++)
139 rho[eID] = rho_p[eID];
144 g[0] = g_p[0]; g[1] = g_p[1];
147 g[0] = g_p[0]; g[1] = g_p[1]; g[2] = g_p[2];
151 delta_T_next = deltaT_next;
152 T_current = T_simulation;
172 assert(nN ==
static_cast<int>(m->count(2)));
173 apf::Field*
f = m->findField(name);
175 fprintf(stderr,
"couldn't find field \"%s\"\n", name);
177 assert(apf::countComponents(
f) == nVar);
178 apf::NewArray<double> tmp(nVar);
180 apf::MeshIterator* it = m->begin(2);
181 while ((
v = m->iterate(it))) {
183 apf::getComponents(
f,
v, 0, &tmp[0]);
184 for(
int j = 0; j < nVar; j++)
185 outArray[i * nVar + j] = tmp[j];