Skip to content

Commit bf4d478

Browse files
authored
Remove Dockerfile and deprecated -Ofast (#172)
1 parent a60e57b commit bf4d478

5 files changed

Lines changed: 26 additions & 99 deletions

File tree

Dockerfile

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
1515
# DOLFIN_CMAKE_CONFIG_PATH)
1616
find_package(DOLFINX REQUIRED)
1717

18-
# set(CMAKE_BUILD_TYPE "Release")
19-
set(CMAKE_CXX_FLAGS "-Ofast ${CMAKE_CXX_FLAGS} -g -Wall")
20-
set(CMAKE_C_FLAGS "-Ofast ${CMAKE_C_FLAGS} -g -Wall")
18+
set(CMAKE_CXX_FLAGS "-O3 -ffast-math ${CMAKE_CXX_FLAGS} -g -Wall")
19+
set(CMAKE_C_FLAGS "-O3 -ffast-math ${CMAKE_C_FLAGS} -g -Wall")
2120

2221
# Compile UFL files
2322
add_custom_command(

src/cgpoisson_problem.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ std::tuple<std::shared_ptr<dolfinx::la::Vector<PetscScalar>>,
2020
std::shared_ptr<dolfinx::fem::Function<PetscScalar>>,
2121
std::function<int(dolfinx::fem::Function<PetscScalar>&,
2222
const dolfinx::la::Vector<PetscScalar>&)>>
23-
problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh, int order, std::string scatterer);
23+
problem(std::shared_ptr<dolfinx::mesh::Mesh<double>> mesh, int order,
24+
std::string scatterer);
2425

25-
} // namespace poisson
26+
} // namespace cgpoisson

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,8 @@ int main(int argc, char* argv[])
264264
std::string fmt = "[%Y-%m-%d %H:%M:%S.%e] [" + thread_name + "] [%l] %v";
265265
spdlog::set_pattern(fmt);
266266

267-
// Turn off logging except on rank 0, if set (e.g. use SPDLOG_LEVEL=info in CLI)
267+
// Turn off logging except on rank 0, if set (e.g. use SPDLOG_LEVEL=info in
268+
// CLI)
268269
if (mpi_rank != 0)
269270
spdlog::set_level(spdlog::level::err);
270271

src/mesh.cpp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,15 @@ namespace
4242
//
4343
// 1. Available at <https://pi.math.cornell.edu/~hatcher/AT/ATpage.html>.
4444
constexpr std::tuple<std::int64_t, std::int64_t, std::int64_t, std::int64_t>
45-
num_entities(std::int64_t i, std::int64_t j, std::int64_t k, int nrefine) {
45+
num_entities(std::int64_t i, std::int64_t j, std::int64_t k, int nrefine)
46+
{
4647
i <<= nrefine;
4748
j <<= nrefine;
4849
k <<= nrefine;
4950
std::int64_t vertices = (i + 1) * (j + 1) * (k + 1);
50-
std::int64_t edges = 7*i*j*k + 3*(i*j + i*k + j*k) + (i + j + k);
51-
std::int64_t faces = 12*i*j*k + 2*(i*j + i*k + j*k);
51+
std::int64_t edges
52+
= 7 * i * j * k + 3 * (i * j + i * k + j * k) + (i + j + k);
53+
std::int64_t faces = 12 * i * j * k + 2 * (i * j + i * k + j * k);
5254
std::int64_t cells = 6 * (i * j * k);
5355
return {vertices, edges, faces, cells};
5456
}
@@ -179,8 +181,8 @@ create_cube_mesh(MPI_Comm comm, std::size_t target_dofs, bool target_dofs_total,
179181
else
180182
MPI_Comm_dup(comm, &sub_comm);
181183

182-
auto cell_part = dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::none,
183-
graph_part, 2);
184+
auto cell_part = dolfinx::mesh::create_cell_partitioner(
185+
dolfinx::mesh::GhostMode::none, graph_part, 2);
184186
auto mesh = dolfinx::mesh::create_box(
185187
comm, sub_comm, {{{0.0, 0.0, 0.0}, {1.0, 1.0, 1.0}}}, {Nx, Ny, Nz},
186188
dolfinx::mesh::CellType::tetrahedron, cell_part);
@@ -197,9 +199,10 @@ create_cube_mesh(MPI_Comm comm, std::size_t target_dofs, bool target_dofs_total,
197199
{
198200
mesh.topology_mutable()->create_connectivity(3, 1);
199201
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
200-
mesh, std::nullopt,
201-
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
202-
dolfinx::refinement::Option::parent_cell_and_facet);
202+
mesh, std::nullopt,
203+
dolfinx::mesh::create_cell_partitioner(
204+
dolfinx::mesh::GhostMode::shared_facet, 2),
205+
dolfinx::refinement::Option::parent_cell_and_facet);
203206
mesh = std::move(new_mesh);
204207
}
205208

@@ -374,9 +377,10 @@ create_spoke_mesh(MPI_Comm comm, std::size_t target_dofs,
374377
< target)
375378
{
376379
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
377-
*mesh, std::nullopt,
378-
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
379-
dolfinx::refinement::Option::parent_cell_and_facet);
380+
*mesh, std::nullopt,
381+
dolfinx::mesh::create_cell_partitioner(
382+
dolfinx::mesh::GhostMode::shared_facet, 2),
383+
dolfinx::refinement::Option::parent_cell_and_facet);
380384
mesh = std::make_shared<dolfinx::mesh::Mesh<double>>(new_mesh);
381385
mesh->topology_mutable()->create_entities(1);
382386
}
@@ -412,9 +416,10 @@ create_spoke_mesh(MPI_Comm comm, std::size_t target_dofs,
412416
marked_edges.push_back(i);
413417

414418
auto [new_mesh, _parent_edges, _parent_facet] = dolfinx::refinement::refine(
415-
*mesh, marked_edges,
416-
dolfinx::mesh::create_cell_partitioner(dolfinx::mesh::GhostMode::shared_facet),
417-
dolfinx::refinement::Option::parent_cell_and_facet);
419+
*mesh, marked_edges,
420+
dolfinx::mesh::create_cell_partitioner(
421+
dolfinx::mesh::GhostMode::shared_facet, 2),
422+
dolfinx::refinement::Option::parent_cell_and_facet);
418423
meshi = std::make_shared<dolfinx::mesh::Mesh<double>>(new_mesh);
419424

420425
double actual_fraction

0 commit comments

Comments
 (0)