MCPcopy Create free account
hub / github.com/IBAMR/IBAMR / initializeDirectorDataOnPatchLevel

Method initializeDirectorDataOnPatchLevel

src/IB/IBRedundantInitializer.cpp:1172–1216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1170} // initializeMassOnPatchLevel
1171
1172unsigned int
1173IBRedundantInitializer::initializeDirectorDataOnPatchLevel(const unsigned int /*global_index_offset*/,
1174 const unsigned int local_index_offset,
1175 Pointer<LData> D_data,
1176 const Pointer<PatchHierarchy<NDIM>> hierarchy,
1177 const int level_number,
1178 const double /*init_data_time*/,
1179 const bool /*can_be_refined*/,
1180 const bool /*initial_time*/,
1181 LDataManager* const /*l_data_manager*/)
1182{
1183#if !defined(NDEBUG)
1184 TBOX_ASSERT(d_data_processed);
1185#endif
1186
1187 // Loop over all patches in the specified level of the patch level and
1188 // initialize the local vertices.
1189 boost::multi_array_ref<double, 2>& D_array = *D_data->getLocalFormVecArray();
1190 int local_idx = invalid_index;
1191 int local_node_count = 0;
1192 Pointer<PatchLevel<NDIM>> level = hierarchy->getPatchLevel(level_number);
1193 for (PatchLevel<NDIM>::Iterator p(level); p; p++)
1194 {
1195 Pointer<Patch<NDIM>> patch = level->getPatch(p());
1196
1197 // Initialize the vertices whose initial locations will be within the
1198 // given patch.
1199 std::vector<std::pair<int, int>> patch_vertices;
1200 getPatchVertices(patch_vertices, patch, hierarchy);
1201 local_node_count += patch_vertices.size();
1202 for (const auto& point_idx : patch_vertices)
1203 {
1204 const int local_petsc_idx = ++local_idx + local_index_offset;
1205
1206 // Initialize the director corresponding to the present vertex.
1207 const std::vector<double>& D = getVertexDirectors(point_idx, level_number);
1208 for (int d = 0; d < 3 * 3; ++d)
1209 {
1210 D_array[local_petsc_idx][d] = D[d];
1211 }
1212 }
1213 }
1214 D_data->restoreArrays();
1215 return local_node_count;
1216} // initializeDirectorOnPatchLevel
1217
1218void
1219IBRedundantInitializer::tagCellsForInitialRefinement(const Pointer<PatchHierarchy<NDIM>> hierarchy,

Callers 1

initializeLevelDataMethod · 0.45

Calls 4

getLocalFormVecArrayMethod · 0.80
getPatchLevelMethod · 0.80
restoreArraysMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected