Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dimensionality of geoms #1215

Merged
merged 4 commits into from
Oct 8, 2024
Merged
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
46 changes: 23 additions & 23 deletions example/geometry/t8_example_geometries.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ typedef enum {
struct t8_geometry_sincos: public t8_geometry
{
public:
/* Basic constructor that sets the dimension and the name. */
t8_geometry_sincos (): t8_geometry (2, "t8_sincos_geometry")
/* Basic constructor that sets the name. */
t8_geometry_sincos (): t8_geometry ("t8_sincos_geometry")
{
}

Expand All @@ -93,7 +93,7 @@ struct t8_geometry_sincos: public t8_geometry
* models the rectangle [0,2] x [0,1].
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -175,16 +175,16 @@ struct t8_geometry_sincos: public t8_geometry
struct t8_geometry_moebius: public t8_geometry_with_vertices
{
public:
/* Basic constructor that sets the dimension and the name. */
t8_geometry_moebius (): t8_geometry_with_vertices (2, "t8_moebius_geometry")
/* Basic constructor that sets the name. */
t8_geometry_moebius (): t8_geometry_with_vertices ("t8_moebius_geometry")
{
}

/**
* Maps points in \f$ [0,1]^2 \f$ to the moebius band.
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -256,16 +256,16 @@ struct t8_geometry_moebius: public t8_geometry_with_vertices
struct t8_geometry_cylinder: public t8_geometry
{
public:
/* Basic constructor that sets the dimension and the name. */
t8_geometry_cylinder (): t8_geometry (2, "t8_cylinder_geometry")
/* Basic constructor that sets the name. */
t8_geometry_cylinder (): t8_geometry ("t8_cylinder_geometry")
{
}

/**
* Map a reference point in the unit square to a cylinder.
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -343,16 +343,16 @@ struct t8_geometry_cylinder: public t8_geometry
struct t8_geometry_circle: public t8_geometry_with_vertices
{
public:
/* Basic constructor that sets the dimension and the name. */
t8_geometry_circle (): t8_geometry_with_vertices (2, "t8_circle_geometry")
/* Basic constructor that sets the name. */
t8_geometry_circle (): t8_geometry_with_vertices ("t8_circle_geometry")
{
}

/**
* Map a reference point in the unit square to a circle.
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -431,16 +431,16 @@ struct t8_geometry_circle: public t8_geometry_with_vertices
struct t8_geometry_moving: public t8_geometry
{
public:
/* Basic constructor that sets the dimension the name and the time pointer. */
t8_geometry_moving (const double *time): t8_geometry (2, "t8_moving_geometry"), ptime (time)
/* Basic constructor that sets the name and the time pointer. */
t8_geometry_moving (const double *time): t8_geometry ("t8_moving_geometry"), ptime (time)
{
}

/**
* Map a reference point in the unit square to a square distorted with time.
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -535,15 +535,15 @@ struct t8_geometry_moving: public t8_geometry
struct t8_geometry_cube_zdistorted: public t8_geometry
{
public:
/* Basic constructor that sets the dimension and the name. */
t8_geometry_cube_zdistorted (): t8_geometry (3, "t8_cube_zdistorted_geometry")
/* Basic constructor that sets the name. */
t8_geometry_cube_zdistorted (): t8_geometry ("t8_cube_zdistorted_geometry")
{
}
/**
* Map a reference point in the unit cube to a cube distorted in the z axis.
* \param [in] cmesh The cmesh in which the point lies.
* \param [in] gtreeid The global tree (of the cmesh) in which the reference point is.
* \param [in] ref_coords Array of \a dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] ref_coords Array of tree dimension x \a num_coords many entries, specifying a point in \f$ [0,1]^2 \f$.
* \param [in] num_coords Amount of points of \f$ \mathrm{dim} \f$ to map.
* \param [out] out_coords The mapped coordinates in physical space of \a ref_coords. The length is \a num_coords * 3.
*/
Expand Down Expand Up @@ -748,7 +748,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type)
break;
case T8_GEOM_ANALYTIC_QUAD_TO_SPHERE:
t8_global_productionf ("Wrapping a quad around a sphere.\n");
t8_cmesh_register_geometry<t8_geometry_analytic> (cmesh, 3, "geom_quad_to_sphere", quad_to_sphere_callback, nullptr,
t8_cmesh_register_geometry<t8_geometry_analytic> (cmesh, "geom_quad_to_sphere", quad_to_sphere_callback, nullptr,
nullptr, nullptr, nullptr, nullptr);
t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_QUAD);
t8_cmesh_set_join (cmesh, 0, 0, 1, 0, 0);
Expand Down Expand Up @@ -776,7 +776,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type)
shape = BRepBuilderAPI_MakeEdge (cad_curve).Edge ();

/* Create a cad geometry. */
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, 2, shape);
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, shape);

/* The arrays indicate which face/edge carries a geometry.
* 0 means no geometry and any other number indicates the position of the geometry
Expand Down Expand Up @@ -840,7 +840,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type)
shape = BRepAlgoAPI_Fuse (shape, BRepBuilderAPI_MakeEdge (cad_curve1).Edge ());

/* Create a cad geometry. */
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, 3, shape);
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, shape);

/* The arrays indicate which face/edge carries a geometry.
* 0 means no geometry and any other number indicates the position of the geometry
Expand Down Expand Up @@ -941,7 +941,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type)
int edges[24] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

/* Create cad geometry. */
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, 3, shape);
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, shape);

/* Create tree 0 */
t8_cmesh_set_tree_class (cmesh, 0, T8_ECLASS_HEX);
Expand Down Expand Up @@ -1038,7 +1038,7 @@ t8_analytic_geom (int level, t8_example_geom_type geom_type)
int edges[24] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };

/* Create a cad geometry. */
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, 3, shape);
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, shape);

/* Create corresponding trees and parameters.
* Here we create num trees by a coordinate transformation from cylinder to cartesian coordinates. */
Expand Down
4 changes: 2 additions & 2 deletions src/t8_cmesh/t8_cmesh_cad.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ t8_cmesh_new_hollow_cylinder (sc_MPI_Comm comm, int num_tangential_trees, int nu
shape = BRepBuilderAPI_MakeFace (cylinder_outer, 1e-6).Face ();
shape = BRepAlgoAPI_Fuse (shape, BRepBuilderAPI_MakeFace (cylinder_inner, 1e-6).Face ());

t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, 3, shape, "cad surface");
t8_cmesh_register_geometry<t8_geometry_cad> (cmesh, shape, "cad surface");

#else /* !T8_WITH_OCC */
SC_ABORTF ("OCC not linked");
#endif /* T8_WITH_OCC */
}
else {
t8_cmesh_register_geometry<t8_geometry_linear> (cmesh, 3);
t8_cmesh_register_geometry<t8_geometry_linear> (cmesh);
}

#if T8_WITH_OCC
Expand Down
Loading