Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion framework/field_functions/field_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "framework/parameters/input_parameters.h"
#include "framework/math/unknown_manager/unknown_manager.h"
#include "framework/mesh/mesh.h"

namespace opensn
{
Expand Down
1 change: 0 additions & 1 deletion framework/field_functions/field_function_grid_based.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "framework/math/spatial_discretization/finite_element/piecewise_linear/piecewise_linear_continuous.h"
#include "framework/math/spatial_discretization/finite_element/piecewise_linear/piecewise_linear_discontinuous.h"
#include "framework/math/spatial_discretization/spatial_discretization.h"
#include "framework/mesh/mesh.h"
#include "framework/mesh/mesh_continuum/mesh_continuum.h"
#include "framework/mesh/mesh_continuum/grid_vtk_utils.h"
#include "framework/object_factory.h"
Expand Down
1 change: 0 additions & 1 deletion framework/field_functions/field_function_grid_based.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

#include "framework/field_functions/field_function.h"
#include "framework/data_types/parallel_vector/ghosted_parallel_stl_vector.h"
#include "framework/mesh/mesh.h"
#include <functional>
#include <string>
#include <memory>
Expand Down
2 changes: 1 addition & 1 deletion framework/field_functions/interpolation/ffinter_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "framework/data_types/vector_ghost_communicator/vector_ghost_communicator.h"
#include "framework/mesh/mesh_continuum/mesh_continuum.h"
#include "framework/field_functions/field_function_grid_based.h"
#include "framework/mesh/cell/cell.h"
#include "framework/mesh/mesh_continuum/cell.h"
#include "framework/logging/log.h"
#include "framework/runtime.h"
#include <cmath>
Expand Down
2 changes: 1 addition & 1 deletion framework/field_functions/interpolation/ffinter_point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ FieldFunctionInterpolationPoint::Execute()

const auto field_data = ref_ff.GetGhostedFieldVector();

const auto& cell = grid->cells[owning_cell_gid_];
const auto& cell = grid->GetGlobalCell(owning_cell_gid_);
const auto& cell_mapping = sdm.GetCellMapping(cell);
const size_t num_nodes = cell_mapping.GetNumNodes();

Expand Down
1 change: 0 additions & 1 deletion framework/graphs/kba_graph_partitioner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include "framework/graphs/kba_graph_partitioner.h"
#include "framework/utils/utils.h"
#include "framework/mesh/mesh.h"
#include "framework/runtime.h"
#include "framework/logging/log.h"
#include <cmath>
Expand Down
9 changes: 8 additions & 1 deletion framework/math/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma once

#include "framework/mesh/mesh.h"
#include <string_view>

namespace opensn
Expand All @@ -20,6 +19,14 @@ enum class GeometryType
THREED_CARTESIAN = 6,
};

enum CoordinateSystemType : int
{
UNDEFINED = 0,
CARTESIAN = 1,
CYLINDRICAL = 2,
SPHERICAL = 3,
};

constexpr std::string_view
ToString(GeometryType type) noexcept
{
Expand Down
1 change: 0 additions & 1 deletion framework/math/quadratures/spatial/spatial_quadrature.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#pragma once

#include "framework/math/quadratures/quadrature_order.h"
#include "framework/mesh/mesh.h"
#include "framework/parameters/input_parameters.h"
#include <vector>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ PieceWiseLinearBaseMapping::GetVertexLocations(const std::shared_ptr<MeshContinu
verts.reserve(cell.vertex_ids.size());

for (const auto vid : cell.vertex_ids)
verts.push_back(grid->vertices[vid]);
verts.push_back(grid->GlobalVertex(vid));

return verts;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#pragma once

#include "framework/mesh/mesh.h"
#include "framework/math/spatial_discretization/cell_mappings/cell_mapping.h"
#include <utility>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ PieceWiseLinearPolygonMapping::PieceWiseLinearPolygonMapping(
{
const CellFace& face = poly_cell.faces[side];

const auto& v0 = grid_->vertices[face.vertex_ids[0]];
const auto& v1 = grid_->vertices[face.vertex_ids[1]];
const auto& v0 = grid_->GlobalVertex(face.vertex_ids[0]);
const auto& v1 = grid_->GlobalVertex(face.vertex_ids[1]);
Vector3 v2 = vc_;

Vector3 sidev01 = v1 - v0;
Expand Down Expand Up @@ -187,7 +187,7 @@ PieceWiseLinearPolygonMapping::ShapeValue(size_t i, const Vector3& xyz) const
{
for (std::size_t s = 0; s < num_of_subtris_; ++s)
{
const auto& p0 = grid_->vertices[sides_[s].v_index[0]];
const auto& p0 = grid_->GlobalVertex(sides_[s].v_index[0]);
Vector3 xyz_ref = xyz - p0;

Vector3 xi_eta_zeta = sides_[s].Jinv * xyz_ref;
Expand Down Expand Up @@ -225,7 +225,7 @@ PieceWiseLinearPolygonMapping::ShapeValues(const Vector3& xyz, Vector<double>& s
shape_values.Resize(num_nodes_, 0.0);
for (std::size_t s = 0; s < num_of_subtris_; ++s)
{
const auto& p0 = grid_->vertices[sides_[s].v_index[0]];
const auto& p0 = grid_->GlobalVertex(sides_[s].v_index[0]);
Vector3 xi_eta_zeta = sides_[s].Jinv * (xyz - p0);

double xi = xi_eta_zeta.x;
Expand Down Expand Up @@ -265,7 +265,7 @@ PieceWiseLinearPolygonMapping::GradShapeValue(size_t i, const Vector3& xyz) cons

for (std::size_t e = 0; e < num_of_subtris_; ++e)
{
const auto& p0 = grid_->vertices[sides_[e].v_index[0]];
const auto& p0 = grid_->GlobalVertex(sides_[e].v_index[0]);
Vector3 xyz_ref = xyz - p0;

Vector3 xi_eta_zeta = sides_[e].Jinv * xyz_ref;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ PieceWiseLinearPolyhedronMapping::PieceWiseLinearPolyhedronMapping(
side_data.v_index[0] = v0index;
side_data.v_index[1] = v1index;

const auto& v0 = grid_->vertices[v0index];
const auto& v0 = grid_->GlobalVertex(v0index);
const auto& v1 = vfc;
const auto& v2 = grid_->vertices[v1index];
const auto& v2 = grid_->GlobalVertex(v1index);
const auto& v3 = vcc;

side_data.v0 = v0;
Expand Down Expand Up @@ -412,7 +412,7 @@ PieceWiseLinearPolyhedronMapping::ShapeValue(size_t i, const Vector3& xyz) const
for (size_t s = 0; s < face_data_[f].sides.size(); ++s)
{
// Map xyz to xi_eta_zeta
const auto& p0 = grid_->vertices[face_data_[f].sides[s].v_index[0]];
const auto& p0 = grid_->GlobalVertex(face_data_[f].sides[s].v_index[0]);
Vector3 xyz_ref = xyz - p0;

Vector3 xi_eta_zeta = face_data_[f].sides[s].Jinv * xyz_ref;
Expand Down Expand Up @@ -461,7 +461,7 @@ PieceWiseLinearPolyhedronMapping::ShapeValues(const Vector3& xyz,
{
const auto& side_fe_info = face_data_[f].sides[s];
// Map xyz to xi_eta_zeta
const auto& p0 = grid_->vertices[side_fe_info.v_index[0]];
const auto& p0 = grid_->GlobalVertex(side_fe_info.v_index[0]);
Vector3 xi_eta_zeta = side_fe_info.Jinv * (xyz - p0);

double xi = xi_eta_zeta.x;
Expand Down Expand Up @@ -507,7 +507,7 @@ PieceWiseLinearPolyhedronMapping::GradShapeValue(size_t i, const Vector3& xyz) c
for (size_t s = 0; s < face_data_[f].sides.size(); ++s)
{
// Map xyz to xi_eta_zeta
const auto& p0 = grid_->vertices[face_data_[f].sides[s].v_index[0]];
const auto& p0 = grid_->GlobalVertex(face_data_[f].sides[s].v_index[0]);
Vector3 xyz_ref = xyz - p0;

Vector3 xi_eta_zeta = face_data_[f].sides[s].Jinv * xyz_ref;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ PieceWiseLinearSlabMapping::PieceWiseLinearSlabMapping(
v1i_(slab_cell.vertex_ids[1]),
volume_quadrature_(volume_quadrature)
{
v0_ = grid_->vertices[v0i_];
const auto& v1 = grid_->vertices[v1i_];
v0_ = grid_->GlobalVertex(v0i_);
const auto& v1 = grid_->GlobalVertex(v1i_);

Vector3 v01 = v1 - v0_;
h_ = v01.Norm();
Expand Down Expand Up @@ -64,8 +64,8 @@ PieceWiseLinearSlabMapping::SlabGradShape(uint32_t index) const
double
PieceWiseLinearSlabMapping::ShapeValue(size_t i, const Vector3& xyz) const
{
const auto& p0 = grid_->vertices[v0i_];
const auto& p1 = grid_->vertices[v1i_];
const auto& p0 = grid_->GlobalVertex(v0i_);
const auto& p1 = grid_->GlobalVertex(v1i_);
Vector3 xyz_ref = xyz - p0;

Vector3 v01 = p1 - p0;
Expand All @@ -87,8 +87,8 @@ void
PieceWiseLinearSlabMapping::ShapeValues(const Vector3& xyz, Vector<double>& shape_values) const
{
shape_values.Resize(num_nodes_, 0.0);
const auto& p0 = grid_->vertices[v0i_];
const auto& p1 = grid_->vertices[v1i_];
const auto& p0 = grid_->GlobalVertex(v0i_);
const auto& p1 = grid_->GlobalVertex(v1i_);
Vector3 xyz_ref = xyz - p0;

Vector3 v01 = p1 - p0;
Expand Down Expand Up @@ -243,7 +243,7 @@ PieceWiseLinearSlabMapping::MakeSurfaceFiniteElementData(size_t face_index) cons
for (size_t qp = 0; qp < num_srf_qpoints; ++qp)
{
F_JxW.push_back(JxW);
const auto face_xyz = (f == 0) ? grid_->vertices[v0i_] : grid_->vertices[v1i_];
const auto face_xyz = (f == 0) ? grid_->GlobalVertex(v0i_) : grid_->GlobalVertex(v1i_);
F_qpoints_xyz.push_back(face_xyz);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include "framework/math/spatial_discretization/cell_mappings/finite_element/piecewise_linear/piecewise_linear_base_mapping.h"
#include "framework/math/quadratures/spatial/line_quadrature.h"
#include "framework/mesh/cell/cell.h"
#include "framework/mesh/mesh_continuum/cell.h"
#include <array>

namespace opensn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ PieceWiseLinearBase::CreateCellMappings()
for (const auto& cell : grid_->local_cells)
cell_mappings_.push_back(MakeCellMapping(cell));

const auto ghost_ids = grid_->cells.GetGhostGlobalIDs();
const auto ghost_ids = grid_->GetGhostGlobalIDs();
for (uint64_t ghost_id : ghost_ids)
{
auto ghost_mapping = MakeCellMapping(grid_->cells[ghost_id]);
auto ghost_mapping = MakeCellMapping(grid_->GetGlobalCell(ghost_id));
nb_cell_mappings_.insert(std::make_pair(ghost_id, std::move(ghost_mapping)));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ PieceWiseLinearContinuous::OrderNodes()

// Now we add the partitions associated with the
// ghost cells.
const auto ghost_cell_ids = grid_->cells.GetGhostGlobalIDs();
const auto ghost_cell_ids = grid_->GetGhostGlobalIDs();
for (const uint64_t ghost_id : ghost_cell_ids)
{
const auto& ghost_cell = grid_->cells[ghost_id];
const auto& ghost_cell = grid_->GetGlobalCell(ghost_id);
for (const uint64_t vid : ghost_cell.vertex_ids)
ls_node_ids_psubs[vid].insert(ghost_cell.partition_id);
} // for ghost_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ PieceWiseLinearDiscontinuous::OrderNodes()
// Collect ghost cell ids needing block addresses
std::map<int, std::vector<uint64_t>> ghost_cell_ids_consolidated;

for (uint64_t global_id : grid_->cells.GetGhostGlobalIDs())
for (uint64_t global_id : grid_->GetGhostGlobalIDs())
{
const auto& cell = grid_->cells[global_id];
const auto& cell = grid_->GetGlobalCell(global_id);
const int locI = cell.partition_id;

std::vector<uint64_t>& locI_cell_id_list = ghost_cell_ids_consolidated[locI];
Expand All @@ -93,7 +93,7 @@ PieceWiseLinearDiscontinuous::OrderNodes()

for (uint64_t cell_global_id : cell_id_list)
{
const auto& cell = grid_->cells[cell_global_id];
const auto& cell = grid_->GetGlobalCell(cell_global_id);

const auto cell_block_address =
local_block_address_ + cell_local_block_address_[cell.local_id];
Expand Down Expand Up @@ -156,7 +156,7 @@ PieceWiseLinearDiscontinuous::BuildSparsityPattern(std::vector<int64_t>& nodal_n
{
if (face.has_neighbor and face.IsNeighborLocal(grid_.get()))
{
const auto& adj_cell = grid_->cells[face.neighbor_id];
const auto& adj_cell = grid_->GetGlobalCell(face.neighbor_id);
const auto& adj_cell_mapping = GetCellMapping(adj_cell);

for (size_t i = 0; i < num_nodes; ++i)
Expand All @@ -180,7 +180,7 @@ PieceWiseLinearDiscontinuous::BuildSparsityPattern(std::vector<int64_t>& nodal_n
{
if (face.has_neighbor and (not face.IsNeighborLocal(grid_.get())))
{
const auto& adj_cell = grid_->cells[face.neighbor_id];
const auto& adj_cell = grid_->GetGlobalCell(face.neighbor_id);
const auto& adj_cell_mapping = GetCellMapping(adj_cell);

for (int i = 0; i < cell_mapping.GetNumNodes(); ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
#include "framework/data_types/dense_matrix.h"
#include "framework/data_types/vector3.h"
#include "framework/math/geometry.h"
#include "framework/mesh/cell/cell.h"
#include "framework/mesh/mesh_continuum/cell.h"
#include "framework/math/spatial_discretization/spatial_discretization.h"
#include "framework/mesh/mesh.h"

namespace opensn
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ SpatialDiscretization::MakeInternalFaceNodeMappings(const double tolerance) cons
std::vector<int> face_adj_mapping(num_face_nodes, -1);
if (face.has_neighbor)
{
const auto& adj_cell = grid_->cells[face.neighbor_id];
const auto& adj_cell = grid_->GetGlobalCell(face.neighbor_id);
const auto& adj_cell_mapping = this->GetCellMapping(adj_cell);
const auto& adj_node_locations = adj_cell_mapping.GetNodeLocations();
const size_t adj_num_nodes = adj_cell_mapping.GetNumNodes();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
#include "framework/math/quadratures/spatial/spatial_quadrature.h"
#include "framework/math/unknown_manager/unknown_manager.h"
#include "framework/mesh/mesh_continuum/mesh_continuum.h"
#include "framework/mesh/cell/cell.h"
#include "framework/mesh/mesh.h"
#include "framework/mesh/mesh_continuum/cell.h"
#include "framework/math/math.h"
#include <petscksp.h>
#include <cassert>
Expand Down
1 change: 0 additions & 1 deletion framework/math/spatial_weight_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: MIT

#include "framework/math/spatial_weight_function.h"
#include "framework/mesh/mesh.h"
#include <stdexcept>

namespace opensn
Expand Down
2 changes: 1 addition & 1 deletion framework/math/spatial_weight_function.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once

#include "framework/data_types/vector3.h"
#include "framework/mesh/mesh.h"
#include "framework/mesh/mesh_continuum/mesh_continuum.h"

namespace opensn
{
Expand Down
8 changes: 4 additions & 4 deletions framework/mesh/io/vtk_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ MeshIO::ToOBJ(const std::shared_ptr<MeshContinuum>& grid, const char* file_name,
auto node_g_index = node;
node_mapping[node_g_index] = node_counter;

Vector3 cur_v = grid->vertices[node_g_index];
Vector3 cur_v = grid->GlobalVertex(node_g_index);

// clang-format off
of << "v "
Expand Down Expand Up @@ -983,7 +983,7 @@ MeshIO::ToExodusII(const std::shared_ptr<MeshContinuum>& grid,
for (size_t v = 0; v < num_verts; ++v)
{
vertex_map[v] = v;
const auto& vertex = grid->vertices[v];
const auto& vertex = grid->GlobalVertex(v);
points->InsertNextPoint(vertex.x, vertex.y, vertex.z);

// Exodus node- and cell indices are 1-based therefore we add a 1 here.
Expand Down Expand Up @@ -1095,7 +1095,7 @@ MeshIO::ToExodusII(const std::shared_ptr<MeshContinuum>& grid,
// Load vertices
for (uint64_t vid : vid_set)
{
const auto& vertex = grid->vertices[vid];
const auto& vertex = grid->GlobalVertex(vid);
points->InsertNextPoint(vertex.x, vertex.y, vertex.z);

// Exodus node- and cell indices are 1-based therefore we add a 1 here.
Expand Down Expand Up @@ -1151,7 +1151,7 @@ MeshIO::ToExodusII(const std::shared_ptr<MeshContinuum>& grid,
// Load vertices
for (uint64_t vid : vid_set)
{
const auto& vertex = grid->vertices[vid];
const auto& vertex = grid->GlobalVertex(vid);
points->InsertNextPoint(vertex.x, vertex.y, vertex.z);
}

Expand Down
1 change: 0 additions & 1 deletion framework/mesh/logical_volume/boolean_logical_volume.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// SPDX-License-Identifier: MIT

#include "framework/mesh/logical_volume/boolean_logical_volume.h"
#include "framework/mesh/mesh.h"
#include "framework/object_factory.h"

namespace opensn
Expand Down
2 changes: 0 additions & 2 deletions framework/mesh/logical_volume/surface_mesh_logical_volume.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// SPDX-License-Identifier: MIT

#include "framework/mesh/logical_volume/surface_mesh_logical_volume.h"
#include "framework/mesh/mesh.h"
#include "framework/mesh/mesh_face.h"
#include "framework/mesh/surface_mesh/surface_mesh.h"
#include "framework/mesh/raytrace/raytracer.h"
#include "framework/object_factory.h"
Expand Down
Loading