Skip to content

Commit

Permalink
[BREAKING CHANGE] Renaming getElementType to elementType
Browse files Browse the repository at this point in the history
  • Loading branch information
tdegeus committed Jul 14, 2023
1 parent 782b7a5 commit 4ff8d7c
Show file tree
Hide file tree
Showing 20 changed files with 30 additions and 31 deletions.
8 changes: 4 additions & 4 deletions docs/details/MeshHex8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ Mesh::Hex8::Regular::ndim()

Return number of dimensions (= 2).

Mesh::Hex8::Regular::getElementType()
-------------------------------------
Mesh::Hex8::Regular::elementType()
----------------------------------

Return element-type.

Expand Down Expand Up @@ -150,8 +150,8 @@ Mesh::Hex8::FineLayer::h()

Unit edge size (matches input).

Mesh::Hex8::FineLayer::getElementType()
---------------------------------------
Mesh::Hex8::FineLayer::elementType()
------------------------------------

Return element-type.

Expand Down
8 changes: 4 additions & 4 deletions docs/details/MeshQuad4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Mesh::Quad4::Regular::ndim()

Return number of dimensions (= 2).

Mesh::Quad4::Regular::getElementType()
--------------------------------------
Mesh::Quad4::Regular::elementType()
-----------------------------------

Return element-type.

Expand Down Expand Up @@ -148,8 +148,8 @@ Mesh::Quad4::FineLayer::h()

Unit edge size (matches input).

Mesh::Quad4::FineLayer::getElementType()
----------------------------------------
Mesh::Quad4::FineLayer::elementType()
-------------------------------------

Return element-type.

Expand Down
4 changes: 2 additions & 2 deletions docs/details/MeshTri3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ Mesh::Tri3::Regular::ndim()

Return number of dimensions (= 2).

Mesh::Tri3::Regular::getElementType()
-------------------------------------
Mesh::Tri3::Regular::elementType()
----------------------------------

Return element-type.

Expand Down
2 changes: 1 addition & 1 deletion docs/details/figures/MeshHex8/FineLayer/paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

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

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

Expand Down
2 changes: 1 addition & 1 deletion docs/details/figures/MeshHex8/Regular/paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

# write XDMF-file with metadata
pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
).write(os.path.splitext(fname)[0] + ".xdmf")
2 changes: 1 addition & 1 deletion docs/details/figures/MeshHex8/Regular/paraview_nodesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

Expand Down
2 changes: 1 addition & 1 deletion docs/details/figures/MeshQuad4/FineLayer/paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

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

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

Expand Down
2 changes: 1 addition & 1 deletion docs/details/figures/MeshQuad4/Regular/paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

# write XDMF-file with metadata
pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
).write(os.path.splitext(fname)[0] + ".xdmf")
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

Expand Down
2 changes: 1 addition & 1 deletion docs/details/figures/MeshTri3/Regular/paraview.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

# write XDMF-file with metadata
pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
).write(os.path.splitext(fname)[0] + ".xdmf")
2 changes: 1 addition & 1 deletion docs/details/figures/MeshTri3/Regular/paraview_nodesets.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@

# write XDMF-file with metadata
xdmf = pv.Mesh(
pv.Connectivity(fname, "/conn", mesh.getElementType(), mesh.conn.shape),
pv.Connectivity(fname, "/conn", mesh.elementType, mesh.conn.shape),
pv.Coordinates(fname, "/coor", mesh.coor.shape),
)

Expand Down
4 changes: 2 additions & 2 deletions include/GooseFEM/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ class RegularBase {
* The ElementType().
* @return element type
*/
auto getElementType() const
auto elementType() const
{
return derived_cast().getElementType_impl();
return derived_cast().elementType_impl();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions include/GooseFEM/MeshHex8.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Regular : public RegularBase3d<Regular> {
return m_nelz;
}

ElementType getElementType_impl() const
ElementType elementType_impl() const
{
return ElementType::Hex8;
}
Expand Down Expand Up @@ -885,7 +885,7 @@ class FineLayer : public RegularBase3d<FineLayer> {
{
return xt::amax(m_layer_nelz)();
}
ElementType getElementType_impl() const
ElementType elementType_impl() const
{
return ElementType::Hex8;
}
Expand Down
4 changes: 2 additions & 2 deletions include/GooseFEM/MeshQuad4.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Regular : public RegularBase2d<Regular> {
return m_nely;
}

ElementType getElementType_impl() const
ElementType elementType_impl() const
{
return ElementType::Quad4;
}
Expand Down Expand Up @@ -578,7 +578,7 @@ class FineLayer : public RegularBase2d<FineLayer> {
return xt::sum(m_nhy)();
}

ElementType getElementType_impl() const
ElementType elementType_impl() const
{
return ElementType::Quad4;
}
Expand Down
2 changes: 1 addition & 1 deletion include/GooseFEM/MeshTri3.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Regular : public RegularBase2d<Regular> {
return m_nely;
}

ElementType getElementType_impl() const
ElementType elementType_impl() const
{
return ElementType::Tri3;
}
Expand Down
3 changes: 1 addition & 2 deletions python/MatrixDiagonal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ void init_MatrixDiagonal(py::module& m)
py::arg("dofs")
);

cls.def("set", &GooseFEM::MatrixDiagonal::set, py::arg("A"));
cls.def_property_readonly("data", &GooseFEM::MatrixDiagonal::data);
cls.def_property("data", &GooseFEM::MatrixDiagonal::data, &GooseFEM::MatrixDiagonal::set);

cls.def("__repr__", [](const GooseFEM::MatrixDiagonal&) {
return "<GooseFEM.MatrixDiagonal>";
Expand Down
2 changes: 1 addition & 1 deletion python/Mesh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void register_Mesh_RegularBase(P& cls)
cls.def_property_readonly("nelx", &C::nelx);
cls.def_property_readonly("nely", &C::nely);
cls.def_property_readonly("h", &C::h);
cls.def_property_readonly("elementType", &C::getElementType);
cls.def_property_readonly("elementType", &C::elementType);
cls.def_property_readonly("coor", &C::coor);
cls.def_property_readonly("conn", &C::conn);
cls.def_property_readonly("dofs", &C::dofs);
Expand Down
2 changes: 1 addition & 1 deletion tests/basic/Mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ TEST_CASE("GooseFEM::Mesh", "Mesh.h")
{
GooseFEM::Mesh::Quad4::Regular mesh(2, 2, 10.0);
auto s = GooseFEM::Mesh::edgesize(mesh.coor(), mesh.conn());
auto t = GooseFEM::Mesh::edgesize(mesh.coor(), mesh.conn(), mesh.getElementType());
auto t = GooseFEM::Mesh::edgesize(mesh.coor(), mesh.conn(), mesh.elementType());
REQUIRE(xt::allclose(s, 10.0));
REQUIRE(xt::allclose(t, 10.0));
}
Expand Down

0 comments on commit 4ff8d7c

Please sign in to comment.