wenqing (63642158) at 26 Mar 17:42
wenqing (63642158) at 26 Mar 15:56
[PL] Pass VectorXd by value to setInitialCond.
... and 21 more commits
wenqing (0c253177) at 26 Mar 15:46
[CTests] Add a test for GMSH2OGS with the mesh created by Gmsh 4
... and 20 more commits
The repetitions in the existing LocalAssemblerInterface::postTimestep(...)
:
void LocalAssemblerInterface::postTimestep(
std::size_t const mesh_item_id,
std::vector<NumLib::LocalToGlobalIndexMap const*> const& dof_tables,
std::vector<GlobalVector*> const& x,
std::vector<GlobalVector*> const& x_prev, double const t, double const dt,
int const process_id)
{
for (int i = 0; i < 10000; i++)
{
std::vector<double> local_x_vec;
std::vector<double> local_x_prev_vec;
auto const n_processes = x.size();
for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
{
auto const indices =
NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
assert(!indices.empty());
auto const local_solution = x[process_id]->get(indices);
local_x_vec.insert(std::end(local_x_vec),
std::begin(local_solution),
std::end(local_solution));
auto const local_solution_prev = x_prev[process_id]->get(indices);
local_x_prev_vec.insert(std::end(local_x_prev_vec),
std::begin(local_solution_prev),
std::end(local_solution_prev));
}
}
std::vector<double> local_x_vec;
std::vector<double> local_x_prev_vec;
auto const n_processes = x.size();
for (std::size_t process_id = 0; process_id < n_processes; ++process_id)
{
auto const indices =
NumLib::getIndices(mesh_item_id, *dof_tables[process_id]);
assert(!indices.empty());
auto const local_solution = x[process_id]->get(indices);
local_x_vec.insert(std::end(local_x_vec), std::begin(local_solution),
std::end(local_solution));
auto const local_solution_prev = x_prev[process_id]->get(indices);
local_x_prev_vec.insert(std::end(local_x_prev_vec),
std::begin(local_solution_prev),
std::end(local_solution_prev));
}
auto const local_x = MathLib::toVector(local_x_vec);
auto const local_x_prev = MathLib::toVector(local_x_prev_vec);
postTimestepConcrete(local_x, local_x_prev, t, dt, process_id);
}
Sorry for delayed response because my machine did not have Internet connection before 2 o'clock. I have conducted a test using the benchmark HydroMechanics/StaggeredScheme/ConsolidationBenchmark/consolidation_benchmark.prj
, which calls this function and normally runs in 2 s. What I did is to add the following lines at the beginning LocalAssemblerInterface::postTimestep(...)
for (int i =0; i<10000; i++)
{
NumLib::getLocalX(mesh_item_id, dof_tables, x);
NumLib::getLocalX(mesh_item_id, dof_tables, x_prev);
}
That means to call getLocalX 20,000 time more to highlight the time usage by NumLib::getIndices(...)
. The same times repetitions are applied to the unchanged LocalAssemblerInterface::postTimestep(...)
.
The run time of two tests are:
The CPU times the two test are almost identical. Therefore, the current changes does not loss the computation efficiency.
@endJunction Thank you for your improvement in the local_x type. The changes look good.
By calling getLocalX
individually for local_x
and local_x_prev
, the function NumLib::getIndices(...)
is called twice by each process variable. If getLocalX
is used in the matrix assembly, we may need getLocalXPrevX
.
wenqing (240144de) at 25 Mar 15:42
[CTests] Add a test for GMSH2OGS with the mesh created by Gmsh 4
... and 2 more commits
wenqing (702586e5) at 25 Mar 15:28
[CTests] Add a test for GMSH2OGS with the mesh created by Gmsh 4
... and 2 more commits
The test was lost since version 4 of this MR. Get it back now.
wenqing (ea6fed51) at 22 Mar 10:14
[CTest/HM] Total initial stress input for the staggered scheme
Applied the suggestion to all the ad-hoc lambda functions.
I see. My bad. Changed the name to process_id
.
wenqing (9047cda1) at 22 Mar 09:55
[ProcessLib] Moved the function getLocalX from LocalAssemblerInterf...
... and 6 more commits
In GMSH2OGS
, only the Gmsh ASCII file created by Gmsh version 2.2 is accepted. This MR enables to read physical ids of a mesh created by Gmsh 4 and exported as Version 2 ASCII
format file. Since there no Gmsh version information in the Version 2 ASCII
format file, a command line flag is introduced to indicate whether the mesh is created by using Gmsh version 4.