diff --git a/src/.clang-format b/src/.clang-format index 2750d3eed9..3e0c747667 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -1,26 +1,26 @@ -# requires clang 14 -# https://releases.llvm.org/14.0.0/tools/clang/docs/ClangFormatStyleOptions.html +# requires clang 19 +# https://releases.llvm.org/19.1.0/tools/clang/docs/ClangFormatStyleOptions.html BasedOnStyle: Google Language: Cpp -Standard: Cpp11 +Standard: c++20 +LineEnding: LF AccessModifierOffset: -2 AllowAllArgumentsOnNextLine: false -AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: false -AlwaysBreakTemplateDeclarations: true AlwaysBreakBeforeMultilineStrings: true BinPackArguments: false BinPackParameters: false BreakConstructorInitializers: BeforeComma +BreakTemplateDeclarations: Yes BreakBeforeBraces: Custom BraceWrapping: AfterCaseLabel: true AfterClass: true - AfterControlStatement: true + AfterControlStatement: Always AfterEnum: true AfterFunction: true AfterNamespace: true @@ -36,10 +36,12 @@ BraceWrapping: SplitEmptyRecord: false SplitEmptyNamespace: false -ConstructorInitializerAllOnOneLineOrOnePerLine: true ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 ColumnLimit: 100 +PackConstructorInitializers: CurrentLine + +DerivePointerAlignment: false FixNamespaceComments: true @@ -48,10 +50,12 @@ IndentPPDirectives: BeforeHash IndentWidth: 2 PenaltyExcessCharacter: 10 +PointerAlignment: Left +ReferenceAlignment: Left ReflowComments: false -SortIncludes: false +SortIncludes: Never SpaceAfterTemplateKeyword: true SpaceBeforeAssignmentOperators: true SpaceBeforeCpp11BracedList: true @@ -60,13 +64,10 @@ SpaceBeforeInheritanceColon: true SpaceBeforeParens: Never SpaceBeforeRangeBasedForLoopColon: true SpaceInEmptyBlock: true -SpaceInEmptyParentheses: false SpacesBeforeTrailingComments: 2 -SpacesInAngles: false -SpacesInCStyleCastParentheses: false +SpacesInAngles: Never SpacesInContainerLiterals: false -SpacesInConditionalStatement: false -SpacesInParentheses: false +SpacesInParens: Never SpacesInSquareBrackets: false UseTab: Never @@ -74,6 +75,6 @@ UseTab: Never ## Possible changes # Axom defaults for alignment -- consider changing -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: false -AlignOperands: false +AlignConsecutiveAssignments: None +AlignConsecutiveDeclarations: None +AlignOperands: DontAlign diff --git a/src/axom/bump/BlendData.hpp b/src/axom/bump/BlendData.hpp index b1d8cbf0c0..bd1b291e34 100644 --- a/src/axom/bump/BlendData.hpp +++ b/src/axom/bump/BlendData.hpp @@ -72,7 +72,7 @@ struct BlendData * \return The number of blend groups in the BlendData. */ AXOM_HOST_DEVICE -inline axom::IndexType numberOfValues(const BlendData &blend) +inline axom::IndexType numberOfValues(const BlendData& blend) { return blend.m_blendGroupSizesView.size(); } diff --git a/src/axom/bump/ComputeMeasure.hpp b/src/axom/bump/ComputeMeasure.hpp index 496d681545..6ba261ba97 100644 --- a/src/axom/bump/ComputeMeasure.hpp +++ b/src/axom/bump/ComputeMeasure.hpp @@ -35,7 +35,7 @@ class ComputeMeasure * * \param adaptor The adaptor object to use to compute the measure. */ - ComputeMeasure(Adaptor &adaptor) + ComputeMeasure(Adaptor& adaptor) : m_adaptor(adaptor) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -67,14 +67,14 @@ class ComputeMeasure * \param topoName The topology name for the field. * \param n_field The node that will contain the new field. */ - void execute(const std::string &topoName, conduit::Node &n_field) + void execute(const std::string& topoName, conduit::Node& n_field) { const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); n_field["topology"] = topoName; n_field["association"] = "element"; - conduit::Node &n_values = n_field["values"]; + conduit::Node& n_values = n_field["values"]; n_values.set_allocator(conduitAllocatorId); n_values.set(conduit::DataType::float64(m_adaptor.numberOfZones())); auto valuesView = bump::utilities::make_array_view(n_values); diff --git a/src/axom/bump/CoordsetBlender.hpp b/src/axom/bump/CoordsetBlender.hpp index 288cee341d..85cb939176 100644 --- a/src/axom/bump/CoordsetBlender.hpp +++ b/src/axom/bump/CoordsetBlender.hpp @@ -51,10 +51,10 @@ class CoordsetBlender * a view and the coordset node since the view may not be able to contain * some coordset metadata and remain trivially copyable. */ - void execute(const BlendData &blend, - const CoordsetViewType &view, - const conduit::Node &n_input, - conduit::Node &n_output, + void execute(const BlendData& blend, + const CoordsetViewType& view, + const conduit::Node& n_input, + conduit::Node& n_output, int allocator_id = axom::execution_space::allocatorID()) const { using value_type = typename CoordsetViewType::value_type; @@ -73,7 +73,7 @@ class CoordsetBlender n_output.reset(); n_output["type"] = "explicit"; - conduit::Node &n_values = n_output["values"]; + conduit::Node& n_values = n_output["values"]; // Determine output size. const auto origSize = blend.m_originalIdsView.size(); @@ -85,7 +85,7 @@ class CoordsetBlender for(size_t i = 0; i < nComponents; i++) { // Allocate data in the Conduit node and make a view. - conduit::Node &comp = n_values[axes[i]]; + conduit::Node& comp = n_values[axes[i]]; comp.set_allocator(conduitAllocatorId); comp.set(conduit::DataType(utils::cpp2conduit::id, outputSize)); compViews[i] = utils::make_array_view(comp); diff --git a/src/axom/bump/CoordsetExtents.hpp b/src/axom/bump/CoordsetExtents.hpp index a04eaf0966..67761051d6 100644 --- a/src/axom/bump/CoordsetExtents.hpp +++ b/src/axom/bump/CoordsetExtents.hpp @@ -43,8 +43,8 @@ struct ComputeCoordsetExtents axom::for_all( CoordsetView::dimension(), AXOM_LAMBDA(axom::IndexType dim) { - double &minValue = extentsView[2 * dim]; - double &maxValue = extentsView[2 * dim + 1]; + double& minValue = extentsView[2 * dim]; + double& maxValue = extentsView[2 * dim + 1]; minValue = axom::numeric_limits::max(); maxValue = -axom::numeric_limits::max(); }); @@ -55,8 +55,8 @@ struct ComputeCoordsetExtents const auto pt = coordsetView[index]; for(int d = 0; d < CoordsetView::dimension(); d++) { - double *minValue = extentsView.data() + 2 * d; - double *maxValue = minValue + 1; + double* minValue = extentsView.data() + 2 * d; + double* maxValue = minValue + 1; const auto value = static_cast(pt[d]); axom::atomicMin(minValue, value); axom::atomicMax(maxValue, value); @@ -150,7 +150,7 @@ class CoordsetExtents * * \param coordsetView The coordset view that wraps the coordset to be examined. */ - CoordsetExtents(const CoordsetView &coordsetView) + CoordsetExtents(const CoordsetView& coordsetView) : m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) { } diff --git a/src/axom/bump/CoordsetSlicer.hpp b/src/axom/bump/CoordsetSlicer.hpp index 5a312df50c..30d2baf2d5 100644 --- a/src/axom/bump/CoordsetSlicer.hpp +++ b/src/axom/bump/CoordsetSlicer.hpp @@ -35,7 +35,7 @@ class CoordsetSlicer { public: /// Constructor - CoordsetSlicer(const CoordsetView &coordsetView) + CoordsetSlicer(const CoordsetView& coordsetView) : m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -69,7 +69,7 @@ class CoordsetSlicer * * \note We assume for now that n_input != n_output. */ - void execute(const SliceData &slice, const conduit::Node &n_input, conduit::Node &n_output) + void execute(const SliceData& slice, const conduit::Node& n_input, conduit::Node& n_output) { AXOM_ANNOTATE_SCOPE("CoordsetSlicer"); using value_type = typename CoordsetView::value_type; @@ -88,7 +88,7 @@ class CoordsetSlicer n_output.reset(); n_output["type"] = "explicit"; - conduit::Node &n_values = n_output["values"]; + conduit::Node& n_values = n_output["values"]; // Determine output size. const auto outputSize = slice.m_indicesView.size(); @@ -98,7 +98,7 @@ class CoordsetSlicer for(size_t i = 0; i < nComponents; i++) { // Allocate data in the Conduit node and make a view. - conduit::Node &comp = n_values[axes[i]]; + conduit::Node& comp = n_values[axes[i]]; comp.set_allocator(conduitAllocatorId); comp.set(conduit::DataType(utils::cpp2conduit::id, outputSize)); compViews[i] = utils::make_array_view(comp); diff --git a/src/axom/bump/ExtractZones.hpp b/src/axom/bump/ExtractZones.hpp index c18e86d43d..d7ab05d7df 100644 --- a/src/axom/bump/ExtractZones.hpp +++ b/src/axom/bump/ExtractZones.hpp @@ -41,7 +41,7 @@ class ExtractZones * \param topoView The input topology view. * \param coordsetView The input coordset view. */ - ExtractZones(const TopologyView &topoView, const CoordsetView &coordsetView) + ExtractZones(const TopologyView& topoView, const CoordsetView& coordsetView) : m_topologyView(topoView) , m_coordsetView(coordsetView) , m_zoneSlice() @@ -101,10 +101,10 @@ class ExtractZones * 3 integer values for extra allocation to be made for nodes, zones, and connectivity. * This extra space can be filled in later by the application. */ - void execute(const SelectedZonesView &selectedZonesView, - const conduit::Node &n_input, - const conduit::Node &n_options, - conduit::Node &n_output) + void execute(const SelectedZonesView& selectedZonesView, + const conduit::Node& n_input, + const conduit::Node& n_options, + conduit::Node& n_output) { AXOM_ANNOTATE_SCOPE("ExtractZones"); namespace utils = axom::bump::utilities; @@ -126,20 +126,20 @@ class ExtractZones Options opts(n_options); // Make a new output topology. - const conduit::Node &n_topologies = n_input.fetch_existing("topologies"); + const conduit::Node& n_topologies = n_input.fetch_existing("topologies"); const std::string topoName = topologyName(n_input, n_options); - const conduit::Node &n_topo = n_topologies.fetch_existing(topoName); + const conduit::Node& n_topo = n_topologies.fetch_existing(topoName); const std::string newTopoName = opts.topologyName(topoName); - conduit::Node &n_newTopo = n_output["topologies/" + newTopoName]; + conduit::Node& n_newTopo = n_output["topologies/" + newTopoName]; makeTopology(selectedZonesView, dataSizes, extra, old2new.view(), n_topo, n_options, n_newTopo); // Make a new coordset. SliceData nSlice; nSlice.m_indicesView = nodeSlice.view(); const std::string coordsetName = n_topo.fetch_existing("coordset").as_string(); - const conduit::Node &n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); + const conduit::Node& n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); const std::string newCoordsetName = opts.coordsetName(coordsetName); - conduit::Node &n_newCoordset = n_output["coordsets/" + newCoordsetName]; + conduit::Node& n_newCoordset = n_output["coordsets/" + newCoordsetName]; makeCoordset(nSlice, n_coordset, n_newCoordset); // Update the coordset name in the topo. @@ -149,8 +149,8 @@ class ExtractZones bool makeOriginalZones = true; if(n_input.has_child("fields")) { - const conduit::Node &n_fields = n_input.fetch_existing("fields"); - conduit::Node &n_newFields = n_output["fields"]; + const conduit::Node& n_fields = n_input.fetch_existing("fields"); + conduit::Node& n_newFields = n_output["fields"]; SliceData zSlice; zSlice.m_indicesView = zoneSliceView(selectedZonesView, extra); makeOriginalZones = !n_fields.has_child(opts.originalElementsField()); @@ -163,8 +163,8 @@ class ExtractZones const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); - conduit::Node &n_outFields = n_output["fields"]; - conduit::Node &n_origElements = n_outFields[opts.originalElementsField()]; + conduit::Node& n_outFields = n_output["fields"]; + conduit::Node& n_origElements = n_outFields[opts.originalElementsField()]; n_origElements["topology"] = newTopoName; n_origElements["association"] = "element"; n_origElements["values"].set_allocator(conduitAllocatorId); @@ -198,8 +198,8 @@ class ExtractZones * * \return An array view containing the zone slice. */ - axom::ArrayView zoneSliceView(const SelectedZonesView &selectedZonesView, - const Sizes &extra) + axom::ArrayView zoneSliceView(const SelectedZonesView& selectedZonesView, + const Sizes& extra) { axom::ArrayView view; if(extra.zones > 0) @@ -236,7 +236,7 @@ class ExtractZones * * \return A Sizes object that contains extra sizes. Values not present in the options will be 0. */ - Sizes getExtra(const conduit::Node &n_options) const + Sizes getExtra(const conduit::Node& n_options) const { Sizes extra {}; if(n_options.has_path("extra/nodes")) @@ -269,10 +269,10 @@ class ExtractZones * * \note old2new is not used in this method. */ - Sizes nodeMap(const SelectedZonesView &selectedZonesView, - const Sizes &extra, - axom::Array &AXOM_UNUSED_PARAM(old2new), - axom::Array &nodeSlice) const + Sizes nodeMap(const SelectedZonesView& selectedZonesView, + const Sizes& extra, + axom::Array& AXOM_UNUSED_PARAM(old2new), + axom::Array& nodeSlice) const { AXOM_ANNOTATE_SCOPE("nodeMap"); const int allocatorID = getAllocatorID(); @@ -338,9 +338,9 @@ class ExtractZones * (excluding extra) for the output mesh. */ Sizes compactNodeMap(const SelectedZonesView selectedZonesView, - const Sizes &extra, - axom::Array &old2new, - axom::Array &nodeSlice) const + const Sizes& extra, + axom::Array& old2new, + axom::Array& nodeSlice) const { AXOM_ANNOTATE_SCOPE("compactNodeMap"); const int allocatorID = getAllocatorID(); @@ -448,12 +448,12 @@ class ExtractZones * \param n_newTopo A node to contain the new topology. */ virtual void makeTopology(const SelectedZonesView selectedZonesView, - const Sizes &dataSizes, - const Sizes &extra, - const axom::ArrayView &old2newView, - const conduit::Node &n_topo, - const conduit::Node &n_options, - conduit::Node &n_newTopo) const + const Sizes& dataSizes, + const Sizes& extra, + const axom::ArrayView& old2newView, + const conduit::Node& n_topo, + const conduit::Node& n_options, + conduit::Node& n_newTopo) const { AXOM_ANNOTATE_SCOPE("makeTopology"); namespace utils = axom::bump::utilities; @@ -476,19 +476,19 @@ class ExtractZones n_newTopo["coordset"] = n_topo["coordset"].as_string(); n_newTopo["elements/shape"] = outputShape(n_topo); - conduit::Node &n_conn = n_newTopo["elements/connectivity"]; + conduit::Node& n_conn = n_newTopo["elements/connectivity"]; n_conn.set_allocator(conduitAllocatorId); n_conn.set(conduit::DataType(utils::cpp2conduit::id, dataSizes.connectivity + extra.connectivity)); auto connView = utils::make_array_view(n_conn); - conduit::Node &n_sizes = n_newTopo["elements/sizes"]; + conduit::Node& n_sizes = n_newTopo["elements/sizes"]; n_sizes.set_allocator(conduitAllocatorId); n_sizes.set( conduit::DataType(utils::cpp2conduit::id, dataSizes.zones + extra.zones)); auto sizesView = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_newTopo["elements/offsets"]; + conduit::Node& n_offsets = n_newTopo["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set( conduit::DataType(utils::cpp2conduit::id, dataSizes.zones + extra.zones)); @@ -561,10 +561,10 @@ class ExtractZones // Handle shapes, if present. if(n_topo.has_path("elements/shapes")) { - const conduit::Node &n_shapes = n_topo.fetch_existing("elements/shapes"); + const conduit::Node& n_shapes = n_topo.fetch_existing("elements/shapes"); auto shapesView = utils::make_array_view(n_shapes); - conduit::Node &n_newShapes = n_newTopo["elements/shapes"]; + conduit::Node& n_newShapes = n_newTopo["elements/shapes"]; n_newShapes.set_allocator(conduitAllocatorId); n_newShapes.set(conduit::DataType(utils::cpp2conduit::id, dataSizes.zones + extra.zones)); @@ -594,9 +594,9 @@ class ExtractZones * \param n_coordset The input coordset, which is passed for metadata. * \param[out] n_newCoordset The new coordset. */ - void makeCoordset(const SliceData &nodeSlice, - const conduit::Node &n_coordset, - conduit::Node &n_newCoordset) const + void makeCoordset(const SliceData& nodeSlice, + const conduit::Node& n_coordset, + conduit::Node& n_newCoordset) const { AXOM_ANNOTATE_SCOPE("makeCoordset"); // _bump_utilities_coordsetslicer_begin @@ -616,11 +616,11 @@ class ExtractZones * \param n_fields The input fields. * \param n_newFields The output fields. */ - void makeFields(const SliceData &nodeSlice, - const SliceData &zoneSlice, - const std::string &newTopoName, - const conduit::Node &n_fields, - conduit::Node &n_newFields) const + void makeFields(const SliceData& nodeSlice, + const SliceData& zoneSlice, + const std::string& newTopoName, + const conduit::Node& n_fields, + conduit::Node& n_newFields) const { AXOM_ANNOTATE_SCOPE("makeFields"); @@ -628,9 +628,9 @@ class ExtractZones for(conduit::index_t i = 0; i < n_fields.number_of_children(); i++) { - const conduit::Node &n_field = n_fields[i]; + const conduit::Node& n_field = n_fields[i]; const std::string association = n_field["association"].as_string(); - conduit::Node &n_newField = n_newFields[n_field.name()]; + conduit::Node& n_newField = n_newFields[n_field.name()]; axom::bump::FieldSlicer fs; fs.setAllocatorID(getAllocatorID()); if(association == "element") @@ -653,7 +653,7 @@ class ExtractZones * * \return Returns the options topology name, if present. Otherwise, it returns the first topology name. */ - std::string topologyName(const conduit::Node &n_input, const conduit::Node &n_options) const + std::string topologyName(const conduit::Node& n_input, const conduit::Node& n_options) const { std::string name; if(n_options.has_path("topology")) @@ -662,7 +662,7 @@ class ExtractZones } else { - const conduit::Node &n_topologies = n_input.fetch_existing("topologies"); + const conduit::Node& n_topologies = n_input.fetch_existing("topologies"); name = n_topologies[0].name(); } return name; @@ -675,7 +675,7 @@ class ExtractZones * * \return True if compaction is on (the default), false otherwise. */ - bool compact(const conduit::Node &n_options) const + bool compact(const conduit::Node& n_options) const { bool retval = true; if(n_options.has_path("compact")) @@ -692,7 +692,7 @@ class ExtractZones * * \return The name of the output shape. */ - std::string outputShape(const conduit::Node &n_topo) const + std::string outputShape(const conduit::Node& n_topo) const { std::string shape; if(n_topo["type"].as_string() == "unstructured") @@ -747,9 +747,9 @@ class ExtractZonesAndMatset : public ExtractZones(topoView, coordsetView) , m_matsetView(matsetView) { } @@ -770,10 +770,10 @@ class ExtractZonesAndMatset : public ExtractZones &old2newView, - const conduit::Node &n_topo, - const conduit::Node &AXOM_UNUSED_PARAM(n_options), - conduit::Node &n_newTopo) const override + const Sizes& AXOM_UNUSED_PARAM(dataSizes), + const Sizes& AXOM_UNUSED_PARAM(extra), + const axom::ArrayView& old2newView, + const conduit::Node& n_topo, + const conduit::Node& AXOM_UNUSED_PARAM(n_options), + conduit::Node& n_newTopo) const override { AXOM_ANNOTATE_SCOPE("makeTopology(polyhedral)"); namespace utils = axom::bump::utilities; @@ -201,34 +201,34 @@ class ExtractZonesAndMatsetPolyhedral n_newTopo["elements/shape"] = "polyhedral"; n_newTopo["subelements/shape"] = "polygonal"; - conduit::Node &n_conn = n_newTopo["elements/connectivity"]; + conduit::Node& n_conn = n_newTopo["elements/connectivity"]; n_conn.set_allocator(conduitAllocatorId); n_conn.set( conduit::DataType(utils::cpp2conduit::id, numSelectedZones * FacesPerHex)); auto connView = utils::make_array_view(n_conn); - conduit::Node &n_sizes = n_newTopo["elements/sizes"]; + conduit::Node& n_sizes = n_newTopo["elements/sizes"]; n_sizes.set_allocator(conduitAllocatorId); n_sizes.set(conduit::DataType(utils::cpp2conduit::id, numSelectedZones)); auto sizesView = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_newTopo["elements/offsets"]; + conduit::Node& n_offsets = n_newTopo["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(utils::cpp2conduit::id, numSelectedZones)); auto offsetsView = utils::make_array_view(n_offsets); - conduit::Node &n_se_conn = n_newTopo["subelements/connectivity"]; + conduit::Node& n_se_conn = n_newTopo["subelements/connectivity"]; n_se_conn.set_allocator(conduitAllocatorId); n_se_conn.set( conduit::DataType(utils::cpp2conduit::id, faceCount * PointsPerQuad)); auto seConnView = utils::make_array_view(n_se_conn); - conduit::Node &n_se_sizes = n_newTopo["subelements/sizes"]; + conduit::Node& n_se_sizes = n_newTopo["subelements/sizes"]; n_se_sizes.set_allocator(conduitAllocatorId); n_se_sizes.set(conduit::DataType(utils::cpp2conduit::id, faceCount)); auto seSizesView = utils::make_array_view(n_se_sizes); - conduit::Node &n_se_offsets = n_newTopo["subelements/offsets"]; + conduit::Node& n_se_offsets = n_newTopo["subelements/offsets"]; n_se_offsets.set_allocator(conduitAllocatorId); n_se_offsets.set(conduit::DataType(utils::cpp2conduit::id, faceCount)); auto seOffsetsView = utils::make_array_view(n_se_offsets); diff --git a/src/axom/bump/ExtrudeMesh.hpp b/src/axom/bump/ExtrudeMesh.hpp index 4b6636828c..3cb0d2fc4b 100644 --- a/src/axom/bump/ExtrudeMesh.hpp +++ b/src/axom/bump/ExtrudeMesh.hpp @@ -41,7 +41,7 @@ class ExtrudeMesh * \param topoView The topology view. * \param coordsetView The coordset view. */ - ExtrudeMesh(const TopologyView &topoView, const CoordsetView &coordsetView) + ExtrudeMesh(const TopologyView& topoView, const CoordsetView& coordsetView) : m_topologyView(topoView) , m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) @@ -86,7 +86,7 @@ class ExtrudeMesh * outputMatsetName: newmatset * \endverbatim */ - void execute(const conduit::Node &n_mesh, const conduit::Node &n_options, conduit::Node &n_output) const + void execute(const conduit::Node& n_mesh, const conduit::Node& n_options, conduit::Node& n_output) const { namespace utils = axom::bump::utilities; namespace views = axom::bump::views; @@ -96,7 +96,7 @@ class ExtrudeMesh // Get some properties from the options. const std::string srcTopoName = n_options.has_child("topologyName") ? n_options["topologyName"].as_string() : "main"; - const conduit::Node &n_srcTopo = n_mesh.fetch_existing("topologies/" + srcTopoName); + const conduit::Node& n_srcTopo = n_mesh.fetch_existing("topologies/" + srcTopoName); const std::string srcCoordsetName = n_srcTopo["coordset"].as_string(); const std::string outputTopoName = n_options.has_child("outputTopologyName") ? n_options["outputTopologyName"].as_string() @@ -153,14 +153,14 @@ class ExtrudeMesh // Create the new coordset. AXOM_ANNOTATE_BEGIN("coordset"); - const char *coordNames[] = {"values/x", "values/y", "values/z"}; - conduit::Node &n_outputCoordset = n_output["coordsets/" + outputCoordsetName]; + const char* coordNames[] = {"values/x", "values/y", "values/z"}; + conduit::Node& n_outputCoordset = n_output["coordsets/" + outputCoordsetName]; n_outputCoordset["type"] = "explicit"; using value_type = typename CoordsetView::value_type; axom::StackArray, 3> values; for(int d = 0; d < 3; d++) { - conduit::Node &n_value = n_outputCoordset[coordNames[d]]; + conduit::Node& n_value = n_outputCoordset[coordNames[d]]; n_value.set_allocator(conduitAllocatorId); n_value.set(conduit::DataType(utils::cpp2conduit::id, totalNodes)); values[d] = utils::make_array_view(n_value); @@ -188,7 +188,7 @@ class ExtrudeMesh // Create the new topology. AXOM_ANNOTATE_BEGIN("topology"); - conduit::Node &n_outputTopo = n_output["topologies/" + outputTopoName]; + conduit::Node& n_outputTopo = n_output["topologies/" + outputTopoName]; n_outputTopo["type"] = "unstructured"; n_outputTopo["coordset"] = outputCoordsetName; int count = axom::utilities::popcount(shapes); @@ -211,10 +211,10 @@ class ExtrudeMesh n_outputTopo["elements/shape"] = "hex"; } - conduit::Node &n_connectivity = n_outputTopo["elements/connectivity"]; - conduit::Node &n_shapes = n_outputTopo["elements/shapes"]; - conduit::Node &n_sizes = n_outputTopo["elements/sizes"]; - conduit::Node &n_offsets = n_outputTopo["elements/offsets"]; + conduit::Node& n_connectivity = n_outputTopo["elements/connectivity"]; + conduit::Node& n_shapes = n_outputTopo["elements/shapes"]; + conduit::Node& n_sizes = n_outputTopo["elements/sizes"]; + conduit::Node& n_offsets = n_outputTopo["elements/offsets"]; using ConnectivityType = typename TopologyView::ConnectivityType; n_connectivity.set_allocator(conduitAllocatorId); @@ -310,11 +310,11 @@ class ExtrudeMesh std::string matsetName = findMatset(n_mesh, srcTopoName); if(!matsetName.empty()) { - const conduit::Node &n_srcMatset = n_mesh.fetch_existing("matsets/" + matsetName); + const conduit::Node& n_srcMatset = n_mesh.fetch_existing("matsets/" + matsetName); std::string outputMatsetName = n_options.has_child("outputMatsetName") ? n_options["outputMatsetName"].as_string() : matsetName; - conduit::Node &n_outputMatset = n_output["matsets/" + outputMatsetName]; + conduit::Node& n_outputMatset = n_output["matsets/" + outputMatsetName]; extrudeMatset(n_srcMatset, n_outputMatset, outputTopoName, nz); } } @@ -333,12 +333,12 @@ class ExtrudeMesh * \return The name of the matset associated with the input topology, or an * empty string if no matset exists. */ - std::string findMatset(const conduit::Node &n_mesh, const std::string &topoName) const + std::string findMatset(const conduit::Node& n_mesh, const std::string& topoName) const { std::string matset; if(n_mesh.has_child("matsets")) { - const conduit::Node &n_matsets = n_mesh["matsets"]; + const conduit::Node& n_matsets = n_mesh["matsets"]; for(conduit::index_t i = 0; i < n_matsets.number_of_children(); i++) { if(n_matsets[i]["topology"].as_string() == topoName) @@ -361,32 +361,32 @@ class ExtrudeMesh * * \note In future work, we could use matset views to support more input matset types. */ - void extrudeMatset(const conduit::Node &n_srcMatset, - conduit::Node &n_outputMatset, - const std::string &outputTopoName, + void extrudeMatset(const conduit::Node& n_srcMatset, + conduit::Node& n_outputMatset, + const std::string& outputTopoName, int nz) const { namespace utils = axom::bump::utilities; namespace views = axom::bump::views; AXOM_ANNOTATE_SCOPE("matset"); - const conduit::Node &n_materialMap = n_srcMatset["material_map"]; + const conduit::Node& n_materialMap = n_srcMatset["material_map"]; - const conduit::Node &n_src_volume_fractions = n_srcMatset["volume_fractions"]; - const conduit::Node &n_src_material_ids = n_srcMatset["material_ids"]; - const conduit::Node &n_src_indices = n_srcMatset["indices"]; - const conduit::Node &n_src_sizes = n_srcMatset["sizes"]; - const conduit::Node &n_src_offsets = n_srcMatset["offsets"]; + const conduit::Node& n_src_volume_fractions = n_srcMatset["volume_fractions"]; + const conduit::Node& n_src_material_ids = n_srcMatset["material_ids"]; + const conduit::Node& n_src_indices = n_srcMatset["indices"]; + const conduit::Node& n_src_sizes = n_srcMatset["sizes"]; + const conduit::Node& n_src_offsets = n_srcMatset["offsets"]; // Make new matset nodes n_outputMatset["material_map"].set(n_materialMap); n_outputMatset["topology"].set(outputTopoName); - conduit::Node &n_material_ids = n_outputMatset["material_ids"]; - conduit::Node &n_volume_fractions = n_outputMatset["volume_fractions"]; - conduit::Node &n_indices = n_outputMatset["indices"]; - conduit::Node &n_sizes = n_outputMatset["sizes"]; - conduit::Node &n_offsets = n_outputMatset["offsets"]; + conduit::Node& n_material_ids = n_outputMatset["material_ids"]; + conduit::Node& n_volume_fractions = n_outputMatset["volume_fractions"]; + conduit::Node& n_indices = n_outputMatset["indices"]; + conduit::Node& n_sizes = n_outputMatset["sizes"]; + conduit::Node& n_offsets = n_outputMatset["offsets"]; const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); diff --git a/src/axom/bump/FieldBlender.hpp b/src/axom/bump/FieldBlender.hpp index ebf60656e6..82a7511822 100644 --- a/src/axom/bump/FieldBlender.hpp +++ b/src/axom/bump/FieldBlender.hpp @@ -27,13 +27,13 @@ namespace bump struct SelectAllPolicy { AXOM_HOST_DEVICE - static inline IndexType size(const BlendData &blend) + static inline IndexType size(const BlendData& blend) { return blend.m_blendGroupSizesView.size(); } AXOM_HOST_DEVICE - static inline IndexType selectedIndex(const BlendData & /*blend*/, IndexType index) + static inline IndexType selectedIndex(const BlendData& /*blend*/, IndexType index) { return index; } @@ -45,13 +45,13 @@ struct SelectAllPolicy struct SelectSubsetPolicy { AXOM_HOST_DEVICE - static inline IndexType size(const BlendData &blend) + static inline IndexType size(const BlendData& blend) { return blend.m_selectedIndicesView.size(); } AXOM_HOST_DEVICE - static inline IndexType selectedIndex(const BlendData &blend, IndexType index) + static inline IndexType selectedIndex(const BlendData& blend, IndexType index) { return blend.m_selectedIndicesView[index]; } @@ -78,7 +78,7 @@ class FieldBlender * \brief Constructor * \param indexing An object used to transform node indices. */ - FieldBlender(const IndexingPolicy &indexing) + FieldBlender(const IndexingPolicy& indexing) : m_indexing(indexing) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -110,21 +110,21 @@ class FieldBlender * \param n_input The input field that we're blending. * \param n_output The output node that will contain the new field. */ - void execute(const BlendData &blend, const conduit::Node &n_input, conduit::Node &n_output) const + void execute(const BlendData& blend, const conduit::Node& n_input, conduit::Node& n_output) const { n_output.reset(); n_output["association"] = n_input["association"]; n_output["topology"] = n_input["topology"]; - const conduit::Node &n_input_values = n_input["values"]; - conduit::Node &n_output_values = n_output["values"]; + const conduit::Node& n_input_values = n_input["values"]; + conduit::Node& n_output_values = n_output["values"]; const conduit::index_t nc = n_input_values.number_of_children(); if(nc > 0) { for(conduit::index_t i = 0; i < nc; i++) { - const conduit::Node &n_comp = n_input_values[i]; - conduit::Node &n_out_comp = n_output_values[n_comp.name()]; + const conduit::Node& n_comp = n_input_values[i]; + conduit::Node& n_out_comp = n_output_values[n_comp.name()]; blendSingleComponent(blend, n_comp, n_out_comp); } } @@ -146,9 +146,9 @@ class FieldBlender * \param n_values The input values that we're blending. * \param n_output_values The output node that will contain the new field. */ - void blendSingleComponent(const BlendData &blend, - const conduit::Node &n_values, - conduit::Node &n_output_values) const + void blendSingleComponent(const BlendData& blend, + const conduit::Node& n_values, + conduit::Node& n_output_values) const { // We're allowing selectedIndicesView to be used to select specific blend // groups. If the user did not provide that, use all blend groups. @@ -177,7 +177,7 @@ class FieldBlender * lambda. */ template - void blendSingleComponentImpl(const BlendData &blend, SrcView comp_view, OutputView out_view) const + void blendSingleComponentImpl(const BlendData& blend, SrcView comp_view, OutputView out_view) const { using value_type = typename decltype(comp_view)::value_type; using accum_type = typename utilities::accumulation_traits::type; diff --git a/src/axom/bump/FieldSlicer.hpp b/src/axom/bump/FieldSlicer.hpp index 17d7eb0db7..43413f876b 100644 --- a/src/axom/bump/FieldSlicer.hpp +++ b/src/axom/bump/FieldSlicer.hpp @@ -35,7 +35,7 @@ struct SliceData * \return The number of values made from the SliceData. */ AXOM_HOST_DEVICE -inline axom::IndexType numberOfValues(const SliceData &slice) { return slice.m_indicesView.size(); } +inline axom::IndexType numberOfValues(const SliceData& slice) { return slice.m_indicesView.size(); } /*! * \accelerated @@ -58,7 +58,7 @@ class FieldSlicer * \brief Constructor * \param indexing An object used to transform node indices. */ - FieldSlicer(const IndexingPolicy &indexing) + FieldSlicer(const IndexingPolicy& indexing) : m_indexing(indexing) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -92,21 +92,21 @@ class FieldSlicer * * \note We assume for now that n_input != n_output. */ - void execute(const SliceData &slice, const conduit::Node &n_input, conduit::Node &n_output) + void execute(const SliceData& slice, const conduit::Node& n_input, conduit::Node& n_output) { n_output.reset(); n_output["association"] = n_input["association"]; n_output["topology"] = n_input["topology"]; - const conduit::Node &n_input_values = n_input["values"]; - conduit::Node &n_output_values = n_output["values"]; + const conduit::Node& n_input_values = n_input["values"]; + conduit::Node& n_output_values = n_output["values"]; const conduit::index_t nc = n_input_values.number_of_children(); if(nc > 0) { for(conduit::index_t i = 0; i < nc; i++) { - const conduit::Node &n_comp = n_input_values[i]; - conduit::Node &n_out_comp = n_output_values[n_comp.name()]; + const conduit::Node& n_comp = n_input_values[i]; + conduit::Node& n_out_comp = n_output_values[n_comp.name()]; sliceSingleComponent(slice, n_comp, n_out_comp); } } @@ -128,9 +128,9 @@ class FieldSlicer * \param n_values The input values that we're slicing. * \param n_output_values The output node that will contain the new field. */ - void sliceSingleComponent(const SliceData &slice, - const conduit::Node &n_values, - conduit::Node &n_output_values) const + void sliceSingleComponent(const SliceData& slice, + const conduit::Node& n_values, + conduit::Node& n_output_values) const { namespace utils = axom::bump::utilities; const auto output_size = slice.m_indicesView.size(); @@ -156,7 +156,7 @@ class FieldSlicer * lambda. */ template - void sliceSingleComponentImpl(const SliceData &slice, + void sliceSingleComponentImpl(const SliceData& slice, ValuesView values_view, OutputView output_view) const { diff --git a/src/axom/bump/HashNaming.hpp b/src/axom/bump/HashNaming.hpp index d1f07b8db8..4297b1f804 100644 --- a/src/axom/bump/HashNaming.hpp +++ b/src/axom/bump/HashNaming.hpp @@ -71,7 +71,7 @@ class HashNaming * to some of the other shortcuts for smaller arrays. */ AXOM_HOST_DEVICE - KeyType makeName(const IndexType *p, int n) const + KeyType makeName(const IndexType* p, int n) const { KeyType name {}; if(n == 1) @@ -125,7 +125,7 @@ class HashNaming * \return A name that encodes the ids. */ AXOM_HOST_DEVICE - KeyType make_name_n(const IndexType *p, int n) const + KeyType make_name_n(const IndexType* p, int n) const { KeyType retval {}; if(n == 3 && m_maxId <= Max20Bit) @@ -171,9 +171,9 @@ class HashNaming axom::utilities::Sorting::sort(sorted, n); // Make a hash from the narrowed ids - void *ptr = static_cast(sorted); + void* ptr = static_cast(sorted); KeyType k0 = - axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(std::uint16_t)); + axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(std::uint16_t)); retval = KeyIDHash | (k0 & PayloadMask); } else if(m_maxId < Max32Bit) @@ -187,9 +187,9 @@ class HashNaming axom::utilities::Sorting::sort(sorted, n); // Make a hash from the narrowed ids - void *ptr = static_cast(sorted); + void* ptr = static_cast(sorted); KeyType k0 = - axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(std::uint32_t)); + axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(std::uint32_t)); retval = KeyIDHash | (k0 & PayloadMask); } else if(n > 0) @@ -202,9 +202,9 @@ class HashNaming axom::utilities::Sorting::sort(sorted, n); // Make a hash from the ids - void *ptr = static_cast(sorted); + void* ptr = static_cast(sorted); KeyType k0 = - axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(IndexType)); + axom::utilities::hash_bytes(static_cast(ptr), n * sizeof(IndexType)); retval = KeyIDHash | (k0 & PayloadMask); } return retval; @@ -216,7 +216,7 @@ class HashNaming // Host-callable methods /// Make a name from the array of ids. - KeyType makeName(const IndexType *p, int n) const { return m_view.makeName(p, n); } + KeyType makeName(const IndexType* p, int n) const { return m_view.makeName(p, n); } /*! * \brief Set the max number of nodes, which can help with id packing/narrowing. diff --git a/src/axom/bump/IndexingPolicies.hpp b/src/axom/bump/IndexingPolicies.hpp index 037c75f381..032b3b6012 100644 --- a/src/axom/bump/IndexingPolicies.hpp +++ b/src/axom/bump/IndexingPolicies.hpp @@ -44,7 +44,7 @@ struct SSElementFieldIndexing * * \note Executes on the host. */ - void update(const conduit::Node &field) + void update(const conduit::Node& field) { axom::bump::utilities::fillFromNode(field, "offsets", m_indexing.m_offsets, true); axom::bump::utilities::fillFromNode(field, "strides", m_indexing.m_strides, true); @@ -78,7 +78,7 @@ struct SSVertexFieldIndexing * * \note Executes on the host. */ - void update(const conduit::Node &field) + void update(const conduit::Node& field) { axom::bump::utilities::fillFromNode(field, "offsets", m_fieldIndexing.m_offsets, true); axom::bump::utilities::fillFromNode(field, "strides", m_fieldIndexing.m_strides, true); diff --git a/src/axom/bump/MakeExplicitCoordset.hpp b/src/axom/bump/MakeExplicitCoordset.hpp index cb8353ba9f..c8097adc82 100644 --- a/src/axom/bump/MakeExplicitCoordset.hpp +++ b/src/axom/bump/MakeExplicitCoordset.hpp @@ -33,7 +33,7 @@ class MakeExplicitCoordset * \param[inout] n_coordset The coordset to convert. * \param allocator_id The allocator id to use when allocating new coordinate memory. */ - static void execute(conduit::Node &n_coordset, + static void execute(conduit::Node& n_coordset, int allocator_id = axom::execution_space::allocatorID()) { const std::string cstype = n_coordset["type"].as_string(); @@ -76,19 +76,19 @@ class MakeExplicitCoordset * \param allocator_id The allocator id to use when allocating new coordinate memory. */ template - static void convert(CoordsetView coordsetView, conduit::Node &n_dest_coordset, int allocator_id) + static void convert(CoordsetView coordsetView, conduit::Node& n_dest_coordset, int allocator_id) { const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(allocator_id); // Make new coordinate arrays - const char *names[] = {"x", "y", "z"}; + const char* names[] = {"x", "y", "z"}; using value_type = typename CoordsetView::value_type; namespace utils = axom::bump::utilities; axom::ArrayView comps[3]; - conduit::Node &n_values = n_dest_coordset["values"]; + conduit::Node& n_values = n_dest_coordset["values"]; for(int c = 0; c < coordsetView.dimension(); c++) { - conduit::Node &n_comp = n_values[names[c]]; + conduit::Node& n_comp = n_values[names[c]]; n_comp.set_allocator(conduitAllocatorId); n_comp.set(conduit::DataType(utils::cpp2conduit::id, coordsetView.size())); comps[c] = utils::make_array_view(n_comp); diff --git a/src/axom/bump/MakePointMesh.hpp b/src/axom/bump/MakePointMesh.hpp index b5f6d8775d..992a0c3ee3 100644 --- a/src/axom/bump/MakePointMesh.hpp +++ b/src/axom/bump/MakePointMesh.hpp @@ -33,7 +33,7 @@ struct MakePointMesh * \param topologyView The topology view that describes the input topology. * \param coordsetView The coordset view that describes the input coordset. */ - MakePointMesh(const TopologyView &topologyView, const CoordsetView &coordsetView) + MakePointMesh(const TopologyView& topologyView, const CoordsetView& coordsetView) : m_topologyView(topologyView) , m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) @@ -70,10 +70,10 @@ struct MakePointMesh * a view and the coordset node since the view may not be able to contain * some coordset metadata and remain trivially copyable. */ - void execute(const conduit::Node &n_topology, - const conduit::Node &n_coordset, - const conduit::Node &n_options, - conduit::Node &n_output) const + void execute(const conduit::Node& n_topology, + const conduit::Node& n_coordset, + const conduit::Node& n_options, + conduit::Node& n_output) const { const auto numZones = m_topologyView.numberOfZones(); const int allocatorID = getAllocatorID(); @@ -97,10 +97,10 @@ struct MakePointMesh * \param[out] n_output A node that will contain the new point mesh. */ void execute(axom::ArrayView selectedZonesView, - const conduit::Node &n_topology, - const conduit::Node &n_coordset, - const conduit::Node &n_options, - conduit::Node &n_output) const + const conduit::Node& n_topology, + const conduit::Node& n_coordset, + const conduit::Node& n_options, + conduit::Node& n_output) const { AXOM_ANNOTATE_SCOPE("ConvertToPointMesh"); namespace utils = axom::bump::utilities; @@ -117,29 +117,29 @@ struct MakePointMesh // Make the zone centers be the new coordset values in the output coordset. AXOM_ANNOTATE_BEGIN("allocate"); - conduit::Node &n_output_coordset = n_output["coordsets/" + opts.coordsetName(n_coordset.name())]; + conduit::Node& n_output_coordset = n_output["coordsets/" + opts.coordsetName(n_coordset.name())]; n_output_coordset.reset(); n_output_coordset["type"] = "explicit"; n_output_coordset["values"].move(zcfield["values"]); // Allocate point mesh data. - conduit::Node &n_output_topo = n_output["topologies/" + opts.topologyName(n_topology.name())]; + conduit::Node& n_output_topo = n_output["topologies/" + opts.topologyName(n_topology.name())]; const auto numPoints = selectedZonesView.size(); n_output_topo.reset(); n_output_topo["type"] = "unstructured"; n_output_topo["coordset"] = opts.coordsetName(n_coordset.name()); n_output_topo["elements/shape"] = "point"; - conduit::Node &n_conn = n_output_topo["elements/connectivity"]; + conduit::Node& n_conn = n_output_topo["elements/connectivity"]; n_conn.set_allocator(conduitAllocatorId); n_conn.set(conduit::DataType(utils::cpp2conduit::id, numPoints)); auto connectivity = utils::make_array_view(n_conn); - conduit::Node &n_sizes = n_output_topo["elements/sizes"]; + conduit::Node& n_sizes = n_output_topo["elements/sizes"]; n_sizes.set_allocator(conduitAllocatorId); n_sizes.set(conduit::DataType(utils::cpp2conduit::id, numPoints)); auto sizes = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_output_topo["elements/offsets"]; + conduit::Node& n_offsets = n_output_topo["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(utils::cpp2conduit::id, numPoints)); auto offsets = utils::make_array_view(n_offsets); diff --git a/src/axom/bump/MakePolyhedralTopology.hpp b/src/axom/bump/MakePolyhedralTopology.hpp index 51405a4a78..f0ae885fb6 100644 --- a/src/axom/bump/MakePolyhedralTopology.hpp +++ b/src/axom/bump/MakePolyhedralTopology.hpp @@ -39,7 +39,7 @@ class MakePolyhedralTopology * * \param topologyView The topology view that wraps the input topology. */ - MakePolyhedralTopology(const TopologyView &topologyView) + MakePolyhedralTopology(const TopologyView& topologyView) : m_topologyView(topologyView) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -73,7 +73,7 @@ class MakePolyhedralTopology * \param[out] n_newTopo The node that will contain the new polyhedral topology. * */ - void execute(const conduit::Node &n_topo, conduit::Node &n_newTopo) const + void execute(const conduit::Node& n_topo, conduit::Node& n_newTopo) const { AXOM_ANNOTATE_SCOPE("MakePolyhedralTopology"); namespace utils = axom::bump::utilities; @@ -90,12 +90,12 @@ class MakePolyhedralTopology n_newTopo["subelements/shape"] = "polygonal"; // This node is the number of faces in each zone. - conduit::Node &n_elem_sizes = n_newTopo["elements/sizes"]; + conduit::Node& n_elem_sizes = n_newTopo["elements/sizes"]; n_elem_sizes.set_allocator(conduitAllocatorId); n_elem_sizes.set(conduit::DataType(utils::cpp2conduit::id, nzones)); auto elem_sizes = utils::make_array_view(n_elem_sizes); - conduit::Node &n_elem_offsets = n_newTopo["elements/offsets"]; + conduit::Node& n_elem_offsets = n_newTopo["elements/offsets"]; n_elem_offsets.set_allocator(conduitAllocatorId); n_elem_offsets.set(conduit::DataType(utils::cpp2conduit::id, nzones)); auto elem_offsets = utils::make_array_view(n_elem_offsets); @@ -144,7 +144,7 @@ class MakePolyhedralTopology //-------------------------------------------------------------------------- AXOM_ANNOTATE_BEGIN("elements"); - conduit::Node &n_elem_conn = n_newTopo["elements/connectivity"]; + conduit::Node& n_elem_conn = n_newTopo["elements/connectivity"]; n_elem_conn.set_allocator(conduitAllocatorId); n_elem_conn.set(conduit::DataType(utils::cpp2conduit::id, totalFaces)); auto elem_conn = utils::make_array_view(n_elem_conn); @@ -156,17 +156,17 @@ class MakePolyhedralTopology //-------------------------------------------------------------------------- AXOM_ANNOTATE_BEGIN("subelements"); // Allocate subelement connectivity - conduit::Node &n_se_conn = n_newTopo["subelements/connectivity"]; + conduit::Node& n_se_conn = n_newTopo["subelements/connectivity"]; n_se_conn.set_allocator(conduitAllocatorId); n_se_conn.set(conduit::DataType(utils::cpp2conduit::id, totalFaceStorage)); auto se_conn = utils::make_array_view(n_se_conn); - conduit::Node &n_se_sizes = n_newTopo["subelements/sizes"]; + conduit::Node& n_se_sizes = n_newTopo["subelements/sizes"]; n_se_sizes.set_allocator(conduitAllocatorId); n_se_sizes.set(conduit::DataType(utils::cpp2conduit::id, totalFaces)); auto se_sizes = utils::make_array_view(n_se_sizes); - conduit::Node &n_se_offsets = n_newTopo["subelements/offsets"]; + conduit::Node& n_se_offsets = n_newTopo["subelements/offsets"]; n_se_offsets.set_allocator(conduitAllocatorId); n_se_offsets.set(conduit::DataType(utils::cpp2conduit::id, totalFaces)); auto se_offsets = utils::make_array_view(n_se_offsets); diff --git a/src/axom/bump/MakeUnstructured.hpp b/src/axom/bump/MakeUnstructured.hpp index ca5ff072a0..0fb287d5a5 100644 --- a/src/axom/bump/MakeUnstructured.hpp +++ b/src/axom/bump/MakeUnstructured.hpp @@ -40,10 +40,10 @@ class MakeUnstructured * * \note There are blueprint methods for this sort of thing but this one runs on device. */ - static void execute(const conduit::Node &topo, - const conduit::Node &coordset, - const std::string &topoName, - conduit::Node &mesh, + static void execute(const conduit::Node& topo, + const conduit::Node& coordset, + const std::string& topoName, + conduit::Node& mesh, int allocator_id = axom::execution_space::allocatorID()) { const std::string type = topo.fetch_existing("type").as_string(); @@ -51,7 +51,7 @@ class MakeUnstructured namespace utils = axom::bump::utilities; mesh["coordsets"][coordset.name()].set_external(coordset); - conduit::Node &n_newtopo = mesh["topologies"][topoName]; + conduit::Node& n_newtopo = mesh["topologies"][topoName]; n_newtopo["coordset"] = coordset.name(); if(type == "unstructured") @@ -61,16 +61,16 @@ class MakeUnstructured else { n_newtopo["type"] = "unstructured"; - conduit::Node &n_newconn = n_newtopo["elements/connectivity"]; - conduit::Node &n_newsizes = n_newtopo["elements/sizes"]; - conduit::Node &n_newoffsets = n_newtopo["elements/offsets"]; + conduit::Node& n_newconn = n_newtopo["elements/connectivity"]; + conduit::Node& n_newsizes = n_newtopo["elements/sizes"]; + conduit::Node& n_newoffsets = n_newtopo["elements/offsets"]; n_newconn.set_allocator(conduitAllocatorId); n_newsizes.set_allocator(conduitAllocatorId); n_newoffsets.set_allocator(conduitAllocatorId); axom::bump::views::dispatch_structured_topologies( topo, - [&](const std::string &shape, auto &topoView) { + [&](const std::string& shape, auto& topoView) { n_newtopo["elements/shape"] = shape; int ptsPerZone = 2; diff --git a/src/axom/bump/MakeZoneCenters.hpp b/src/axom/bump/MakeZoneCenters.hpp index 61c57634f7..d6c1a334af 100644 --- a/src/axom/bump/MakeZoneCenters.hpp +++ b/src/axom/bump/MakeZoneCenters.hpp @@ -40,7 +40,7 @@ class MakeZoneCenters * \param topologyView The view for the input topology. * \param coordsetView The view for the input coordset. */ - MakeZoneCenters(const TopologyView &topologyView, const CoordsetView &coordsetView) + MakeZoneCenters(const TopologyView& topologyView, const CoordsetView& coordsetView) : m_topologyView(topologyView) , m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) @@ -77,9 +77,9 @@ class MakeZoneCenters * a view and the coordset node since the view may not be able to contain * some coordset metadata and remain trivially copyable. */ - void execute(const conduit::Node &n_topology, - const conduit::Node &n_coordset, - conduit::Node &n_outputField) const + void execute(const conduit::Node& n_topology, + const conduit::Node& n_coordset, + conduit::Node& n_outputField) const { const auto numZones = m_topologyView.numberOfZones(); const int allocatorID = getAllocatorID(); @@ -111,9 +111,9 @@ class MakeZoneCenters * generate a field that is repurposed some other way. */ void execute(axom::ArrayView selectedZonesView, - const conduit::Node &n_topology, - const conduit::Node &n_coordset, - conduit::Node &n_outputField) const + const conduit::Node& n_topology, + const conduit::Node& n_coordset, + conduit::Node& n_outputField) const { using value_type = typename CoordsetView::value_type; using PointType = typename CoordsetView::PointType; @@ -132,7 +132,7 @@ class MakeZoneCenters n_outputField.reset(); n_outputField["association"] = "element"; n_outputField["topology"] = n_topology.name(); - conduit::Node &n_values = n_outputField["values"]; + conduit::Node& n_values = n_outputField["values"]; // Determine output size. const auto outputSize = selectedZonesView.size(); @@ -142,7 +142,7 @@ class MakeZoneCenters for(size_t i = 0; i < nComponents; i++) { // Allocate data in the Conduit node and make a view. - conduit::Node &comp = n_values[axes[i]]; + conduit::Node& comp = n_values[axes[i]]; comp.set_allocator(conduitAllocatorId); comp.set(conduit::DataType(utils::cpp2conduit::id, outputSize)); compViews[i] = utils::make_array_view(comp); diff --git a/src/axom/bump/MakeZoneVolumes.hpp b/src/axom/bump/MakeZoneVolumes.hpp index 480a4e99eb..58e9b954e1 100644 --- a/src/axom/bump/MakeZoneVolumes.hpp +++ b/src/axom/bump/MakeZoneVolumes.hpp @@ -41,7 +41,7 @@ class MakeZoneVolumes * \param topologyView The view for the input topology. * \param coordsetView The view for the input coordset. */ - MakeZoneVolumes(const TopologyView &topologyView, const CoordsetView &coordsetView) + MakeZoneVolumes(const TopologyView& topologyView, const CoordsetView& coordsetView) : m_topologyView(topologyView) , m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) @@ -75,9 +75,9 @@ class MakeZoneVolumes * \param[out] n_outputField The output node that will contain the new field. * */ - void execute(const conduit::Node &n_topology, - const conduit::Node &AXOM_UNUSED_PARAM(n_coordset), - conduit::Node &n_outputField) const + void execute(const conduit::Node& n_topology, + const conduit::Node& AXOM_UNUSED_PARAM(n_coordset), + conduit::Node& n_outputField) const { namespace utils = axom::bump::utilities; const auto conduitAllocatorId = @@ -90,7 +90,7 @@ class MakeZoneVolumes n_outputField.reset(); n_outputField["association"] = "element"; n_outputField["topology"] = n_topology.name(); - conduit::Node &n_values = n_outputField["values"]; + conduit::Node& n_values = n_outputField["values"]; n_values.set_allocator(conduitAllocatorId); n_values.set(conduit::DataType(utils::cpp2conduit::id, outputSize)); auto valuesView = utils::make_array_view(n_values); diff --git a/src/axom/bump/MapBasedNaming.hpp b/src/axom/bump/MapBasedNaming.hpp index a45eb40375..b4ccd531a5 100644 --- a/src/axom/bump/MapBasedNaming.hpp +++ b/src/axom/bump/MapBasedNaming.hpp @@ -55,7 +55,7 @@ class MapBasedNaming * \return The name that describes the array of ids. */ AXOM_HOST_DEVICE - KeyType makeName(const IndexType *p, int n) const + KeyType makeName(const IndexType* p, int n) const { std::set ids; for(int i = 0; i < n; i++) @@ -80,13 +80,13 @@ class MapBasedNaming AXOM_HOST_DEVICE void setMaxId(IndexType) { } - MapType *m_map_ptr {nullptr}; + MapType* m_map_ptr {nullptr}; }; // Host-callable methods /// Make a name from the array of ids. - KeyType makeName(const IndexType *p, int n) const { return m_view.makeName(p, n); } + KeyType makeName(const IndexType* p, int n) const { return m_view.makeName(p, n); } /*! * \brief Set the max number of nodes, which can help with id packing/narrowing. diff --git a/src/axom/bump/MatsetSlicer.hpp b/src/axom/bump/MatsetSlicer.hpp index 644c57837d..4a83c36829 100644 --- a/src/axom/bump/MatsetSlicer.hpp +++ b/src/axom/bump/MatsetSlicer.hpp @@ -35,7 +35,7 @@ class MatsetSlicer /*! * \brief Constructor. */ - MatsetSlicer(const MatsetView &matsetView) + MatsetSlicer(const MatsetView& matsetView) : m_matsetView(matsetView) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -68,16 +68,16 @@ class MatsetSlicer * \param n_matset The input matset. * \param[out] n_newMatset The output matset. */ - void execute(const SliceData &slice, const conduit::Node &n_matset, conduit::Node &n_newMatset) + void execute(const SliceData& slice, const conduit::Node& n_matset, conduit::Node& n_newMatset) { using MatsetIndex = typename MatsetView::IndexType; using MatsetFloat = typename MatsetView::FloatType; namespace utils = axom::bump::utilities; - const axom::ArrayView &selectedZonesView = slice.m_indicesView; + const axom::ArrayView& selectedZonesView = slice.m_indicesView; SLIC_ASSERT(selectedZonesView.size() > 0); // Copy the material_map if it exists. - const char *keys[] = {"topology", "material_map"}; + const char* keys[] = {"topology", "material_map"}; for(int i = 0; i < 2; i++) { if(n_matset.has_child(keys[i])) n_newMatset[keys[i]] = n_matset.fetch_existing(keys[i]); @@ -88,12 +88,12 @@ class MatsetSlicer // Allocate sizes/offsets. AXOM_ANNOTATE_BEGIN("alloc"); - conduit::Node &n_sizes = n_newMatset["sizes"]; + conduit::Node& n_sizes = n_newMatset["sizes"]; n_sizes.set_allocator(conduitAllocatorId); n_sizes.set(conduit::DataType(utils::cpp2conduit::id, selectedZonesView.size())); auto sizesView = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_newMatset["offsets"]; + conduit::Node& n_offsets = n_newMatset["offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(utils::cpp2conduit::id, selectedZonesView.size())); auto offsetsView = utils::make_array_view(n_offsets); @@ -147,17 +147,17 @@ class MatsetSlicer { SLIC_ERROR_IF(totalSize == 0, "ReduceSum returned 0 for totalSize."); } - conduit::Node &n_indices = n_newMatset["indices"]; + conduit::Node& n_indices = n_newMatset["indices"]; n_indices.set_allocator(conduitAllocatorId); n_indices.set(conduit::DataType(utils::cpp2conduit::id, totalSize)); auto indicesView = utils::make_array_view(n_indices); - conduit::Node &n_material_ids = n_newMatset["material_ids"]; + conduit::Node& n_material_ids = n_newMatset["material_ids"]; n_material_ids.set_allocator(conduitAllocatorId); n_material_ids.set(conduit::DataType(utils::cpp2conduit::id, totalSize)); auto materialIdsView = utils::make_array_view(n_material_ids); - conduit::Node &n_volume_fractions = n_newMatset["volume_fractions"]; + conduit::Node& n_volume_fractions = n_newMatset["volume_fractions"]; n_volume_fractions.set_allocator(conduitAllocatorId); n_volume_fractions.set(conduit::DataType(utils::cpp2conduit::id, totalSize)); auto volumeFractionsView = utils::make_array_view(n_volume_fractions); diff --git a/src/axom/bump/MergeCoordsetPoints.hpp b/src/axom/bump/MergeCoordsetPoints.hpp index a724e57b94..82a29cb0b9 100644 --- a/src/axom/bump/MergeCoordsetPoints.hpp +++ b/src/axom/bump/MergeCoordsetPoints.hpp @@ -93,7 +93,7 @@ class MergeCoordsetPoints * * \param coordsetView The coordset view that wraps the coordset to be modified. */ - MergeCoordsetPoints(const CoordsetView &coordsetView) + MergeCoordsetPoints(const CoordsetView& coordsetView) : m_coordsetView(coordsetView) , m_allocator_id(axom::execution_space::allocatorID()) { } @@ -146,10 +146,10 @@ class MergeCoordsetPoints * * \return True if point merging happened; False if no point merging was needed. */ - bool execute(conduit::Node &n_coordset, - const conduit::Node &n_options, - axom::Array &selectedIds, - axom::Array &old2new) const + bool execute(conduit::Node& n_coordset, + const conduit::Node& n_options, + axom::Array& selectedIds, + axom::Array& old2new) const { namespace utils = axom::bump::utilities; const axom::bump::Options opts(n_options); @@ -297,7 +297,7 @@ class MergeCoordsetPoints * \param tolerance The tolerance used to merge points. */ template - void createNames(axom::Array &coordNames, double tolerance) const + void createNames(axom::Array& coordNames, double tolerance) const { constexpr double smallTolerance = 1.e-6; @@ -322,7 +322,7 @@ class MergeCoordsetPoints * \param tolerance The tolerance used to merge points. */ template - void createNamesInner(axom::Array &coordNames, double tolerance) const + void createNamesInner(axom::Array& coordNames, double tolerance) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE(axom::fmt::format("createNames<{}>", utils::cpp2conduit::name)); @@ -356,9 +356,9 @@ class MergeCoordsetPoints } // Make a name for this point - const void *tptr = static_cast(truncated); + const void* tptr = static_cast(truncated); coordNamesView[index] = - axom::utilities::hash_bytes(static_cast(tptr), + axom::utilities::hash_bytes(static_cast(tptr), sizeof(Precision) * CoordsetView::dimension()); }); } diff --git a/src/axom/bump/MergeMeshes.hpp b/src/axom/bump/MergeMeshes.hpp index b03a989312..99ffc77bed 100644 --- a/src/axom/bump/MergeMeshes.hpp +++ b/src/axom/bump/MergeMeshes.hpp @@ -34,7 +34,7 @@ namespace bump */ struct MeshInput { - conduit::Node *m_input {nullptr}; //!< Pointer to Blueprint mesh. + conduit::Node* m_input {nullptr}; //!< Pointer to Blueprint mesh. axom::ArrayView m_nodeMapView {}; //!< Map for mesh nodeIds to nodeIds in final mesh. axom::ArrayView m_nodeSliceView {}; //!< Node ids to be extracted and added to final mesh. std::string m_topologyName {}; //!< The name of the topology to use. @@ -80,9 +80,9 @@ class MergeMeshes * The options node may contain a "topology" string that designates the name of * the topology to be merged. */ - void execute(const std::vector &inputs, - const conduit::Node &options, - conduit::Node &output) const + void execute(const std::vector& inputs, + const conduit::Node& options, + conduit::Node& output) const { AXOM_ANNOTATE_SCOPE("MergeMeshes"); bool ok = validInputs(inputs); @@ -131,7 +131,7 @@ class MergeMeshes * * \return True if the inputs appear to be valid; False otherwise. */ - bool validInputs(const std::vector &inputs) const + bool validInputs(const std::vector& inputs) const { try { @@ -142,25 +142,25 @@ class MergeMeshes if(inputs[i].m_topologyName.empty()) { // If we did not specify which topology, make sure that there is only 1. - const char *keys[] = {"coordsets", "topologies", "matsets"}; + const char* keys[] = {"coordsets", "topologies", "matsets"}; if(inputs[i].m_topologyName.empty()) { for(int k = 0; k < 3; k++) { if(inputs[i].m_input->has_path(keys[k])) { - const conduit::Node &n = inputs[i].m_input->fetch_existing(keys[k]); + const conduit::Node& n = inputs[i].m_input->fetch_existing(keys[k]); if(n.number_of_children() > 1) return false; } } } } - const conduit::Node &n_topo = getTopology(inputs[i]); + const conduit::Node& n_topo = getTopology(inputs[i]); if(n_topo["type"].as_string() != "unstructured") { return false; } - const conduit::Node &n_coordset = getCoordset(inputs[i]); + const conduit::Node& n_coordset = getCoordset(inputs[i]); if(n_coordset["type"].as_string() != "explicit") { return false; @@ -174,7 +174,7 @@ class MergeMeshes } } } - catch(std::exception &e) + catch(std::exception& e) { return false; } @@ -187,7 +187,7 @@ class MergeMeshes * \param inputs A vector of inputs to be merged. * \param[out] output The node that will contain the merged mesh. */ - void singleInput(const std::vector &inputs, conduit::Node &output) const + void singleInput(const std::vector& inputs, conduit::Node& output) const { axom::bump::utilities::copy(output, *(inputs[0].m_input), getAllocatorID()); } @@ -200,7 +200,7 @@ class MergeMeshes * return that topology from the mesh input. Otherwise, the * first topology is returned. */ - const conduit::Node &getTopology(const MeshInput &input) const + const conduit::Node& getTopology(const MeshInput& input) const { if(!input.m_topologyName.empty()) { @@ -217,9 +217,9 @@ class MergeMeshes * return the coordset for that topology from the mesh input. * Otherwise, the first coordset is returned. */ - const conduit::Node &getCoordset(const MeshInput &input) const + const conduit::Node& getCoordset(const MeshInput& input) const { - const conduit::Node &n_topo = getTopology(input); + const conduit::Node& n_topo = getTopology(input); const std::string coordsetName = n_topo["coordset"].as_string(); return input.m_input->fetch_existing("coordsets/" + coordsetName); } @@ -234,9 +234,9 @@ class MergeMeshes * \note We merge matsets first (for derived classes) so we can use the merged matset * when we merge mixed fields. */ - void mergeInputs(const std::vector &inputs, - const conduit::Node &n_options, - conduit::Node &output) const + void mergeInputs(const std::vector& inputs, + const conduit::Node& n_options, + conduit::Node& output) const { mergeCoordset(inputs, output); mergeTopology(inputs, n_options, output); @@ -250,23 +250,23 @@ class MergeMeshes * \param inputs A vector of inputs to be merged. * \param[out] output The node that will contain the output mesh. */ - void mergeCoordset(const std::vector &inputs, conduit::Node &output) const + void mergeCoordset(const std::vector& inputs, conduit::Node& output) const { AXOM_ANNOTATE_SCOPE("mergeCoordset"); namespace utils = axom::bump::utilities; const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); const axom::IndexType totalNodes = countNodes(inputs); - conduit::Node &n_newCoordsets = output["coordsets"]; - conduit::Node *n_newValuesPtr = nullptr; + conduit::Node& n_newCoordsets = output["coordsets"]; + conduit::Node* n_newValuesPtr = nullptr; int nComps = 2; axom::IndexType offsets[3] = {0, 0, 0}; const axom::IndexType n = static_cast(inputs.size()); for(axom::IndexType i = 0; i < n; i++) { - const conduit::Node &n_srcCoordset = getCoordset(inputs[i]); - const conduit::Node &n_srcValues = n_srcCoordset.fetch_existing("values"); + const conduit::Node& n_srcCoordset = getCoordset(inputs[i]); + const conduit::Node& n_srcValues = n_srcCoordset.fetch_existing("values"); const auto type = n_srcCoordset.fetch_existing("type").as_string(); SLIC_ASSERT(type == "explicit"); @@ -274,16 +274,16 @@ class MergeMeshes // Make all of the components the first time. if(i == 0) { - conduit::Node &n_newCoordset = n_newCoordsets[n_srcCoordset.name()]; + conduit::Node& n_newCoordset = n_newCoordsets[n_srcCoordset.name()]; n_newCoordset["type"] = "explicit"; - conduit::Node &n_newValues = n_newCoordset["values"]; + conduit::Node& n_newValues = n_newCoordset["values"]; n_newValuesPtr = n_newCoordset.fetch_ptr("values"); nComps = n_srcValues.number_of_children(); for(int c = 0; c < nComps; c++) { - const conduit::Node &n_srcComp = n_srcValues[c]; - conduit::Node &n_comp = n_newValues[n_srcComp.name()]; + const conduit::Node& n_srcComp = n_srcValues[c]; + conduit::Node& n_comp = n_newValues[n_srcComp.name()]; n_comp.set_allocator(conduitAllocatorId); n_comp.set(conduit::DataType(n_srcComp.dtype().id(), totalNodes)); } @@ -294,8 +294,8 @@ class MergeMeshes using FloatType = typename decltype(comp0)::value_type; for(int c = 0; c < nComps; c++) { - const conduit::Node &n_srcComp = n_srcValues[c]; - conduit::Node &n_comp = n_newValuesPtr->child(c); + const conduit::Node& n_srcComp = n_srcValues[c]; + conduit::Node& n_comp = n_newValuesPtr->child(c); auto srcCompView = utils::make_array_view(n_srcComp); auto compView = utils::make_array_view(n_comp); @@ -359,11 +359,11 @@ class MergeMeshes * * \return The number of nodes in the \a index input mesh. */ - axom::IndexType countNodes(const std::vector &inputs, size_t index) const + axom::IndexType countNodes(const std::vector& inputs, size_t index) const { SLIC_ASSERT(index < inputs.size()); - const conduit::Node &coordset = getCoordset(inputs[index]); + const conduit::Node& coordset = getCoordset(inputs[index]); axom::IndexType nnodes = 0; if(inputs[index].m_nodeSliceView.size() > 0) { @@ -383,7 +383,7 @@ class MergeMeshes * * \return The total number of nodes in the input meshes. */ - axom::IndexType countNodes(const std::vector &inputs) const + axom::IndexType countNodes(const std::vector& inputs) const { axom::IndexType nodeTotal = 0; for(size_t i = 0; i < inputs.size(); i++) @@ -402,10 +402,10 @@ class MergeMeshes * * \return The number of zones in the \a index input mesh. */ - axom::IndexType countZones(const std::vector &inputs, size_t index) const + axom::IndexType countZones(const std::vector& inputs, size_t index) const { - const conduit::Node &n_topo = getTopology(inputs[index]); - const conduit::Node &n_size = n_topo.fetch_existing("elements/sizes"); + const conduit::Node& n_topo = getTopology(inputs[index]); + const conduit::Node& n_size = n_topo.fetch_existing("elements/sizes"); axom::IndexType nzones = n_size.dtype().number_of_elements(); return nzones; } @@ -418,21 +418,21 @@ class MergeMeshes * \param[out] totalZones The total zones for all meshes. * \param elem_sizes The name of the element sizes key. */ - void countZones(const std::vector &inputs, - axom::IndexType &totalConnLength, - axom::IndexType &totalZones, - const std::string &elem_sizes = std::string("elements/sizes")) const + void countZones(const std::vector& inputs, + axom::IndexType& totalConnLength, + axom::IndexType& totalZones, + const std::string& elem_sizes = std::string("elements/sizes")) const { totalConnLength = 0; totalZones = 0; axom::IndexType n = static_cast(inputs.size()); for(axom::IndexType i = 0; i < n; i++) { - const conduit::Node &n_topo = getTopology(inputs[i]); + const conduit::Node& n_topo = getTopology(inputs[i]); const std::string type = n_topo.fetch_existing("type").as_string(); SLIC_ASSERT(type == "unstructured"); - const conduit::Node &n_size = n_topo.fetch_existing(elem_sizes); + const conduit::Node& n_size = n_topo.fetch_existing(elem_sizes); const auto nzones = n_size.dtype().number_of_elements(); totalZones += nzones; @@ -477,19 +477,19 @@ class MergeMeshes * * \return A map of shape names to shape ids. */ - std::map buildShapeMap(const std::vector &inputs) const + std::map buildShapeMap(const std::vector& inputs) const { std::map shape_map; const axom::IndexType n = static_cast(inputs.size()); for(axom::IndexType i = 0; i < n; i++) { - const conduit::Node &n_srcTopo = getTopology(inputs[i]); + const conduit::Node& n_srcTopo = getTopology(inputs[i]); const auto type = n_srcTopo.fetch_existing("type").as_string(); const auto shape = n_srcTopo.fetch_existing("elements/shape").as_string(); SLIC_ASSERT(type == "unstructured"); if(shape == "mixed") { - const conduit::Node &n_shape_map = n_srcTopo.fetch_existing("elements/shape_map"); + const conduit::Node& n_shape_map = n_srcTopo.fetch_existing("elements/shape_map"); for(int s = 0; s < n_shape_map.number_of_children(); s++) { const std::string sname = n_shape_map[s].name(); @@ -513,9 +513,9 @@ class MergeMeshes * \param n_options A node that contains the options. * \param[out] output The node that will contain the output mesh. */ - void mergeTopology(const std::vector &inputs, - const conduit::Node &n_options, - conduit::Node &output) const + void mergeTopology(const std::vector& inputs, + const conduit::Node& n_options, + conduit::Node& output) const { // Check the shape types. std::map shape_map = buildShapeMap(inputs); @@ -538,10 +538,10 @@ class MergeMeshes * \param n_options A node that contains the options. * \param[out] output The node that will contain the output mesh. */ - void mergeTopologiesUnstructured(std::map &shape_map, - const std::vector &inputs, - const conduit::Node &n_options, - conduit::Node &output) const + void mergeTopologiesUnstructured(std::map& shape_map, + const std::vector& inputs, + const conduit::Node& n_options, + conduit::Node& output) const { namespace utils = axom::bump::utilities; const auto conduitAllocatorId = @@ -550,7 +550,7 @@ class MergeMeshes AXOM_ANNOTATE_SCOPE("mergeTopologiesUnstructured"); axom::IndexType totalConnLen = 0, totalZones = 0; countZones(inputs, totalConnLen, totalZones); - conduit::Node &n_newTopologies = output["topologies"]; + conduit::Node& n_newTopologies = output["topologies"]; const axom::IndexType n = static_cast(inputs.size()); // If there are polygon shapes then assume that the rest of the shapes @@ -561,15 +561,15 @@ class MergeMeshes shape_map[views::PolygonTraits::name()] = views::PolygonTraits::id(); } - conduit::Node *n_newTopoPtr = nullptr; + conduit::Node* n_newTopoPtr = nullptr; axom::IndexType connOffset = 0, sizesOffset = 0, shapesOffset = 0, coordOffset = 0; for(axom::IndexType i = 0; i < n; i++) { - const conduit::Node &n_srcTopo = getTopology(inputs[i]); + const conduit::Node& n_srcTopo = getTopology(inputs[i]); const std::string srcShape = n_srcTopo.fetch_existing("elements/shape").as_string(); - const conduit::Node &n_srcConn = n_srcTopo.fetch_existing("elements/connectivity"); - const conduit::Node &n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); - const conduit::Node &n_srcOffsets = n_srcTopo.fetch_existing("elements/offsets"); + const conduit::Node& n_srcConn = n_srcTopo.fetch_existing("elements/connectivity"); + const conduit::Node& n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); + const conduit::Node& n_srcOffsets = n_srcTopo.fetch_existing("elements/offsets"); // Make all of the elements the first time. if(i == 0) @@ -579,21 +579,21 @@ class MergeMeshes { newTopoName = n_options["topologyName"].as_string(); } - conduit::Node &n_newTopo = n_newTopologies[newTopoName]; + conduit::Node& n_newTopo = n_newTopologies[newTopoName]; n_newTopoPtr = n_newTopologies.fetch_ptr(newTopoName); n_newTopo["type"] = "unstructured"; n_newTopo["coordset"] = n_srcTopo["coordset"].as_string(); - conduit::Node &n_newConn = n_newTopo["elements/connectivity"]; + conduit::Node& n_newConn = n_newTopo["elements/connectivity"]; n_newConn.set_allocator(conduitAllocatorId); n_newConn.set(conduit::DataType(n_srcConn.dtype().id(), totalConnLen)); - conduit::Node &n_newSizes = n_newTopo["elements/sizes"]; + conduit::Node& n_newSizes = n_newTopo["elements/sizes"]; n_newSizes.set_allocator(conduitAllocatorId); n_newSizes.set(conduit::DataType(n_srcSizes.dtype().id(), totalZones)); - conduit::Node &n_newOffsets = n_newTopo["elements/offsets"]; + conduit::Node& n_newOffsets = n_newTopo["elements/offsets"]; n_newOffsets.set_allocator(conduitAllocatorId); n_newOffsets.set(conduit::DataType(n_srcConn.dtype().id(), totalZones)); @@ -602,11 +602,11 @@ class MergeMeshes n_newTopo["elements/shape"] = "mixed"; // Build a new shape map in the new topology. - conduit::Node &n_shape_map = n_newTopo["elements/shape_map"]; + conduit::Node& n_shape_map = n_newTopo["elements/shape_map"]; for(auto it = shape_map.begin(); it != shape_map.end(); it++) n_shape_map[it->first] = it->second; - conduit::Node &n_newShapes = n_newTopo["elements/shapes"]; + conduit::Node& n_newShapes = n_newTopo["elements/shapes"]; n_newShapes.set_allocator(conduitAllocatorId); n_newShapes.set(conduit::DataType(n_srcConn.dtype().id(), totalZones)); } @@ -623,7 +623,7 @@ class MergeMeshes n_srcOffsets, [&](auto srcConnView, auto srcSizesView, auto srcOffsetsView) { using ConnType = typename decltype(srcConnView)::value_type; - conduit::Node &n_newConn = n_newTopoPtr->fetch_existing("elements/connectivity"); + conduit::Node& n_newConn = n_newTopoPtr->fetch_existing("elements/connectivity"); auto connView = utils::make_array_view(n_newConn); // Copy the relevant connectivity from srcConnView. Also compute how @@ -643,7 +643,7 @@ class MergeMeshes // Copy this input's sizes into the new topology. axom::bump::views::indexNodeToArrayView(n_srcSizes, [&](auto srcSizesView) { using ConnType = typename decltype(srcSizesView)::value_type; - conduit::Node &n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); + conduit::Node& n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); auto sizesView = utils::make_array_view(n_newSizes); mergeTopology_copy_sizes(sizesOffset, sizesView, srcSizesView); @@ -658,11 +658,11 @@ class MergeMeshes // Copy shape information if it exists. if(n_srcTopo.has_path("elements/shapes")) { - const conduit::Node &n_srcShapes = n_srcTopo.fetch_existing("elements/shapes"); + const conduit::Node& n_srcShapes = n_srcTopo.fetch_existing("elements/shapes"); axom::bump::views::indexNodeToArrayView(n_srcShapes, [&](auto srcShapesView) { using ConnType = typename decltype(srcShapesView)::value_type; - conduit::Node &n_newShapes = n_newTopoPtr->fetch_existing("elements/shapes"); + conduit::Node& n_newShapes = n_newTopoPtr->fetch_existing("elements/shapes"); auto shapesView = utils::make_array_view(n_newShapes); // Copy all sizes from the input. mergeTopology_copy_shapes(shapesOffset, shapesView, srcShapesView); @@ -673,9 +673,9 @@ class MergeMeshes { // Fill in shape information. There is no source shape information. Use // sizes to get the number of zones. - const conduit::Node &n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); + const conduit::Node& n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); axom::IndexType nz = n_srcSizes.dtype().number_of_elements(); - conduit::Node &n_newShapes = n_newTopoPtr->fetch_existing("elements/shapes"); + conduit::Node& n_newShapes = n_newTopoPtr->fetch_existing("elements/shapes"); axom::bump::views::indexNodeToArrayView(n_newShapes, [&](auto shapesView) { const int shapeId = axom::bump::views::shapeNameToID(srcShape); mergeTopology_default_shapes(shapesOffset, shapesView, nz, shapeId); @@ -686,10 +686,10 @@ class MergeMeshes } // Make new offsets from the sizes. - conduit::Node &n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); + conduit::Node& n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); axom::bump::views::indexNodeToArrayView(n_newSizes, [&](auto sizesView) { using ConnType = typename decltype(sizesView)::value_type; - conduit::Node &n_newOffsets = n_newTopoPtr->fetch_existing("elements/offsets"); + conduit::Node& n_newOffsets = n_newTopoPtr->fetch_existing("elements/offsets"); auto offsetsView = utils::make_array_view(n_newOffsets); axom::exclusive_scan(sizesView, offsetsView); }); @@ -703,7 +703,7 @@ class MergeMeshes * * \return A vector of polyhedral mesh inputs. */ - std::vector makePolyhedralInputs(const std::vector &inputs) const + std::vector makePolyhedralInputs(const std::vector& inputs) const { AXOM_ANNOTATE_SCOPE("makePolyhedralInputs"); namespace views = axom::bump::views; @@ -713,14 +713,14 @@ class MergeMeshes std::vector phInputs(inputs.size()); for(size_t i = 0; i < inputs.size(); i++) { - const conduit::Node &n_srcTopo = getTopology(inputs[i]); - const conduit::Node &n_srcCoordset = getCoordset(inputs[i]); + const conduit::Node& n_srcTopo = getTopology(inputs[i]); + const conduit::Node& n_srcCoordset = getCoordset(inputs[i]); // Make a new mesh input node and a topology node under it. phInputs[i].m_input = new conduit::Node; phInputs[i].m_topologyName = inputs[i].m_topologyName; - conduit::Node &n_phTopo = phInputs[i].m_input->operator[]("topologies/" + n_srcTopo.name()); - conduit::Node &n_phCoordset = + conduit::Node& n_phTopo = phInputs[i].m_input->operator[]("topologies/" + n_srcTopo.name()); + conduit::Node& n_phCoordset = phInputs[i].m_input->operator[]("coordsets/" + n_srcCoordset.name()); // We need coordsets linked in. @@ -735,7 +735,7 @@ class MergeMeshes { // Convert the mesh to polyhedral. const std::string shape = n_srcTopo.fetch_existing("elements/shape").as_string(); - const conduit::Node &n_elem_conn = n_srcTopo.fetch_existing("elements/connectivity"); + const conduit::Node& n_elem_conn = n_srcTopo.fetch_existing("elements/connectivity"); views::indexNodeToArrayView(n_elem_conn, [&](auto connView) { using ConnectivityType = typename decltype(connView)::value_type; @@ -794,9 +794,9 @@ class MergeMeshes * \brief Make a polyhedral mesh given the input topology view. */ template - void makePolyhedralMesh(const TopologyView &topologyView, - const conduit::Node &n_srcTopo, - conduit::Node &n_phTopo) const + void makePolyhedralMesh(const TopologyView& topologyView, + const conduit::Node& n_srcTopo, + conduit::Node& n_phTopo) const { using ConnectivityType = typename TopologyView::ConnectivityType; @@ -814,7 +814,7 @@ class MergeMeshes * * \param inputs The mesh inputs to delete. */ - void deleteMeshInputs(std::vector &inputs) const + void deleteMeshInputs(std::vector& inputs) const { for(size_t i = 0; i < inputs.size(); i++) { @@ -830,9 +830,9 @@ class MergeMeshes * \param n_options A node that contains the options. * \param[out] output The Conduit node that will contain the merged polyhedral mesh. */ - void mergeTopologiesPolyhedral(const std::vector &inputs, - const conduit::Node &n_options, - conduit::Node &output) const + void mergeTopologiesPolyhedral(const std::vector& inputs, + const conduit::Node& n_options, + conduit::Node& output) const { AXOM_ANNOTATE_SCOPE("mergeTopologiesPolyhedral"); std::vector phInputs; @@ -842,7 +842,7 @@ class MergeMeshes mergeTopologiesPolyhedralInner(phInputs, n_options, output); deleteMeshInputs(phInputs); } - catch(std::exception &e) + catch(std::exception& e) { deleteMeshInputs(phInputs); throw e; @@ -856,9 +856,9 @@ class MergeMeshes * \param n_options A node that contains the options. * \param[out] output The Conduit node that will contain the merged polyhedral mesh. */ - void mergeTopologiesPolyhedralInner(const std::vector &inputs, - const conduit::Node &n_options, - conduit::Node &output) const + void mergeTopologiesPolyhedralInner(const std::vector& inputs, + const conduit::Node& n_options, + conduit::Node& output) const { namespace utils = axom::bump::utilities; const auto conduitAllocatorId = @@ -871,22 +871,22 @@ class MergeMeshes axom::IndexType totalSEConnLen = 0, totalSEZones = 0; countZones(inputs, totalSEConnLen, totalSEZones, "subelements/sizes"); - conduit::Node &n_newTopologies = output["topologies"]; + conduit::Node& n_newTopologies = output["topologies"]; const axom::IndexType n = static_cast(inputs.size()); - conduit::Node *n_newTopoPtr = nullptr; + conduit::Node* n_newTopoPtr = nullptr; axom::IndexType connOffset = 0, sizesOffset = 0, seConnOffset = 0, seSizesOffset = 0, coordOffset = 0, faceOffset = 0; for(axom::IndexType i = 0; i < n; i++) { - const conduit::Node &n_srcTopo = getTopology(inputs[i]); + const conduit::Node& n_srcTopo = getTopology(inputs[i]); - const conduit::Node &n_srcConn = n_srcTopo.fetch_existing("elements/connectivity"); - const conduit::Node &n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); - const conduit::Node &n_srcOffsets = n_srcTopo.fetch_existing("elements/offsets"); - const conduit::Node &n_srcSEConn = n_srcTopo.fetch_existing("subelements/connectivity"); - const conduit::Node &n_srcSESizes = n_srcTopo.fetch_existing("subelements/sizes"); - const conduit::Node &n_srcSEOffsets = n_srcTopo.fetch_existing("subelements/offsets"); + const conduit::Node& n_srcConn = n_srcTopo.fetch_existing("elements/connectivity"); + const conduit::Node& n_srcSizes = n_srcTopo.fetch_existing("elements/sizes"); + const conduit::Node& n_srcOffsets = n_srcTopo.fetch_existing("elements/offsets"); + const conduit::Node& n_srcSEConn = n_srcTopo.fetch_existing("subelements/connectivity"); + const conduit::Node& n_srcSESizes = n_srcTopo.fetch_existing("subelements/sizes"); + const conduit::Node& n_srcSEOffsets = n_srcTopo.fetch_existing("subelements/offsets"); // Make all of the elements the first time. if(i == 0) @@ -899,7 +899,7 @@ class MergeMeshes } // Start making new topo. - conduit::Node &n_newTopo = n_newTopologies[newTopoName]; + conduit::Node& n_newTopo = n_newTopologies[newTopoName]; n_newTopoPtr = n_newTopologies.fetch_ptr(newTopoName); n_newTopo["type"] = "unstructured"; @@ -908,27 +908,27 @@ class MergeMeshes n_newTopo["subelements/shape"] = "polygonal"; // Allocate some bulk data. - conduit::Node &n_newConn = n_newTopo["elements/connectivity"]; + conduit::Node& n_newConn = n_newTopo["elements/connectivity"]; n_newConn.set_allocator(conduitAllocatorId); n_newConn.set(conduit::DataType(n_srcConn.dtype().id(), totalElemConnLen)); - conduit::Node &n_newSizes = n_newTopo["elements/sizes"]; + conduit::Node& n_newSizes = n_newTopo["elements/sizes"]; n_newSizes.set_allocator(conduitAllocatorId); n_newSizes.set(conduit::DataType(n_srcSizes.dtype().id(), totalElemZones)); - conduit::Node &n_newOffsets = n_newTopo["elements/offsets"]; + conduit::Node& n_newOffsets = n_newTopo["elements/offsets"]; n_newOffsets.set_allocator(conduitAllocatorId); n_newOffsets.set(conduit::DataType(n_srcOffsets.dtype().id(), totalElemZones)); - conduit::Node &n_newSEConn = n_newTopo["subelements/connectivity"]; + conduit::Node& n_newSEConn = n_newTopo["subelements/connectivity"]; n_newSEConn.set_allocator(conduitAllocatorId); n_newSEConn.set(conduit::DataType(n_srcSEConn.dtype().id(), totalSEConnLen)); - conduit::Node &n_newSESizes = n_newTopo["subelements/sizes"]; + conduit::Node& n_newSESizes = n_newTopo["subelements/sizes"]; n_newSESizes.set_allocator(conduitAllocatorId); n_newSESizes.set(conduit::DataType(n_srcSESizes.dtype().id(), totalSEZones)); - conduit::Node &n_newSEOffsets = n_newTopo["subelements/offsets"]; + conduit::Node& n_newSEOffsets = n_newTopo["subelements/offsets"]; n_newSEOffsets.set_allocator(conduitAllocatorId); n_newSEOffsets.set(conduit::DataType(n_srcSEOffsets.dtype().id(), totalSEZones)); } @@ -941,7 +941,7 @@ class MergeMeshes n_srcSESizes, [&](auto srcConnView, auto srcSizesView, auto srcOffsetsView, auto srcSESizesView) { using ConnType = typename decltype(srcConnView)::value_type; - conduit::Node &n_newConn = n_newTopoPtr->fetch_existing("elements/connectivity"); + conduit::Node& n_newConn = n_newTopoPtr->fetch_existing("elements/connectivity"); auto connView = utils::make_array_view(n_newConn); // Copy the relevant connectivity from srcConnView. Also compute how @@ -962,7 +962,7 @@ class MergeMeshes // Copy this input's sizes into the new topology. axom::bump::views::indexNodeToArrayView(n_srcSizes, [&](auto srcSizesView) { using ConnType = typename decltype(srcSizesView)::value_type; - conduit::Node &n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); + conduit::Node& n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); auto sizesView = utils::make_array_view(n_newSizes); mergeTopology_copy_sizes(sizesOffset, sizesView, srcSizesView); @@ -977,7 +977,7 @@ class MergeMeshes n_srcSEOffsets, [&](auto srcSEConnView, auto srcSESizesView, auto srcSEOffsetsView) { using ConnType = typename decltype(srcSEConnView)::value_type; - conduit::Node &n_newSEConn = n_newTopoPtr->fetch_existing("subelements/connectivity"); + conduit::Node& n_newSEConn = n_newTopoPtr->fetch_existing("subelements/connectivity"); auto seConnView = utils::make_array_view(n_newSEConn); // Copy the relevant connectivity from srcSEConnView. Also compute how @@ -998,7 +998,7 @@ class MergeMeshes // Copy this input's subelement sizes into the new topology. axom::bump::views::indexNodeToArrayView(n_srcSESizes, [&](auto srcSESizesView) { using ConnType = typename decltype(srcSESizesView)::value_type; - conduit::Node &n_newSESizes = n_newTopoPtr->fetch_existing("subelements/sizes"); + conduit::Node& n_newSESizes = n_newTopoPtr->fetch_existing("subelements/sizes"); auto seSizesView = utils::make_array_view(n_newSESizes); mergeTopology_copy_sizes(seSizesOffset, seSizesView, srcSESizesView); @@ -1008,18 +1008,18 @@ class MergeMeshes } // Make new offsets from the sizes. - conduit::Node &n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); - conduit::Node &n_newSESizes = n_newTopoPtr->fetch_existing("subelements/sizes"); + conduit::Node& n_newSizes = n_newTopoPtr->fetch_existing("elements/sizes"); + conduit::Node& n_newSESizes = n_newTopoPtr->fetch_existing("subelements/sizes"); axom::bump::views::indexNodeToArrayViewSame( n_newSizes, n_newSESizes, [&](auto sizesView, auto seSizesView) { using ConnType = typename decltype(sizesView)::value_type; - conduit::Node &n_newOffsets = n_newTopoPtr->fetch_existing("elements/offsets"); + conduit::Node& n_newOffsets = n_newTopoPtr->fetch_existing("elements/offsets"); auto offsetsView = utils::make_array_view(n_newOffsets); axom::exclusive_scan(sizesView, offsetsView); - conduit::Node &n_newSEOffsets = n_newTopoPtr->fetch_existing("subelements/offsets"); + conduit::Node& n_newSEOffsets = n_newTopoPtr->fetch_existing("subelements/offsets"); auto seOffsetsView = utils::make_array_view(n_newSEOffsets); axom::exclusive_scan(seSizesView, seOffsetsView); }); @@ -1157,7 +1157,7 @@ class MergeMeshes * \param inputs A vector of inputs to be merged. * \param[out] output The node that will contain the output mesh. */ - void mergeFields(const std::vector &inputs, conduit::Node &output) const + void mergeFields(const std::vector& inputs, conduit::Node& output) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("mergeFields"); @@ -1182,10 +1182,10 @@ class MergeMeshes { if(inputs[i].m_input->has_child("fields")) { - const conduit::Node &n_fields = inputs[i].m_input->fetch_existing("fields"); + const conduit::Node& n_fields = inputs[i].m_input->fetch_existing("fields"); for(conduit::index_t c = 0; c < n_fields.number_of_children(); c++) { - const conduit::Node &n_field = n_fields[c]; + const conduit::Node& n_field = n_fields[c]; FieldInformation fi; fi.m_topology = n_field.fetch_existing("topology").as_string(); fi.m_association = n_field.fetch_existing("association").as_string(); @@ -1197,7 +1197,7 @@ class MergeMeshes if(n_field.has_path("volume_dependent")) { - const auto &vd = n_field["volume_dependent"]; + const auto& vd = n_field["volume_dependent"]; if(vd.dtype().is_string()) { fi.m_volume_dependent = (vd.as_string() == "true") ? 1 : 0; @@ -1213,7 +1213,7 @@ class MergeMeshes { fi.m_matset = n_field["matset"].as_string(); fi.m_have_matset_values = 1; - const conduit::Node &matset_values = n_field["matset_values"]; + const conduit::Node& matset_values = n_field["matset_values"]; fi.m_dtype = matset_values.dtype().is_object() ? matset_values[0].dtype().id() : matset_values.dtype().id(); @@ -1224,7 +1224,7 @@ class MergeMeshes if(n_field.has_path("values")) { fi.m_have_values = 1; - const conduit::Node &n_values = n_field.fetch_existing("values"); + const conduit::Node& n_values = n_field.fetch_existing("values"); if(n_values.number_of_children() > 0) { for(conduit::index_t comp = 0; comp < n_values.number_of_children(); comp++) @@ -1246,10 +1246,10 @@ class MergeMeshes // Make new fields const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); - conduit::Node &n_newFields = output["fields"]; + conduit::Node& n_newFields = output["fields"]; for(auto it = fieldInfo.begin(); it != fieldInfo.end(); it++) { - conduit::Node &n_newField = n_newFields[it->first]; + conduit::Node& n_newField = n_newFields[it->first]; n_newField["association"] = it->second.m_association; n_newField["topology"] = it->second.m_topology; if(!it->second.m_matset.empty()) @@ -1267,7 +1267,7 @@ class MergeMeshes if(it->second.m_have_values) { const std::string srcPath("fields/" + it->first + "/values"); - conduit::Node &n_values = n_newField["values"]; + conduit::Node& n_values = n_newField["values"]; n_values.set_allocator(conduitAllocatorId); if(it->second.m_association == "element") { @@ -1286,12 +1286,12 @@ class MergeMeshes // Vector if(it->second.m_have_values) { - conduit::Node &n_values = n_newField["values"]; + conduit::Node& n_values = n_newField["values"]; for(size_t ci = 0; ci < it->second.m_components.size(); ci++) { const std::string srcPath("fields/" + it->first + "/values/" + it->second.m_components[ci]); - conduit::Node &n_comp = n_values[it->second.m_components[ci]]; + conduit::Node& n_comp = n_values[it->second.m_components[ci]]; n_comp.set_allocator(conduitAllocatorId); if(it->second.m_association == "element") { @@ -1325,9 +1325,9 @@ class MergeMeshes * \param[out] n_values The node will be populated with data values from the field inputs. * \param srcPath The path to the source data in each input node. */ - void copyZonal(const std::vector &inputs, - conduit::Node &n_values, - const std::string &srcPath) const + void copyZonal(const std::vector& inputs, + conduit::Node& n_values, + const std::string& srcPath) const { axom::IndexType offset = 0; for(size_t i = 0; i < inputs.size(); i++) @@ -1336,7 +1336,7 @@ class MergeMeshes if(inputs[i].m_input->has_path(srcPath)) { - const conduit::Node &n_src_values = inputs[i].m_input->fetch_existing(srcPath); + const conduit::Node& n_src_values = inputs[i].m_input->fetch_existing(srcPath); axom::bump::views::nodeToArrayView(n_values, n_src_values, [&](auto destView, auto srcView) { copyZonal_copy(nzones, offset, destView, srcView); }); @@ -1400,9 +1400,9 @@ class MergeMeshes * \param[out] n_values The node will be populated with data values from the field inputs. * \param srcPath The path to the source data in each input node. */ - void copyNodal(const std::vector &inputs, - conduit::Node &n_values, - const std::string &srcPath) const + void copyNodal(const std::vector& inputs, + conduit::Node& n_values, + const std::string& srcPath) const { axom::IndexType offset = 0; for(size_t i = 0; i < inputs.size(); i++) @@ -1411,7 +1411,7 @@ class MergeMeshes if(inputs[i].m_input->has_path(srcPath)) { - const conduit::Node &n_src_values = inputs[i].m_input->fetch_existing(srcPath); + const conduit::Node& n_src_values = inputs[i].m_input->fetch_existing(srcPath); axom::bump::views::nodeToArrayView(n_src_values, n_values, [&](auto srcView, auto destView) { copyNodal_copy(inputs[i].m_nodeSliceView, nnodes, offset, destView, srcView); @@ -1470,8 +1470,8 @@ class MergeMeshes * \param inputs A vector of inputs to be merged. * \param[out] output The node that will contain the output mesh. */ - virtual void mergeMatset(const std::vector &AXOM_UNUSED_PARAM(inputs), - conduit::Node &AXOM_UNUSED_PARAM(output)) const + virtual void mergeMatset(const std::vector& AXOM_UNUSED_PARAM(inputs), + conduit::Node& AXOM_UNUSED_PARAM(output)) const { // Do nothing. } @@ -1483,9 +1483,9 @@ class MergeMeshes * \param[out] n_field The new field that we're creating. * \param srcPath The path to the source input's "matset_values" node. */ - virtual void copyMixedField(const std::vector &AXOM_UNUSED_PARAM(inputs), - conduit::Node &AXOM_UNUSED_PARAM(n_field), - const std::string &AXOM_UNUSED_PARAM(srcPath)) const + virtual void copyMixedField(const std::vector& AXOM_UNUSED_PARAM(inputs), + conduit::Node& AXOM_UNUSED_PARAM(n_field), + const std::string& AXOM_UNUSED_PARAM(srcPath)) const { // Do nothing. } @@ -1515,12 +1515,12 @@ class DispatchAnyMatset * \param func The function to invoke on the array views. */ template - void execute(conduit::Node &n_material_ids, - conduit::Node &n_sizes, - conduit::Node &n_offsets, - conduit::Node &n_indices, - conduit::Node &n_volume_fractions, - FuncType &&func) + void execute(conduit::Node& n_material_ids, + conduit::Node& n_sizes, + conduit::Node& n_offsets, + conduit::Node& n_indices, + conduit::Node& n_volume_fractions, + FuncType&& func) { // Support various types of material data. axom::bump::views::indexNodeToArrayViewSame( @@ -1546,7 +1546,7 @@ class DispatchAnyMatset * \param func The function to invoke on the matset view. */ template - void dispatchMatset(conduit::Node &n_matset, FuncType &&func) + void dispatchMatset(conduit::Node& n_matset, FuncType&& func) { axom::bump::views::dispatch_material(n_matset, [&](auto matsetView) { func(matsetView); }); } @@ -1562,7 +1562,7 @@ class DispatchAnyMatset * \param func The function to invoke on the matset view. */ template - void dispatchMixedField(conduit::Node &n_matset, conduit::Node &n_field, FuncType &&func) + void dispatchMixedField(conduit::Node& n_matset, conduit::Node& n_field, FuncType&& func) { axom::bump::views::dispatch_material_field( n_matset, @@ -1592,12 +1592,12 @@ class DispatchTypedUnibufferMatset * \param func The function to invoke on the array views. */ template - void execute(conduit::Node &n_material_ids, - conduit::Node &n_sizes, - conduit::Node &n_offsets, - conduit::Node &n_indices, - conduit::Node &n_volume_fractions, - FuncType &&func) + void execute(conduit::Node& n_material_ids, + conduit::Node& n_sizes, + conduit::Node& n_offsets, + conduit::Node& n_indices, + conduit::Node& n_volume_fractions, + FuncType&& func) { namespace utils = axom::bump::utilities; auto materialIdsView = utils::make_array_view(n_material_ids); @@ -1619,7 +1619,7 @@ class DispatchTypedUnibufferMatset * \param func The function to invoke on the matset view. */ template - void dispatchMatset(conduit::Node &n_matset, FuncType &&func) + void dispatchMatset(conduit::Node& n_matset, FuncType&& func) { auto matsetView = views::make_unibuffer_matset::view(n_matset); @@ -1637,7 +1637,7 @@ class DispatchTypedUnibufferMatset * \param func The function to invoke on the matset view. */ template - void dispatchMixedField(conduit::Node &n_matset, conduit::Node &n_field, FuncType &&func) + void dispatchMixedField(conduit::Node& n_matset, conduit::Node& n_field, FuncType&& func) { axom::bump::views::dispatch_material_unibuffer_field( n_matset, @@ -1688,7 +1688,7 @@ class MergeMeshesAndMatsets : public MergeMeshes * \param inputs The inputs to be merged. * \param[out] mi The material information. */ - void getMaterialInfo(const std::vector &inputs, MaterialInfo &mi) const + void getMaterialInfo(const std::vector& inputs, MaterialInfo& mi) const { // Make a pass through the inputs and make a list of the material names. mi.hasMatsets = false; @@ -1708,15 +1708,15 @@ class MergeMeshesAndMatsets : public MergeMeshes { if(inputs[i].m_input->has_path("matsets")) { - conduit::Node &n_matsets = inputs[i].m_input->fetch_existing("matsets"); - conduit::Node &n_matset = n_matsets[0]; + conduit::Node& n_matsets = inputs[i].m_input->fetch_existing("matsets"); + conduit::Node& n_matset = n_matsets[0]; mi.matsetName = n_matset.name(); mi.topoName = n_matset.fetch_existing("topology").as_string(); mi.elementDominant = conduit::blueprint::mesh::matset::is_element_dominant(n_matset); mi.multiBuffer = conduit::blueprint::mesh::matset::is_multi_buffer(n_matset) && !n_matset.has_child("material_ids"); auto matInfo = axom::bump::views::materials(n_matset); - for(const auto &info : matInfo) + for(const auto& info : matInfo) { if(mi.allMats.find(info.m_name) == mi.allMats.end()) { @@ -1746,7 +1746,7 @@ class MergeMeshesAndMatsets : public MergeMeshes * \param[out] mi The material information. */ template - void countMaterialSizes(const std::vector &inputs, MaterialInfo &mi) const + void countMaterialSizes(const std::vector& inputs, MaterialInfo& mi) const { AXOM_ANNOTATE_SCOPE("sizes"); namespace utils = axom::bump::utilities; @@ -1764,10 +1764,10 @@ class MergeMeshesAndMatsets : public MergeMeshes if(inputs[i].m_input->has_path("matsets")) { - conduit::Node &n_matsets = inputs[i].m_input->fetch_existing("matsets"); - conduit::Node &n_matset = n_matsets[0]; + conduit::Node& n_matsets = inputs[i].m_input->fetch_existing("matsets"); + conduit::Node& n_matset = n_matsets[0]; axom::IndexType matCount = 0; - auto *This = this; + auto* This = this; disp.dispatchMatset(n_matset, [&](auto matsetView) { // Figure out the types to use for storing the data. using MatsetViewType = std::remove_reference_t; @@ -1795,7 +1795,7 @@ class MergeMeshesAndMatsets : public MergeMeshes * * \note We only create a unibuffer matset for the merged matset. */ - virtual void mergeMatset(const std::vector &inputs, conduit::Node &output) const override + virtual void mergeMatset(const std::vector& inputs, conduit::Node& output) const override { AXOM_ANNOTATE_SCOPE("mergeMatset"); namespace utils = axom::bump::utilities; @@ -1811,25 +1811,25 @@ class MergeMeshesAndMatsets : public MergeMeshes // Allocate AXOM_ANNOTATE_BEGIN("allocate"); - conduit::Node &n_newMatset = output["matsets/" + mi.matsetName]; + conduit::Node& n_newMatset = output["matsets/" + mi.matsetName]; n_newMatset["topology"] = mi.topoName; - conduit::Node &n_volume_fractions = n_newMatset["volume_fractions"]; + conduit::Node& n_volume_fractions = n_newMatset["volume_fractions"]; n_volume_fractions.set_allocator(conduitAllocatorId); n_volume_fractions.set(conduit::DataType(mi.ftype, mi.totalMatCount)); - conduit::Node &n_material_ids = n_newMatset["material_ids"]; + conduit::Node& n_material_ids = n_newMatset["material_ids"]; n_material_ids.set_allocator(conduitAllocatorId); n_material_ids.set(conduit::DataType(mi.itype, mi.totalMatCount)); - conduit::Node &n_sizes = n_newMatset["sizes"]; + conduit::Node& n_sizes = n_newMatset["sizes"]; n_sizes.set_allocator(conduitAllocatorId); n_sizes.set(conduit::DataType(mi.itype, mi.totalZones)); - conduit::Node &n_offsets = n_newMatset["offsets"]; + conduit::Node& n_offsets = n_newMatset["offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(mi.itype, mi.totalZones)); - conduit::Node &n_indices = n_newMatset["indices"]; + conduit::Node& n_indices = n_newMatset["indices"]; n_indices.set_allocator(conduitAllocatorId); n_indices.set(conduit::DataType(mi.itype, mi.totalMatCount)); AXOM_ANNOTATE_END("allocate"); @@ -1838,13 +1838,13 @@ class MergeMeshesAndMatsets : public MergeMeshes AXOM_ANNOTATE_SCOPE("populate"); // Make material_map. - conduit::Node &n_material_map = n_newMatset["material_map"]; + conduit::Node& n_material_map = n_newMatset["material_map"]; for(auto it = mi.allMats.begin(); it != mi.allMats.end(); it++) n_material_map[it->first] = it->second; // Populate MaterialDispatch disp; - auto *This = this; + auto* This = this; disp.execute(n_material_ids, n_sizes, n_offsets, @@ -1863,8 +1863,8 @@ class MergeMeshesAndMatsets : public MergeMeshes if(inputs[i].m_input->has_child("matsets")) { - conduit::Node &n_matsets = inputs[i].m_input->fetch_existing("matsets"); - conduit::Node &n_matset = n_matsets[0]; + conduit::Node& n_matsets = inputs[i].m_input->fetch_existing("matsets"); + conduit::Node& n_matset = n_matsets[0]; disp.dispatchMatset(n_matset, [&](auto matsetView) { This->mergeMatset_sizes(matsetView, sizesView, nzones, zOffset); @@ -1890,8 +1890,8 @@ class MergeMeshesAndMatsets : public MergeMeshes if(inputs[i].m_input->has_child("matsets")) { - conduit::Node &n_matsets = inputs[i].m_input->fetch_existing("matsets"); - conduit::Node &n_matset = n_matsets[0]; + conduit::Node& n_matsets = inputs[i].m_input->fetch_existing("matsets"); + conduit::Node& n_matset = n_matsets[0]; disp.dispatchMatset(n_matset, [&](auto matsetView) { This->mergeMatset_copy(n_matset, @@ -2030,8 +2030,8 @@ class MergeMeshesAndMatsets : public MergeMeshes * lambda. */ template - void mergeMatset_copy(const conduit::Node &n_matset, - const std::map &allMats, + void mergeMatset_copy(const conduit::Node& n_matset, + const std::map& allMats, IntegerView materialIdsView, IntegerView offsetsView, FloatView volumeFractionsView, @@ -2045,7 +2045,7 @@ class MergeMeshesAndMatsets : public MergeMeshes // Make some maps for renumbering material numbers. const auto localMaterialMap = axom::bump::views::materials(n_matset); std::map localToAll; - for(const auto &info : localMaterialMap) + for(const auto& info : localMaterialMap) { const auto it = allMats.find(info.m_name); SLIC_ASSERT(it != allMats.end()); @@ -2129,10 +2129,10 @@ class MergeMeshesAndMatsets : public MergeMeshes * \param srcFieldPath The path to the source field. * \param[out] fi The field information. We only fill in the dtype and component names. */ - void getMixedFieldInformation(const std::vector &inputs, - const std::string &srcFieldPath, - const MaterialInfo &mi, - FieldInformation &fi) const + void getMixedFieldInformation(const std::vector& inputs, + const std::string& srcFieldPath, + const MaterialInfo& mi, + FieldInformation& fi) const { fi.m_dtype = -1; fi.m_components.clear(); @@ -2143,7 +2143,7 @@ class MergeMeshesAndMatsets : public MergeMeshes { if(inputs[i].m_input->has_path(srcFieldMatsetValuesPath)) { - const conduit::Node &n_matset_values = + const conduit::Node& n_matset_values = inputs[i].m_input->fetch_existing(srcFieldMatsetValuesPath); // NOTE: we only try to populate components for fields that look like vectors @@ -2152,7 +2152,7 @@ class MergeMeshesAndMatsets : public MergeMeshes for(conduit::index_t ci = 0; ci < n_matset_values.number_of_children(); ci++) { // n_component is a material name - const conduit::Node &n_component = n_matset_values[ci]; + const conduit::Node& n_component = n_matset_values[ci]; if(n_component.number_of_children() > 0) { @@ -2178,7 +2178,7 @@ class MergeMeshesAndMatsets : public MergeMeshes // vector - the component name for(conduit::index_t ci = 0; ci < n_matset_values.number_of_children(); ci++) { - const conduit::Node &n_component = n_matset_values[ci]; + const conduit::Node& n_component = n_matset_values[ci]; fi.m_dtype = n_component.dtype().id(); fi.m_components.push_back(n_component.name()); } @@ -2205,9 +2205,9 @@ class MergeMeshesAndMatsets : public MergeMeshes * can use their pre-existing merged arrays. * \note Mixed fields in Blueprint at this time are limited to scalars. */ - virtual void copyMixedField(const std::vector &inputs, - conduit::Node &n_field, - const std::string &srcFieldPath) const override + virtual void copyMixedField(const std::vector& inputs, + conduit::Node& n_field, + const std::string& srcFieldPath) const override { AXOM_ANNOTATE_SCOPE("copyMixedField"); MaterialInfo mi; @@ -2230,25 +2230,25 @@ class MergeMeshesAndMatsets : public MergeMeshes SLIC_ERROR_IF(fi.m_components.size() > 0, "Vector mixed vars not supported"); // Get the Conduit node for the matset we built previously - conduit::Node *n_matset = const_cast( + conduit::Node* n_matset = const_cast( conduit::blueprint::mesh::utils::find_reference_node(n_field, "matset")); SLIC_ERROR_IF(n_matset == nullptr, axom::fmt::format("The new matset {} was not found.", matsetName)); // Get some parts of the new unibuffer matset. - conduit::Node &n_material_ids = n_matset->fetch_existing("material_ids"); - conduit::Node &n_sizes = n_matset->fetch_existing("sizes"); - conduit::Node &n_offsets = n_matset->fetch_existing("offsets"); - conduit::Node &n_indices = n_matset->fetch_existing("indices"); + conduit::Node& n_material_ids = n_matset->fetch_existing("material_ids"); + conduit::Node& n_sizes = n_matset->fetch_existing("sizes"); + conduit::Node& n_offsets = n_matset->fetch_existing("offsets"); + conduit::Node& n_indices = n_matset->fetch_existing("indices"); // Allocate the new mixed field. - conduit::Node &n_matset_values = n_field["matset_values"]; + conduit::Node& n_matset_values = n_field["matset_values"]; n_matset_values.set_allocator(conduitAllocatorId); n_matset_values.set(conduit::DataType(mi.ftype, mi.totalMatCount)); // Dispatch the mixed material we built so we can access its arrays as views. MaterialDispatch disp; - auto *This = this; + auto* This = this; disp.execute( n_material_ids, n_sizes, @@ -2269,10 +2269,10 @@ class MergeMeshesAndMatsets : public MergeMeshes if(inputs[i].m_input->has_child("matsets") && inputs[i].m_input->has_path(srcFieldPath)) { // Get the source matset. - conduit::Node &n_matsets = inputs[i].m_input->fetch_existing("matsets"); - conduit::Node &n_matset = n_matsets.fetch_existing(matsetName); + conduit::Node& n_matsets = inputs[i].m_input->fetch_existing("matsets"); + conduit::Node& n_matset = n_matsets.fetch_existing(matsetName); // Get the source field. - conduit::Node &n_src_field = inputs[i].m_input->fetch_existing(srcFieldPath); + conduit::Node& n_src_field = inputs[i].m_input->fetch_existing(srcFieldPath); // Dispatch the source mixed field. disp.dispatchMixedField(n_matset, n_src_field, diff --git a/src/axom/bump/MergePolyhedralFaces.hpp b/src/axom/bump/MergePolyhedralFaces.hpp index b0cd6b81bd..6a7a5eda16 100644 --- a/src/axom/bump/MergePolyhedralFaces.hpp +++ b/src/axom/bump/MergePolyhedralFaces.hpp @@ -48,7 +48,7 @@ class MergePolyhedralFaces * * \param n_topology The topology to modify. */ - static void execute(conduit::Node &n_topo, + static void execute(conduit::Node& n_topo, int allocator_id = axom::execution_space::allocatorID()) { SLIC_ASSERT(n_topo.fetch_existing("elements/shape").as_string() == "polyhedral"); @@ -59,12 +59,12 @@ class MergePolyhedralFaces const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(allocatorID); // Get the data from the topology and make views. - conduit::Node &n_elem_conn = n_topo["elements/connectivity"]; - conduit::Node &n_elem_sizes = n_topo["elements/sizes"]; - conduit::Node &n_elem_offsets = n_topo["elements/offsets"]; - conduit::Node &n_se_conn = n_topo["subelements/connectivity"]; - conduit::Node &n_se_sizes = n_topo["subelements/sizes"]; - conduit::Node &n_se_offsets = n_topo["subelements/offsets"]; + conduit::Node& n_elem_conn = n_topo["elements/connectivity"]; + conduit::Node& n_elem_sizes = n_topo["elements/sizes"]; + conduit::Node& n_elem_offsets = n_topo["elements/offsets"]; + conduit::Node& n_se_conn = n_topo["subelements/connectivity"]; + conduit::Node& n_se_sizes = n_topo["subelements/sizes"]; + conduit::Node& n_se_offsets = n_topo["subelements/offsets"]; auto elem_conn = utils::make_array_view(n_elem_conn); auto elem_sizes = utils::make_array_view(n_elem_sizes); auto elem_offsets = utils::make_array_view(n_elem_offsets); diff --git a/src/axom/bump/MinMax.hpp b/src/axom/bump/MinMax.hpp index 6669cecf54..70cca4b76d 100644 --- a/src/axom/bump/MinMax.hpp +++ b/src/axom/bump/MinMax.hpp @@ -38,7 +38,7 @@ struct MinMax * * \return A pair containing the min,max values in the node. */ - static std::pair execute(const conduit::Node &n) + static std::pair execute(const conduit::Node& n) { SLIC_ASSERT(n.dtype().number_of_elements() > 0); std::pair retval; diff --git a/src/axom/bump/NodeToZoneRelationBuilder.hpp b/src/axom/bump/NodeToZoneRelationBuilder.hpp index c2a06abe31..b5563c0f89 100644 --- a/src/axom/bump/NodeToZoneRelationBuilder.hpp +++ b/src/axom/bump/NodeToZoneRelationBuilder.hpp @@ -285,16 +285,16 @@ class NodeToZoneRelationBuilder * \param coordset The topology's coordset. * \param[out] The node that will contain the O2M relation. */ - void execute(const conduit::Node &topo, const conduit::Node &coordset, conduit::Node &relation) + void execute(const conduit::Node& topo, const conduit::Node& coordset, conduit::Node& relation) { const std::string type = topo.fetch_existing("type").as_string(); const auto conduitAllocatorID = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); - conduit::Node &n_zones = relation["zones"]; - conduit::Node &n_sizes = relation["sizes"]; - conduit::Node &n_offsets = relation["offsets"]; + conduit::Node& n_zones = relation["zones"]; + conduit::Node& n_sizes = relation["sizes"]; + conduit::Node& n_offsets = relation["offsets"]; n_zones.set_allocator(conduitAllocatorID); n_sizes.set_allocator(conduitAllocatorID); n_offsets.set_allocator(conduitAllocatorID); @@ -302,7 +302,7 @@ class NodeToZoneRelationBuilder if(type == "unstructured") { conduit::blueprint::mesh::utils::ShapeType shape(topo); - const conduit::Node &n_connectivity = topo["elements/connectivity"]; + const conduit::Node& n_connectivity = topo["elements/connectivity"]; const std::string shapeType = topo["elements/shape"].as_string(); const auto intTypeId = n_connectivity.dtype().id(); const auto connSize = n_connectivity.dtype().number_of_elements(); @@ -320,8 +320,8 @@ class NodeToZoneRelationBuilder } else if(shape.is_polygonal() || shapeType == "mixed") { - const conduit::Node &n_topo_sizes = topo["elements/sizes"]; - const conduit::Node &n_topo_offsets = topo["elements/offsets"]; + const conduit::Node& n_topo_sizes = topo["elements/sizes"]; + const conduit::Node& n_topo_offsets = topo["elements/offsets"]; const auto nzones = n_topo_sizes.dtype().number_of_elements(); @@ -416,9 +416,9 @@ class NodeToZoneRelationBuilder */ template void handlePolyhedralView(PHView topoView, - conduit::Node &n_zones, - conduit::Node &n_sizes, - conduit::Node &n_offsets, + conduit::Node& n_zones, + conduit::Node& n_sizes, + conduit::Node& n_offsets, axom::IndexType nnodes, int intTypeId) const { @@ -493,7 +493,7 @@ class NodeToZoneRelationBuilder * lambda. */ template - void fillZonesPH(const TopologyView &topoView, + void fillZonesPH(const TopologyView& topoView, IntegerView connectivityView, IntegerView zonesView, OffsetsView offsets_view) const diff --git a/src/axom/bump/Options.hpp b/src/axom/bump/Options.hpp index 062eeb9c41..d73290d8ed 100644 --- a/src/axom/bump/Options.hpp +++ b/src/axom/bump/Options.hpp @@ -28,14 +28,14 @@ class Options * \param nzones The total number of zones in the associated topology. * \param options The node that contains the options. */ - Options(const conduit::Node &options) : m_options(options) { } + Options(const conduit::Node& options) : m_options(options) { } /*! * \brief Return the name of the topology to make in the output. * \param default_value The name to use if the option is not defined. * \return The name of the topology to make in the output. */ - std::string topologyName(const std::string &default_value = std::string()) const + std::string topologyName(const std::string& default_value = std::string()) const { std::string name(default_value); if(m_options.has_child("topologyName")) @@ -50,7 +50,7 @@ class Options * \param default_value The name to use if the option is not defined. * \return The name of the coordset to make in the output. */ - std::string coordsetName(const std::string &default_value = std::string()) const + std::string coordsetName(const std::string& default_value = std::string()) const { std::string name(default_value); if(m_options.has_child("coordsetName")) @@ -81,13 +81,13 @@ class Options * \param[out] f A map of the fields that will be processed, as well as their output name in the new fields. * \return True if the fields were present in the options. False otherwise. */ - bool fields(std::map &f) const + bool fields(std::map& f) const { bool retval = m_options.has_child("fields"); f.clear(); if(retval) { - const conduit::Node &n_opt_fields = m_options.fetch_existing("fields"); + const conduit::Node& n_opt_fields = m_options.fetch_existing("fields"); for(conduit::index_t i = 0; i < n_opt_fields.number_of_children(); i++) { if(n_opt_fields[i].dtype().is_string()) @@ -107,7 +107,7 @@ class Options * \brief Return the options node reference. * \return The options node reference. */ - const conduit::Node &options() const { return m_options; } + const conduit::Node& options() const { return m_options; } /** * \brief Get the name of the matset on which we'll operate. @@ -120,7 +120,7 @@ class Options * \param default_value The name to use if the option is not defined. * \return The name of the matset to make in the output. */ - std::string matsetName(const std::string &default_value = std::string()) const + std::string matsetName(const std::string& default_value = std::string()) const { std::string name(default_value.empty() ? matset() : default_value); if(options().has_child("matsetName")) @@ -145,7 +145,7 @@ class Options * * \return True if key is present and set to non-zero, false otherwise. */ - bool flagValue(const std::string &key, bool defaultValue) const + bool flagValue(const std::string& key, bool defaultValue) const { bool retval = defaultValue; if(options().has_path(key)) @@ -156,7 +156,7 @@ class Options } protected: - const conduit::Node &m_options; // A reference to the options node. + const conduit::Node& m_options; // A reference to the options node. }; } // end namespace bump diff --git a/src/axom/bump/PrimalAdaptor.hpp b/src/axom/bump/PrimalAdaptor.hpp index bfaebd67c7..fa526b935c 100644 --- a/src/axom/bump/PrimalAdaptor.hpp +++ b/src/axom/bump/PrimalAdaptor.hpp @@ -27,19 +27,19 @@ struct PolyhedralFaces static constexpr int MAX_PLANES = 64; AXOM_HOST_DEVICE inline int size() const { return m_planes.size(); } - AXOM_HOST_DEVICE inline const PlaneType &operator[](size_t i) const { return m_planes[i]; } - AXOM_HOST_DEVICE inline PlaneType &operator[](size_t i) { return m_planes[i]; } - AXOM_HOST_DEVICE inline void push_back(const PlaneType &plane) { m_planes.push_back(plane); } + AXOM_HOST_DEVICE inline const PlaneType& operator[](size_t i) const { return m_planes[i]; } + AXOM_HOST_DEVICE inline PlaneType& operator[](size_t i) { return m_planes[i]; } + AXOM_HOST_DEVICE inline void push_back(const PlaneType& plane) { m_planes.push_back(plane); } AXOM_HOST_DEVICE axom::ArrayView getFaces() const { - return axom::ArrayView(const_cast(m_planes.data()), m_planes.size()); + return axom::ArrayView(const_cast(m_planes.data()), m_planes.size()); } axom::StaticArray m_planes; }; template -std::ostream &operator<<(std::ostream &os, const PolyhedralFaces &obj) +std::ostream& operator<<(std::ostream& os, const PolyhedralFaces& obj) { os << "PolyhedralFaces\n"; for(int i = 0; i < obj.size(); i++) @@ -66,7 +66,7 @@ struct AveragePoints * * \param pt The point to add. */ - AXOM_HOST_DEVICE inline void add(const PointType &pt) + AXOM_HOST_DEVICE inline void add(const PointType& pt) { sum += VectorType(pt); numPoints++; @@ -120,8 +120,8 @@ struct AdaptPolyhedron * * \return A representation of the polyhedral zone. */ - AXOM_HOST_DEVICE static PolyhedralRepresentation convert(const TopologyView &topologyView, - const CoordsetView &coordsetView, + AXOM_HOST_DEVICE static PolyhedralRepresentation convert(const TopologyView& topologyView, + const CoordsetView& coordsetView, size_t zoneIndex) { const auto zone = topologyView.zone(zoneIndex); @@ -235,8 +235,8 @@ struct AdaptPolyhedron * * \return A representation of the polyhedral zone. */ - AXOM_HOST_DEVICE static PolyhedralRepresentation convert(const TopologyView &topologyView, - const CoordsetView &coordsetView, + AXOM_HOST_DEVICE static PolyhedralRepresentation convert(const TopologyView& topologyView, + const CoordsetView& coordsetView, size_t zoneIndex) { PolyhedralRepresentation faces; @@ -334,7 +334,7 @@ struct PrimalAdaptor * \param topologyView The topology view to use for initialization. * \param coordsetView The coordset view to use for initialization. */ - AXOM_HOST_DEVICE PrimalAdaptor(const TopologyView &topologyView, const CoordsetView &coordsetView) + AXOM_HOST_DEVICE PrimalAdaptor(const TopologyView& topologyView, const CoordsetView& coordsetView) : m_topologyView(topologyView) , m_coordsetView(coordsetView) { } diff --git a/src/axom/bump/RecenterField.hpp b/src/axom/bump/RecenterField.hpp index 3b4ce76d74..487d7698a5 100644 --- a/src/axom/bump/RecenterField.hpp +++ b/src/axom/bump/RecenterField.hpp @@ -57,7 +57,7 @@ class RecenterField * \param relation The node that contains an o2mrelation with nodes to zones. * \param out_field[out] The node that will contain the new field. */ - void execute(const conduit::Node &field, const conduit::Node &relation, conduit::Node &out_field) const + void execute(const conduit::Node& field, const conduit::Node& relation, conduit::Node& out_field) const { const std::string association = field.fetch_existing("association").as_string(); @@ -66,12 +66,12 @@ class RecenterField out_field["topology"] = field["topology"]; // Make output values. - const conduit::Node &n_values = field["values"]; + const conduit::Node& n_values = field["values"]; if(n_values.number_of_children() > 0) { for(conduit::index_t c = 0; c < n_values.number_of_children(); c++) { - const conduit::Node &n_comp = n_values[c]; + const conduit::Node& n_comp = n_values[c]; recenterSingleComponent(n_comp, relation, out_field["values"][n_comp.name()]); } } @@ -93,18 +93,18 @@ class RecenterField * \param n_comp The input component. * \param n_out[out] The node that will contain the new field. */ - void recenterSingleComponent(const conduit::Node &n_comp, - const conduit::Node &relation, - conduit::Node &n_out) const + void recenterSingleComponent(const conduit::Node& n_comp, + const conduit::Node& relation, + conduit::Node& n_out) const { namespace utils = axom::bump::utilities; // Get the data field for the o2m relation. const auto data_paths = conduit::blueprint::o2mrelation::data_paths(relation); // Use the o2mrelation to average data from n_comp to the n_out. - const conduit::Node &n_relvalues = relation[data_paths[0]]; - const conduit::Node &n_sizes = relation["sizes"]; - const conduit::Node &n_offsets = relation["offsets"]; + const conduit::Node& n_relvalues = relation[data_paths[0]]; + const conduit::Node& n_sizes = relation["sizes"]; + const conduit::Node& n_offsets = relation["offsets"]; views::indexNodeToArrayViewSame( n_relvalues, n_sizes, diff --git a/src/axom/bump/SelectedZones.hpp b/src/axom/bump/SelectedZones.hpp index f42afbcf13..1aa480f48b 100644 --- a/src/axom/bump/SelectedZones.hpp +++ b/src/axom/bump/SelectedZones.hpp @@ -43,8 +43,8 @@ class SelectedZones * \endcode */ SelectedZones(axom::IndexType nzones, - const conduit::Node &n_options, - const std::string &selection_key = std::string("selectedZones"), + const conduit::Node& n_options, + const std::string& selection_key = std::string("selectedZones"), int allocator_id = axom::execution_space::allocatorID()) : m_selectionKey(selection_key) , m_selectedZones() @@ -76,7 +76,7 @@ class SelectedZones * * \return The name of the key in the options that this class looks for. */ - const std::string &selectionKey() const { return m_selectionKey; } + const std::string& selectionKey() const { return m_selectionKey; } // The following members are protected (unless using CUDA) #if !defined(__CUDACC__) @@ -96,7 +96,7 @@ class SelectedZones * strided-structured indexing are the [0..n) zone numbers that exist only * within the selected window. */ - void buildSelectedZones(axom::IndexType nzones, const conduit::Node &n_options) + void buildSelectedZones(axom::IndexType nzones, const conduit::Node& n_options) { if(n_options.has_path(m_selectionKey)) { diff --git a/src/axom/bump/TopologyMapper.hpp b/src/axom/bump/TopologyMapper.hpp index 22d45060c4..46846a405a 100644 --- a/src/axom/bump/TopologyMapper.hpp +++ b/src/axom/bump/TopologyMapper.hpp @@ -62,8 +62,8 @@ namespace detail */ AXOM_SUPPRESS_HD_WARN template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polygon &shape1, - const axom::primal::Polygon &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polygon& shape1, + const axom::primal::Polygon& shape2, double eps = 1.e-10) { constexpr bool tryFixOrientation = false; @@ -84,8 +84,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polygon -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shape1, - const axom::primal::Tetrahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron& shape1, + const axom::primal::Tetrahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -93,8 +93,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shap } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shape1, - const axom::primal::Hexahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron& shape1, + const axom::primal::Hexahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -102,8 +102,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shap } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shape1, - const axom::primal::Polyhedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron& shape1, + const axom::primal::Polyhedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -111,8 +111,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shap } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shape1, - const axom::bump::PolyhedralFaces &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron& shape1, + const axom::bump::PolyhedralFaces& shape2, double eps = 1.e-10) { const bool tryFixOrientation = false; @@ -123,8 +123,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Tetrahedron &shap // Hexahedron first template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape1, - const axom::primal::Tetrahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron& shape1, + const axom::primal::Tetrahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -132,8 +132,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape1, - const axom::primal::Hexahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron& shape1, + const axom::primal::Hexahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -141,8 +141,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape1, - const axom::primal::Polyhedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron& shape1, + const axom::primal::Polyhedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -150,8 +150,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape1, - const axom::bump::PolyhedralFaces &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron& shape1, + const axom::bump::PolyhedralFaces& shape2, double eps = 1.e-10) { const bool tryFixOrientation = false; @@ -162,8 +162,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Hexahedron &shape // Polyhedron first template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape1, - const axom::primal::Tetrahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron& shape1, + const axom::primal::Tetrahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -171,8 +171,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape1, - const axom::primal::Hexahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron& shape1, + const axom::primal::Hexahedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -180,8 +180,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape1, - const axom::primal::Polyhedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron& shape1, + const axom::primal::Polyhedron& shape2, double eps = 1.e-10) { const auto ph = axom::primal::clip(shape1, shape2, eps); @@ -189,8 +189,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape1, - const axom::bump::PolyhedralFaces &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron& shape1, + const axom::bump::PolyhedralFaces& shape2, double eps = 1.e-10) { auto clipped = shape1; @@ -200,42 +200,42 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::primal::Polyhedron &shape // PolyhedralFaces first template -AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces &shape1, - const axom::primal::Tetrahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces& shape1, + const axom::primal::Tetrahedron& shape2, double eps = 1.e-10) { return shapeOverlap(shape2, shape1, eps); } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces &shape1, - const axom::primal::Hexahedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces& shape1, + const axom::primal::Hexahedron& shape2, double eps = 1.e-10) { return shapeOverlap(shape2, shape1, eps); } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces &shape1, - const axom::primal::Polyhedron &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces& shape1, + const axom::primal::Polyhedron& shape2, double eps = 1.e-10) { return shapeOverlap(shape2, shape1, eps); } template -AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces &shape1, - const axom::bump::PolyhedralFaces &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces& shape1, + const axom::bump::PolyhedralFaces& shape2, double eps = 1.e-10) { using PointType = axom::primal::Point; // Find largest plane offset. T maxOffset {}; - for(const auto &plane : shape1.getFaces()) + for(const auto& plane : shape1.getFaces()) { maxOffset = axom::utilities::max(maxOffset, axom::utilities::abs(plane.getOffset())); } - for(const auto &plane : shape2.getFaces()) + for(const auto& plane : shape2.getFaces()) { maxOffset = axom::utilities::max(maxOffset, axom::utilities::abs(plane.getOffset())); } @@ -269,8 +269,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const axom::bump::PolyhedralFaces &shape * \return The volume of the overlap between the shapes. */ template -AXOM_HOST_DEVICE double shapeOverlap(const VariableShape &shape1, - const Shape2Type &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const VariableShape& shape1, + const Shape2Type& shape2, double eps = 1.e-10) { const int id = shape1.id(); @@ -319,8 +319,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const VariableShape &shape1, * \return The volume of the overlap between the shapes. */ template -AXOM_HOST_DEVICE double shapeOverlap(const Shape1Type &shape1, - const VariableShape &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const Shape1Type& shape1, + const VariableShape& shape2, double eps = 1.e-10) { const int id = shape2.id(); @@ -369,8 +369,8 @@ AXOM_HOST_DEVICE double shapeOverlap(const Shape1Type &shape1, * \return The volume of the overlap between the shapes. */ template -AXOM_HOST_DEVICE double shapeOverlap(const VariableShape &shape1, - const VariableShape &shape2, +AXOM_HOST_DEVICE double shapeOverlap(const VariableShape& shape1, + const VariableShape& shape2, double eps = 1.e-10) { int id = shape1.id(); @@ -465,11 +465,11 @@ class TopologyMapper * \param targetTopoView The target topology view. * \param targetCoordsetView The target coordset view. */ - TopologyMapper(const SrcTopologyView &srcTopoView, - const SrcCoordsetView &srcCoordsetView, - const SrcMatsetView &srcMatsetView, - const TargetTopologyView &targetTopoView, - const TargetCoordsetView &targetCoordsetView) + TopologyMapper(const SrcTopologyView& srcTopoView, + const SrcCoordsetView& srcCoordsetView, + const SrcMatsetView& srcMatsetView, + const TargetTopologyView& targetTopoView, + const TargetCoordsetView& targetCoordsetView) : m_srcView(srcTopoView, srcCoordsetView) , m_srcMatsetView(srcMatsetView) , m_targetView(targetTopoView, targetCoordsetView) @@ -521,9 +521,9 @@ class TopologyMapper * \note After executing, the n_targetMesh node will contain a new matset containing * the results of the intersections with the src/target meshes. */ - void execute(const conduit::Node &n_srcMesh, - const conduit::Node &n_options, - conduit::Node &n_targetMesh) const + void execute(const conduit::Node& n_srcMesh, + const conduit::Node& n_options, + conduit::Node& n_targetMesh) const { AXOM_ANNOTATE_SCOPE("TopologyMapper::execute"); namespace utils = axom::bump::utilities; @@ -534,11 +534,11 @@ class TopologyMapper const int allocatorID = getAllocatorID(); - const char *SRC_MATSET_NAME = "source/matsetName"; - const char *SRC_SELECTED_ZONES = "source/selectedZones"; - const char *TARGET_TOPOLOGY_NAME = "target/topologyName"; - const char *TARGET_MATSET_NAME = "target/matsetName"; - const char *TARGET_SELECTED_ZONES = "target/selectedZones"; + const char* SRC_MATSET_NAME = "source/matsetName"; + const char* SRC_SELECTED_ZONES = "source/selectedZones"; + const char* TARGET_TOPOLOGY_NAME = "target/topologyName"; + const char* TARGET_MATSET_NAME = "target/matsetName"; + const char* TARGET_SELECTED_ZONES = "target/selectedZones"; // Make sure options are in the right memory space in case we are given lists of // selected zone ids. @@ -546,8 +546,8 @@ class TopologyMapper utils::copy(n_options_copy, n_options, getAllocatorID()); // Ensure required options exist. - const char *required[] = {SRC_MATSET_NAME, TARGET_TOPOLOGY_NAME, TARGET_MATSET_NAME}; - for(const auto &key : required) + const char* required[] = {SRC_MATSET_NAME, TARGET_TOPOLOGY_NAME, TARGET_MATSET_NAME}; + for(const auto& key : required) { if(!n_options_copy.has_path(key)) { @@ -560,8 +560,8 @@ class TopologyMapper const std::string targetMatsetName = n_options_copy[TARGET_MATSET_NAME].as_string(); // Look at the source mesh's matset. Count the number of materials. - const conduit::Node &n_matset = n_srcMesh.fetch_existing("matsets/" + srcMatsetName); - const conduit::Node &n_materialMap = n_matset.fetch_existing("material_map"); + const conduit::Node& n_matset = n_srcMesh.fetch_existing("matsets/" + srcMatsetName); + const conduit::Node& n_materialMap = n_matset.fetch_existing("material_map"); const auto nmats = n_materialMap.number_of_children(); const auto numMaterialSlots = nmats + 1; // leave space for empty material. @@ -638,15 +638,15 @@ class TopologyMapper const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(allocatorID); // Make target matset. - conduit::Node &n_targetMatset = n_targetMesh["matsets/" + targetMatsetName]; + conduit::Node& n_targetMatset = n_targetMesh["matsets/" + targetMatsetName]; n_targetMatset["material_map"].set(n_materialMap); n_targetMatset["topology"].set(targetTopologyName); - conduit::Node &n_volume_fractions = n_targetMatset["volume_fractions"]; - conduit::Node &n_material_ids = n_targetMatset["material_ids"]; - conduit::Node &n_indices = n_targetMatset["indices"]; - conduit::Node &n_sizes = n_targetMatset["sizes"]; - conduit::Node &n_offsets = n_targetMatset["offsets"]; + conduit::Node& n_volume_fractions = n_targetMatset["volume_fractions"]; + conduit::Node& n_material_ids = n_targetMatset["material_ids"]; + conduit::Node& n_indices = n_targetMatset["indices"]; + conduit::Node& n_sizes = n_targetMatset["sizes"]; + conduit::Node& n_offsets = n_targetMatset["offsets"]; // Allocate memory for the output matset. n_volume_fractions.set_allocator(conduitAllocatorId); @@ -703,7 +703,7 @@ class TopologyMapper utils::ComputeShapeAmount::execute(targetShape); // Handle intersection in-depth of the bounding boxes intersected. - auto handleIntersection = [&](std::int32_t currentNode, const std::int32_t *leafNodes) { + auto handleIntersection = [&](std::int32_t currentNode, const std::int32_t* leafNodes) { const auto srcBboxIndex = leafNodes[currentNode]; // This should not happen but check that we're not given bad values. @@ -743,8 +743,8 @@ class TopologyMapper #endif // Add the src material contribution into the target material. - MatIntType *matids = material_ids.data() + zi * numMaterialSlots; - MatFloatType *vfs = volume_fractions.data() + zi * numMaterialSlots; + MatIntType* matids = material_ids.data() + zi * numMaterialSlots; + MatFloatType* vfs = volume_fractions.data() + zi * numMaterialSlots; for(int m = 0; m < nmats; m++) { if(matids[m] == mat) @@ -777,7 +777,7 @@ class TopologyMapper }; // This predicate determines whether 2 bboxes intersect. - auto bbIsect = [](const SrcBoundingBox &queryBbox, const SrcBoundingBox &bvhBbox) -> bool { + auto bbIsect = [](const SrcBoundingBox& queryBbox, const SrcBoundingBox& bvhBbox) -> bool { bool rv = queryBbox.intersectsWith(bvhBbox); #if defined(AXOM_DEBUG_TOPOLOGY_MAPPER) && !defined(AXOM_DEVICE_CODE) std::cout << "bbIsect: rv=" << rv << ", q=" << queryBbox << ", bvh=" << bvhBbox @@ -802,7 +802,7 @@ class TopologyMapper nTargetZones, AXOM_LAMBDA(axom::IndexType index) { // Sum the material within the zone. - MatFloatType *vfs = volume_fractions.data() + index * numMaterialSlots; + MatFloatType* vfs = volume_fractions.data() + index * numMaterialSlots; MatFloatType vfSum(0); for(MatIntType m = 0; m < sizes[index]; m++) { diff --git a/src/axom/bump/Unique.hpp b/src/axom/bump/Unique.hpp index c4a77f5aed..2fb2cbfa66 100644 --- a/src/axom/bump/Unique.hpp +++ b/src/axom/bump/Unique.hpp @@ -33,7 +33,7 @@ namespace detail * \param container The container (usually a view) whose data will be printed. */ template -void printContainer(const std::string &name, const ContainerType &container) +void printContainer(const std::string& name, const ContainerType& container) { using value_type = typename ContainerType::value_type; using printed_type = @@ -67,7 +67,7 @@ void printContainer(const std::string &name, const ContainerType &container) * \param container The container whose data will be printed. */ template -void printMap(const std::string &name, const MapType &container, bool printKey) +void printMap(const std::string& name, const MapType& container, bool printKey) { std::cout << name << "=["; for(auto it = container.begin(); it != container.end(); it++) @@ -116,8 +116,8 @@ struct Unique * \note key_orig_view is passed by value so it does not require a local copy to capture it. */ static void execute(const axom::ArrayView keys_orig_view, - axom::Array &skeys, - axom::Array &sindices, + axom::Array& skeys, + axom::Array& sindices, int allocator_id = axom::execution_space::allocatorID()) { const int allocatorID = allocator_id; @@ -211,9 +211,9 @@ struct Unique * \param[out] sindices An array of indices that indicate where in the original view the keys came from. * */ - static void execute(const axom::ArrayView &keys_orig_view, - axom::Array &skeys, - axom::Array &sindices, + static void execute(const axom::ArrayView& keys_orig_view, + axom::Array& skeys, + axom::Array& sindices, int allocator_id = axom::execution_space::allocatorID()) { // Make unique values and store the indices. @@ -235,8 +235,8 @@ struct Unique // Sort the vector by the keys. std::sort(unique_vector.begin(), unique_vector.end(), - [](const std::pair &a, - const std::pair &b) { return a.first < b.first; }); + [](const std::pair& a, + const std::pair& b) { return a.first < b.first; }); // Allocate the output arrays and populate them const axom::IndexType newsize = unique_vector.size(); diff --git a/src/axom/bump/VariableShape.hpp b/src/axom/bump/VariableShape.hpp index c9dcd24504..025ad7aacc 100644 --- a/src/axom/bump/VariableShape.hpp +++ b/src/axom/bump/VariableShape.hpp @@ -48,14 +48,14 @@ class VariableShape * \brief Add a point to the shape. * \param pt The point to add. */ - AXOM_HOST_DEVICE void push_back(const PointType &pt) { m_points.push_back(pt); } + AXOM_HOST_DEVICE void push_back(const PointType& pt) { m_points.push_back(pt); } /*! * \brief Return the \a index'th point. * \param index The index of the point to return. * \return The desired point. */ - AXOM_HOST_DEVICE const PointType &operator[](axom::IndexType index) const + AXOM_HOST_DEVICE const PointType& operator[](axom::IndexType index) const { return m_points[index]; } @@ -138,7 +138,7 @@ class VariableShape /// Printing method for VariableShape objects. template -std::ostream &operator<<(std::ostream &os, const VariableShape &obj) +std::ostream& operator<<(std::ostream& os, const VariableShape& obj) { os << "{shapeId=" << obj.m_shapeId << ", points={"; for(int i = 0; i < obj.m_points.size(); i++) diff --git a/src/axom/bump/ZoneListBuilder.hpp b/src/axom/bump/ZoneListBuilder.hpp index 20108d48f3..a09765d744 100644 --- a/src/axom/bump/ZoneListBuilder.hpp +++ b/src/axom/bump/ZoneListBuilder.hpp @@ -38,7 +38,7 @@ class ZoneListBuilder * \param topoView The topology view to use for creating the zone lists. * \param matsetView The matset view to use for creating the zone lists. */ - ZoneListBuilder(const TopologyView &topoView, const MatsetView &matsetView) + ZoneListBuilder(const TopologyView& topoView, const MatsetView& matsetView) : m_topologyView(topoView) , m_matsetView(matsetView) , m_allocator_id(axom::execution_space::allocatorID()) @@ -78,8 +78,8 @@ class ZoneListBuilder * considered mixed as we might have to split those zones. */ void execute(axom::IndexType nnodes, - axom::Array &cleanIndices, - axom::Array &mixedIndices) const + axom::Array& cleanIndices, + axom::Array& mixedIndices) const { AXOM_ANNOTATE_SCOPE("ZoneListBuilder.1"); const int allocatorID = getAllocatorID(); @@ -102,11 +102,11 @@ class ZoneListBuilder { const auto zone = deviceTopologyView.zone(zoneIndex); const auto nnodesThisZone = zone.numberOfNodes(); - int *nodeData = nMatsPerNodeView.data(); + int* nodeData = nMatsPerNodeView.data(); for(axom::IndexType i = 0; i < nnodesThisZone; i++) { const auto nodeId = zone.getId(i); - int *nodePtr = nodeData + nodeId; + int* nodePtr = nodeData + nodeId; axom::atomicMax(nodePtr, nmats); } } @@ -126,7 +126,7 @@ class ZoneListBuilder MaskType clean {1}; const axom::IndexType nnodesThisZone = zone.numberOfNodes(); - const auto &zoneNodeIds = zone.getIdsStorage(); + const auto& zoneNodeIds = zone.getIdsStorage(); for(axom::IndexType i = 0; i < nnodesThisZone; i++) { const auto nodeId = zoneNodeIds[i]; @@ -249,8 +249,8 @@ class ZoneListBuilder */ void execute(axom::IndexType nnodes, const SelectedZonesView selectedZonesView, - axom::Array &cleanIndices, - axom::Array &mixedIndices) const + axom::Array& cleanIndices, + axom::Array& mixedIndices) const { AXOM_ANNOTATE_SCOPE("ZoneListBuilder.2"); SLIC_ASSERT(selectedZonesView.size() > 0); @@ -276,11 +276,11 @@ class ZoneListBuilder { const auto zone = deviceTopologyView.zone(zoneIndex); const auto nnodesThisZone = zone.numberOfNodes(); - int *nodeData = nMatsPerNodeView.data(); + int* nodeData = nMatsPerNodeView.data(); for(axom::IndexType i = 0; i < nnodesThisZone; i++) { const auto nodeId = zone.getId(i); - int *nodePtr = nodeData + nodeId; + int* nodePtr = nodeData + nodeId; axom::atomicMax(nodePtr, nmats); } } @@ -417,8 +417,8 @@ class ZoneListBuilder * */ void execute(const SelectedZonesView selectedZonesView, - axom::Array &cleanIndices, - axom::Array &mixedIndices) const + axom::Array& cleanIndices, + axom::Array& mixedIndices) const { AXOM_ANNOTATE_SCOPE("ZoneListBuilder.3"); const int allocatorID = getAllocatorID(); diff --git a/src/axom/bump/data/MeshTester.hpp b/src/axom/bump/data/MeshTester.hpp index e486f9bc33..6c99c74ab5 100644 --- a/src/axom/bump/data/MeshTester.hpp +++ b/src/axom/bump/data/MeshTester.hpp @@ -71,7 +71,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseOne(conduit::Node &mesh); + void initTestCaseOne(conduit::Node& mesh); /*! * \brief Initializes an MIRMesh based on the example from Meredith and Childs 2010 paper. @@ -80,7 +80,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseTwo(conduit::Node &mesh); + void initTestCaseTwo(conduit::Node& mesh); /*! * \brief Initializes an MIRMesh used for testing triangle clipping cases. @@ -89,7 +89,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseThree(conduit::Node &mesh); + void initTestCaseThree(conduit::Node& mesh); /*! * \brief Intializes a mesh used for testing a single circle of one materials surrounded by another. @@ -99,7 +99,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseFour(conduit::Node &mesh); + void initTestCaseFour(conduit::Node& mesh); /*! * \brief Initializes a mesh to be used for testing a set of concentric circles centered in a uniform 2D grid. @@ -111,7 +111,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseFive(int gridSize, int numCircles, conduit::Node &mesh); + void initTestCaseFive(int gridSize, int numCircles, conduit::Node& mesh); /*! * \brief Initializes a mesh to be used for testing a set of concentric spheres centered in a uniform 3D grid. @@ -123,7 +123,7 @@ class MeshTester * * \return The generated mesh. */ - void initTestCaseSix(int gridSize, int numSpheres, conduit::Node &mesh); + void initTestCaseSix(int gridSize, int numSpheres, conduit::Node& mesh); /*! * \brief Initializes a mesh composed of a uniform grid with a circle of material in it. @@ -135,9 +135,9 @@ class MeshTester * \return The generated mesh. */ void createUniformGridTestCaseMesh(int gridSize, - const Point2 &circleCenter, + const Point2& circleCenter, axom::float64 circleRadius, - conduit::Node &mesh); + conduit::Node& mesh); /*! * \brief Initializes a mesh to be used for validating the results of quad clipping. * @@ -146,28 +146,28 @@ class MeshTester * * \return The generated mesh. */ - void initQuadClippingTestMesh(conduit::Node &mesh); + void initQuadClippingTestMesh(conduit::Node& mesh); private: /*! * \brief make a 3x3 mesh of quads. * \param mesh A conduit node that will contain the new mesh. */ - void mesh3x3(conduit::Node &mesh); + void mesh3x3(conduit::Node& mesh); /*! * \brief Generates a 2D uniform grid of n x n elements. * * \param gridSize The number of elements in the width and height of the uniform grid. */ - void generateGrid(int gridSize, conduit::Node &mesh); + void generateGrid(int gridSize, conduit::Node& mesh); /*! * \brief Generates a 3D uniform grid of n x n x n elements. * * \param gridSize The number of elements in the width, height, and depth of the uniform grid. */ - void generateGrid3D(int gridSize, conduit::Node &mesh); + void generateGrid3D(int gridSize, conduit::Node& mesh); /*! * \brief Calculates the number of corners of the quad that are within the circle. @@ -181,12 +181,12 @@ class MeshTester * * \return The number of corners of the quad that are within the circle. */ - int circleQuadCornersOverlaps(const Point2 &circleCenter, + int circleQuadCornersOverlaps(const Point2& circleCenter, axom::float64 circleRadius, - const Point2 &quadP0, - const Point2 &quadP1, - const Point2 &quadP2, - const Point2 &quadP3); + const Point2& quadP0, + const Point2& quadP1, + const Point2& quadP2, + const Point2& quadP3); bool m_structured {false}; }; diff --git a/src/axom/bump/extraction/BlendGroupBuilder.hpp b/src/axom/bump/extraction/BlendGroupBuilder.hpp index 41e3fc0bc0..7e5c502e2c 100644 --- a/src/axom/bump/extraction/BlendGroupBuilder.hpp +++ b/src/axom/bump/extraction/BlendGroupBuilder.hpp @@ -83,15 +83,15 @@ class BlendGroupBuilder * \brief Access the state views. * \return A reference to the state. */ - State &state() { return m_state; } - const State &state() const { return m_state; } + State& state() { return m_state; } + const State& state() const { return m_state; } /*! * \brief Provide a hint to the naming policy view so it can do narrowing. * * \param nnodes The number of nodes in the input mesh. */ - void setNamingPolicy(const NamingPolicyView &view) { m_state.m_namingView = view; } + void setNamingPolicy(const NamingPolicyView& view) { m_state.m_namingView = view; } /*! * \brief Set the number of zones. @@ -99,8 +99,8 @@ class BlendGroupBuilder * \param blendGroupsView The view that holds the number of blend groups for each zone. * \param blendGroupsLenView The view that holds the size of the blend group data for each zone. */ - void setBlendGroupSizes(const axom::ArrayView &blendGroupsView, - const axom::ArrayView &blendGroupsLenView) + void setBlendGroupSizes(const axom::ArrayView& blendGroupsView, + const axom::ArrayView& blendGroupsLenView) { m_state.m_nzones = blendGroupsView.size(); m_state.m_blendGroupsView = blendGroupsView; @@ -113,7 +113,7 @@ class BlendGroupBuilder * \param[out] bgSum The total number of blend groups for all zones. * \param[out] bgLenSum The total size of blend group data for all zones. */ - void computeBlendGroupSizes(IndexType &bgSum, IndexType &bgLenSum) + void computeBlendGroupSizes(IndexType& bgSum, IndexType& bgLenSum) { AXOM_ANNOTATE_SCOPE("computeBlendGroupSizes"); axom::ReduceSum blendGroups_sum(0); @@ -136,8 +136,8 @@ class BlendGroupBuilder * \param blendOffsetView The offsets to each blend group for views sized: view[blendGroupSum]. * \param blendGroupOffsetsView The offsets to each zone's blend groups data. */ - void setBlendGroupOffsets(const axom::ArrayView &blendOffsetView, - const axom::ArrayView &blendGroupOffsetsView) + void setBlendGroupOffsets(const axom::ArrayView& blendOffsetView, + const axom::ArrayView& blendGroupOffsetsView) { m_state.m_blendOffsetView = blendOffsetView; m_state.m_blendGroupOffsetsView = blendGroupOffsetsView; @@ -156,11 +156,11 @@ class BlendGroupBuilder /*! * \brief Set the views that we'll use for blend groups. */ - void setBlendViews(const axom::ArrayView &blendNames, - const axom::ArrayView &blendGroupSizes, - const axom::ArrayView &blendGroupStart, - const axom::ArrayView &blendIds, - const axom::ArrayView &blendCoeff) + void setBlendViews(const axom::ArrayView& blendNames, + const axom::ArrayView& blendGroupSizes, + const axom::ArrayView& blendGroupStart, + const axom::ArrayView& blendIds, + const axom::ArrayView& blendCoeff) { m_state.m_blendNamesView = blendNames; m_state.m_blendGroupSizesView = blendGroupSizes; @@ -175,8 +175,8 @@ class BlendGroupBuilder * \param uniqueNames A view containing unique, sorted blend group names. * \param uniqueIndices A view containing the original blend group index for each unique name. */ - void setUniqueNames(const axom::ArrayView &uniqueNames, - const axom::ArrayView &uniqueIndices) + void setUniqueNames(const axom::ArrayView& uniqueNames, + const axom::ArrayView& uniqueIndices) { m_state.m_blendUniqueNamesView = uniqueNames; m_state.m_blendUniqueIndicesView = uniqueIndices; @@ -186,7 +186,7 @@ class BlendGroupBuilder * \brief Get the blend names view. * \return The blend names view. */ - const axom::ArrayView &blendNames() const { return m_state.m_blendNamesView; } + const axom::ArrayView& blendNames() const { return m_state.m_blendNamesView; } /*! * \brief This class helps us manage blend group creation and usage for blend groups within a single zone. @@ -351,7 +351,7 @@ class BlendGroupBuilder * \brief Print the current blend group to a stream. * \param os The stream to which the blend group will print. */ - void print(std::ostream &os) const + void print(std::ostream& os) const { const auto n = m_state->m_blendGroupSizesView[m_blendGroupId]; const auto offset = m_state->m_blendGroupStartView[m_blendGroupId]; @@ -361,7 +361,7 @@ class BlendGroupBuilder os << " size: " << n << std::endl; os << " offset: " << offset << std::endl; - const IndexType *ids = m_state->m_blendIdsView.data() + offset; + const IndexType* ids = m_state->m_blendIdsView.data() + offset; os << " ids: ["; for(int bi = 0; bi < n; bi++) { @@ -370,7 +370,7 @@ class BlendGroupBuilder } os << "]"; os << "\n"; - const float *weights = m_state->m_blendCoeffView.data() + offset; + const float* weights = m_state->m_blendCoeffView.data() + offset; os << " weights: ["; for(int bi = 0; bi < n; bi++) { @@ -414,7 +414,7 @@ class BlendGroupBuilder IndexType m_blendGroupId; // The global blend group index within this current zone. IndexType m_startOffset; // The data offset for the first ids/weights in this blend group. IndexType m_currentDataOffset; // The current data offset. - State *m_state; // Pointer to the main state. + State* m_state; // Pointer to the main state. }; /*! @@ -438,7 +438,7 @@ class BlendGroupBuilder // Global start groups.m_startOffset = groups.m_currentDataOffset = m_state.m_blendOffsetView[zoneIndex]; - groups.m_state = const_cast(&m_state); + groups.m_state = const_cast(&m_state); return groups; } @@ -449,8 +449,8 @@ class BlendGroupBuilder * \param[out] newSelectedIndices An array that will contain the data for the * new selected indices, if we need to make it. */ - void filterUnique(axom::Array &newUniqueNames, - axom::Array &newUniqueIndices) + void filterUnique(axom::Array& newUniqueNames, + axom::Array& newUniqueIndices) { AXOM_ANNOTATE_SCOPE("filterUnique"); const auto nIndices = m_state.m_blendUniqueIndicesView.size(); diff --git a/src/axom/bump/extraction/ExtractorOptions.hpp b/src/axom/bump/extraction/ExtractorOptions.hpp index c476463adc..7cb063d139 100644 --- a/src/axom/bump/extraction/ExtractorOptions.hpp +++ b/src/axom/bump/extraction/ExtractorOptions.hpp @@ -26,7 +26,7 @@ class ExtractorOptions : public axom::bump::Options * * \param options The node that contains the clipping options. */ - ExtractorOptions(const conduit::Node &options) : axom::bump::Options(options) { } + ExtractorOptions(const conduit::Node& options) : axom::bump::Options(options) { } /** * \brief Return the name of the field used for clipping. @@ -99,7 +99,7 @@ class ExtractorOptions : public axom::bump::Options protected: /// Access the base class' options. - const conduit::Node &options() const { return this->m_options; } + const conduit::Node& options() const { return this->m_options; } }; } // end namespace extraction diff --git a/src/axom/bump/extraction/FieldIntersector.hpp b/src/axom/bump/extraction/FieldIntersector.hpp index ef71a6bee5..eb0411b96a 100644 --- a/src/axom/bump/extraction/FieldIntersector.hpp +++ b/src/axom/bump/extraction/FieldIntersector.hpp @@ -73,7 +73,7 @@ class FieldIntersector */ AXOM_HOST_DEVICE axom::IndexType determineTableCase(axom::IndexType AXOM_UNUSED_PARAM(zone_index), - const ConnectivityView &node_ids) const + const ConnectivityView& node_ids) const { axom::IndexType case_number = 0, num_ids = node_ids.size(); for(IndexType i = 0; i < num_ids; i++) @@ -116,12 +116,12 @@ class FieldIntersector * \param n_options The node that contains the options. * \param n_fields The node that contains fields. */ - void initialize(const TopologyView &AXOM_UNUSED_PARAM(topologyView), - const CoordsetView &AXOM_UNUSED_PARAM(coordsetView), - const conduit::Node &n_options, - const conduit::Node &AXOM_UNUSED_PARAM(n_topology), - const conduit::Node &AXOM_UNUSED_PARAM(n_coordset), - const conduit::Node &n_fields) + void initialize(const TopologyView& AXOM_UNUSED_PARAM(topologyView), + const CoordsetView& AXOM_UNUSED_PARAM(coordsetView), + const conduit::Node& n_options, + const conduit::Node& AXOM_UNUSED_PARAM(n_topology), + const conduit::Node& AXOM_UNUSED_PARAM(n_coordset), + const conduit::Node& n_fields) { namespace utils = axom::bump::utilities; const int allocator_id = getAllocatorID(); @@ -131,8 +131,8 @@ class FieldIntersector m_view.m_fieldValue = opts.value(); // Make sure the clipField is the right data type and store access to it in the view. - const conduit::Node &n_field = n_fields.fetch_existing(opts.field()); - const conduit::Node &n_field_values = n_field["values"]; + const conduit::Node& n_field = n_fields.fetch_existing(opts.field()); + const conduit::Node& n_field_values = n_field["values"]; SLIC_ASSERT(n_field["association"].as_string() == "vertex"); SLIC_ASSERT(!n_field_values.dtype().is_object()); if(n_field_values.dtype().id() == utils::cpp2conduit::id) @@ -157,12 +157,12 @@ class FieldIntersector * \param n_options The options. * \return The name of the toplogy on which to operate. */ - std::string getTopologyName(const conduit::Node &n_input, const conduit::Node &n_options) const + std::string getTopologyName(const conduit::Node& n_input, const conduit::Node& n_options) const { // Get the topo name. FieldOptions opts(n_options); - const conduit::Node &n_fields = n_input.fetch_existing("fields"); - const conduit::Node &n_field = n_fields.fetch_existing(opts.field()); + const conduit::Node& n_fields = n_input.fetch_existing("fields"); + const conduit::Node& n_field = n_fields.fetch_existing(opts.field()); return n_field["topology"].as_string(); } diff --git a/src/axom/bump/extraction/FieldOptions.hpp b/src/axom/bump/extraction/FieldOptions.hpp index 2ccd71ea68..b87c3987e3 100644 --- a/src/axom/bump/extraction/FieldOptions.hpp +++ b/src/axom/bump/extraction/FieldOptions.hpp @@ -26,7 +26,7 @@ class FieldOptions : public axom::bump::extraction::ExtractorOptions * * \param options The node that contains the clipping options. */ - FieldOptions(const conduit::Node &options) : axom::bump::extraction::ExtractorOptions(options) { } + FieldOptions(const conduit::Node& options) : axom::bump::extraction::ExtractorOptions(options) { } /** * \brief Return the name of the field used for clipping. diff --git a/src/axom/bump/extraction/PlaneIntersector.hpp b/src/axom/bump/extraction/PlaneIntersector.hpp index 6324f26a34..14e064c3ff 100644 --- a/src/axom/bump/extraction/PlaneIntersector.hpp +++ b/src/axom/bump/extraction/PlaneIntersector.hpp @@ -69,7 +69,7 @@ class PlaneIntersector */ AXOM_HOST_DEVICE axom::IndexType determineTableCase(axom::IndexType AXOM_UNUSED_PARAM(zoneIndex), - const ConnectivityView &nodeIds) const + const ConnectivityView& nodeIds) const { axom::IndexType caseNumber = 0, numIds = nodeIds.size(); for(IndexType i = 0; i < numIds; i++) @@ -114,12 +114,12 @@ class PlaneIntersector * \note This is a host-side initialization, though some array data in the n_options * node may be on-device already. */ - void initialize(const TopologyView &AXOM_UNUSED_PARAM(topologyView), - const CoordsetView &coordsetView, - const conduit::Node &n_options, - const conduit::Node &AXOM_UNUSED_PARAM(n_topology), - const conduit::Node &AXOM_UNUSED_PARAM(n_coordset), - const conduit::Node &AXOM_UNUSED_PARAM(n_fields)) + void initialize(const TopologyView& AXOM_UNUSED_PARAM(topologyView), + const CoordsetView& coordsetView, + const conduit::Node& n_options, + const conduit::Node& AXOM_UNUSED_PARAM(n_topology), + const conduit::Node& AXOM_UNUSED_PARAM(n_coordset), + const conduit::Node& AXOM_UNUSED_PARAM(n_fields)) { // Make a plane from the options. SLIC_ASSERT(n_options.has_child("origin")); @@ -150,8 +150,8 @@ class PlaneIntersector * \param n_options The options. * \return The name of the toplogy on which to operate. */ - std::string getTopologyName(const conduit::Node &AXOM_UNUSED_PARAM(n_input), - const conduit::Node &n_options) const + std::string getTopologyName(const conduit::Node& AXOM_UNUSED_PARAM(n_input), + const conduit::Node& n_options) const { return n_options["topology"].as_string(); } @@ -174,7 +174,7 @@ class PlaneIntersector * \param n The Conduit node with the data. * \param[out] values An output array of the data on the host, converted to value_type. */ - void getArrayValues(const conduit::Node &n, value_type values[NDIMS]) const + void getArrayValues(const conduit::Node& n, value_type values[NDIMS]) const { SLIC_ERROR_IF(n.dtype().number_of_elements() != NDIMS, "Incompatible sizes."); diff --git a/src/axom/bump/extraction/Table.cpp b/src/axom/bump/extraction/Table.cpp index 512249551c..420cb3eb63 100644 --- a/src/axom/bump/extraction/Table.cpp +++ b/src/axom/bump/extraction/Table.cpp @@ -13,9 +13,9 @@ namespace extraction { void Table::load(size_t n, - const IndexData *shapes, - const IndexData *offsets, - const TableData *table, + const IndexData* shapes, + const IndexData* offsets, + const TableData* table, size_t tableLen, int allocatorID) { diff --git a/src/axom/bump/extraction/Table.hpp b/src/axom/bump/extraction/Table.hpp index b6cce052bf..64c25f1d26 100644 --- a/src/axom/bump/extraction/Table.hpp +++ b/src/axom/bump/extraction/Table.hpp @@ -57,7 +57,7 @@ class TableView { if(m_currentShape < m_numShapes) { - const TableData *ptr = m_shapeStart + m_offset; + const TableData* ptr = m_shapeStart + m_offset; m_offset += shapeLength(ptr); m_currentShape++; } @@ -71,7 +71,7 @@ class TableView { if(m_currentShape < m_numShapes) { - const TableData *ptr = m_shapeStart + m_offset; + const TableData* ptr = m_shapeStart + m_offset; m_offset += shapeLength(ptr); m_currentShape++; } @@ -83,7 +83,7 @@ class TableView * \return true if the iterators are equal; false otherwise. */ AXOM_HOST_DEVICE - inline bool operator==(const iterator &it) const + inline bool operator==(const iterator& it) const { // Do not worry about m_offset return m_shapeStart == it.m_shapeStart && m_currentShape == it.m_currentShape && @@ -96,7 +96,7 @@ class TableView * \return true if the iterators are different; false otherwise. */ AXOM_HOST_DEVICE - inline bool operator!=(const iterator &it) const + inline bool operator!=(const iterator& it) const { // Do not worry about m_offset return m_shapeStart != it.m_shapeStart || m_currentShape != it.m_currentShape || @@ -110,13 +110,13 @@ class TableView AXOM_HOST_DEVICE inline TableDataView operator*() const { - TableData *ptr = m_shapeStart + m_offset; + TableData* ptr = m_shapeStart + m_offset; const auto len = shapeLength(ptr); return TableDataView(ptr, len); } #if !defined(AXOM_DEVICE_CODE) private: - void printShape(std::ostream &os, TableData shape) const + void printShape(std::ostream& os, TableData shape) const { switch(shape) { @@ -158,7 +158,7 @@ class TableView break; } } - void printColor(std::ostream &os, TableData color) const + void printColor(std::ostream& os, TableData color) const { switch(color) { @@ -173,7 +173,7 @@ class TableView break; } } - void printIds(std::ostream &os, const TableData *ids, int n) const + void printIds(std::ostream& os, const TableData* ids, int n) const { for(int i = 0; i < n; i++) { @@ -193,9 +193,9 @@ class TableView } public: - void print(std::ostream &os) const + void print(std::ostream& os) const { - TableData *ptr = m_shapeStart + m_offset; + TableData* ptr = m_shapeStart + m_offset; printShape(os, ptr[0]); os << " "; int offset = 2; @@ -232,7 +232,7 @@ class TableView * \return The number of values to advance. */ AXOM_HOST_DEVICE - size_t shapeLength(const TableData *caseData) const + size_t shapeLength(const TableData* caseData) const { size_t retval = 0; const auto shape = caseData[0]; @@ -278,7 +278,7 @@ class TableView return retval; } - TableData *m_shapeStart {nullptr}; + TableData* m_shapeStart {nullptr}; int m_offset {0}; int m_currentShape {0}; int m_numShapes {0}; @@ -298,7 +298,7 @@ class TableView * \param table The table data that contains all cases. */ AXOM_HOST_DEVICE - TableView(const IndexView &shapes, const IndexView &offsets, const TableDataView &table) + TableView(const IndexView& shapes, const IndexView& offsets, const TableDataView& table) : m_shapes(shapes) , m_offsets(offsets) , m_table(table) @@ -323,7 +323,7 @@ class TableView { SLIC_ASSERT(static_cast(caseId) < m_shapes.size()); iterator it; - it.m_shapeStart = const_cast(m_table.data() + m_offsets[caseId]); + it.m_shapeStart = const_cast(m_table.data() + m_offsets[caseId]); it.m_offset = 0; it.m_currentShape = 0; it.m_numShapes = m_shapes[caseId]; @@ -341,7 +341,7 @@ class TableView { SLIC_ASSERT(static_cast(caseId) < m_shapes.size()); iterator it; - it.m_shapeStart = const_cast(m_table.data() + m_offsets[caseId]); + it.m_shapeStart = const_cast(m_table.data() + m_offsets[caseId]); it.m_offset = 0; // not checked in iterator::operator== it.m_currentShape = m_shapes[caseId]; it.m_numShapes = m_shapes[caseId]; @@ -382,9 +382,9 @@ class Table * \param allocatorID The allocator ID to use when allocating memory. */ void load(size_t n, - const IndexData *shapes, - const IndexData *offsets, - const TableData *table, + const IndexData* shapes, + const IndexData* offsets, + const TableData* table, size_t tableLen, int allocatorID); /*! diff --git a/src/axom/bump/extraction/TableBasedExtractor.hpp b/src/axom/bump/extraction/TableBasedExtractor.hpp index 3dc1a18329..db5bfa3f28 100644 --- a/src/axom/bump/extraction/TableBasedExtractor.hpp +++ b/src/axom/bump/extraction/TableBasedExtractor.hpp @@ -259,14 +259,14 @@ struct FragmentOperations * \return True if the fragment was added, false otherwise. */ AXOM_HOST_DEVICE - static bool addFragment(const TableView::TableDataView &fragment, + static bool addFragment(const TableView::TableDataView& fragment, axom::ArrayView connView, - ConnectivityType &size, - ConnectivityType &offset, - ConnectivityType &shape, - int &color, - const ConnectivityType *point_2_new, - int &outputIndex) + ConnectivityType& size, + ConnectivityType& offset, + ConnectivityType& shape, + int& color, + const ConnectivityType* point_2_new, + int& outputIndex) { // Output the nodes used in this zone. const int fragmentSize = fragment.size(); @@ -298,15 +298,15 @@ struct FragmentOperations * \param[inout] colorView The view that wraps colors (can change on output). * \param allocator_id The allocator to use. */ - static void filterZeroSizes(FragmentData &AXOM_UNUSED_PARAM(fragmentData), - conduit::Node &AXOM_UNUSED_PARAM(n_sizes), - conduit::Node &AXOM_UNUSED_PARAM(n_offsets), - conduit::Node &AXOM_UNUSED_PARAM(n_shapes), - conduit::Node &AXOM_UNUSED_PARAM(n_color), - axom::ArrayView &AXOM_UNUSED_PARAM(sizesView), - axom::ArrayView &AXOM_UNUSED_PARAM(offsetsView), - axom::ArrayView &AXOM_UNUSED_PARAM(shapesView), - axom::ArrayView &AXOM_UNUSED_PARAM(colorView), + static void filterZeroSizes(FragmentData& AXOM_UNUSED_PARAM(fragmentData), + conduit::Node& AXOM_UNUSED_PARAM(n_sizes), + conduit::Node& AXOM_UNUSED_PARAM(n_offsets), + conduit::Node& AXOM_UNUSED_PARAM(n_shapes), + conduit::Node& AXOM_UNUSED_PARAM(n_color), + axom::ArrayView& AXOM_UNUSED_PARAM(sizesView), + axom::ArrayView& AXOM_UNUSED_PARAM(offsetsView), + axom::ArrayView& AXOM_UNUSED_PARAM(shapesView), + axom::ArrayView& AXOM_UNUSED_PARAM(colorView), int AXOM_UNUSED_PARAM(allocator_id)) { } @@ -344,7 +344,7 @@ struct FragmentOperations * \param maskOffsetsView The offsets view to indicate where to write the new data. */ template -DataView filter(conduit::Node &n_src, +DataView filter(conduit::Node& n_src, DataView srcView, axom::IndexType newSize, axom::ArrayView maskView, @@ -400,14 +400,14 @@ struct FragmentOperations<2, ExecSpace, ConnectivityType> * \return True if the fragment was added, false otherwise. */ AXOM_HOST_DEVICE - static bool addFragment(const TableView::TableDataView &fragment, + static bool addFragment(const TableView::TableDataView& fragment, axom::ArrayView connView, - ConnectivityType &size, - ConnectivityType &offset, - ConnectivityType &shape, - int &color, - const ConnectivityType *point_2_new, - int &outputIndex) + ConnectivityType& size, + ConnectivityType& offset, + ConnectivityType& shape, + int& color, + const ConnectivityType* point_2_new, + int& outputIndex) { constexpr int NotFound = -1; // Output the nodes used in this zone. @@ -468,15 +468,15 @@ struct FragmentOperations<2, ExecSpace, ConnectivityType> * \param[inout] colorView The view that wraps colors (can change on output). * \param allocator_id The allocator to use. */ - static void filterZeroSizes(FragmentData &fragmentData, - conduit::Node &n_sizes, - conduit::Node &n_offsets, - conduit::Node &n_shapes, - conduit::Node &n_color, - axom::ArrayView &sizesView, - axom::ArrayView &offsetsView, - axom::ArrayView &shapesView, - axom::ArrayView &colorView, + static void filterZeroSizes(FragmentData& fragmentData, + conduit::Node& n_sizes, + conduit::Node& n_offsets, + conduit::Node& n_shapes, + conduit::Node& n_color, + axom::ArrayView& sizesView, + axom::ArrayView& offsetsView, + axom::ArrayView& shapesView, + axom::ArrayView& colorView, int allocator_id) { AXOM_ANNOTATE_SCOPE("filterZeroSizes"); @@ -623,10 +623,10 @@ struct StridedStructuredFields * \param n_newField The node that will contain the new field. */ static bool sliceElementField( - const TopologyView &AXOM_UNUSED_PARAM(topologyView), - const axom::bump::SliceData &AXOM_UNUSED_PARAM(slice), - const conduit::Node &AXOM_UNUSED_PARAM(n_field), - conduit::Node &AXOM_UNUSED_PARAM(n_newField), + const TopologyView& AXOM_UNUSED_PARAM(topologyView), + const axom::bump::SliceData& AXOM_UNUSED_PARAM(slice), + const conduit::Node& AXOM_UNUSED_PARAM(n_field), + conduit::Node& AXOM_UNUSED_PARAM(n_newField), int AXOM_UNUSED_PARAM(allocator_id) = axom::execution_space::allocatorID()) { return false; @@ -641,10 +641,10 @@ struct StridedStructuredFields * \param n_newField The node that will contain the new field. */ static bool blendVertexField( - const TopologyView &AXOM_UNUSED_PARAM(topologyView), - const axom::bump::BlendData &AXOM_UNUSED_PARAM(blend), - const conduit::Node &AXOM_UNUSED_PARAM(n_field), - conduit::Node &AXOM_UNUSED_PARAM(n_newField), + const TopologyView& AXOM_UNUSED_PARAM(topologyView), + const axom::bump::BlendData& AXOM_UNUSED_PARAM(blend), + const conduit::Node& AXOM_UNUSED_PARAM(n_field), + conduit::Node& AXOM_UNUSED_PARAM(n_newField), int AXOM_UNUSED_PARAM(allocator_id) = axom::execution_space::allocatorID()) { return false; @@ -672,10 +672,10 @@ struct StridedStructuredFields * \param n_field The field being sliced. * \param n_newField The node that will contain the new field. */ - static bool sliceElementField(const TopologyView &topologyView, - const axom::bump::SliceData &slice, - const conduit::Node &n_field, - conduit::Node &n_newField, + static bool sliceElementField(const TopologyView& topologyView, + const axom::bump::SliceData& slice, + const conduit::Node& n_field, + conduit::Node& n_newField, int allocator_id = axom::execution_space::allocatorID()) { bool handled = false; @@ -703,10 +703,10 @@ struct StridedStructuredFields * \param n_field The field being sliced. * \param n_newField The node that will contain the new field. */ - static bool blendVertexField(const TopologyView &topologyView, - const axom::bump::BlendData &blend, - const conduit::Node &n_field, - conduit::Node &n_newField, + static bool blendVertexField(const TopologyView& topologyView, + const axom::bump::BlendData& blend, + const conduit::Node& n_field, + conduit::Node& n_newField, int allocator_id = axom::execution_space::allocatorID()) { bool handled = false; @@ -787,9 +787,9 @@ class TableBasedExtractor * \param coordsetView A coordset view suitable for the supplied coordset. * */ - TableBasedExtractor(const TopologyView &topoView, - const CoordsetView &coordsetView, - const Intersector &intersector = Intersector()) + TableBasedExtractor(const TopologyView& topoView, + const CoordsetView& coordsetView, + const Intersector& intersector = Intersector()) : m_topologyView(topoView) , m_coordsetView(coordsetView) , m_intersector(intersector) @@ -826,7 +826,7 @@ class TableBasedExtractor * * \param naming A new naming policy object. */ - void setNamingPolicy(NamingPolicy &naming) { m_naming = naming; } + void setNamingPolicy(NamingPolicy& naming) { m_naming = naming; } /*! * \brief Execute the extraction operation. @@ -835,19 +835,19 @@ class TableBasedExtractor * \param[in] n_options A Conduit node that contains options. * \param[out] n_output A Conduit node that will hold the output mesh. This should be a different node from \a n_input. */ - void execute(const conduit::Node &n_input, const conduit::Node &n_options, conduit::Node &n_output) + void execute(const conduit::Node& n_input, const conduit::Node& n_options, conduit::Node& n_output) { // Get the topo/coordset names in the input. ExtractorOptions opts(n_options); - const std::string &topoName = m_intersector.getTopologyName(n_input, n_options); - const conduit::Node &n_topo = n_input.fetch_existing("topologies/" + topoName); + const std::string& topoName = m_intersector.getTopologyName(n_input, n_options); + const conduit::Node& n_topo = n_input.fetch_existing("topologies/" + topoName); const std::string coordsetName = n_topo["coordset"].as_string(); - const conduit::Node &n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); - const conduit::Node &n_fields = n_input.fetch_existing("fields"); + const conduit::Node& n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); + const conduit::Node& n_fields = n_input.fetch_existing("fields"); - conduit::Node &n_newTopo = n_output["topologies/" + opts.topologyName(topoName)]; - conduit::Node &n_newCoordset = n_output["coordsets/" + opts.coordsetName(coordsetName)]; - conduit::Node &n_newFields = n_output["fields"]; + conduit::Node& n_newTopo = n_output["topologies/" + opts.topologyName(topoName)]; + conduit::Node& n_newCoordset = n_output["coordsets/" + opts.coordsetName(coordsetName)]; + conduit::Node& n_newFields = n_output["fields"]; execute(n_topo, n_coordset, n_fields, n_options, n_newTopo, n_newCoordset, n_newFields); } @@ -863,13 +863,13 @@ class TableBasedExtractor * \param[out] n_newCoordset A node that will contain the new coordset for the topology. * \param[out] n_newFields A node that will contain the new fields for the topology. */ - void execute(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields) + void execute(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields) { namespace utils = axom::bump::utilities; const auto allocatorID = getAllocatorID(); @@ -1084,7 +1084,7 @@ class TableBasedExtractor // Fields were present in the options. Count the element fields. for(auto it = fieldsToProcess.begin(); it != fieldsToProcess.end(); it++) { - const conduit::Node &n_field = n_fields.fetch_existing(it->first); + const conduit::Node& n_field = n_fields.fetch_existing(it->first); if(n_field.fetch_existing("topology").as_string() == n_topo.name()) { numElementFields += @@ -1097,7 +1097,7 @@ class TableBasedExtractor // Fields were not present in the options. Select all fields that have the same topology as n_topo. for(conduit::index_t i = 0; i < n_fields.number_of_children(); i++) { - const conduit::Node &n_field = n_fields[i]; + const conduit::Node& n_field = n_fields[i]; if(n_field.fetch_existing("topology").as_string() == n_topo.name()) { numElementFields += @@ -1177,7 +1177,7 @@ class TableBasedExtractor /*! * \brief Make a bitset that indicates the parts of the selection that are selected. */ - int getSelection(const ExtractorOptions &opts) const + int getSelection(const ExtractorOptions& opts) const { int selection = 0; if(opts.inside()) axom::utilities::setBitOn(selection, 0); @@ -1192,7 +1192,7 @@ class TableBasedExtractor * \param[out] views The views array that will contain the table views. * \param dimension The dimension the topology (so we can load a subset of tables) */ - void createTableViews(TableViews &views, int dimension) + void createTableViews(TableViews& views, int dimension) { AXOM_ANNOTATE_SCOPE("createTableViews"); if(dimension == -1 || dimension == 2) @@ -1231,8 +1231,8 @@ class TableBasedExtractor ZoneData zoneData, NodeData nodeData, FragmentData fragmentData, - const ExtractorOptions &opts, - const SelectedZones &selectedZones) const + const ExtractorOptions& opts, + const SelectedZones& selectedZones) const { AXOM_ANNOTATE_SCOPE("computeSizes"); const auto selection = getSelection(opts); @@ -1263,7 +1263,7 @@ class TableBasedExtractor // Iterate over the shapes in this case to determine the number of blend groups. const auto tableIndex = detail::getTableIndex(zone.id(), zone.numberOfNodes()); - const auto &ctView = tableViews[tableIndex]; + const auto& ctView = tableViews[tableIndex]; int thisBlendGroups = 0; // The number of blend groups produced in this case. int thisBlendGroupLen = 0; // The total length of the blend groups. @@ -1393,7 +1393,7 @@ class TableBasedExtractor * * \param[inout] fragmentData The object that contains data about the zone fragments. */ - void computeFragmentOffsets(FragmentData &fragmentData) const + void computeFragmentOffsets(FragmentData& fragmentData) const { AXOM_ANNOTATE_SCOPE("computeFragmentOffsets"); axom::exclusive_scan(fragmentData.m_fragmentsView, fragmentData.m_fragmentOffsetsView); @@ -1419,7 +1419,7 @@ class TableBasedExtractor * * \param[inout] fragmentData The object that contains data about the zone fragments. */ - void computeFragmentSizes(FragmentData &fragmentData, const SelectedZones &selectedZones) const + void computeFragmentSizes(FragmentData& fragmentData, const SelectedZones& selectedZones) const { AXOM_ANNOTATE_SCOPE("computeFragmentSizes"); const auto nzones = selectedZones.view().size(); @@ -1528,8 +1528,8 @@ class TableBasedExtractor void makeBlendGroups(TableViews tableViews, BlendGroupBuilderType builder, ZoneData zoneData, - const ExtractorOptions &opts, - const SelectedZones &selectedZones) const + const ExtractorOptions& opts, + const SelectedZones& selectedZones) const { AXOM_ANNOTATE_SCOPE("makeBlendGroups"); const auto selection = getSelection(opts); @@ -1551,7 +1551,7 @@ class TableBasedExtractor // Iterate over the shapes in this case to determine the number of blend groups. const auto tableIndex = detail::getTableIndex(zone.id(), zone.numberOfNodes()); - const auto &ctView = tableViews[tableIndex]; + const auto& ctView = tableViews[tableIndex]; // These are the points used in this zone's fragments. const BitSet ptused = zoneData.m_pointsUsedView[szIndex]; @@ -1692,12 +1692,12 @@ class TableBasedExtractor ZoneData zoneData, NodeData nodeData, FragmentData fragmentData, - const ExtractorOptions &opts, - const SelectedZones &selectedZones, - const std::string &newTopologyName, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields) const + const ExtractorOptions& opts, + const SelectedZones& selectedZones, + const std::string& newTopologyName, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields) const { AXOM_ANNOTATE_SCOPE("makeTopology"); using FragmentOps = @@ -1714,34 +1714,34 @@ class TableBasedExtractor axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); // Allocate connectivity. - conduit::Node &n_conn = n_newTopo["elements/connectivity"]; + conduit::Node& n_conn = n_newTopo["elements/connectivity"]; n_conn.set_allocator(conduitAllocatorID); n_conn.set(conduit::DataType(connTypeID, fragmentData.m_finalConnSize)); auto connView = utils::make_array_view(n_conn); // Allocate shapes. - conduit::Node &n_shapes = n_newTopo["elements/shapes"]; + conduit::Node& n_shapes = n_newTopo["elements/shapes"]; n_shapes.set_allocator(conduitAllocatorID); n_shapes.set(conduit::DataType(connTypeID, fragmentData.m_finalNumZones)); auto shapesView = utils::make_array_view(n_shapes); // Allocate sizes. - conduit::Node &n_sizes = n_newTopo["elements/sizes"]; + conduit::Node& n_sizes = n_newTopo["elements/sizes"]; n_sizes.set_allocator(conduitAllocatorID); n_sizes.set(conduit::DataType(connTypeID, fragmentData.m_finalNumZones)); auto sizesView = utils::make_array_view(n_sizes); // Allocate offsets. - conduit::Node &n_offsets = n_newTopo["elements/offsets"]; + conduit::Node& n_offsets = n_newTopo["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorID); n_offsets.set(conduit::DataType(connTypeID, fragmentData.m_finalNumZones)); auto offsetsView = utils::make_array_view(n_offsets); // Allocate a color variable to keep track of the "color" of the fragments. - conduit::Node &n_color = n_newFields[opts.colorField()]; + conduit::Node& n_color = n_newFields[opts.colorField()]; n_color["topology"] = newTopologyName; n_color["association"] = "element"; - conduit::Node &n_color_values = n_color["values"]; + conduit::Node& n_color_values = n_color["values"]; n_color_values.set_allocator(conduitAllocatorID); n_color_values.set(conduit::DataType::int32(fragmentData.m_finalNumZones)); auto colorView = utils::make_array_view(n_color_values); @@ -1752,10 +1752,10 @@ class TableBasedExtractor "AXOM_EXTRACTOR_ADD_CASE_FIELD and AXOM_EXTRACTOR_DEGENERATES are mutually exclusive.") #endif // Allocate a color variable to keep track of the "color" of the fragments. - conduit::Node &n_case = n_newFields["case"]; + conduit::Node& n_case = n_newFields["case"]; n_case["topology"] = newTopologyName; n_case["association"] = "element"; - conduit::Node &n_case_values = n_case["values"]; + conduit::Node& n_case_values = n_case["values"]; n_case_values.set_allocator(conduitAllocatorID); n_case_values.set(conduit::DataType::int32(fragmentData.m_finalNumZones)); auto caseView = utils::make_array_view(n_case_values); @@ -2015,7 +2015,7 @@ class TableBasedExtractor else { n_newTopo["elements/shape"] = "mixed"; - conduit::Node &n_shape_map = n_newTopo["elements/shape_map"]; + conduit::Node& n_shape_map = n_newTopo["elements/shape_map"]; for(auto it = shapeMap.cbegin(); it != shapeMap.cend(); it++) { n_shape_map[it->first] = it->second; @@ -2059,9 +2059,9 @@ class TableBasedExtractor * \param n_coordset The input coordset, which is passed for metadata. * \param[out] n_newCoordset The new coordset. */ - void makeCoordset(const BlendData &blend, - const conduit::Node &n_coordset, - conduit::Node &n_newCoordset) const + void makeCoordset(const BlendData& blend, + const conduit::Node& n_coordset, + conduit::Node& n_newCoordset) const { AXOM_ANNOTATE_SCOPE("makeCoordset"); // _bump_utilities_coordsetblender_begin @@ -2080,12 +2080,12 @@ class TableBasedExtractor * \param n_fields The source fields. * \param[out] n_out_fields The node that will contain the new fields. */ - void makeFields(const BlendData &blend, - const SliceData &slice, - const std::string &topologyName, - const std::map &fieldMap, - const conduit::Node &n_fields, - conduit::Node &n_out_fields) const + void makeFields(const BlendData& blend, + const SliceData& slice, + const std::string& topologyName, + const std::map& fieldMap, + const conduit::Node& n_fields, + conduit::Node& n_out_fields) const { AXOM_ANNOTATE_SCOPE("makeFields"); bool handled = false; @@ -2109,8 +2109,8 @@ class TableBasedExtractor // Make the fields one at a time using ExecSpace kernels to copy data. for(auto it = fieldMap.begin(); it != fieldMap.end(); it++) { - const conduit::Node &n_field = n_fields.fetch_existing(it->first); - conduit::Node &n_out_field = n_out_fields[it->second]; + const conduit::Node& n_field = n_fields.fetch_existing(it->first); + conduit::Node& n_out_field = n_out_fields[it->second]; makeSingleField(blend, slice, topologyName, n_field, n_out_field); } } @@ -2128,11 +2128,11 @@ class TableBasedExtractor * \param[out] n_out_field The node that will contain the new field. */ template - void makeSingleField(const BlendData &blend, - const SliceData &slice, - const std::string &topologyName, - const conduit::Node &n_field, - conduit::Node &n_out_field) const + void makeSingleField(const BlendData& blend, + const SliceData& slice, + const std::string& topologyName, + const conduit::Node& n_field, + conduit::Node& n_out_field) const { constexpr bool ss = axom::bump::views::view_traits::supports_strided_structured(); const std::string association = n_field["association"].as_string(); @@ -2191,19 +2191,19 @@ class TableBasedExtractor * \param n_fields The source fields. * \param[out] n_out_fields The node that will contain the new fields. */ - void makeFieldsInParallel(const BlendData &blend, - const SliceData &slice, - const std::string &topologyName, - const std::map &fieldMap, - const conduit::Node &n_fields, - conduit::Node &n_out_fields) const + void makeFieldsInParallel(const BlendData& blend, + const SliceData& slice, + const std::string& topologyName, + const std::map& fieldMap, + const conduit::Node& n_fields, + conduit::Node& n_out_fields) const { // Set up output fields. int numFields = static_cast(fieldMap.size()); if(numFields > 0) { - axom::Array inFields(numFields, numFields); - axom::Array outFields(numFields, numFields); + axom::Array inFields(numFields, numFields); + axom::Array outFields(numFields, numFields); axom::IndexType i = 0; for(auto it = fieldMap.begin(); it != fieldMap.end(); it++, i++) { @@ -2233,11 +2233,11 @@ class TableBasedExtractor * \note Objects that we need to capture into kernels are passed by value (they only contain views anyway). Data can be modified through the views. */ void makeOriginalElements(FragmentData fragmentData, - const ExtractorOptions &opts, - const SelectedZones &selectedZones, - const conduit::Node &n_fields, - conduit::Node &n_newTopo, - conduit::Node &n_newFields) const + const ExtractorOptions& opts, + const SelectedZones& selectedZones, + const conduit::Node& n_fields, + conduit::Node& n_newTopo, + conduit::Node& n_newFields) const { AXOM_ANNOTATE_SCOPE("makeOriginalElements"); namespace utils = axom::bump::utilities; @@ -2253,14 +2253,14 @@ class TableBasedExtractor if(n_fields.has_child(originalElements)) { // originalElements already exists. We need to map it forward. - const conduit::Node &n_orig = n_fields[originalElements]; - const conduit::Node &n_orig_values = n_orig["values"]; + const conduit::Node& n_orig = n_fields[originalElements]; + const conduit::Node& n_orig_values = n_orig["values"]; views::indexNodeToArrayView(n_orig_values, [&](auto origValuesView) { using value_type = typename decltype(origValuesView)::value_type; - conduit::Node &n_origElem = n_newFields[originalElements]; + conduit::Node& n_origElem = n_newFields[originalElements]; n_origElem["association"] = "element"; n_origElem["topology"] = opts.topologyName(n_newTopo.name()); - conduit::Node &n_values = n_origElem["values"]; + conduit::Node& n_values = n_origElem["values"]; n_values.set_allocator(conduitAllocatorID); n_values.set(conduit::DataType(n_orig_values.dtype().id(), fragmentData.m_finalNumZones)); auto valuesView = utils::make_array_view(n_values); @@ -2270,10 +2270,10 @@ class TableBasedExtractor else { // Make a new node and populate originalElement. - conduit::Node &n_orig = n_newFields[originalElements]; + conduit::Node& n_orig = n_newFields[originalElements]; n_orig["association"] = "element"; n_orig["topology"] = opts.topologyName(n_newTopo.name()); - conduit::Node &n_values = n_orig["values"]; + conduit::Node& n_values = n_orig["values"]; n_values.set_allocator(conduitAllocatorID); n_values.set(conduit::DataType(connTypeID, fragmentData.m_finalNumZones)); auto valuesView = utils::make_array_view(n_values); @@ -2305,7 +2305,7 @@ class TableBasedExtractor */ template void makeOriginalElements_copy(FragmentData fragmentData, - const SelectedZones &selectedZones, + const SelectedZones& selectedZones, DataView valuesView, DataView origValuesView) const { @@ -2374,10 +2374,10 @@ class TableBasedExtractor * \param topoName The name of the output topology. * \param[inout] n_newFields The fields node for the output mesh. */ - void markNewNodes(const BlendData &blend, - const std::string &newNodes, - const std::string &topoName, - conduit::Node &n_newFields) const + void markNewNodes(const BlendData& blend, + const std::string& newNodes, + const std::string& topoName, + conduit::Node& n_newFields) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("markNewNodes"); @@ -2396,8 +2396,8 @@ class TableBasedExtractor // We can mark the new nodes with fresh values. This comes up in // applications that call the extractor multiple times. - conduit::Node &n_new_nodes = n_newFields.fetch_existing(newNodes); - conduit::Node &n_new_nodes_values = n_new_nodes["values"]; + conduit::Node& n_new_nodes = n_newFields.fetch_existing(newNodes); + conduit::Node& n_new_nodes_values = n_new_nodes["values"]; auto valuesView = utils::make_array_view(n_new_nodes_values); // Update values for the blend groups only. @@ -2410,10 +2410,10 @@ class TableBasedExtractor // Make the field for the first time. const auto conduitAllocatorId = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); - conduit::Node &n_new_nodes = n_newFields[newNodes]; + conduit::Node& n_new_nodes = n_newFields[newNodes]; n_new_nodes["topology"] = topoName; n_new_nodes["association"] = "vertex"; - conduit::Node &n_new_nodes_values = n_new_nodes["values"]; + conduit::Node& n_new_nodes_values = n_new_nodes["values"]; n_new_nodes_values.set_allocator(conduitAllocatorId); n_new_nodes_values.set(conduit::DataType(utils::cpp2conduit::id, outputSize)); auto valuesView = utils::make_array_view(n_new_nodes_values); diff --git a/src/axom/bump/extraction/TableManager.cpp b/src/axom/bump/extraction/TableManager.cpp index 0e93e9c8df..635c334159 100644 --- a/src/axom/bump/extraction/TableManager.cpp +++ b/src/axom/bump/extraction/TableManager.cpp @@ -16,7 +16,7 @@ TableManager::TableManager() { m_allocator_id = axom::getDefaultAllocatorID(); } void TableManager::setAllocatorID(int allocatorID) { m_allocator_id = allocatorID; } -Table &TableManager::operator[](size_t shape) +Table& TableManager::operator[](size_t shape) { const size_t index = shapeToIndex(shape); SLIC_ASSERT(shape < ST_MAX); diff --git a/src/axom/bump/extraction/TableManager.hpp b/src/axom/bump/extraction/TableManager.hpp index cf0101884d..a63dbc7952 100644 --- a/src/axom/bump/extraction/TableManager.hpp +++ b/src/axom/bump/extraction/TableManager.hpp @@ -37,7 +37,7 @@ class TableManager * * \return A reference to the table. */ - Table &operator[](size_t shape); + Table& operator[](size_t shape); /*! * \brief Load tables based on dimension. diff --git a/src/axom/bump/io/save.cpp b/src/axom/bump/io/save.cpp index 1d8e5fc64e..5e0bb0393a 100644 --- a/src/axom/bump/io/save.cpp +++ b/src/axom/bump/io/save.cpp @@ -49,9 +49,9 @@ static int ShapeID_to_vtk_cell(int shape_value) return vtktype; } -static void save_unstructured_vtk(const conduit::Node &mesh, const std::string &path) +static void save_unstructured_vtk(const conduit::Node& mesh, const std::string& path) { - FILE *file = fopen(path.c_str(), "wt"); + FILE* file = fopen(path.c_str(), "wt"); if(file == nullptr) { SLIC_ERROR(fmt::format("The file {} could not be created.", path)); @@ -65,8 +65,8 @@ static void save_unstructured_vtk(const conduit::Node &mesh, const std::string & fprintf(file, "DATASET UNSTRUCTURED_GRID\n"); // Write the points - const conduit::Node &coordset = mesh["coordsets"][0]; - const conduit::Node &points = coordset["values"]; + const conduit::Node& coordset = mesh["coordsets"][0]; + const conduit::Node& points = coordset["values"]; const auto x = points["x"].as_double_accessor(); const auto y = points["y"].as_double_accessor(); size_t num_points = 0; @@ -98,10 +98,10 @@ static void save_unstructured_vtk(const conduit::Node &mesh, const std::string & }); // Write the cells - const conduit::Node &topologies = mesh["topologies"]; - const conduit::Node &topo = topologies[0]; - const conduit::Node &elements = topo["elements"]; - const conduit::Node &connectivity = elements["connectivity"]; + const conduit::Node& topologies = mesh["topologies"]; + const conduit::Node& topo = topologies[0]; + const conduit::Node& elements = topo["elements"]; + const conduit::Node& connectivity = elements["connectivity"]; size_t num_cells = elements["sizes"].dtype().number_of_elements(); size_t total_num_indices = connectivity.dtype().number_of_elements(); @@ -139,7 +139,7 @@ static void save_unstructured_vtk(const conduit::Node &mesh, const std::string & fprintf(file, "CELL_TYPES %zu\n", num_cells); if(elements.has_child("shapes")) { - const conduit::Node &shapes = elements["shapes"]; + const conduit::Node& shapes = elements["shapes"]; for(size_t i = 0; i < num_cells; ++i) { const auto type = ShapeID_to_vtk_cell(shapes.as_int32_array()[i]); @@ -161,9 +161,9 @@ static void save_unstructured_vtk(const conduit::Node &mesh, const std::string & fclose(file); } -void save_vtk(const conduit::Node &mesh, const std::string &path) +void save_vtk(const conduit::Node& mesh, const std::string& path) { - const conduit::Node &n_topologies = mesh.fetch_existing("topologies"); + const conduit::Node& n_topologies = mesh.fetch_existing("topologies"); if(n_topologies.number_of_children() != 1) { SLIC_ERROR("The mesh must have a single topology."); diff --git a/src/axom/bump/io/save.hpp b/src/axom/bump/io/save.hpp index d1172097d7..ece0486235 100644 --- a/src/axom/bump/io/save.hpp +++ b/src/axom/bump/io/save.hpp @@ -24,7 +24,7 @@ namespace io * * \note This function currently handles only unstructured topos with explicit coordsets. */ -void save_vtk(const conduit::Node &node, const std::string &path); +void save_vtk(const conduit::Node& node, const std::string& path); } // end namespace io } // end namespace bump diff --git a/src/axom/bump/tests/blueprint_testing_data_helpers.hpp b/src/axom/bump/tests/blueprint_testing_data_helpers.hpp index 4518093b88..2a23118a7b 100644 --- a/src/axom/bump/tests/blueprint_testing_data_helpers.hpp +++ b/src/axom/bump/tests/blueprint_testing_data_helpers.hpp @@ -32,19 +32,19 @@ namespace data * \param mesh The node that contains the blueprint mesh and fields. * \param dist The radial distance of interest. */ -void add_distance(conduit::Node &mesh, float dist = 6.5f) +void add_distance(conduit::Node& mesh, float dist = 6.5f) { // Make a new distance field. - const conduit::Node &n_coordset = mesh["coordsets"][0]; + const conduit::Node& n_coordset = mesh["coordsets"][0]; axom::bump::views::dispatch_coordset(n_coordset, [&](auto coordsetView) { using PointType = typename decltype(coordsetView)::PointType; using SphereType = axom::primal::Sphere; mesh["fields/distance/topology"] = "mesh"; mesh["fields/distance/association"] = "vertex"; - conduit::Node &n_values = mesh["fields/distance/values"]; + conduit::Node& n_values = mesh["fields/distance/values"]; const auto nnodes = coordsetView.size(); n_values.set(conduit::DataType::float32(nnodes)); - float *valuesPtr = static_cast(n_values.data_ptr()); + float* valuesPtr = static_cast(n_values.data_ptr()); SphereType s(dist); for(int index = 0; index < nnodes; index++) { @@ -62,7 +62,7 @@ void add_distance(conduit::Node &mesh, float dist = 6.5f) * \param[out] mesh The node that will contain the new mesh and fields. */ template -void braid(const std::string &type, const Dimensions &dims, conduit::Node &mesh) +void braid(const std::string& type, const Dimensions& dims, conduit::Node& mesh) { int d[3] = {0, 0, 0}; auto n = dims.size(); @@ -76,9 +76,9 @@ void braid(const std::string &type, const Dimensions &dims, conduit::Node &mesh) } // Return the max value for element i in vfA, vfB, vfC. -float make_field_value(const std::vector &vfA, - const std::vector &vfB, - const std::vector &vfC, +float make_field_value(const std::vector& vfA, + const std::vector& vfB, + const std::vector& vfC, size_t i) { return vfA[i] + vfB[i] + vfC[i]; @@ -96,12 +96,12 @@ float make_field_value(const std::vector &vfA, * \param[out] matset The node that will contain the matset. * \param[out] mfield The node that will contain the mixed field. */ -void make_unibuffer(const std::vector &vfA, - const std::vector &vfB, - const std::vector &vfC, - const std::vector &matnos, - conduit::Node &matset, - conduit::Node &mfield) +void make_unibuffer(const std::vector& vfA, + const std::vector& vfB, + const std::vector& vfC, + const std::vector& matnos, + conduit::Node& matset, + conduit::Node& mfield) { std::vector material_ids; std::vector volume_fractions, field_values; @@ -164,12 +164,12 @@ void make_unibuffer(const std::vector &vfA, * \param[out] matset The node that will contain the matset. * \param[out] mfield The node that will contain the mixed field. */ -void make_multibuffer(const std::vector &vfA, - const std::vector &vfB, - const std::vector &vfC, - const std::vector &AXOM_UNUSED_PARAM(matnos), - conduit::Node &matset, - conduit::Node &mfield) +void make_multibuffer(const std::vector& vfA, + const std::vector& vfB, + const std::vector& vfC, + const std::vector& AXOM_UNUSED_PARAM(matnos), + conduit::Node& matset, + conduit::Node& mfield) { std::vector indices(vfA.size()); std::iota(indices.begin(), indices.end(), 0); @@ -199,12 +199,12 @@ void make_multibuffer(const std::vector &vfA, * \param[out] matset The node that will contain the matset. * \param[out] mfield The node that will contain the mixed field. */ -void make_element_dominant(const std::vector &vfA, - const std::vector &vfB, - const std::vector &vfC, - const std::vector &AXOM_UNUSED_PARAM(matnos), - conduit::Node &matset, - conduit::Node &mfield) +void make_element_dominant(const std::vector& vfA, + const std::vector& vfB, + const std::vector& vfC, + const std::vector& AXOM_UNUSED_PARAM(matnos), + conduit::Node& matset, + conduit::Node& mfield) { // NOTE: These are not sparse. matset["volume_fractions/A"].set(vfA); @@ -229,12 +229,12 @@ void make_element_dominant(const std::vector &vfA, * \param[out] matset The node that will contain the matset. * \param[out] mfield The node that will contain the mixed field. */ -void make_material_dominant(const std::vector &vfA, - const std::vector &vfB, - const std::vector &vfC, - const std::vector &AXOM_UNUSED_PARAM(matnos), - conduit::Node &matset, - conduit::Node &mfield) +void make_material_dominant(const std::vector& vfA, + const std::vector& vfB, + const std::vector& vfC, + const std::vector& AXOM_UNUSED_PARAM(matnos), + conduit::Node& matset, + conduit::Node& mfield) { std::vector svfA, svfB, svfC; // sparse arrays std::vector ziA, ziB, ziC; @@ -293,12 +293,12 @@ void make_material_dominant(const std::vector &vfA, * *--------------* */ template -void make_matset(const std::string &type, - const std::string &topoName, - const Dimensions &dims, +void make_matset(const std::string& type, + const std::string& topoName, + const Dimensions& dims, bool cleanMats, bool makeMixedField, - conduit::Node &mesh) + conduit::Node& mesh) { SLIC_ERROR_IF(cleanMats && makeMixedField, "We cannot make a mixed field when making clean materials."); @@ -405,7 +405,7 @@ void make_matset(const std::string &type, } const std::vector matnos {{22, 66, 33}}; - conduit::Node &matset = mesh["matsets/mat"]; + conduit::Node& matset = mesh["matsets/mat"]; matset["topology"] = topoName; matset["material_map/A"] = matnos[0]; matset["material_map/B"] = matnos[1]; @@ -440,7 +440,7 @@ void make_matset(const std::string &type, * * \param[out] mesh The node that will contain the new mesh. */ -void mixed3d(conduit::Node &mesh) +void mixed3d(conduit::Node& mesh) { // clang-format off const std::vector conn{{ diff --git a/src/axom/bump/tests/blueprint_testing_helpers.hpp b/src/axom/bump/tests/blueprint_testing_helpers.hpp index 0ea7ffd715..e2f6f867bb 100644 --- a/src/axom/bump/tests/blueprint_testing_helpers.hpp +++ b/src/axom/bump/tests/blueprint_testing_helpers.hpp @@ -77,23 +77,23 @@ struct execution_name #endif //------------------------------------------------------------------------------ -std::string pjoin(const std::string &str) { return str; } +std::string pjoin(const std::string& str) { return str; } -std::string pjoin(const char *str) { return std::string(str); } +std::string pjoin(const char* str) { return std::string(str); } template -std::string pjoin(const std::string &str, Args... args) +std::string pjoin(const std::string& str, Args... args) { return axom::utilities::filesystem::joinPath(str, pjoin(args...)); } template -std::string pjoin(const char *str, Args... args) +std::string pjoin(const char* str, Args... args) { return axom::utilities::filesystem::joinPath(std::string(str), pjoin(args...)); } -void psplit(const std::string &filepath, std::string &path, std::string &filename) +void psplit(const std::string& filepath, std::string& path, std::string& filename) { axom::Path p(filepath); path = p.dirName(); @@ -102,11 +102,11 @@ void psplit(const std::string &filepath, std::string &path, std::string &filenam std::string dataDirectory() { return AXOM_DATA_DIR; } -std::string testData(const std::string &filename) { return pjoin(dataDirectory(), filename); } +std::string testData(const std::string& filename) { return pjoin(dataDirectory(), filename); } std::string baselineDirectory(); -std::string yamlRoot(const std::string &filepath) +std::string yamlRoot(const std::string& filepath) { std::string retval, path, filename; psplit(filepath, path, filename); @@ -122,7 +122,7 @@ std::string yamlRoot(const std::string &filepath) return retval; } -void printNode(const conduit::Node &n) +void printNode(const conduit::Node& n) { conduit::Node options; options["num_children_threshold"] = 10000; @@ -157,11 +157,11 @@ struct compareValue }; template -bool compareArray(const conduit::Node &n1, - const conduit::Node &AXOM_UNUSED_PARAM(n2), - const conduit::DataAccessor &a1, - const conduit::DataAccessor &a2, - conduit::Node &info, +bool compareArray(const conduit::Node& n1, + const conduit::Node& AXOM_UNUSED_PARAM(n2), + const conduit::DataAccessor& a1, + const conduit::DataAccessor& a2, + conduit::Node& info, T tolerance = T {0}) { bool same = true; @@ -207,11 +207,11 @@ bool compareArray(const conduit::Node &n1, } template -bool compareScalar(const conduit::Node &n1, - const conduit::Node &AXOM_UNUSED_PARAM(n2), - const T &v1, - const T &v2, - conduit::Node &info, +bool compareScalar(const conduit::Node& n1, + const conduit::Node& AXOM_UNUSED_PARAM(n2), + const T& v1, + const T& v2, + conduit::Node& info, T tolerance = T {}) { bool same = compareValue::compare(v1, v2, tolerance); @@ -222,7 +222,7 @@ bool compareScalar(const conduit::Node &n1, return same; } -bool compareNode(const conduit::Node &n1, const conduit::Node &n2, double tolerance, conduit::Node &info) +bool compareNode(const conduit::Node& n1, const conduit::Node& n2, double tolerance, conduit::Node& info) { bool same = false; // String @@ -380,10 +380,10 @@ bool compareNode(const conduit::Node &n1, const conduit::Node &n2, double tolera return same; } -bool compareConduit(const conduit::Node &n1, - const conduit::Node &n2, +bool compareConduit(const conduit::Node& n1, + const conduit::Node& n2, double tolerance, - conduit::Node &info) + conduit::Node& info) { bool same = true; // See if n1, n2 are objects - but not both. @@ -403,8 +403,8 @@ bool compareConduit(const conduit::Node &n1, // Both are objects. Recurse. for(int i = 0; i < n1.number_of_children(); i++) { - const auto &n1c = n1.child(i); - const auto &n2c = n2.fetch_existing(n1c.name()); + const auto& n1c = n1.child(i); + const auto& n2c = n2.fetch_existing(n1c.name()); same &= compareConduit(n1c, n2c, tolerance, info); } } @@ -416,7 +416,7 @@ bool compareConduit(const conduit::Node &n1, return same; } -void saveBaseline(const std::string &filename, const conduit::Node &n) +void saveBaseline(const std::string& filename, const conduit::Node& n) { std::string file_with_ext(filename + ".yaml"); try @@ -439,11 +439,11 @@ void saveBaseline(const std::string &filename, const conduit::Node &n) } } -void saveBaseline(const std::vector &baselinePaths, - const std::string &baselineName, - const conduit::Node &n) +void saveBaseline(const std::vector& baselinePaths, + const std::string& baselineName, + const conduit::Node& n) { - for(const auto &path : baselinePaths) + for(const auto& path : baselinePaths) { axom::utilities::filesystem::makeDirsForPath(path); std::string filename(pjoin(path, baselineName)); @@ -462,7 +462,7 @@ void saveBaseline(const std::vector &baselinePaths, * * \return True on success; False otherwise. */ -bool convert_yaml_json(const std::string &yaml_filename, const std::string &json_filename) +bool convert_yaml_json(const std::string& yaml_filename, const std::string& json_filename) { const std::string script_path = "convert_yaml_json.py"; @@ -526,7 +526,7 @@ if __name__ == "__main__": } #endif -bool loadBaseline(const std::string &filename, const std::string &protocol, conduit::Node &n) +bool loadBaseline(const std::string& filename, const std::string& protocol, conduit::Node& n) { bool loaded = false; std::string file_with_ext(filename + "." + protocol); @@ -542,7 +542,7 @@ bool loadBaseline(const std::string &filename, const std::string &protocol, cond conduit::relay::io::load(file_with_ext, protocol, n); loaded = true; } - catch(conduit::Error &e) + catch(conduit::Error& e) { if(attempt == MAX_ATTEMPTS - 1) { @@ -573,7 +573,7 @@ bool loadBaseline(const std::string &filename, const std::string &protocol, cond return loaded; } -bool loadBaseline(const std::string &filename, conduit::Node &n) +bool loadBaseline(const std::string& filename, conduit::Node& n) { bool loaded = false; #if defined(_WIN32) @@ -583,7 +583,7 @@ bool loadBaseline(const std::string &filename, conduit::Node &n) { loaded = loadBaseline(filename, "yaml", n); } - catch(conduit::Error &e) + catch(conduit::Error& e) { SLIC_INFO(axom::fmt::format("Could not load {}! {}", filename, e.message())); } @@ -623,15 +623,15 @@ std::vector baselinePaths() return paths; } -bool compareBaseline(const std::vector &baselinePaths, - const std::string &baselineName, - const conduit::Node ¤t, - conduit::Node &info, +bool compareBaseline(const std::vector& baselinePaths, + const std::string& baselineName, + const conduit::Node& current, + conduit::Node& info, double tolerance = 1.5e-6) { bool success = false; int count = 0; - for(const auto &path : baselinePaths) + for(const auto& path : baselinePaths) { try { @@ -656,7 +656,7 @@ bool compareBaseline(const std::vector &baselinePaths, break; } } - catch(conduit::Error &e) + catch(conduit::Error& e) { SLIC_INFO(axom::fmt::format("Could not load {} from {}! {}", baselineName, path, e.message())); } @@ -674,7 +674,7 @@ bool compareBaseline(const std::vector &baselinePaths, //------------------------------------------------------------------------------ template -bool compare_views(const Container1 &a, const Container2 &b) +bool compare_views(const Container1& a, const Container2& b) { bool eq = a.size() == b.size(); for(axom::IndexType i = 0; i < a.size() && eq; i++) @@ -727,7 +727,7 @@ class TestApplication /*! * \brief Parse the command line and run the tests. */ - int execute(int argc, char *argv[]) + int execute(int argc, char* argv[]) { int result = 0; @@ -768,12 +768,12 @@ class TestApplication // Run all the tests. result = RUN_ALL_TESTS(); } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << m_app.help() << std::endl; result = 0; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; @@ -788,7 +788,7 @@ class TestApplication * \param name The root filename to use. * \param hostMesh A Blueprint mesh. */ - void saveVisualization(const std::string &name, const conduit::Node &hostMesh) + void saveVisualization(const std::string& name, const conduit::Node& hostMesh) { if(m_visualize) { @@ -810,7 +810,7 @@ class TestApplication * \return true on success; false if the test did not pass. */ template - bool test(const std::string &name, const conduit::Node ¤tMesh, double tolerance = 2.6e-6) + bool test(const std::string& name, const conduit::Node& currentMesh, double tolerance = 2.6e-6) { AXOM_ANNOTATE_SCOPE("test"); bool retval = true; @@ -865,7 +865,7 @@ class TestApplication * * \return true if the test should be rebaselined; false otherwise. */ - bool rebaseline(const std::string &name) + bool rebaseline(const std::string& name) { bool retval = false; if(m_rebaseline.size() == 1 && m_rebaseline[0] == "none") @@ -887,7 +887,7 @@ class TestApplication } /// Conduit error handler that blocks (helpful for getting a stack in a debugger) - static void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) + static void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { std::cout << "s1=" << s1 << ", s2=" << s2 << ", i1=" << i1 << std::endl; // This is on purpose. diff --git a/src/axom/bump/tests/bump_clipfield.cpp b/src/axom/bump/tests/bump_clipfield.cpp index 2770712b2a..fb32a78712 100644 --- a/src/axom/bump/tests/bump_clipfield.cpp +++ b/src/axom/bump/tests/bump_clipfield.cpp @@ -247,7 +247,7 @@ TEST(bump_clipfield, blend_group_builder) //------------------------------------------------------------------------------ template -bool increasing(const ArrayType &arr) +bool increasing(const ArrayType& arr) { bool retval = true; for(size_t i = 1; i < arr.size(); i++) retval &= (arr[i] >= arr[i - 1]); @@ -255,14 +255,14 @@ bool increasing(const ArrayType &arr) } template -bool decreasing(const ArrayType &arr) +bool decreasing(const ArrayType& arr) { bool retval = true; for(size_t i = 1; i < arr.size(); i++) retval &= (arr[i] <= arr[i - 1]); return retval; } -std::vector permute(const std::vector &input) +std::vector permute(const std::vector& input) { std::vector values, indices; std::vector order; @@ -412,7 +412,7 @@ TEST(bump_clipfield, make_name) //------------------------------------------------------------------------------ template -void test_one_shape(const conduit::Node &hostMesh, const std::string &name) +void test_one_shape(const conduit::Node& hostMesh, const std::string& name) { using TopoView = axom::bump::views::UnstructuredTopologySingleShapeView; using CoordsetView = axom::bump::views::ExplicitCoordsetView; @@ -423,19 +423,16 @@ void test_one_shape(const conduit::Node &hostMesh, const std::string &name) // _bump_utilities_clipfield_begin // Make views for the device mesh. - conduit::Node &n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); - conduit::Node &n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); - conduit::Node &n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); - axom::ArrayView xView(static_cast(n_x.data_ptr()), - n_x.dtype().number_of_elements()); - axom::ArrayView yView(static_cast(n_y.data_ptr()), - n_y.dtype().number_of_elements()); - axom::ArrayView zView(static_cast(n_z.data_ptr()), - n_z.dtype().number_of_elements()); + conduit::Node& n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); + conduit::Node& n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); + conduit::Node& n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); + axom::ArrayView xView(static_cast(n_x.data_ptr()), n_x.dtype().number_of_elements()); + axom::ArrayView yView(static_cast(n_y.data_ptr()), n_y.dtype().number_of_elements()); + axom::ArrayView zView(static_cast(n_z.data_ptr()), n_z.dtype().number_of_elements()); CoordsetView coordsetView(xView, yView, zView); - conduit::Node &n_conn = deviceMesh.fetch_existing("topologies/topo/elements/connectivity"); - axom::ArrayView connView(static_cast(n_conn.data_ptr()), + conduit::Node& n_conn = deviceMesh.fetch_existing("topologies/topo/elements/connectivity"); + axom::ArrayView connView(static_cast(n_conn.data_ptr()), n_conn.dtype().number_of_elements()); TopoView topoView(connView); @@ -461,7 +458,7 @@ void test_one_shape(const conduit::Node &hostMesh, const std::string &name) } template -void test_one_shape_exec(const conduit::Node &hostMesh, const std::string &name) +void test_one_shape_exec(const conduit::Node& hostMesh, const std::string& name) { test_one_shape(hostMesh, name); @@ -508,7 +505,7 @@ TEST(bump_clipfield, onehex) //------------------------------------------------------------------------------ template -void braid2d_clip_test(const std::string &type, const std::string &name) +void braid2d_clip_test(const std::string& type, const std::string& name) { using Indexing = axom::bump::views::StructuredIndexing; using TopoView = axom::bump::views::StructuredTopologyView; @@ -562,7 +559,7 @@ void braid2d_clip_test(const std::string &type, const std::string &name) utils::make_array_view(deviceClipMesh.fetch_existing("coordsets/clipcoords/values/y")); ExpCoordsetView expCoordsetView(xView, yView); - conduit::Node &n_device_topo = deviceClipMesh.fetch_existing("topologies/" + clipTopoName); + conduit::Node& n_device_topo = deviceClipMesh.fetch_existing("topologies/" + clipTopoName); const auto connView = utils::make_array_view(n_device_topo.fetch_existing("elements/connectivity")); @@ -641,7 +638,7 @@ TEST(bump_clipfield, uniform2d) //------------------------------------------------------------------------------ template -void braid_rectilinear_clip_test(const std::string &name) +void braid_rectilinear_clip_test(const std::string& name) { using Indexing = axom::bump::views::StructuredIndexing; using TopoView = axom::bump::views::StructuredTopologyView; @@ -725,7 +722,7 @@ TEST(bump_clipfield, rectilinear3d) //------------------------------------------------------------------------------ template -void strided_structured_clip_test(const std::string &name, const conduit::Node &options) +void strided_structured_clip_test(const std::string& name, const conduit::Node& options) { // Create the data conduit::Node hostMesh, deviceMesh; @@ -739,8 +736,8 @@ void strided_structured_clip_test(const std::string &name, const conduit::Node & utils::copy(deviceOptions, options); // Create views - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - const conduit::Node &n_topo = deviceMesh["topologies/mesh"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_topo = deviceMesh["topologies/mesh"]; auto coordsetView = axom::bump::views::make_explicit_coordset::view(n_coordset); auto topoView = axom::bump::views::make_strided_structured_topology<2>::view(n_topo); @@ -761,7 +758,7 @@ void strided_structured_clip_test(const std::string &name, const conduit::Node & EXPECT_TRUE(TestApp.test(name, hostClipMesh)); } -void strided_structured_clip_test_exec(const std::string &name, const conduit::Node &options) +void strided_structured_clip_test_exec(const std::string& name, const conduit::Node& options) { strided_structured_clip_test(name, options); @@ -795,7 +792,7 @@ TEST(bump_clipfield, strided_structured_2d) //------------------------------------------------------------------------------ template -void braid3d_clip_test(const std::string &type, const std::string &name) +void braid3d_clip_test(const std::string& type, const std::string& name) { using TopoView = axom::bump::views::UnstructuredTopologySingleShapeView; using CoordsetView = axom::bump::views::ExplicitCoordsetView; @@ -808,19 +805,19 @@ void braid3d_clip_test(const std::string &type, const std::string &name) TestApp.saveVisualization(name + "_orig", hostMesh); // Create views - conduit::Node &n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); - conduit::Node &n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); - conduit::Node &n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); - const axom::ArrayView x(static_cast(n_x.data_ptr()), + conduit::Node& n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); + conduit::Node& n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); + conduit::Node& n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); + const axom::ArrayView x(static_cast(n_x.data_ptr()), n_x.dtype().number_of_elements()); - const axom::ArrayView y(static_cast(n_y.data_ptr()), + const axom::ArrayView y(static_cast(n_y.data_ptr()), n_y.dtype().number_of_elements()); - const axom::ArrayView z(static_cast(n_z.data_ptr()), + const axom::ArrayView z(static_cast(n_z.data_ptr()), n_z.dtype().number_of_elements()); CoordsetView coordsetView(x, y, z); - conduit::Node &n_conn = deviceMesh.fetch_existing("topologies/mesh/elements/connectivity"); - const axom::ArrayView conn(static_cast(n_conn.data_ptr()), + conduit::Node& n_conn = deviceMesh.fetch_existing("topologies/mesh/elements/connectivity"); + const axom::ArrayView conn(static_cast(n_conn.data_ptr()), n_conn.dtype().number_of_elements()); TopoView topoView(conn); @@ -848,7 +845,7 @@ void braid3d_clip_test(const std::string &type, const std::string &name) /// Execute the braid3d test for a single shape on multiple ExecSpaces template -void braid3d_clip_test_exec(const std::string &type, const std::string &name) +void braid3d_clip_test_exec(const std::string& type, const std::string& name) { braid3d_clip_test(type, name); @@ -887,7 +884,7 @@ TEST(bump_clipfield, hex) //------------------------------------------------------------------------------ template -void braid3d_mixed_clip_test(const std::string &name) +void braid3d_mixed_clip_test(const std::string& name) { using CoordType = float; using ConnType = int; @@ -901,29 +898,29 @@ void braid3d_mixed_clip_test(const std::string &name) TestApp.saveVisualization(name + "_orig", hostMesh); // Create views - conduit::Node &n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); - conduit::Node &n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); - conduit::Node &n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); - const axom::ArrayView x(static_cast(n_x.data_ptr()), + conduit::Node& n_x = deviceMesh.fetch_existing("coordsets/coords/values/x"); + conduit::Node& n_y = deviceMesh.fetch_existing("coordsets/coords/values/y"); + conduit::Node& n_z = deviceMesh.fetch_existing("coordsets/coords/values/z"); + const axom::ArrayView x(static_cast(n_x.data_ptr()), n_x.dtype().number_of_elements()); - const axom::ArrayView y(static_cast(n_y.data_ptr()), + const axom::ArrayView y(static_cast(n_y.data_ptr()), n_y.dtype().number_of_elements()); - const axom::ArrayView z(static_cast(n_z.data_ptr()), + const axom::ArrayView z(static_cast(n_z.data_ptr()), n_z.dtype().number_of_elements()); CoordsetView coordsetView(x, y, z); - conduit::Node &n_device_topo = deviceMesh.fetch_existing("topologies/mesh"); - conduit::Node &n_conn = n_device_topo.fetch_existing("elements/connectivity"); - conduit::Node &n_shapes = n_device_topo.fetch_existing("elements/shapes"); - conduit::Node &n_sizes = n_device_topo.fetch_existing("elements/sizes"); - conduit::Node &n_offsets = n_device_topo.fetch_existing("elements/offsets"); - axom::ArrayView connView(static_cast(n_conn.data_ptr()), + conduit::Node& n_device_topo = deviceMesh.fetch_existing("topologies/mesh"); + conduit::Node& n_conn = n_device_topo.fetch_existing("elements/connectivity"); + conduit::Node& n_shapes = n_device_topo.fetch_existing("elements/shapes"); + conduit::Node& n_sizes = n_device_topo.fetch_existing("elements/sizes"); + conduit::Node& n_offsets = n_device_topo.fetch_existing("elements/offsets"); + axom::ArrayView connView(static_cast(n_conn.data_ptr()), n_conn.dtype().number_of_elements()); - axom::ArrayView shapesView(static_cast(n_shapes.data_ptr()), + axom::ArrayView shapesView(static_cast(n_shapes.data_ptr()), n_shapes.dtype().number_of_elements()); - axom::ArrayView sizesView(static_cast(n_sizes.data_ptr()), + axom::ArrayView sizesView(static_cast(n_sizes.data_ptr()), n_sizes.dtype().number_of_elements()); - axom::ArrayView offsetsView(static_cast(n_offsets.data_ptr()), + axom::ArrayView offsetsView(static_cast(n_offsets.data_ptr()), n_offsets.dtype().number_of_elements()); // Make the shape map. @@ -971,7 +968,7 @@ TEST(bump_clipfield, mixed_hip) { braid3d_mixed_clip_test("mixed"); } //------------------------------------------------------------------------------ template -void compare_values(const Container1 &c1, const Container2 &c2) +void compare_values(const Container1& c1, const Container2& c2) { EXPECT_EQ(c1.size(), c2.number_of_elements()); for(size_t i = 0; i < c1.size(); i++) @@ -983,7 +980,7 @@ void compare_values(const Container1 &c1, const Container2 &c2) template struct point_merge_test { - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { hostMesh["coordsets/coords/type"] = "explicit"; hostMesh["coordsets/coords/values/x"].set( @@ -1131,7 +1128,7 @@ struct test_selectedzones EXPECT_TRUE(TestApp.test("selectedzones2", hostResult)); } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { /* 12--13--14--15 @@ -1142,7 +1139,7 @@ struct test_selectedzones | | x | | 0---1---2---3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: rectilinear @@ -1180,7 +1177,7 @@ TEST(bump_clipfield, selectedzones_hip) { test_selectedzones::test(); #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_coordset_extents.cpp b/src/axom/bump/tests/bump_coordset_extents.cpp index f513ccb590..f0da848da9 100644 --- a/src/axom/bump/tests/bump_coordset_extents.cpp +++ b/src/axom/bump/tests/bump_coordset_extents.cpp @@ -23,7 +23,7 @@ struct test_coordset_extents static void test_uniform_2d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: uniform dims: @@ -55,7 +55,7 @@ struct test_coordset_extents static void test_uniform_3d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: uniform dims: @@ -92,7 +92,7 @@ struct test_coordset_extents static void test_rectilinear_2d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: rectilinear values: @@ -118,7 +118,7 @@ struct test_coordset_extents static void test_rectilinear_3d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: rectilinear values: @@ -147,7 +147,7 @@ struct test_coordset_extents static void test_explicit_2d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: explicit values: @@ -173,7 +173,7 @@ struct test_coordset_extents static void test_explicit_3d() { - const char *yaml = R"( + const char* yaml = R"( coords: type: explicit values: @@ -200,7 +200,7 @@ struct test_coordset_extents EXPECT_NEAR(extents[5], expectedExtents[5], eps); } - static void initialize(const char *yaml, conduit::Node &n_device) + static void initialize(const char* yaml, conduit::Node& n_device) { conduit::Node n_coordset; n_coordset.parse(yaml); @@ -377,7 +377,7 @@ TEST(bump_coordset_extents, explicit3d_hip) #endif //------------------------------------------------------------------------------ -void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) +void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { std::cout << "s1=" << s1 << ", s2=" << s2 << ", i1=" << i1 << std::endl; // This is on purpose. @@ -386,7 +386,7 @@ void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); @@ -422,12 +422,12 @@ int main(int argc, char *argv[]) result = RUN_ALL_TESTS(); } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << app.help() << std::endl; result = 0; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; diff --git a/src/axom/bump/tests/bump_cutfield.cpp b/src/axom/bump/tests/bump_cutfield.cpp index b0a601bfe1..d76099c5b9 100644 --- a/src/axom/bump/tests/bump_cutfield.cpp +++ b/src/axom/bump/tests/bump_cutfield.cpp @@ -110,7 +110,7 @@ struct test_cutfield EXPECT_TRUE(TestApp.test(name + "_gyroid", hostResult)); } - static void initialize(conduit::Node &mesh) + static void initialize(conduit::Node& mesh) { const axom::IndexType N = 20; const axom::StackArray dims {N, N, (NDIMS > 2) ? N : 0}; @@ -186,10 +186,10 @@ struct test_cutfield EXPECT_TRUE(TestApp.test(name + "_gyroid", hostResult)); } - static void initialize_polygonal(conduit::Node &n_mesh) + static void initialize_polygonal(conduit::Node& n_mesh) { // This is a tile definition for a tile that contains polygons with 3-8 sides. - static const char *tile = R"( + static const char* tile = R"( coordsets: coords: type: explicit @@ -321,7 +321,7 @@ TEST(bump_cutfield, cutfield_3D_hip) { test_cutfield::test(); } #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_make_polyhedral_topology.cpp b/src/axom/bump/tests/bump_make_polyhedral_topology.cpp index 328d3ab314..f8f6605135 100644 --- a/src/axom/bump/tests/bump_make_polyhedral_topology.cpp +++ b/src/axom/bump/tests/bump_make_polyhedral_topology.cpp @@ -29,13 +29,13 @@ axom::blueprint::testing::TestApplication TestApp; template struct make_polyhedral { - static void initialize(const std::string &type, conduit::Node &n_mesh) + static void initialize(const std::string& type, conduit::Node& n_mesh) { axom::StackArray dims {4, 4, 4}; axom::blueprint::testing::data::braid(type, dims, n_mesh); } - static void test(const std::string &type, const std::string &name) + static void test(const std::string& type, const std::string& name) { // Create the data conduit::Node hostMesh, deviceMesh; @@ -45,8 +45,8 @@ struct make_polyhedral //_bump_utilities_makepolyhedraltopology_begin // Run the algorithm - const conduit::Node &n_input = deviceMesh["topologies/mesh"]; - conduit::Node &n_output = deviceMesh["topologies/polymesh"]; + const conduit::Node& n_input = deviceMesh["topologies/mesh"]; + conduit::Node& n_output = deviceMesh["topologies/polymesh"]; if(type == "uniform") { auto topologyView = views::make_uniform_topology<3>::view(n_input); @@ -247,7 +247,7 @@ TEST(bump_make_polyhedral_topology, hexs_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_mergemeshes.cpp b/src/axom/bump/tests/bump_mergemeshes.cpp index 61dd6a27db..8dd828b1d1 100644 --- a/src/axom/bump/tests/bump_mergemeshes.cpp +++ b/src/axom/bump/tests/bump_mergemeshes.cpp @@ -30,7 +30,7 @@ namespace utils = axom::bump::utilities; //#define AXOM_DEBUG_MERGE_MESHES_TEST #ifdef AXOM_DEBUG_MERGE_MESHES_TEST -void saveMesh(const conduit::Node &n_mesh, const std::string &fileRoot) +void saveMesh(const conduit::Node& n_mesh, const std::string& fileRoot) { #ifdef CONDUIT_RELAY_IO_HDF5_ENABLED const std::string protocol("hdf5"); @@ -50,7 +50,7 @@ struct test_mergemeshes static void test() { std::vector matsetTypes {"unibuffer", "element_dominant", "material_dominant"}; - for(const auto &matsetType : matsetTypes) + for(const auto& matsetType : matsetTypes) { for(int matflags = 3; matflags >= 1; matflags--) { @@ -60,7 +60,7 @@ struct test_mergemeshes } } - static void test(const std::string &matsetType, int matflags) + static void test(const std::string& matsetType, int matflags) { conduit::Node hostMesh; create(hostMesh, matsetType, matflags); @@ -114,7 +114,7 @@ struct test_mergemeshes { success = compareConduit(expectedResult, hostResult, tolerance, info); } - catch(const conduit::Error &e) + catch(const conduit::Error& e) { e.print(); } @@ -126,9 +126,9 @@ struct test_mergemeshes EXPECT_TRUE(success); } - static void create(conduit::Node &mesh, const std::string &matsetType, int matflags) + static void create(conduit::Node& mesh, const std::string& matsetType, int matflags) { - const char *yaml = R"xx( + const char* yaml = R"xx( domain0000: coordsets: coords: @@ -232,27 +232,27 @@ struct test_mergemeshes } /// Remove mixed field and matset on domains according to matflags. This tests merging domains that are missing materials/fields. - static void applyMatFlags(conduit::Node &mesh, int matflags) + static void applyMatFlags(conduit::Node& mesh, int matflags) { for(int dom = 0; dom < 2; dom++) { if(!axom::utilities::bitIsSet(matflags, dom)) { - conduit::Node &domain = mesh[dom]; + conduit::Node& domain = mesh[dom]; domain["fields"].remove("zonal_mixed"); domain.remove("matsets"); } } } - static void changeMatsetType(conduit::Node &domain, const std::string &matsetType) + static void changeMatsetType(conduit::Node& domain, const std::string& matsetType) { // Change the material and field representations if(matsetType == "element_dominant") { conduit::Node domainCopy(domain); - conduit::Node &srcMatset = domainCopy["matsets/mat"]; - conduit::Node &srcField = domainCopy["fields/zonal_mixed"]; + conduit::Node& srcMatset = domainCopy["matsets/mat"]; + conduit::Node& srcField = domainCopy["fields/zonal_mixed"]; domain.remove("matsets/mat"); domain.remove("fields/zonal_mixed"); @@ -280,8 +280,8 @@ struct test_mergemeshes else if(matsetType == "material_dominant") { conduit::Node domainCopy(domain); - conduit::Node &srcMatset = domainCopy["matsets/mat"]; - conduit::Node &srcField = domainCopy["fields/zonal_mixed"]; + conduit::Node& srcMatset = domainCopy["matsets/mat"]; + conduit::Node& srcField = domainCopy["fields/zonal_mixed"]; domain.remove("matsets/mat"); domain.remove("fields/zonal_mixed"); @@ -299,13 +299,13 @@ struct test_mergemeshes } } - static void result(conduit::Node &mesh, int matflags) + static void result(conduit::Node& mesh, int matflags) { // NOTE: We pass back different baselines for different matflags. The fields and matset change. // It is simpler to just have a totally separate baseline to parse. // Result for matflags=3 - both input domains had the material and the mixed field. - const char *yaml3 = R"xx( + const char* yaml3 = R"xx( coordsets: coords: type: "explicit" @@ -355,7 +355,7 @@ struct test_mergemeshes )xx"; // Result for matflags=2 - domain 0 lacked the material and domain so we get default values where domain 0's data would be. - const char *yaml2 = R"xx( + const char* yaml2 = R"xx( coordsets: coords: type: "explicit" @@ -405,7 +405,7 @@ struct test_mergemeshes )xx"; // Result for matflags=1 - domain 1 lacked the material and domain so we get default values where domain 1's data would be. - const char *yaml1 = R"xx( + const char* yaml1 = R"xx( coordsets: coords: type: "explicit" @@ -485,7 +485,7 @@ TEST(bump_mergemeshes, mergemeshes_hip) { test_mergemeshes::test(); } #endif //------------------------------------------------------------------------------ -void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) +void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { std::cout << "s1=" << s1 << ", s2=" << s2 << ", i1=" << i1 << std::endl; // This is on purpose. @@ -493,7 +493,7 @@ void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); @@ -528,12 +528,12 @@ int main(int argc, char *argv[]) result = RUN_ALL_TESTS(); } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << app.help() << std::endl; result = 0; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; diff --git a/src/axom/bump/tests/bump_mesh_operations.cpp b/src/axom/bump/tests/bump_mesh_operations.cpp index 78128271d7..6ac1271d45 100644 --- a/src/axom/bump/tests/bump_mesh_operations.cpp +++ b/src/axom/bump/tests/bump_mesh_operations.cpp @@ -58,7 +58,7 @@ struct test_make_unstructured EXPECT_TRUE(TestApp.test("unstructured", hostResult)); } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { std::vector dims {4, 4}; axom::blueprint::testing::data::braid("uniform", dims, mesh); @@ -92,8 +92,8 @@ struct test_recenter_field conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); // _bump_utilities_recenterfield_begin - const conduit::Node &deviceTopo = deviceMesh["topologies/mesh"]; - const conduit::Node &deviceCoordset = deviceMesh["coordsets/coords"]; + const conduit::Node& deviceTopo = deviceMesh["topologies/mesh"]; + const conduit::Node& deviceCoordset = deviceMesh["coordsets/coords"]; // Make a node to zone relation on the device. conduit::Node deviceRelation; @@ -129,7 +129,7 @@ struct test_recenter_field } } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { /* 8---9--10--11 @@ -282,7 +282,7 @@ struct test_extractzones utils::make_array_view(newHostMesh["matsets/mat1/volume_fractions"]))); } - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { /* 8-------9------10------11 @@ -295,7 +295,7 @@ struct test_extractzones | | | | 0-------1-------2-------3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: explicit @@ -356,7 +356,7 @@ TEST(bump_blueprint_utilities, extractzones_hip) { test_extractzones:: template struct test_extractzones_polyhedral { - static void test(const std::string &name, bool selectZones) + static void test(const std::string& name, bool selectZones) { constexpr int MAXMATERIALS = 5; const int gridSize = 7; @@ -400,9 +400,9 @@ struct test_extractzones_polyhedral axom::execution_space::allocatorID()); axom::copy(selectedZones.data(), ids.data(), nzones * sizeof(axom::IndexType)); - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - const conduit::Node &n_topology = deviceMesh["topologies/mesh"]; - const conduit::Node &n_matset = deviceMesh["matsets/mat"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_topology = deviceMesh["topologies/mesh"]; + const conduit::Node& n_matset = deviceMesh["matsets/mat"]; // Wrap the data in views. auto coordsetView = views::make_explicit_coordset::view(n_coordset); @@ -434,7 +434,7 @@ struct test_extractzones_polyhedral EXPECT_TRUE(TestApp.test(name, newHostMesh)); } - static void create(int gridSize, int numCircles, conduit::Node &hostMesh) + static void create(int gridSize, int numCircles, conduit::Node& hostMesh) { AXOM_ANNOTATE_SCOPE("generate"); axom::bump::data::MeshTester tester; @@ -559,7 +559,7 @@ struct test_zonelistbuilder utils::make_array_view(hostData["mixed"]))); } - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { /* 20------21-------22-------23-------24 @@ -580,7 +580,7 @@ struct test_zonelistbuilder |z0 |z1 |z2 |z3 | 0-------1--------2--------3--------4 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: rectilinear @@ -649,11 +649,11 @@ struct test_makezonecenters conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); - const conduit::Node &n_rmesh = deviceMesh["topologies/rmesh"]; + const conduit::Node& n_rmesh = deviceMesh["topologies/rmesh"]; auto rmeshView = views::make_rectilinear_topology<2>::view(n_rmesh); testTopo(deviceMesh, rmeshView, n_rmesh); - const conduit::Node &n_umesh = deviceMesh["topologies/umesh"]; + const conduit::Node& n_umesh = deviceMesh["topologies/umesh"]; views::UnstructuredTopologySingleShapeView> umeshView( utils::make_array_view(n_umesh["elements/connectivity"]), utils::make_array_view(n_umesh["elements/sizes"]), @@ -662,11 +662,11 @@ struct test_makezonecenters } template - static void testTopo(const conduit::Node &deviceMesh, - const TopologyView &topoView, - const conduit::Node &n_topo) + static void testTopo(const conduit::Node& deviceMesh, + const TopologyView& topoView, + const conduit::Node& n_topo) { - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; auto coordsetView = views::make_rectilinear_coordset::view(n_coordset); using CoordsetView = decltype(coordsetView); @@ -692,7 +692,7 @@ struct test_makezonecenters } } - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { /* 12------13-------14-------15 @@ -709,7 +709,7 @@ struct test_makezonecenters |z0 |z1 |z2 | 0-------1--------2--------3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: rectilinear @@ -774,7 +774,7 @@ struct test_mergecoordsetpoints conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); - conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; + conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; auto coordsetView = views::make_explicit_coordset::view(n_coordset); using CoordsetView = decltype(coordsetView); @@ -818,7 +818,7 @@ struct test_mergecoordsetpoints } } - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { /* We have nodes that are given such that each zone corner is repeated and may have some @@ -834,7 +834,7 @@ struct test_mergecoordsetpoints |z0 |z1 | 0-------1--------2 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: explicit @@ -887,8 +887,8 @@ struct test_makepointmesh conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - const conduit::Node &n_topology = deviceMesh["topologies/mesh"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_topology = deviceMesh["topologies/mesh"]; // Wrap the data in views. auto coordsetView = views::make_explicit_coordset::view(n_coordset); @@ -954,12 +954,12 @@ struct test_makepointmesh } } - static void compare(const conduit::Node &n_mesh, - const axom::Array &x, - const axom::Array &y, - const axom::Array &connectivity, - const axom::Array &sizes, - const axom::Array &offsets) + static void compare(const conduit::Node& n_mesh, + const axom::Array& x, + const axom::Array& y, + const axom::Array& connectivity, + const axom::Array& sizes, + const axom::Array& offsets) { EXPECT_TRUE( compare_views(x.view(), @@ -978,7 +978,7 @@ struct test_makepointmesh utils::make_array_view(n_mesh["topologies/pointmesh/elements/offsets"]))); } - static void create(conduit::Node &hostMesh) + static void create(conduit::Node& hostMesh) { /* 8-------9------10------11 @@ -991,7 +991,7 @@ struct test_makepointmesh | | | | 0-------1-------2-------3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( coordsets: coords: type: explicit @@ -1041,7 +1041,7 @@ TEST(bump_blueprint_utilities, makepointmesh_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_node_to_zone_relation.cpp b/src/axom/bump/tests/bump_node_to_zone_relation.cpp index 4cae6ffb38..e88a19dc0c 100644 --- a/src/axom/bump/tests/bump_node_to_zone_relation.cpp +++ b/src/axom/bump/tests/bump_node_to_zone_relation.cpp @@ -23,14 +23,14 @@ namespace utils = axom::bump::utilities; template struct test_node_to_zone_relation_builder { - static void test(const conduit::Node &hostMesh) + static void test(const conduit::Node& hostMesh) { // host -> device conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); // _bump_utilities_n2zrel_begin - const conduit::Node &deviceTopo = deviceMesh["topologies/mesh"]; - const conduit::Node &deviceCoordset = deviceMesh["coordsets/coords"]; + const conduit::Node& deviceTopo = deviceMesh["topologies/mesh"]; + const conduit::Node& deviceCoordset = deviceMesh["coordsets/coords"]; // Run the algorithm on the device conduit::Node deviceRelation; @@ -69,10 +69,10 @@ struct test_node_to_zone_relation_builder axom::ArrayView(offsets, sizeof(offsets) / sizeof(int))); } - static void compareRelation(const conduit::Node &hostRelation, - const axom::ArrayView &zones, - const axom::ArrayView &sizes, - const axom::ArrayView &offsets) + static void compareRelation(const conduit::Node& hostRelation, + const axom::ArrayView& zones, + const axom::ArrayView& sizes, + const axom::ArrayView& offsets) { const auto zonesView = utils::make_array_view(hostRelation["zones"]); const auto sizesView = utils::make_array_view(hostRelation["sizes"]); @@ -87,8 +87,8 @@ struct test_node_to_zone_relation_builder for(axom::IndexType i = 0; i < sizesView.size(); i++) { // Sort the result so we can compare to the expected answer. - IndexT *begin = zonesView.data() + offsetsView[i]; - IndexT *end = zonesView.data() + offsetsView[i] + sizesView[i]; + IndexT* begin = zonesView.data() + offsetsView[i]; + IndexT* end = zonesView.data() + offsetsView[i] + sizesView[i]; std::sort(begin, end); for(int j = 0; j < sizesView[i]; j++) @@ -192,13 +192,13 @@ struct test_node_to_zone_relation_builder_polyhedral { using SuperClass = test_node_to_zone_relation_builder; - static void test(const conduit::Node &hostMesh) + static void test(const conduit::Node& hostMesh) { // host -> device conduit::Node deviceMesh; utils::copy(deviceMesh, hostMesh); - const conduit::Node &deviceTopo = deviceMesh["topologies/mesh"]; - const conduit::Node &deviceCoordset = deviceMesh["coordsets/coords"]; + const conduit::Node& deviceTopo = deviceMesh["topologies/mesh"]; + const conduit::Node& deviceCoordset = deviceMesh["coordsets/coords"]; // Run the algorithm on the device conduit::Node deviceRelation; @@ -258,7 +258,7 @@ struct test_node_to_zone_relation_builder_polyhedral axom::ArrayView(offsets, sizeof(offsets) / sizeof(int))); } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { conduit::blueprint::mesh::examples::basic("polyhedra", 3, 3, 3, mesh); // Make sure all the types are the same. @@ -306,7 +306,7 @@ TEST(bump_node_to_zone_relation, n2zrel_polyhedral_hip) #endif //------------------------------------------------------------------------------ -void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) +void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { std::cout << "s1=" << s1 << ", s2=" << s2 << ", i1=" << i1 << std::endl; // This is on purpose. @@ -314,7 +314,7 @@ void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); @@ -349,12 +349,12 @@ int main(int argc, char *argv[]) result = RUN_ALL_TESTS(); } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << app.help() << std::endl; result = 0; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; diff --git a/src/axom/bump/tests/bump_planeslice.cpp b/src/axom/bump/tests/bump_planeslice.cpp index 26350ed0c8..184440fd89 100644 --- a/src/axom/bump/tests/bump_planeslice.cpp +++ b/src/axom/bump/tests/bump_planeslice.cpp @@ -125,7 +125,7 @@ struct test_planeslice } } - static void initialize(conduit::Node &mesh) + static void initialize(conduit::Node& mesh) { const axom::IndexType N = 10; const axom::StackArray dims {N, N, (NDIMS > 2) ? N : 0}; @@ -160,7 +160,7 @@ TEST(bump_planeslice, planeslice_3D_hip) { test_planeslice::test(); #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_slicers.cpp b/src/axom/bump/tests/bump_slicers.cpp index 8900950ade..da88281b73 100644 --- a/src/axom/bump/tests/bump_slicers.cpp +++ b/src/axom/bump/tests/bump_slicers.cpp @@ -79,7 +79,7 @@ struct test_matset_slice utils::make_array_view(newHostMatset["volume_fractions"]))); } - static void create(conduit::Node &matset) + static void create(conduit::Node& matset) { /* 8-------9------10------11 @@ -92,7 +92,7 @@ struct test_matset_slice | | | | 0-------1-------2-------3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( topology: mesh material_map: a: 1 @@ -125,7 +125,7 @@ TEST(bump_slicers, matsetslice_hip) { test_matset_slice::test(); } //------------------------------------------------------------------------------ template -void test_coordsetslicer(const conduit::Node &hostCoordset, Func &&makeView) +void test_coordsetslicer(const conduit::Node& hostCoordset, Func&& makeView) { axom::Array ids {{0, 1, 2, 4, 5, 6}}; @@ -177,7 +177,7 @@ struct coordsetslicer_explicit | | | | 0---1---2---3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( type: explicit values: x: [0., 1., 2., 3., 0., 1., 2., 3., 0., 1., 2., 3.] @@ -187,7 +187,7 @@ type: explicit conduit::Node coordset; coordset.parse(yaml); - auto makeView = [](const conduit::Node &deviceCoordset) { + auto makeView = [](const conduit::Node& deviceCoordset) { return axom::bump::views::make_explicit_coordset::view(deviceCoordset); }; @@ -222,7 +222,7 @@ struct coordsetslicer_rectilinear | | | | 0---1---2---3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( type: rectilinear values: x: [0., 1., 2., 3.] @@ -232,7 +232,7 @@ type: rectilinear conduit::Node coordset; coordset.parse(yaml); - auto makeView = [](const conduit::Node &deviceCoordset) { + auto makeView = [](const conduit::Node& deviceCoordset) { return axom::bump::views::make_rectilinear_coordset::view(deviceCoordset); }; test_coordsetslicer(coordset, makeView); @@ -269,7 +269,7 @@ struct coordsetslicer_uniform | | | | 0---1---2---3 */ - const char *yaml = R"xx( + const char* yaml = R"xx( type: uniform dims: i: 4 @@ -279,7 +279,7 @@ type: uniform conduit::Node coordset; coordset.parse(yaml); - auto makeView = [](const conduit::Node &deviceCoordset) { + auto makeView = [](const conduit::Node& deviceCoordset) { return axom::bump::views::make_uniform_coordset<2>::view(deviceCoordset); }; test_coordsetslicer(coordset, makeView); @@ -358,9 +358,9 @@ struct test_fieldslicer } } - static void create(conduit::Node &fields) + static void create(conduit::Node& fields) { - const char *yaml = R"xx( + const char* yaml = R"xx( fields: scalar: topology: mesh @@ -389,7 +389,7 @@ TEST(bump_slicers, fieldslicer_hip) { test_fieldslicer::test(); } #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); diff --git a/src/axom/bump/tests/bump_topology_mapper.cpp b/src/axom/bump/tests/bump_topology_mapper.cpp index 8b31df39b5..b9136b274b 100644 --- a/src/axom/bump/tests/bump_topology_mapper.cpp +++ b/src/axom/bump/tests/bump_topology_mapper.cpp @@ -105,7 +105,7 @@ If fine has 2x2 refinement, it looks like this: %----%----%----%----%----%----% */ -const char *yaml = R"( +const char* yaml = R"( coordsets: coarse_coords: type: explicit @@ -177,10 +177,10 @@ const char *yaml = R"( * \param ny The number of nodes in the Y direction. * \param refinement The number of refinements to make from the coarse to fine levels. */ -void make_fine(conduit::Node &n_mesh, - const std::string &coordsetName, - const std::string &topoName, - const double *extents, +void make_fine(conduit::Node& n_mesh, + const std::string& coordsetName, + const std::string& topoName, + const double* extents, int nx, int ny, int refinement) @@ -224,12 +224,12 @@ void make_fine(conduit::Node &n_mesh, } } - conduit::Node &n_coordset = n_mesh["coordsets/" + coordsetName]; + conduit::Node& n_coordset = n_mesh["coordsets/" + coordsetName]; n_coordset["type"] = "explicit"; n_coordset["values/x"].set(xc); n_coordset["values/y"].set(yc); - conduit::Node &n_topo = n_mesh["topologies/" + topoName]; + conduit::Node& n_topo = n_mesh["topologies/" + topoName]; n_topo["type"] = "unstructured"; n_topo["coordset"] = coordsetName; n_topo["elements/shape"] = "quad"; @@ -326,7 +326,7 @@ class test_TopologyMapper private: static constexpr int refinement = 4; - static void initialize(conduit::Node &n_mesh) + static void initialize(conduit::Node& n_mesh) { // Make the 2D input mesh. n_mesh.parse(yaml); @@ -349,7 +349,7 @@ class test_TopologyMapper * the output meshes. The data needs to be in the right memory for * the ExecutionSpace. */ - static void extrude(conduit::Node &n_dev) + static void extrude(conduit::Node& n_dev) { const int allocatorID = axom::execution_space::allocatorID(); @@ -360,7 +360,7 @@ class test_TopologyMapper using SrcTopologyView = views::UnstructuredTopologyMixedShapeView; axom::Array shapeValues, shapeIds; - const conduit::Node &n_srcTopo = n_dev["topologies/postmir"]; + const conduit::Node& n_srcTopo = n_dev["topologies/postmir"]; auto shapeMap = views::buildShapeMap(n_srcTopo, shapeValues, shapeIds, allocatorID); axom::synchronize(); SrcTopologyView srcTopo( @@ -375,7 +375,7 @@ class test_TopologyMapper views::make_explicit_coordset::view(n_dev["coordsets/fine_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/fine"]; + const conduit::Node& n_targetTopo = n_dev["topologies/fine"]; using TargetShapeType = views::QuadShape; auto targetTopo = views::make_unstructured_single_shape_topology::view(n_targetTopo); @@ -410,7 +410,7 @@ class test_TopologyMapper targetExt.execute(n_dev, n_opts2, n_dev); } - static void mapping2D(conduit::Node &n_dev) + static void mapping2D(conduit::Node& n_dev) { // Wrap coarse/post_mir mesh in views. auto srcCoordset = @@ -419,7 +419,7 @@ class test_TopologyMapper using SrcTopologyView = views::UnstructuredTopologyMixedShapeView; axom::Array shapeValues, shapeIds; - const conduit::Node &n_srcTopo = n_dev["topologies/postmir"]; + const conduit::Node& n_srcTopo = n_dev["topologies/postmir"]; const int allocatorID = axom::execution_space::allocatorID(); auto shapeMap = views::buildShapeMap(n_srcTopo, shapeValues, shapeIds, allocatorID); axom::synchronize(); @@ -430,7 +430,7 @@ class test_TopologyMapper utils::make_array_view(n_srcTopo["elements/offsets"]), shapeMap); - const conduit::Node &n_srcMatset = n_dev["matsets/postmir_matset"]; + const conduit::Node& n_srcMatset = n_dev["matsets/postmir_matset"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -439,7 +439,7 @@ class test_TopologyMapper views::make_explicit_coordset::view(n_dev["coordsets/fine_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/fine"]; + const conduit::Node& n_targetTopo = n_dev["topologies/fine"]; using TargetShapeType = views::QuadShape; auto targetTopo = views::make_unstructured_single_shape_topology::view(n_targetTopo); @@ -458,7 +458,7 @@ class test_TopologyMapper // _bump_utilities_topologymapper_end } - static void mapping3D(conduit::Node &n_dev) + static void mapping3D(conduit::Node& n_dev) { // Wrap coarse/post_mir mesh in views. auto srcCoordset = @@ -466,7 +466,7 @@ class test_TopologyMapper using SrcCoordsetView = decltype(srcCoordset); using SrcTopologyView = views::UnstructuredTopologyMixedShapeView; axom::Array shapeValues, shapeIds; - const conduit::Node &n_srcTopo = n_dev["topologies/epm"]; + const conduit::Node& n_srcTopo = n_dev["topologies/epm"]; EXPECT_EQ(n_srcTopo["type"].as_string(), "unstructured"); EXPECT_EQ(n_srcTopo["elements/shape"].as_string(), "mixed"); @@ -487,7 +487,7 @@ class test_TopologyMapper SrcTopologyView srcTopo(srcConnView, srcShapesView, srcSizesView, srcOffsetsView, shapeMap); - const conduit::Node &n_srcMatset = n_dev["matsets/epm_matset"]; + const conduit::Node& n_srcMatset = n_dev["matsets/epm_matset"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -496,7 +496,7 @@ class test_TopologyMapper views::make_explicit_coordset::view(n_dev["coordsets/efm_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/efm"]; + const conduit::Node& n_targetTopo = n_dev["topologies/efm"]; using TargetShapeType = views::HexShape; auto targetTopo = views::make_unstructured_single_shape_topology::view(n_targetTopo); @@ -513,12 +513,12 @@ class test_TopologyMapper mapper.execute(n_dev, n_opts, n_dev); } - static void makePolyhedral(conduit::Node &n_dev) + static void makePolyhedral(conduit::Node& n_dev) { // Wrap coarse/epm mesh in a view. using SrcTopologyView = views::UnstructuredTopologyMixedShapeView; axom::Array shapeValues, shapeIds; - const conduit::Node &n_srcTopo = n_dev["topologies/epm"]; + const conduit::Node& n_srcTopo = n_dev["topologies/epm"]; const int allocatorID = axom::execution_space::allocatorID(); auto shapeMap = views::buildShapeMap(n_srcTopo, shapeValues, shapeIds, allocatorID); axom::synchronize(); @@ -530,7 +530,7 @@ class test_TopologyMapper shapeMap); // Turn the source mesh "epm" polyhedral and store in phmesh. - conduit::Node &n_phTopo = n_dev["topologies/phmesh"]; + conduit::Node& n_phTopo = n_dev["topologies/phmesh"]; bump::MakePolyhedralTopology mph(srcTopo); mph.execute(n_srcTopo, n_phTopo); bump::MergePolyhedralFaces::execute(n_phTopo); @@ -540,7 +540,7 @@ class test_TopologyMapper n_dev["matsets/ph_matset/topology"] = "phmesh"; } - static void mappingPolyhedral(conduit::Node &n_dev) + static void mappingPolyhedral(conduit::Node& n_dev) { // Wrap coarse/post_mir mesh in views. auto srcCoordset = @@ -548,11 +548,11 @@ class test_TopologyMapper using SrcCoordsetView = decltype(srcCoordset); // Make polyhedral topology view. - const conduit::Node &n_srcTopo = n_dev["topologies/phmesh"]; + const conduit::Node& n_srcTopo = n_dev["topologies/phmesh"]; auto srcTopo = views::make_unstructured_polyhedral_topology::view(n_srcTopo); using SrcTopologyView = decltype(srcTopo); - const conduit::Node &n_srcMatset = n_dev["matsets/ph_matset"]; + const conduit::Node& n_srcMatset = n_dev["matsets/ph_matset"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -561,7 +561,7 @@ class test_TopologyMapper views::make_explicit_coordset::view(n_dev["coordsets/efm_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/efm"]; + const conduit::Node& n_targetTopo = n_dev["topologies/efm"]; using TargetShapeType = views::HexShape; auto targetTopo = views::make_unstructured_single_shape_topology::view(n_targetTopo); @@ -613,7 +613,7 @@ class test_TopologyMapper_Polygonal EXPECT_TRUE(TestApp.test("test_poly", hostResult)); } - static void initialize(conduit::Node &n_mesh) + static void initialize(conduit::Node& n_mesh) { // Make polygonal geometry const conduit::index_t nlevels = 4; @@ -621,7 +621,7 @@ class test_TopologyMapper_Polygonal conduit::blueprint::mesh::examples::polytess(nlevels, nz, n_mesh); // Make a matset from the level field. - conduit::Node &n_matset = n_mesh["matsets/mat"]; + conduit::Node& n_matset = n_mesh["matsets/mat"]; n_matset["topology"] = "topo"; for(int mat = 1; mat <= nlevels; mat++) { @@ -653,20 +653,20 @@ class test_TopologyMapper_Polygonal make_target2(n_mesh); } - static void make_target1(conduit::Node &n_mesh) + static void make_target1(conduit::Node& n_mesh) { // Make a quad mesh double extents[] = {-6.32843, 6.32843, -6.32843, 6.32843}; make_fine(n_mesh, "target1_coords", "target1", extents, 100, 100, 1); } - static void make_target2(conduit::Node &n_mesh) + static void make_target2(conduit::Node& n_mesh) { const auto x = n_mesh["coordsets/coords/values/x"].as_float64_accessor(); const auto y = n_mesh["coordsets/coords/values/y"].as_float64_accessor(); // Make a rotated copy of the input topo mesh. - conduit::Node &target2_coords = n_mesh["coordsets/target2_coords"]; + conduit::Node& target2_coords = n_mesh["coordsets/target2_coords"]; target2_coords["type"] = "explicit"; target2_coords["values/x"].set(conduit::DataType::float64(x.number_of_elements())); target2_coords["values/y"].set(conduit::DataType::float64(y.number_of_elements())); @@ -687,19 +687,19 @@ class test_TopologyMapper_Polygonal n_mesh["topologies/target2/coordset"] = "target2_coords"; } - static void mapping_target1(conduit::Node &n_dev) + static void mapping_target1(conduit::Node& n_dev) { // Wrap polygonal mesh in views. auto srcCoordset = views::make_explicit_coordset::view(n_dev["coordsets/coords"]); using SrcCoordsetView = decltype(srcCoordset); - const conduit::Node &n_srcTopo = n_dev["topologies/topo"]; + const conduit::Node& n_srcTopo = n_dev["topologies/topo"]; auto srcTopo = views::make_unstructured_single_shape_topology>::view( n_srcTopo); using SrcTopologyView = decltype(srcTopo); - const conduit::Node &n_srcMatset = n_dev["matsets/mat"]; + const conduit::Node& n_srcMatset = n_dev["matsets/mat"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -708,7 +708,7 @@ class test_TopologyMapper_Polygonal views::make_explicit_coordset::view(n_dev["coordsets/target1_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/target1"]; + const conduit::Node& n_targetTopo = n_dev["topologies/target1"]; using TargetShapeType = views::QuadShape; auto targetTopo = views::make_unstructured_single_shape_topology::view(n_targetTopo); @@ -725,19 +725,19 @@ class test_TopologyMapper_Polygonal mapper.execute(n_dev, n_opts, n_dev); } - static void mapping_target2(conduit::Node &n_dev) + static void mapping_target2(conduit::Node& n_dev) { // Wrap polygonal mesh in views. auto srcCoordset = views::make_explicit_coordset::view(n_dev["coordsets/coords"]); using SrcCoordsetView = decltype(srcCoordset); - const conduit::Node &n_srcTopo = n_dev["topologies/topo"]; + const conduit::Node& n_srcTopo = n_dev["topologies/topo"]; auto srcTopo = views::make_unstructured_single_shape_topology>::view( n_srcTopo); using SrcTopologyView = decltype(srcTopo); - const conduit::Node &n_srcMatset = n_dev["matsets/mat"]; + const conduit::Node& n_srcMatset = n_dev["matsets/mat"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -746,7 +746,7 @@ class test_TopologyMapper_Polygonal views::make_explicit_coordset::view(n_dev["coordsets/target2_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/target2"]; + const conduit::Node& n_targetTopo = n_dev["topologies/target2"]; auto targetTopo = views::make_unstructured_single_shape_topology>::view( n_targetTopo); @@ -769,7 +769,7 @@ class test_TopologyMapper_Polygonal mapper.execute(n_dev, n_opts, n_dev); } - static int countBadMaterialZones(const conduit::Node &matset, double eps = 1.e-4) + static int countBadMaterialZones(const conduit::Node& matset, double eps = 1.e-4) { const auto volume_fractions = utils::make_array_view(matset["volume_fractions"]); //const auto material_ids = utils::make_array_view(matset["material_ids"]); @@ -914,7 +914,7 @@ TEST(bump_topology_mapper, TopologyMapper_Polygonal_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/tests/bump_utilities.cpp b/src/axom/bump/tests/bump_utilities.cpp index d1d5e912c1..c2f77ec79e 100644 --- a/src/axom/bump/tests/bump_utilities.cpp +++ b/src/axom/bump/tests/bump_utilities.cpp @@ -146,7 +146,7 @@ struct test_copy_braid EXPECT_TRUE(emptyHostMesh.dtype().is_empty()); } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { const int d[3] = {10, 10, 10}; conduit::blueprint::mesh::examples::braid("hexs", d[0], d[1], d[2], mesh); @@ -166,7 +166,7 @@ TEST(bump_utilities, copy_hip) { test_copy_braid::test(); } #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; ::testing::InitGoogleTest(&argc, argv); diff --git a/src/axom/bump/tests/bump_views.cpp b/src/axom/bump/tests/bump_views.cpp index 491691e866..1cb52228ae 100644 --- a/src/axom/bump/tests/bump_views.cpp +++ b/src/axom/bump/tests/bump_views.cpp @@ -56,7 +56,7 @@ TEST(bump_views, shape2conduitName) //------------------------------------------------------------------------------ template -void compareShapes(const ShapeType &shape1, const VariableShapeType &shape2) +void compareShapes(const ShapeType& shape1, const VariableShapeType& shape2) { using ConnType = typename ShapeType::ConnectivityType; @@ -436,7 +436,7 @@ struct test_structured_topology_view_rectilinear AXOM_LAMBDA(axom::IndexType zoneIndex) { const auto zone = topoView.zone(zoneIndex); axom::IndexType m = -1; - for(const auto &id : zone.getIds()) + for(const auto& id : zone.getIds()) { m = axom::utilities::max(static_cast(id), m); } @@ -457,7 +457,7 @@ struct test_structured_topology_view_rectilinear } } - static void create(conduit::Node &mesh) + static void create(conduit::Node& mesh) { std::vector dims {4, 4}; axom::blueprint::testing::data::braid("rectilinear", dims, mesh); @@ -499,7 +499,7 @@ struct test_strided_structured axom::bump::views::dispatch_explicit_coordset(hostMesh["coordsets/coords"], [&](auto coordsetView) { axom::bump::views::dispatch_structured_topology( hostMesh["topologies/mesh"], - [&](const std::string &AXOM_UNUSED_PARAM(shape), auto topoView) { + [&](const std::string& AXOM_UNUSED_PARAM(shape), auto topoView) { execute(coordsetView, topoView); }); }); @@ -589,7 +589,7 @@ struct test_braid2d_mat struct NoMixedFields { }; - static void test(const std::string &type, const std::string &mattype, const std::string &name) + static void test(const std::string& type, const std::string& mattype, const std::string& name) { namespace utils = axom::bump::utilities; const int allocatorID = axom::execution_space::allocatorID(); @@ -915,7 +915,7 @@ TEST(bump_views, matset_material_dominant_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/bump/utilities/blueprint_utilities.cpp b/src/axom/bump/utilities/blueprint_utilities.cpp index 5ad1c145c2..5fcf72943f 100644 --- a/src/axom/bump/utilities/blueprint_utilities.cpp +++ b/src/axom/bump/utilities/blueprint_utilities.cpp @@ -19,7 +19,7 @@ namespace bump namespace utilities { -std::vector coordsetAxes(const conduit::Node &n_input) +std::vector coordsetAxes(const conduit::Node& n_input) { std::vector axes; // Get the axis names for the output coordset. For uniform, prefer x,y,z diff --git a/src/axom/bump/utilities/blueprint_utilities.hpp b/src/axom/bump/utilities/blueprint_utilities.hpp index cc1be16b7c..98fc3926e6 100644 --- a/src/axom/bump/utilities/blueprint_utilities.hpp +++ b/src/axom/bump/utilities/blueprint_utilities.hpp @@ -27,7 +27,7 @@ namespace utilities * * \return A vector containing the names of the coordset's axes. */ -std::vector coordsetAxes(const conduit::Node &n_input); +std::vector coordsetAxes(const conduit::Node& n_input); } // end namespace utilities } // end namespace bump diff --git a/src/axom/bump/utilities/conduit_array_view.hpp b/src/axom/bump/utilities/conduit_array_view.hpp index 2897c742a3..72996e1b9b 100644 --- a/src/axom/bump/utilities/conduit_array_view.hpp +++ b/src/axom/bump/utilities/conduit_array_view.hpp @@ -28,7 +28,7 @@ namespace detail * regular interleaved layouts in addition to dense arrays. */ template -inline axom::ArrayView make_conduit_array_view(conduit::Node &n) +inline axom::ArrayView make_conduit_array_view(conduit::Node& n) { SLIC_ASSERT_MSG(cpp2conduit::id == n.dtype().id(), "Cannot create ArrayView with a type that does not match the Conduit node."); @@ -40,7 +40,7 @@ inline axom::ArrayView make_conduit_array_view(conduit::Node &n) SLIC_ERROR_IF(stride_bytes % static_cast(sizeof(T)) != 0, "Conduit stride is not compatible with the selected node type."); - auto *data = static_cast(n.element_ptr(0)); + auto* data = static_cast(n.element_ptr(0)); const auto stride = stride_bytes / static_cast(sizeof(T)); return axom::ArrayView( data, @@ -50,7 +50,7 @@ inline axom::ArrayView make_conduit_array_view(conduit::Node &n) } template -inline axom::ArrayView make_conduit_array_view(const conduit::Node &n) +inline axom::ArrayView make_conduit_array_view(const conduit::Node& n) { SLIC_ASSERT_MSG(cpp2conduit::id == n.dtype().id(), "Cannot create ArrayView with a type that does not match the Conduit node."); @@ -62,7 +62,7 @@ inline axom::ArrayView make_conduit_array_view(const conduit::Node &n) SLIC_ERROR_IF(stride_bytes % static_cast(sizeof(T)) != 0, "Conduit stride is not compatible with the selected node type."); - auto *data = const_cast(static_cast(n.element_ptr(0))); + auto* data = const_cast(static_cast(n.element_ptr(0))); const auto stride = stride_bytes / static_cast(sizeof(T)); return axom::ArrayView( data, diff --git a/src/axom/bump/utilities/conduit_memory.cpp b/src/axom/bump/utilities/conduit_memory.cpp index a79b662170..bf4b01851e 100644 --- a/src/axom/bump/utilities/conduit_memory.cpp +++ b/src/axom/bump/utilities/conduit_memory.cpp @@ -9,7 +9,7 @@ namespace axom::bump::utilities { -bool isDeviceAllocated(const conduit::Node &n) +bool isDeviceAllocated(const conduit::Node& n) { #if defined(AXOM_USE_UMPIRE) return isDeviceAllocator(axom::getAllocatorIDFromPointer(n.data_ptr())); diff --git a/src/axom/bump/utilities/conduit_memory.hpp b/src/axom/bump/utilities/conduit_memory.hpp index 287ab34324..614655f47b 100644 --- a/src/axom/bump/utilities/conduit_memory.hpp +++ b/src/axom/bump/utilities/conduit_memory.hpp @@ -40,13 +40,13 @@ namespace utilities */ /// @{ template -inline axom::ArrayView make_array_view(conduit::Node &n) +inline axom::ArrayView make_array_view(conduit::Node& n) { return detail::make_conduit_array_view(n); } template -inline axom::ArrayView make_array_view(const conduit::Node &n) +inline axom::ArrayView make_array_view(const conduit::Node& n) { return detail::make_conduit_array_view(n); } @@ -61,7 +61,7 @@ inline axom::ArrayView make_array_view(const conduit::Node &n) * * \return True if the data looks device-allocated; false otherwise. */ -bool isDeviceAllocated(const conduit::Node &n); +bool isDeviceAllocated(const conduit::Node& n); //------------------------------------------------------------------------------ namespace internal @@ -78,8 +78,8 @@ namespace internal * \param destAllocatorID The allocator for the destination. It defaults to the allocator for ExecSpace. */ template -void copyImpl(conduit::Node &dest, - const conduit::Node &src, +void copyImpl(conduit::Node& dest, + const conduit::Node& src, int destAllocatorID, bool destAllocatorForDevice) { @@ -143,8 +143,8 @@ void copyImpl(conduit::Node &dest, * \param destAllocatorID The allocator for the destination. It defaults to the allocator for ExecSpace. */ template -void copy(conduit::Node &dest, - const conduit::Node &src, +void copy(conduit::Node& dest, + const conduit::Node& src, int destAllocatorID = axom::execution_space::allocatorID()) { const bool destAllocatorForDevice = isDeviceAllocator(destAllocatorID); @@ -163,7 +163,7 @@ void copy(conduit::Node &dest, * \param moveToHost Sometimes data are on device and need to be moved to host first. */ template -bool fillFromNode(const conduit::Node &n, const std::string &key, ArrayType &arr, bool moveToHost = false) +bool fillFromNode(const conduit::Node& n, const std::string& key, ArrayType& arr, bool moveToHost = false) { bool found = false; if((found = n.has_path(key)) == true) diff --git a/src/axom/bump/utilities/conduit_traits.cpp b/src/axom/bump/utilities/conduit_traits.cpp index 9de1e863fe..0b88d39af0 100644 --- a/src/axom/bump/utilities/conduit_traits.cpp +++ b/src/axom/bump/utilities/conduit_traits.cpp @@ -15,16 +15,16 @@ namespace utilities // Static data. These originally appeared as constexpr members in the header file // but there were linker errors despite constexpr. -const char *cpp2conduit::name = "int8"; -const char *cpp2conduit::name = "int16"; -const char *cpp2conduit::name = "int32"; -const char *cpp2conduit::name = "int64"; -const char *cpp2conduit::name = "uint8"; -const char *cpp2conduit::name = "uint16"; -const char *cpp2conduit::name = "uint32"; -const char *cpp2conduit::name = "uint64"; -const char *cpp2conduit::name = "float32"; -const char *cpp2conduit::name = "float64"; +const char* cpp2conduit::name = "int8"; +const char* cpp2conduit::name = "int16"; +const char* cpp2conduit::name = "int32"; +const char* cpp2conduit::name = "int64"; +const char* cpp2conduit::name = "uint8"; +const char* cpp2conduit::name = "uint16"; +const char* cpp2conduit::name = "uint32"; +const char* cpp2conduit::name = "uint64"; +const char* cpp2conduit::name = "float32"; +const char* cpp2conduit::name = "float64"; } // end namespace utilities } // end namespace bump diff --git a/src/axom/bump/utilities/conduit_traits.hpp b/src/axom/bump/utilities/conduit_traits.hpp index 2713377e5b..c075dc23a0 100644 --- a/src/axom/bump/utilities/conduit_traits.hpp +++ b/src/axom/bump/utilities/conduit_traits.hpp @@ -30,7 +30,7 @@ struct cpp2conduit { using type = conduit::int8; static constexpr conduit::index_t id = conduit::DataType::INT8_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -38,7 +38,7 @@ struct cpp2conduit { using type = conduit::int16; static constexpr conduit::index_t id = conduit::DataType::INT16_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -46,7 +46,7 @@ struct cpp2conduit { using type = conduit::int32; static constexpr conduit::index_t id = conduit::DataType::INT32_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -54,7 +54,7 @@ struct cpp2conduit { using type = conduit::int64; static constexpr conduit::index_t id = conduit::DataType::INT64_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -62,7 +62,7 @@ struct cpp2conduit { using type = conduit::uint8; static constexpr conduit::index_t id = conduit::DataType::UINT8_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -70,7 +70,7 @@ struct cpp2conduit { using type = conduit::uint16; static constexpr conduit::index_t id = conduit::DataType::UINT16_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -78,7 +78,7 @@ struct cpp2conduit { using type = conduit::uint32; static constexpr conduit::index_t id = conduit::DataType::UINT32_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -86,7 +86,7 @@ struct cpp2conduit { using type = conduit::uint64; static constexpr conduit::index_t id = conduit::DataType::UINT64_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -94,7 +94,7 @@ struct cpp2conduit { using type = conduit::float32; static constexpr conduit::index_t id = conduit::DataType::FLOAT32_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; template <> @@ -102,7 +102,7 @@ struct cpp2conduit { using type = conduit::float64; static constexpr conduit::index_t id = conduit::DataType::FLOAT64_ID; - AXOM_BUMP_EXPORT static const char *name; + AXOM_BUMP_EXPORT static const char* name; }; } // end namespace utilities diff --git a/src/axom/bump/utilities/utilities.hpp b/src/axom/bump/utilities/utilities.hpp index 2d1f01b4d2..3e7822d689 100644 --- a/src/axom/bump/utilities/utilities.hpp +++ b/src/axom/bump/utilities/utilities.hpp @@ -89,7 +89,7 @@ template <> struct ComputeShapeAmount<2> { template - static inline AXOM_HOST_DEVICE double execute(const ShapeType &shape) + static inline AXOM_HOST_DEVICE double execute(const ShapeType& shape) { return shape.area(); } @@ -102,7 +102,7 @@ template <> struct ComputeShapeAmount<3> { template - static inline AXOM_HOST_DEVICE double execute(const ShapeType &shape) + static inline AXOM_HOST_DEVICE double execute(const ShapeType& shape) { return shape.volume(); } diff --git a/src/axom/bump/views/ExplicitCoordsetView.hpp b/src/axom/bump/views/ExplicitCoordsetView.hpp index 60476d1536..2175217d5d 100644 --- a/src/axom/bump/views/ExplicitCoordsetView.hpp +++ b/src/axom/bump/views/ExplicitCoordsetView.hpp @@ -49,7 +49,7 @@ class ExplicitCoordsetView * \param y The second coordinate component. */ AXOM_HOST_DEVICE - ExplicitCoordsetView(const axom::ArrayView &x, const axom::ArrayView &y) + ExplicitCoordsetView(const axom::ArrayView& x, const axom::ArrayView& y) : m_coordinates {x, y} { #if !defined(AXOM_DEVICE_CODE) @@ -127,9 +127,9 @@ class ExplicitCoordsetView * \param z The third coordinate component. */ AXOM_HOST_DEVICE - ExplicitCoordsetView(const axom::ArrayView &x, - const axom::ArrayView &y, - const axom::ArrayView &z) + ExplicitCoordsetView(const axom::ArrayView& x, + const axom::ArrayView& y, + const axom::ArrayView& z) : m_coordinates {x, y, z} { #if !defined(AXOM_DEVICE_CODE) diff --git a/src/axom/bump/views/MaterialView.cpp b/src/axom/bump/views/MaterialView.cpp index 2ad12ab495..a1af17944c 100644 --- a/src/axom/bump/views/MaterialView.cpp +++ b/src/axom/bump/views/MaterialView.cpp @@ -12,12 +12,12 @@ namespace bump { namespace views { -MaterialInformation materials(const conduit::Node &matset) +MaterialInformation materials(const conduit::Node& matset) { MaterialInformation info; if(matset.has_child("material_map")) { - const conduit::Node &mm = matset["material_map"]; + const conduit::Node& mm = matset["material_map"]; for(conduit::index_t i = 0; i < mm.number_of_children(); i++) { info.push_back(Material {mm[i].to_int(), mm[i].name()}); diff --git a/src/axom/bump/views/MaterialView.hpp b/src/axom/bump/views/MaterialView.hpp index 20a50335d2..301ad27e59 100644 --- a/src/axom/bump/views/MaterialView.hpp +++ b/src/axom/bump/views/MaterialView.hpp @@ -42,7 +42,7 @@ using MaterialInformation = std::vector; * * \return A vector of Material that contains the materials in the material_map. */ -MaterialInformation materials(const conduit::Node &matset); +MaterialInformation materials(const conduit::Node& matset); /*! * \brief This struct can encode some positional information about the material @@ -100,11 +100,11 @@ class UnibufferMaterialView constexpr static axom::IndexType MaxMaterials = MAXMATERIALS; - void set(const axom::ArrayView &material_ids, - const axom::ArrayView &volume_fractions, - const axom::ArrayView &sizes, - const axom::ArrayView &offsets, - const axom::ArrayView &indices) + void set(const axom::ArrayView& material_ids, + const axom::ArrayView& volume_fractions, + const axom::ArrayView& sizes, + const axom::ArrayView& offsets, + const axom::ArrayView& indices) { #if !defined(AXOM_DEVICE_CODE) SLIC_ERROR_IF(material_ids.size() != volume_fractions.size(), @@ -130,7 +130,7 @@ class UnibufferMaterialView } AXOM_HOST_DEVICE - void zoneMaterials(ZoneIndex zi, IDList &ids, VFList &vfs) const + void zoneMaterials(ZoneIndex zi, IDList& ids, VFList& vfs) const { SLIC_ASSERT(zi < static_cast(numberOfZones())); @@ -150,8 +150,8 @@ class UnibufferMaterialView AXOM_HOST_DEVICE axom::IndexType zoneMaterials(ZoneIndex zi, - axom::ArrayView &ids, - axom::ArrayView &vfs) const + axom::ArrayView& ids, + axom::ArrayView& vfs) const { SLIC_ASSERT(zi < static_cast(numberOfZones())); @@ -176,7 +176,7 @@ class UnibufferMaterialView } AXOM_HOST_DEVICE - bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType &vf) const + bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType& vf) const { SLIC_ASSERT(zi < static_cast(numberOfZones())); const auto sz = numberOfMaterials(zi); @@ -223,12 +223,12 @@ class UnibufferMaterialView void AXOM_HOST_DEVICE operator++() { advance(true); } void AXOM_HOST_DEVICE operator++(int) { advance(true); } - bool AXOM_HOST_DEVICE operator==(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator==(const const_iterator& rhs) const { return m_currentIndex == rhs.m_currentIndex && m_zoneIndex == rhs.m_zoneIndex && m_view == rhs.m_view; } - bool AXOM_HOST_DEVICE operator!=(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator!=(const const_iterator& rhs) const { return m_currentIndex != rhs.m_currentIndex || m_zoneIndex != rhs.m_zoneIndex || m_view != rhs.m_view; @@ -242,7 +242,7 @@ class UnibufferMaterialView DISABLE_DEFAULT_CTOR(const_iterator); /// Constructor - AXOM_HOST_DEVICE const_iterator(const UnibufferMaterialView *view, + AXOM_HOST_DEVICE const_iterator(const UnibufferMaterialView* view, ZoneIndex zoneIndex, axom::IndexType currentIndex = 0) : m_view(view) @@ -261,7 +261,7 @@ class UnibufferMaterialView } } - const UnibufferMaterialView *m_view; + const UnibufferMaterialView* m_view; ZoneIndex m_zoneIndex; axom::IndexType m_currentIndex; axom::IndexType m_index; // not considered in ==, != @@ -345,7 +345,7 @@ class ElementDominantMaterialView constexpr static axom::IndexType MaxMaterials = MAXMATERIALS; constexpr static axom::IndexType InvalidIndex = -1; - void add(MaterialID matno, const axom::ArrayView &vfs) + void add(MaterialID matno, const axom::ArrayView& vfs) { #if !defined(AXOM_DEVICE_CODE) const auto begin = m_matnos.data(); @@ -379,7 +379,7 @@ class ElementDominantMaterialView axom::IndexType nmats = 0; for(axom::IndexType i = 0; i < m_volume_fractions.size(); i++) { - const auto ¤tVF = m_volume_fractions[i]; + const auto& currentVF = m_volume_fractions[i]; SLIC_ASSERT(zi < currentVF.size()); nmats += currentVF[zi] > 0 ? 1 : 0; } @@ -387,14 +387,14 @@ class ElementDominantMaterialView } AXOM_HOST_DEVICE - void zoneMaterials(ZoneIndex zi, IDList &ids, VFList &vfs) const + void zoneMaterials(ZoneIndex zi, IDList& ids, VFList& vfs) const { ids.clear(); vfs.clear(); for(axom::IndexType i = 0; i < m_volume_fractions.size(); i++) { - const auto ¤tVF = m_volume_fractions[i]; + const auto& currentVF = m_volume_fractions[i]; SLIC_ASSERT(zi < currentVF.size()); if(currentVF[zi] > 0) { @@ -406,13 +406,13 @@ class ElementDominantMaterialView AXOM_HOST_DEVICE axom::IndexType zoneMaterials(ZoneIndex zi, - axom::ArrayView &ids, - axom::ArrayView &vfs) const + axom::ArrayView& ids, + axom::ArrayView& vfs) const { axom::IndexType n = 0; for(axom::IndexType i = 0; i < m_volume_fractions.size(); i++) { - const auto ¤tVF = m_volume_fractions[i]; + const auto& currentVF = m_volume_fractions[i]; SLIC_ASSERT(zi < currentVF.size()); if(currentVF[zi] > 0) { @@ -432,14 +432,14 @@ class ElementDominantMaterialView } AXOM_HOST_DEVICE - bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType &vf) const + bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType& vf) const { bool found = false; vf = FloatType {}; int mi = indexOfMaterialID(mat); if(mi != InvalidIndex) { - const auto ¤tVF = m_volume_fractions[mi]; + const auto& currentVF = m_volume_fractions[mi]; SLIC_ASSERT(zi < currentVF.size()); vf = currentVF[zi]; found = vf > 0; @@ -482,12 +482,12 @@ class ElementDominantMaterialView m_currentIndex += (m_currentIndex < m_view->m_volume_fractions.size()) ? 1 : 0; advance(); } - bool AXOM_HOST_DEVICE operator==(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator==(const const_iterator& rhs) const { return m_currentIndex == rhs.m_currentIndex && m_zoneIndex == rhs.m_zoneIndex && m_view == rhs.m_view; } - bool AXOM_HOST_DEVICE operator!=(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator!=(const const_iterator& rhs) const { return m_currentIndex != rhs.m_currentIndex || m_zoneIndex != rhs.m_zoneIndex || m_view != rhs.m_view; @@ -501,7 +501,7 @@ class ElementDominantMaterialView DISABLE_DEFAULT_CTOR(const_iterator); /// Constructor - AXOM_HOST_DEVICE const_iterator(const ElementDominantMaterialView *view, + AXOM_HOST_DEVICE const_iterator(const ElementDominantMaterialView* view, ZoneIndex zoneIndex, axom::IndexType currentIndex = 0) : m_view(view) @@ -522,7 +522,7 @@ class ElementDominantMaterialView } } - const ElementDominantMaterialView *m_view; + const ElementDominantMaterialView* m_view; ZoneIndex m_zoneIndex; axom::IndexType m_currentIndex; }; @@ -637,8 +637,8 @@ class MaterialDominantMaterialView constexpr static axom::IndexType InvalidIndex = -1; void add(MaterialID matno, - const axom::ArrayView &ids, - const axom::ArrayView &vfs) + const axom::ArrayView& ids, + const axom::ArrayView& vfs) { #if !defined(AXOM_DEVICE_CODE) SLIC_ERROR_IF(ids.size() != vfs.size(), "Array views for ids, vfs have different sizes."); @@ -661,7 +661,7 @@ class MaterialDominantMaterialView axom::IndexType nzones = -1; for(axom::IndexType mi = 0; mi < m_size; mi++) { - const auto &element_ids = m_element_ids[mi]; + const auto& element_ids = m_element_ids[mi]; const auto sz = element_ids.size(); for(axom::IndexType i = 0; i < sz; i++) { @@ -679,7 +679,7 @@ class MaterialDominantMaterialView axom::IndexType nmats = 0; for(axom::IndexType mi = 0; mi < m_size; mi++) { - const auto &element_ids = m_element_ids[mi]; + const auto& element_ids = m_element_ids[mi]; const auto sz = element_ids.size(); for(axom::IndexType i = 0; i < sz; i++) { @@ -694,15 +694,15 @@ class MaterialDominantMaterialView } AXOM_HOST_DEVICE - void zoneMaterials(ZoneIndex zi, IDList &ids, VFList &vfs) const + void zoneMaterials(ZoneIndex zi, IDList& ids, VFList& vfs) const { ids.clear(); vfs.clear(); for(axom::IndexType mi = 0; mi < m_size; mi++) { - const auto &element_ids = m_element_ids[mi]; - const auto &volume_fractions = m_volume_fractions[mi]; + const auto& element_ids = m_element_ids[mi]; + const auto& volume_fractions = m_volume_fractions[mi]; const auto sz = element_ids.size(); for(axom::IndexType i = 0; i < sz; i++) { @@ -718,14 +718,14 @@ class MaterialDominantMaterialView AXOM_HOST_DEVICE axom::IndexType zoneMaterials(ZoneIndex zi, - axom::ArrayView &ids, - axom::ArrayView &vfs) const + axom::ArrayView& ids, + axom::ArrayView& vfs) const { axom::IndexType n = 0; for(axom::IndexType mi = 0; mi < m_size; mi++) { - const auto &element_ids = m_element_ids[mi]; - const auto &volume_fractions = m_volume_fractions[mi]; + const auto& element_ids = m_element_ids[mi]; + const auto& volume_fractions = m_volume_fractions[mi]; const auto sz = element_ids.size(); for(axom::IndexType i = 0; i < sz; i++) { @@ -749,15 +749,15 @@ class MaterialDominantMaterialView } AXOM_HOST_DEVICE - bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType &vf) const + bool zoneContainsMaterial(ZoneIndex zi, MaterialID mat, FloatType& vf) const { bool found = false; vf = FloatType {}; axom::IndexType mi = indexOfMaterialID(mat); if(mi != InvalidIndex) { - const auto &element_ids = m_element_ids[mi]; - const auto &volume_fractions = m_volume_fractions[mi]; + const auto& element_ids = m_element_ids[mi]; + const auto& volume_fractions = m_volume_fractions[mi]; const auto n = element_ids.size(); for(axom::IndexType i = 0; i < n; i++) { @@ -799,12 +799,12 @@ class MaterialDominantMaterialView axom::IndexType AXOM_HOST_DEVICE size() const { return m_view->numberOfMaterials(m_zoneIndex); } void AXOM_HOST_DEVICE operator++() { advance(true); } void AXOM_HOST_DEVICE operator++(int) { advance(true); } - bool AXOM_HOST_DEVICE operator==(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator==(const const_iterator& rhs) const { return m_miIndex == rhs.m_miIndex && m_index == rhs.m_index && m_zoneIndex == rhs.m_zoneIndex && m_view == rhs.m_view; } - bool AXOM_HOST_DEVICE operator!=(const const_iterator &rhs) const + bool AXOM_HOST_DEVICE operator!=(const const_iterator& rhs) const { return m_miIndex != rhs.m_miIndex || m_index != rhs.m_index || m_zoneIndex != rhs.m_zoneIndex || m_view != rhs.m_view; @@ -818,7 +818,7 @@ class MaterialDominantMaterialView DISABLE_DEFAULT_CTOR(const_iterator); /// Constructor - AXOM_HOST_DEVICE const_iterator(const MaterialDominantMaterialView *view, + AXOM_HOST_DEVICE const_iterator(const MaterialDominantMaterialView* view, ZoneIndex zoneIndex, axom::IndexType miIndex, axom::IndexType index) @@ -847,7 +847,7 @@ class MaterialDominantMaterialView // Look for the next m_miIndex,m_index pair that contains material for the selected zone index. for(; m_miIndex < m_view->m_size; m_miIndex++) { - const auto &element_ids = m_view->m_element_ids[m_miIndex]; + const auto& element_ids = m_view->m_element_ids[m_miIndex]; const auto sz = element_ids.size(); for(; m_index < sz; m_index++) { @@ -860,7 +860,7 @@ class MaterialDominantMaterialView } } - const MaterialDominantMaterialView *m_view; + const MaterialDominantMaterialView* m_view; ZoneIndex m_zoneIndex; axom::IndexType m_miIndex; axom::IndexType m_index; diff --git a/src/axom/bump/views/MixedFieldView.hpp b/src/axom/bump/views/MixedFieldView.hpp index 1fea6f06e7..4a48754441 100644 --- a/src/axom/bump/views/MixedFieldView.hpp +++ b/src/axom/bump/views/MixedFieldView.hpp @@ -47,7 +47,7 @@ struct MixedFieldTraits, Fie * * \return The field value at the provided index. */ - AXOM_HOST_DEVICE FieldT value(const IteratorIndex &index) const + AXOM_HOST_DEVICE FieldT value(const IteratorIndex& index) const { SLIC_ASSERT(axom::utilities::inBounds_0_N(index.m_localIndex, m_values.size())); return m_values[index.m_localIndex]; @@ -80,7 +80,7 @@ struct MixedFieldTraits; - Traits &traits() { return m_traits; } - const Traits &traits() const { return m_traits; } + Traits& traits() { return m_traits; } + const Traits& traits() const { return m_traits; } /*! * \brief Given a MatsetView's const_iterator, use it to look up the typed field * data in the field. */ - AXOM_HOST_DEVICE FieldT value(const typename MatsetView::const_iterator &it) const + AXOM_HOST_DEVICE FieldT value(const typename MatsetView::const_iterator& it) const { return m_traits.value(it.index()); } diff --git a/src/axom/bump/views/NodeArrayView.hpp b/src/axom/bump/views/NodeArrayView.hpp index 99bbbbcd1e..57cbd9840c 100644 --- a/src/axom/bump/views/NodeArrayView.hpp +++ b/src/axom/bump/views/NodeArrayView.hpp @@ -94,15 +94,15 @@ constexpr int select_float_types() template struct NodeTypeTraits; -#define AXOM_BUMP_DECLARE_NODE_TYPE_TRAITS(CppType, DTypeID, IsMethod, PtrMethod, Label) \ - template <> \ - struct NodeTypeTraits \ - { \ - static bool matches(const conduit::Node &n) { return n.dtype().IsMethod(); } \ - static CppType *data(conduit::Node &n) { return n.PtrMethod(); } \ - static CppType *data(const conduit::Node &n) { return const_cast(n.PtrMethod()); } \ - static const char *label() { return Label; } \ - static int dtypeId() { return conduit::DataType::DTypeID; } \ +#define AXOM_BUMP_DECLARE_NODE_TYPE_TRAITS(CppType, DTypeID, IsMethod, PtrMethod, Label) \ + template <> \ + struct NodeTypeTraits \ + { \ + static bool matches(const conduit::Node& n) { return n.dtype().IsMethod(); } \ + static CppType* data(conduit::Node& n) { return n.PtrMethod(); } \ + static CppType* data(const conduit::Node& n) { return const_cast(n.PtrMethod()); } \ + static const char* label() { return Label; } \ + static int dtypeId() { return conduit::DataType::DTypeID; } \ }; AXOM_BUMP_NODE_ARRAY_VIEW_TYPES(AXOM_BUMP_DECLARE_NODE_TYPE_TRAITS) @@ -110,31 +110,31 @@ AXOM_BUMP_NODE_ARRAY_VIEW_TYPES(AXOM_BUMP_DECLARE_NODE_TYPE_TRAITS) #undef AXOM_BUMP_DECLARE_NODE_TYPE_TRAITS template -std::enable_if_t invoke_single_array_view(NodeType &n, FuncType &&func) +std::enable_if_t invoke_single_array_view(NodeType& n, FuncType&& func) { func(axom::bump::utilities::detail::make_conduit_array_view(n)); } template -std::enable_if_t invoke_single_array_view(NodeType &AXOM_UNUSED_PARAM(n), - FuncType &&AXOM_UNUSED_PARAM(func)) +std::enable_if_t invoke_single_array_view(NodeType& AXOM_UNUSED_PARAM(n), + FuncType&& AXOM_UNUSED_PARAM(func)) { SLIC_WARNING("Unsupported " << NodeTypeTraits::label() << " node."); } template -std::enable_if_t invoke_same_array_views(FuncType &&func, NodeTypes &&...nodes) +std::enable_if_t invoke_same_array_views(FuncType&& func, NodeTypes&&... nodes) { func(axom::bump::utilities::detail::make_conduit_array_view(nodes)...); } template -std::enable_if_t invoke_same_array_views(FuncType &&AXOM_UNUSED_PARAM(func), - NodeTypes &&...AXOM_UNUSED_PARAM(nodes)) +std::enable_if_t invoke_same_array_views(FuncType&& AXOM_UNUSED_PARAM(func), + NodeTypes&&... AXOM_UNUSED_PARAM(nodes)) { } template -void dispatch_single_array_view(NodeType &n, FuncType &&func) +void dispatch_single_array_view(NodeType& n, FuncType&& func) { #define AXOM_BUMP_DISPATCH_SINGLE(CppType, DTypeID, IsMethod, PtrMethod, Label) \ if(NodeTypeTraits::matches(n)) \ @@ -154,7 +154,7 @@ void dispatch_single_array_view(NodeType &n, FuncType &&func) } template -void dispatch_same_array_views(FirstNodeType &first, FuncType &&func, NodeTypes &&...nodes) +void dispatch_same_array_views(FirstNodeType& first, FuncType&& func, NodeTypes&&... nodes) { #define AXOM_BUMP_DISPATCH_SAME(CppType, DTypeID, IsMethod, PtrMethod, Label) \ if(NodeTypeTraits::matches(first)) \ @@ -174,13 +174,13 @@ void dispatch_same_array_views(FirstNodeType &first, FuncType &&func, NodeTypes } template -void nodeToArrayViewInternal(FuncType &&func, Delimiter, ViewTypes... views) +void nodeToArrayViewInternal(FuncType&& func, Delimiter, ViewTypes... views) { func(views...); } template -void nodeToArrayViewInternal(NodeType &first, Args &&...args) +void nodeToArrayViewInternal(NodeType& first, Args&&... args) { dispatch_single_array_view(first, [&](auto view) { nodeToArrayViewInternal(std::forward(args)..., view); @@ -188,7 +188,7 @@ void nodeToArrayViewInternal(NodeType &first, Args &&...args) } template -void nodeToArrayViewSameInternal(FuncType &&func, Delimiter, FirstNode &first, Args &&...args) +void nodeToArrayViewSameInternal(FuncType&& func, Delimiter, FirstNode& first, Args&&... args) { dispatch_same_array_views(first, std::forward(func), @@ -197,7 +197,7 @@ void nodeToArrayViewSameInternal(FuncType &&func, Delimiter, FirstNode &first, A } template -void nodeToArrayViewSameInternal(FirstNode &first, Args &&...args) +void nodeToArrayViewSameInternal(FirstNode& first, Args&&... args) { nodeToArrayViewSameInternal(std::forward(args)..., first); } @@ -220,13 +220,13 @@ void nodeToArrayViewSameInternal(FirstNode &first, Args &&...args) * nodeToArrayView(node1, node2, [](auto &view1, auto &view2) { }); */ template -void nodeToArrayView(const conduit::Node &first, Args &&...args) +void nodeToArrayView(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., detail::ArgumentDelimiter); } template -void nodeToArrayView(conduit::Node &first, Args &&...args) +void nodeToArrayView(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., detail::ArgumentDelimiter); } @@ -246,19 +246,19 @@ void nodeToArrayView(conduit::Node &first, Args &&...args) * nodeToArrayViewSame(node1, node2, [](auto &view1, auto &view2) { }); */ template -void nodeToArrayViewSame(const conduit::Node &first, Args &&...args) +void nodeToArrayViewSame(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., detail::ArgumentDelimiter); } template -void nodeToArrayViewSame(conduit::Node &first, Args &&...args) +void nodeToArrayViewSame(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., detail::ArgumentDelimiter); } template -void indexNodeToArrayView(const conduit::Node &first, Args &&...args) +void indexNodeToArrayView(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., @@ -266,7 +266,7 @@ void indexNodeToArrayView(const conduit::Node &first, Args &&...args) } template -void indexNodeToArrayView(conduit::Node &first, Args &&...args) +void indexNodeToArrayView(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., @@ -274,7 +274,7 @@ void indexNodeToArrayView(conduit::Node &first, Args &&...args) } template -void indexNodeToArrayViewSame(const conduit::Node &first, Args &&...args) +void indexNodeToArrayViewSame(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., @@ -282,7 +282,7 @@ void indexNodeToArrayViewSame(const conduit::Node &first, Args &&...args) } template -void indexNodeToArrayViewSame(conduit::Node &first, Args &&...args) +void indexNodeToArrayViewSame(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., @@ -290,7 +290,7 @@ void indexNodeToArrayViewSame(conduit::Node &first, Args &&...args) } template -void floatNodeToArrayView(const conduit::Node &first, Args &&...args) +void floatNodeToArrayView(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., @@ -298,7 +298,7 @@ void floatNodeToArrayView(const conduit::Node &first, Args &&...args) } template -void floatNodeToArrayView(conduit::Node &first, Args &&...args) +void floatNodeToArrayView(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewInternal(first, std::forward(args)..., @@ -306,7 +306,7 @@ void floatNodeToArrayView(conduit::Node &first, Args &&...args) } template -void floatNodeToArrayViewSame(const conduit::Node &first, Args &&...args) +void floatNodeToArrayViewSame(const conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., @@ -314,7 +314,7 @@ void floatNodeToArrayViewSame(const conduit::Node &first, Args &&...args) } template -void floatNodeToArrayViewSame(conduit::Node &first, Args &&...args) +void floatNodeToArrayViewSame(conduit::Node& first, Args&&... args) { detail::nodeToArrayViewSameInternal(first, std::forward(args)..., diff --git a/src/axom/bump/views/RectilinearCoordsetView.hpp b/src/axom/bump/views/RectilinearCoordsetView.hpp index 13f2d41155..48746db6cb 100644 --- a/src/axom/bump/views/RectilinearCoordsetView.hpp +++ b/src/axom/bump/views/RectilinearCoordsetView.hpp @@ -47,7 +47,7 @@ class RectilinearCoordsetView2 * \param y The second coordinate component. */ AXOM_HOST_DEVICE - RectilinearCoordsetView2(const axom::ArrayView &x, const axom::ArrayView &y) + RectilinearCoordsetView2(const axom::ArrayView& x, const axom::ArrayView& y) : m_coordinates {x, y} , m_indexing(LogicalIndex {{x.size(), y.size()}}) { } @@ -71,7 +71,7 @@ class RectilinearCoordsetView2 * \return The indexing that contains the mesh logical sizes. */ AXOM_HOST_DEVICE - const StructuredIndexing &indexing() const { return m_indexing; } + const StructuredIndexing& indexing() const { return m_indexing; } /*! * \brief Get a coordinate array view for a dimension. @@ -169,9 +169,9 @@ class RectilinearCoordsetView3 * \param z The third coordinate component. */ AXOM_HOST_DEVICE - RectilinearCoordsetView3(const axom::ArrayView &x, - const axom::ArrayView &y, - const axom::ArrayView &z) + RectilinearCoordsetView3(const axom::ArrayView& x, + const axom::ArrayView& y, + const axom::ArrayView& z) : m_coordinates {x, y, z} , m_indexing(LogicalIndex {{x.size(), y.size(), z.size()}}) { } @@ -196,7 +196,7 @@ class RectilinearCoordsetView3 * \return The indexing that contains the mesh logical sizes. */ AXOM_HOST_DEVICE - const StructuredIndexing &indexing() const { return m_indexing; } + const StructuredIndexing& indexing() const { return m_indexing; } /*! * \brief Get a coordinate array view for a dimension. diff --git a/src/axom/bump/views/Shapes.hpp b/src/axom/bump/views/Shapes.hpp index a1f4d127bb..24eaa557c9 100644 --- a/src/axom/bump/views/Shapes.hpp +++ b/src/axom/bump/views/Shapes.hpp @@ -99,7 +99,7 @@ struct PointTraits return axom::StackArray {0, 0}; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "point"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "point"; } }; /*! @@ -147,7 +147,7 @@ struct LineTraits return axom::StackArray {0, 1}; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "line"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "line"; } }; /*! @@ -202,7 +202,7 @@ struct TriTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "tri"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "tri"; } }; /*! @@ -257,7 +257,7 @@ struct QuadTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "quad"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "quad"; } }; /*! @@ -316,7 +316,7 @@ struct TetTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "tet"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "tet"; } }; /*! @@ -381,7 +381,7 @@ struct PyramidTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "pyramid"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "pyramid"; } }; /*! @@ -448,7 +448,7 @@ struct WedgeTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "wedge"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "wedge"; } }; /*! @@ -510,7 +510,7 @@ struct HexTraits return edges[edgeIndex]; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "hex"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "hex"; } }; /*! @@ -533,7 +533,7 @@ struct PolygonTraits AXOM_HOST_DEVICE constexpr static IndexType dimension() { return 2; } AXOM_HOST_DEVICE constexpr static IndexType numberOfFaces() { return 1; } AXOM_HOST_DEVICE constexpr static IndexType maxNodesInFace() { return 20; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "polygonal"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "polygonal"; } }; /*! @@ -548,7 +548,7 @@ struct PolyhedronTraits AXOM_HOST_DEVICE constexpr static bool is_polyhedral() { return true; } AXOM_HOST_DEVICE constexpr static bool is_variable_size() { return true; } AXOM_HOST_DEVICE constexpr static IndexType dimension() { return 3; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "polyhedral"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "polyhedral"; } }; /*! @@ -560,13 +560,13 @@ struct PolygonShape : public PolygonTraits using ConnectivityType = ConnType; using ConnectivityView = axom::ArrayView; using ConnectivityStorage = ConnectivityType; - using ConnectivityStorageRef = ConnectivityView &; - using ConnectivityStorageConstRef = const ConnectivityView &; + using ConnectivityStorageRef = ConnectivityView&; + using ConnectivityStorageConstRef = const ConnectivityView&; /*! * \brief Construct a shape. */ - AXOM_HOST_DEVICE PolygonShape(const ConnectivityView &ids) : m_ids(ids) { } + AXOM_HOST_DEVICE PolygonShape(const ConnectivityView& ids) : m_ids(ids) { } /*! * \brief Return the number of nodes in the polygon. @@ -616,8 +616,8 @@ struct PolygonShape : public PolygonTraits * */ AXOM_HOST_DEVICE void getFace(int AXOM_UNUSED_PARAM(faceIndex), - ConnectivityType *ids, - axom::IndexType &numIds) const + ConnectivityType* ids, + axom::IndexType& numIds) const { numIds = m_ids.size(); for(axom::IndexType i = 0; i < numIds; i++) @@ -665,8 +665,8 @@ template struct Shape : public ShapeTraits { using ConnectivityStorage = ConnStorage; - using ConnectivityStorageRef = ConnStorage &; - using ConnectivityStorageConstRef = const ConnStorage &; + using ConnectivityStorageRef = ConnStorage&; + using ConnectivityStorageConstRef = const ConnStorage&; using ConnectivityType = typename ConnStorage::value_type; using ConnectivityView = axom::ArrayView; @@ -717,7 +717,7 @@ struct Shape : public ShapeTraits */ AXOM_HOST_DEVICE ConnectivityView getIds() const { - return ConnectivityView(const_cast(m_ids.data()), m_ids.size()); + return ConnectivityView(const_cast(m_ids.data()), m_ids.size()); } /*! @@ -740,8 +740,8 @@ struct Shape : public ShapeTraits template AXOM_HOST_DEVICE typename std::enable_if<(_ndims == 2), void>::type getFace( axom::IndexType AXOM_UNUSED_PARAM(faceIndex), - ConnectivityType *ids, - axom::IndexType &numIds) const + ConnectivityType* ids, + axom::IndexType& numIds) const { numIds = static_cast(m_ids.size()); for(axom::IndexType i = 0; i < numIds; i++) @@ -752,8 +752,8 @@ struct Shape : public ShapeTraits template AXOM_HOST_DEVICE typename std::enable_if<_ndims != 2, void>::type getFace(axom::IndexType faceIndex, - ConnectivityType *ids, - axom::IndexType &numIds) const + ConnectivityType* ids, + axom::IndexType& numIds) const { numIds = ShapeTraits::numberOfNodesInFace(faceIndex); const auto faceIds = ShapeTraits::getFace(faceIndex); @@ -828,8 +828,8 @@ template struct VariableShape { using ConnectivityStorage = axom::ArrayView; - using ConnectivityStorageRef = ConnectivityStorage &; - using ConnectivityStorageConstRef = const ConnectivityStorage &; + using ConnectivityStorageRef = ConnectivityStorage&; + using ConnectivityStorageConstRef = const ConnectivityStorage&; using ConnectivityType = ConnType; using ConnectivityView = ConnectivityStorage; @@ -946,8 +946,8 @@ struct VariableShape } AXOM_HOST_DEVICE void getFace(axom::IndexType faceIndex, - ConnectivityType *ids, - axom::IndexType &numIds) const + ConnectivityType* ids, + axom::IndexType& numIds) const { switch(m_shapeId) { @@ -1101,7 +1101,7 @@ struct VariableShape */ AXOM_HOST_DEVICE ConnectivityView getIds() const { return m_ids; } - AXOM_HOST_DEVICE constexpr static const char *name() { return "mixed"; } + AXOM_HOST_DEVICE constexpr static const char* name() { return "mixed"; } /*! * \brief Get the storage for the ids that make up this shape. @@ -1129,7 +1129,7 @@ struct VariableShape * * \return The shape id that matches the name, or 0 if there is no match. */ -inline int shapeNameToID(const std::string &name) +inline int shapeNameToID(const std::string& name) { int id = Invalid_ShapeID; if(name == PointTraits::name()) diff --git a/src/axom/bump/views/StridedStructuredIndexing.hpp b/src/axom/bump/views/StridedStructuredIndexing.hpp index fcb8eafc6c..0b8d1eef58 100644 --- a/src/axom/bump/views/StridedStructuredIndexing.hpp +++ b/src/axom/bump/views/StridedStructuredIndexing.hpp @@ -79,9 +79,9 @@ struct StridedStructuredIndexing * \param strides The amount to stride when moving to the next element for each logical dimension. */ AXOM_HOST_DEVICE - StridedStructuredIndexing(const LogicalIndex &dims, - const LogicalIndex &offsets, - const LogicalIndex &strides) + StridedStructuredIndexing(const LogicalIndex& dims, + const LogicalIndex& offsets, + const LogicalIndex& strides) : m_dimensions(dims) , m_offsets(offsets) , m_strides(strides) @@ -113,7 +113,7 @@ struct StridedStructuredIndexing * \return The logical dimensions. */ AXOM_HOST_DEVICE - const LogicalIndex &logicalDimensions() const { return m_dimensions; } + const LogicalIndex& logicalDimensions() const { return m_dimensions; } /*! * \brief Return the j stride. @@ -143,7 +143,7 @@ struct StridedStructuredIndexing * \return The global index. */ AXOM_HOST_DEVICE - IndexType globalToGlobal(const LogicalIndex &global) const + IndexType globalToGlobal(const LogicalIndex& global) const { IndexType gl {}; for(int i = 0; i < NDIMS; i++) @@ -199,7 +199,7 @@ struct StridedStructuredIndexing * \return local logical index. */ AXOM_HOST_DEVICE - LogicalIndex globalToLocal(const LogicalIndex &global) const + LogicalIndex globalToLocal(const LogicalIndex& global) const { LogicalIndex local(global); for(int i = 0; i < NDIMS; i++) @@ -228,7 +228,7 @@ struct StridedStructuredIndexing * \return global logical index. */ AXOM_HOST_DEVICE - LogicalIndex localToGlobal(const LogicalIndex &local) const + LogicalIndex localToGlobal(const LogicalIndex& local) const { LogicalIndex global(local); for(int i = 0; i < NDIMS; i++) @@ -301,7 +301,7 @@ struct StridedStructuredIndexing * \return The index that corresponds to the \a logical index. */ AXOM_HOST_DEVICE - IndexType logicalIndexToIndex(const LogicalIndex &logical) const + IndexType logicalIndexToIndex(const LogicalIndex& logical) const { IndexType index {}; IndexType stride {1}; @@ -321,7 +321,7 @@ struct StridedStructuredIndexing * \return True if the logical index is within the index, false otherwise. */ AXOM_HOST_DEVICE - bool contains(const LogicalIndex &logical) const + bool contains(const LogicalIndex& logical) const { bool retval = true; for(int i = 0; i < dimension(); i++) @@ -392,7 +392,7 @@ struct StridedStructuredIndexing */ /// @{ AXOM_HOST_DEVICE - LogicalIndex clamp(const LogicalIndex &logical) const + LogicalIndex clamp(const LogicalIndex& logical) const { LogicalIndex retval; const IndexType lower(0); diff --git a/src/axom/bump/views/StructuredIndexing.hpp b/src/axom/bump/views/StructuredIndexing.hpp index 7192800df3..ed14f53dcd 100644 --- a/src/axom/bump/views/StructuredIndexing.hpp +++ b/src/axom/bump/views/StructuredIndexing.hpp @@ -53,7 +53,7 @@ class StructuredIndexing } AXOM_HOST_DEVICE - StructuredIndexing(const LogicalIndex &dims) : m_dimensions(dims) + StructuredIndexing(const LogicalIndex& dims) : m_dimensions(dims) { #if !defined(AXOM_DEVICE_CODE) for(int d = 0; d < NDIMS; d++) @@ -85,7 +85,7 @@ class StructuredIndexing * \return The logical dimensions. */ AXOM_HOST_DEVICE - const LogicalIndex &logicalDimensions() const { return m_dimensions; } + const LogicalIndex& logicalDimensions() const { return m_dimensions; } /*! * \brief Return the j stride. @@ -115,7 +115,7 @@ class StructuredIndexing * \return The global index. */ AXOM_HOST_DEVICE - inline IndexType globalToGlobal(const LogicalIndex &global) const + inline IndexType globalToGlobal(const LogicalIndex& global) const { return logicalIndexToIndex(global); } @@ -134,7 +134,7 @@ class StructuredIndexing * \return Same as the input in this case. */ AXOM_HOST_DEVICE - inline LogicalIndex globalToLocal(const LogicalIndex &index) const { return index; } + inline LogicalIndex globalToLocal(const LogicalIndex& index) const { return index; } /*! * \brief Turn global index to local index. no-op. @@ -150,7 +150,7 @@ class StructuredIndexing * \return Same as the input in this case. */ AXOM_HOST_DEVICE - inline LogicalIndex localToGlobal(const LogicalIndex &index) const { return index; } + inline LogicalIndex localToGlobal(const LogicalIndex& index) const { return index; } /*! * \brief Turn local index to global index. no-op. @@ -214,21 +214,21 @@ class StructuredIndexing /// @{ template AXOM_HOST_DEVICE typename std::enable_if<_ndims == 1, IndexType>::type logicalIndexToIndex( - const LogicalIndex &logical) const + const LogicalIndex& logical) const { return logical[0]; } template AXOM_HOST_DEVICE typename std::enable_if<_ndims == 2, IndexType>::type logicalIndexToIndex( - const LogicalIndex &logical) const + const LogicalIndex& logical) const { return logical[1] * m_dimensions[0] + logical[0]; } template AXOM_HOST_DEVICE typename std::enable_if<_ndims == 3, IndexType>::type logicalIndexToIndex( - const LogicalIndex &logical) const + const LogicalIndex& logical) const { return (logical[2] * m_dimensions[1] * m_dimensions[0]) + (logical[1] * m_dimensions[0]) + logical[0]; @@ -244,7 +244,7 @@ class StructuredIndexing * \return True if the logical index is within the index, false otherwise. */ AXOM_HOST_DEVICE - bool contains(const LogicalIndex &logical) const + bool contains(const LogicalIndex& logical) const { bool retval = true; for(int i = 0; i < dimension(); i++) @@ -291,7 +291,7 @@ class StructuredIndexing */ /// @{ AXOM_HOST_DEVICE - LogicalIndex clamp(const LogicalIndex &logical) const + LogicalIndex clamp(const LogicalIndex& logical) const { LogicalIndex retval; const IndexType lower(0); diff --git a/src/axom/bump/views/StructuredTopologyView.hpp b/src/axom/bump/views/StructuredTopologyView.hpp index 9ab0ef2633..11e436e698 100644 --- a/src/axom/bump/views/StructuredTopologyView.hpp +++ b/src/axom/bump/views/StructuredTopologyView.hpp @@ -56,7 +56,7 @@ class StructuredTopologyView * * \param indexing The indexing policy for the topology (num zones in each dimension). */ - AXOM_HOST_DEVICE StructuredTopologyView(const IndexingPolicy &indexing) + AXOM_HOST_DEVICE StructuredTopologyView(const IndexingPolicy& indexing) : m_zoneIndexing(indexing) , m_nodeIndexing(indexing.expand()) { } @@ -95,7 +95,7 @@ class StructuredTopologyView * * \return The mesh logical dimensions. */ - AXOM_HOST_DEVICE const LogicalIndex &logicalDimensions() const + AXOM_HOST_DEVICE const LogicalIndex& logicalDimensions() const { return m_zoneIndexing.logicalDimensions(); } @@ -105,14 +105,14 @@ class StructuredTopologyView * * \return The indexing object. */ - AXOM_HOST_DEVICE inline IndexingPolicy &indexing() { return m_zoneIndexing; } + AXOM_HOST_DEVICE inline IndexingPolicy& indexing() { return m_zoneIndexing; } /*! * \brief Return indexing object. * * \return The indexing object. */ - AXOM_HOST_DEVICE inline const IndexingPolicy &indexing() const { return m_zoneIndexing; } + AXOM_HOST_DEVICE inline const IndexingPolicy& indexing() const { return m_zoneIndexing; } /*! * \brief Return a zone. @@ -133,7 +133,7 @@ class StructuredTopologyView const auto kp = m_nodeIndexing.kStride(); Shape3D shape; - auto &data = shape.getIdsStorage(); + auto& data = shape.getIdsStorage(); data[0] = m_nodeIndexing.globalToGlobal(m_nodeIndexing.localToGlobal(localLogical)); data[1] = data[0] + 1; data[2] = data[1] + jp; @@ -164,7 +164,7 @@ class StructuredTopologyView const auto jp = m_nodeIndexing.jStride(); Shape2D shape; - auto &data = shape.getIdsStorage(); + auto& data = shape.getIdsStorage(); data[0] = m_nodeIndexing.globalToGlobal(m_nodeIndexing.localToGlobal(localLogical)); data[1] = data[0] + 1; data[2] = data[1] + jp; @@ -190,7 +190,7 @@ class StructuredTopologyView const auto localLogical = m_zoneIndexing.indexToLogicalIndex(zoneIndex); Shape1D shape; - auto &data = shape.getIdsStorage(); + auto& data = shape.getIdsStorage(); data[0] = m_nodeIndexing.globalToGlobal(m_nodeIndexing.localToGlobal(localLogical)); data[1] = data[0] + 1; diff --git a/src/axom/bump/views/UniformCoordsetView.hpp b/src/axom/bump/views/UniformCoordsetView.hpp index 7b3fafe665..3e4cfbdd08 100644 --- a/src/axom/bump/views/UniformCoordsetView.hpp +++ b/src/axom/bump/views/UniformCoordsetView.hpp @@ -51,7 +51,7 @@ class UniformCoordsetView * \param spacing The spacing inbetween points. */ AXOM_HOST_DEVICE - UniformCoordsetView(const LogicalIndex &dims, const ExtentsType &origin, const ExtentsType &spacing) + UniformCoordsetView(const LogicalIndex& dims, const ExtentsType& origin, const ExtentsType& spacing) : m_indexing(dims) , m_origin(origin) , m_spacing(spacing) @@ -76,21 +76,21 @@ class UniformCoordsetView * \return The indexing that contains the mesh logical sizes. */ AXOM_HOST_DEVICE - const StructuredIndexing &indexing() const { return m_indexing; } + const StructuredIndexing& indexing() const { return m_indexing; } /*! * \brief Return the coordset origin. * \return The coordset origin. */ AXOM_HOST_DEVICE - const ExtentsType &origin() const { return m_origin; } + const ExtentsType& origin() const { return m_origin; } /*! * \brief Return the coordset spacing. * \return The coordset spacing. */ AXOM_HOST_DEVICE - const ExtentsType &spacing() const { return m_spacing; } + const ExtentsType& spacing() const { return m_spacing; } /*! * \brief Return the requested point from the coordset. @@ -100,7 +100,7 @@ class UniformCoordsetView * \return A point that corresponds to \a vertex_index. */ AXOM_HOST_DEVICE - PointType getPoint(const LogicalIndex &vertex_index) const + PointType getPoint(const LogicalIndex& vertex_index) const { PointType pt; for(int i = 0; i < NDIMS; i++) pt[i] = m_origin[i] + vertex_index[i] * m_spacing[i]; @@ -115,7 +115,7 @@ class UniformCoordsetView * \return A point that corresponds to \a vertex_index. */ AXOM_HOST_DEVICE - PointType operator[](const LogicalIndex &vertex_index) const { return getPoint(vertex_index); } + PointType operator[](const LogicalIndex& vertex_index) const { return getPoint(vertex_index); } /*! * \brief Return the requested point from the coordset. diff --git a/src/axom/bump/views/UnstructuredTopologyMixedShapeView.cpp b/src/axom/bump/views/UnstructuredTopologyMixedShapeView.cpp index 1418cdafd7..5b7965c8bb 100644 --- a/src/axom/bump/views/UnstructuredTopologyMixedShapeView.cpp +++ b/src/axom/bump/views/UnstructuredTopologyMixedShapeView.cpp @@ -12,16 +12,16 @@ namespace bump { namespace views { -ShapeMap buildShapeMap(const conduit::Node &n_topo, - axom::Array &values, - axom::Array &ids, +ShapeMap buildShapeMap(const conduit::Node& n_topo, + axom::Array& values, + axom::Array& ids, int allocatorID) { // Make the map from the Conduit shape_map. Use std::map to sort the key values. // The shape_map nodes should be in host memory since the int values can fit // in a Conduit::Node. std::map sm; - const conduit::Node &n_shape_map = n_topo.fetch_existing("elements/shape_map"); + const conduit::Node& n_shape_map = n_topo.fetch_existing("elements/shape_map"); for(conduit::index_t i = 0; i < n_shape_map.number_of_children(); i++) { const auto value = static_cast(n_shape_map[i].to_int()); diff --git a/src/axom/bump/views/UnstructuredTopologyMixedShapeView.hpp b/src/axom/bump/views/UnstructuredTopologyMixedShapeView.hpp index 37272af989..822494be74 100644 --- a/src/axom/bump/views/UnstructuredTopologyMixedShapeView.hpp +++ b/src/axom/bump/views/UnstructuredTopologyMixedShapeView.hpp @@ -39,8 +39,8 @@ class ShapeMap * \param shape_values A view of sorted values used in the Conduit data. * \param shape_ids A view of shape ids that correspond to the values from Conduit. */ - AXOM_HOST_DEVICE ShapeMap(const axom::ArrayView &shape_values, - const axom::ArrayView &shape_ids) + AXOM_HOST_DEVICE ShapeMap(const axom::ArrayView& shape_values, + const axom::ArrayView& shape_ids) : m_shape_values(shape_values) , m_shape_ids(shape_ids) { } @@ -83,9 +83,9 @@ class ShapeMap * \param[out] ids The Shape ids that correspond to the shape values. * \param allocatorID The allocator to use when creating the arrays. */ -ShapeMap buildShapeMap(const conduit::Node &n_topo, - axom::Array &values, - axom::Array &ids, +ShapeMap buildShapeMap(const conduit::Node& n_topo, + axom::Array& values, + axom::Array& ids, int allocatorID); /*! * \brief This class provides a view for Conduit/Blueprint mixed shape unstructured grids. @@ -113,11 +113,11 @@ class UnstructuredTopologyMixedShapeView * \param offsets The offset to each zone in the connectivity. */ AXOM_HOST_DEVICE - UnstructuredTopologyMixedShapeView(const ConnectivityView &conn, - const ConnectivityView &shapes, - const ConnectivityView &sizes, - const ConnectivityView &offsets, - const ShapeMap &shapemap) + UnstructuredTopologyMixedShapeView(const ConnectivityView& conn, + const ConnectivityView& shapes, + const ConnectivityView& sizes, + const ConnectivityView& offsets, + const ShapeMap& shapemap) : m_connectivity(conn) , m_shapes(shapes) , m_sizes(sizes) @@ -165,7 +165,7 @@ class UnstructuredTopologyMixedShapeView * * \return The size of the connectivity. */ - AXOM_HOST_DEVICE inline const IndexingPolicy &indexing() const { return m_indexing; } + AXOM_HOST_DEVICE inline const IndexingPolicy& indexing() const { return m_indexing; } /*! * \brief Return a zone. diff --git a/src/axom/bump/views/UnstructuredTopologyPolyhedralView.hpp b/src/axom/bump/views/UnstructuredTopologyPolyhedralView.hpp index d18a80f7e9..41022eff8e 100644 --- a/src/axom/bump/views/UnstructuredTopologyPolyhedralView.hpp +++ b/src/axom/bump/views/UnstructuredTopologyPolyhedralView.hpp @@ -36,12 +36,12 @@ class UnstructuredTopologyPolyhedralView { /// Constructor AXOM_HOST_DEVICE - PolyhedronData(const ConnectivityView &subelement_conn, - const ConnectivityView &subelement_sizes, - const ConnectivityView &subelement_offsets, - const ConnectivityView &element_conn, - const ConnectivityView &element_sizes, - const ConnectivityView &element_offsets) + PolyhedronData(const ConnectivityView& subelement_conn, + const ConnectivityView& subelement_sizes, + const ConnectivityView& subelement_offsets, + const ConnectivityView& element_conn, + const ConnectivityView& element_sizes, + const ConnectivityView& element_offsets) : m_subelement_conn(subelement_conn) , m_subelement_sizes(subelement_sizes) , m_subelement_offsets(subelement_offsets) @@ -64,7 +64,7 @@ class UnstructuredTopologyPolyhedralView /// Copy Constructor AXOM_HOST_DEVICE - PolyhedronData(const PolyhedronData &obj) + PolyhedronData(const PolyhedronData& obj) : m_subelement_conn(obj.m_subelement_conn) , m_subelement_sizes(obj.m_subelement_sizes) , m_subelement_offsets(obj.m_subelement_offsets) @@ -91,7 +91,7 @@ class UnstructuredTopologyPolyhedralView constexpr static IndexType MaximumNumberOfIds = 20 * 3; /// Constructor. - AXOM_HOST_DEVICE PolyhedronShape(const PolyhedronData &obj, axom::IndexType zi) + AXOM_HOST_DEVICE PolyhedronShape(const PolyhedronData& obj, axom::IndexType zi) : m_data(obj) , m_zoneIndex(zi) , m_ids() @@ -182,7 +182,7 @@ class UnstructuredTopologyPolyhedralView m_data.m_subelement_sizes[faceId]); } - AXOM_HOST_DEVICE void getFace(int faceIndex, ConnectivityType *ids, axom::IndexType &numIds) const + AXOM_HOST_DEVICE void getFace(int faceIndex, ConnectivityType* ids, axom::IndexType& numIds) const { const auto faceIds = getFace(faceIndex); numIds = faceIds.size(); @@ -193,7 +193,7 @@ class UnstructuredTopologyPolyhedralView } private: - AXOM_HOST_DEVICE bool find(const ConnectivityType *arr, + AXOM_HOST_DEVICE bool find(const ConnectivityType* arr, axom::IndexType n, ConnectivityType value) const { @@ -217,12 +217,12 @@ class UnstructuredTopologyPolyhedralView * \brief Constructor. */ AXOM_HOST_DEVICE - UnstructuredTopologyPolyhedralView(const ConnectivityView &subelement_conn, - const ConnectivityView &subelement_sizes, - const ConnectivityView &subelement_offsets, - const ConnectivityView &element_conn, - const ConnectivityView &element_sizes, - const ConnectivityView &element_offsets) + UnstructuredTopologyPolyhedralView(const ConnectivityView& subelement_conn, + const ConnectivityView& subelement_sizes, + const ConnectivityView& subelement_offsets, + const ConnectivityView& element_conn, + const ConnectivityView& element_sizes, + const ConnectivityView& element_offsets) : m_data(subelement_conn, subelement_sizes, subelement_offsets, @@ -259,7 +259,7 @@ class UnstructuredTopologyPolyhedralView * * \return The size of the connectivity. */ - AXOM_HOST_DEVICE inline const IndexingPolicy &indexing() const { return m_data.m_indexing; } + AXOM_HOST_DEVICE inline const IndexingPolicy& indexing() const { return m_data.m_indexing; } /*! * \brief Return a zone. diff --git a/src/axom/bump/views/UnstructuredTopologySingleShapeView.hpp b/src/axom/bump/views/UnstructuredTopologySingleShapeView.hpp index ba555274f1..ed6cbebc57 100644 --- a/src/axom/bump/views/UnstructuredTopologySingleShapeView.hpp +++ b/src/axom/bump/views/UnstructuredTopologySingleShapeView.hpp @@ -39,7 +39,7 @@ class UnstructuredTopologySingleShapeView * \param conn The mesh connectivity. */ AXOM_HOST_DEVICE - UnstructuredTopologySingleShapeView(const ConnectivityView &conn) + UnstructuredTopologySingleShapeView(const ConnectivityView& conn) : m_connectivityView(conn) , m_sizesView() , m_offsetsView() @@ -57,9 +57,9 @@ class UnstructuredTopologySingleShapeView * \param offsets The offset to each zone in the connectivity. */ AXOM_HOST_DEVICE - UnstructuredTopologySingleShapeView(const ConnectivityView &conn, - const ConnectivityView &sizes, - const ConnectivityView &offsets) + UnstructuredTopologySingleShapeView(const ConnectivityView& conn, + const ConnectivityView& sizes, + const ConnectivityView& offsets) : m_connectivityView(conn) , m_sizesView(sizes) , m_offsetsView(offsets) @@ -111,7 +111,7 @@ class UnstructuredTopologySingleShapeView * * \return The size of the connectivity. */ - AXOM_HOST_DEVICE inline const IndexingPolicy &indexing() const { return m_indexing; } + AXOM_HOST_DEVICE inline const IndexingPolicy& indexing() const { return m_indexing; } /*! * \brief Return a zone. diff --git a/src/axom/bump/views/dispatch_coordset.hpp b/src/axom/bump/views/dispatch_coordset.hpp index 97795fcce6..2aa7cb7cd5 100644 --- a/src/axom/bump/views/dispatch_coordset.hpp +++ b/src/axom/bump/views/dispatch_coordset.hpp @@ -39,11 +39,11 @@ struct make_rectilinear_coordset * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { namespace utils = axom::bump::utilities; verify(coordset, "coordset"); - const conduit::Node &values = coordset.fetch_existing("values"); + const conduit::Node& values = coordset.fetch_existing("values"); SLIC_ERROR_IF(values.number_of_children() != 3, "3D rectilinear coordsets require 3 component arrays."); auto xView = utils::make_array_view(values[0]); @@ -66,11 +66,11 @@ struct make_rectilinear_coordset * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { namespace utils = axom::bump::utilities; verify(coordset, "coordset"); - const conduit::Node &values = coordset.fetch_existing("values"); + const conduit::Node& values = coordset.fetch_existing("values"); SLIC_ERROR_IF(values.number_of_children() != 2, "2D rectilinear coordsets require 2 component arrays."); auto xView = utils::make_array_view(values[0]); @@ -99,11 +99,11 @@ struct make_uniform_coordset<3> * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { verify(coordset, "coordset"); const std::string keys[] = {"i", "j", "k"}; - const conduit::Node &n_dims = coordset["dims"]; + const conduit::Node& n_dims = coordset["dims"]; axom::StackArray dims; axom::StackArray origin {0., 0., 0.}, spacing {1., 1., 1.}; for(int i = 0; i < 3; i++) @@ -130,11 +130,11 @@ struct make_uniform_coordset<2> * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { verify(coordset, "coordset"); const std::string keys[] = {"i", "j"}; - const conduit::Node &n_dims = coordset["dims"]; + const conduit::Node& n_dims = coordset["dims"]; axom::StackArray dims; axom::StackArray origin {0., 0.}, spacing {1., 1.}; for(int i = 0; i < 2; i++) @@ -158,10 +158,10 @@ struct make_uniform_coordset<2> * \param func The function/lambda to invoke using the coordset view. */ template -void dispatch_uniform_coordset(const conduit::Node &coordset, FuncType &&func) +void dispatch_uniform_coordset(const conduit::Node& coordset, FuncType&& func) { verify(coordset, "coordset"); - const conduit::Node &n_dims = coordset["dims"]; + const conduit::Node& n_dims = coordset["dims"]; const conduit::index_t ndims = n_dims.number_of_children(); if(ndims == 2) { @@ -189,10 +189,10 @@ void dispatch_uniform_coordset(const conduit::Node &coordset, FuncType &&func) * \param func The function/lambda to invoke using the coordset view. */ template -void dispatch_rectilinear_coordset(const conduit::Node &coordset, FuncType &&func) +void dispatch_rectilinear_coordset(const conduit::Node& coordset, FuncType&& func) { verify(coordset, "coordset"); - const conduit::Node &values = coordset["values"]; + const conduit::Node& values = coordset["values"]; if(values.number_of_children() == 2) { axom::bump::views::floatNodeToArrayViewSame(values[0], values[1], [&](auto xView, auto yView) { @@ -237,11 +237,11 @@ struct make_explicit_coordset * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { namespace utils = axom::bump::utilities; verify(coordset, "coordset"); - const conduit::Node &values = coordset.fetch_existing("values"); + const conduit::Node& values = coordset.fetch_existing("values"); SLIC_ERROR_IF(values.number_of_children() != 3, "3D explicit coordsets require 3 component arrays."); auto x = utils::make_array_view(values[0]); @@ -264,11 +264,11 @@ struct make_explicit_coordset * \param topo The node containing the coordset. * \return The coordset view. */ - static CoordsetView view(const conduit::Node &coordset) + static CoordsetView view(const conduit::Node& coordset) { namespace utils = axom::bump::utilities; verify(coordset, "coordset"); - const conduit::Node &values = coordset.fetch_existing("values"); + const conduit::Node& values = coordset.fetch_existing("values"); SLIC_ERROR_IF(values.number_of_children() != 2, "2D explicit coordsets require 2 component arrays."); auto x = utils::make_array_view(values[0]); @@ -287,10 +287,10 @@ struct make_explicit_coordset * \param func The function/lambda to invoke using the coordset view. */ template -void dispatch_explicit_coordset(const conduit::Node &coordset, FuncType &&func) +void dispatch_explicit_coordset(const conduit::Node& coordset, FuncType&& func) { verify(coordset, "coordset"); - const conduit::Node &values = coordset["values"]; + const conduit::Node& values = coordset["values"]; if(values.number_of_children() == 2) { axom::bump::views::floatNodeToArrayViewSame(values[0], values[1], [&](auto xView, auto yView) { @@ -326,7 +326,7 @@ void dispatch_explicit_coordset(const conduit::Node &coordset, FuncType &&func) * \param func The function/lambda to invoke using the coordset view. */ template -void dispatch_coordset(const conduit::Node &coordset, FuncType &&func) +void dispatch_coordset(const conduit::Node& coordset, FuncType&& func) { const std::string cstype = coordset["type"].as_string(); if(cstype == "uniform") diff --git a/src/axom/bump/views/dispatch_material.hpp b/src/axom/bump/views/dispatch_material.hpp index 82fa5cd617..a73c26ec15 100644 --- a/src/axom/bump/views/dispatch_material.hpp +++ b/src/axom/bump/views/dispatch_material.hpp @@ -28,7 +28,7 @@ constexpr void verifyPositiveMaxMaterials() static_assert(MAXMATERIALS > 0, "MAXMATERIALS must be greater than 0."); } -inline void verifyMixedField(const conduit::Node &n_field) +inline void verifyMixedField(const conduit::Node& n_field) { SLIC_ERROR_IF(!n_field.has_path("matset_values"), "The mixed field does not contain matset_values"); @@ -47,9 +47,9 @@ inline void verifyMixedField(const conduit::Node &n_field) * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_unibuffer_with_values(const conduit::Node &matset, - const conduit::Node &values, - FuncType &&func) +bool dispatch_material_unibuffer_with_values(const conduit::Node& matset, + const conduit::Node& values, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); bool retval = false; @@ -88,14 +88,14 @@ bool dispatch_material_unibuffer_with_values(const conduit::Node &matset, * \return The material id for the named material. */ template -IntElement getMaterialID(const conduit::Node &matset, - const std::string &matName, +IntElement getMaterialID(const conduit::Node& matset, + const std::string& matName, IntElement defaultValue) { IntElement matno = static_cast(defaultValue); if(matset.has_child("material_map")) { - const conduit::Node &n_mm = matset["material_map"]; + const conduit::Node& n_mm = matset["material_map"]; if(n_mm.has_child(matName)) { matno = static_cast(n_mm[matName].to_int()); @@ -117,9 +117,9 @@ IntElement getMaterialID(const conduit::Node &matset, * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_element_dominant_with_values(const conduit::Node &matset, - const conduit::Node &values_object, - FuncType &&func) +bool dispatch_material_element_dominant_with_values(const conduit::Node& matset, + const conduit::Node& values_object, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); bool retval = false; @@ -129,7 +129,7 @@ bool dispatch_material_element_dominant_with_values(const conduit::Node &matset, { if(values_object.number_of_children() > 0) { - const conduit::Node &n_firstValues = values_object[0]; + const conduit::Node& n_firstValues = values_object[0]; floatNodeToArrayView(n_firstValues, [&](auto firstValues) { using FirstValuesView = std::remove_reference_t; using FloatElement = typename std::remove_const::type; @@ -140,9 +140,9 @@ bool dispatch_material_element_dominant_with_values(const conduit::Node &matset, for(conduit::index_t i = 0; i < values_object.number_of_children(); i++) { - const conduit::Node &values = values_object[i]; - const FloatElement *values_ptr = values.value(); - FloatView values_view(const_cast(values_ptr), + const conduit::Node& values = values_object[i]; + const FloatElement* values_ptr = values.value(); + FloatView values_view(const_cast(values_ptr), values.dtype().number_of_elements()); // Get the material number if we can. @@ -172,9 +172,9 @@ bool dispatch_material_element_dominant_with_values(const conduit::Node &matset, * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_material_dominant_with_values(const conduit::Node &matset, - const conduit::Node &values_object, - FuncType &&func) +bool dispatch_material_material_dominant_with_values(const conduit::Node& matset, + const conduit::Node& values_object, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); bool retval = false; @@ -182,12 +182,12 @@ bool dispatch_material_material_dominant_with_values(const conduit::Node &matset if(conduit::blueprint::mesh::matset::is_multi_buffer(matset) && conduit::blueprint::mesh::matset::is_material_dominant(matset)) { - const conduit::Node &element_ids = matset.fetch_existing("element_ids"); + const conduit::Node& element_ids = matset.fetch_existing("element_ids"); if(values_object.number_of_children() > 0 && values_object.number_of_children() == element_ids.number_of_children()) { - const conduit::Node &n_firstValues = values_object[0]; - const conduit::Node &n_firstIndices = element_ids[0]; + const conduit::Node& n_firstValues = values_object[0]; + const conduit::Node& n_firstIndices = element_ids[0]; indexNodeToArrayView(n_firstIndices, [&](auto firstIndices) { floatNodeToArrayView(n_firstValues, [&](auto firstValues) { @@ -202,15 +202,15 @@ bool dispatch_material_material_dominant_with_values(const conduit::Node &matset for(conduit::index_t i = 0; i < values_object.number_of_children(); i++) { - const conduit::Node &indices = element_ids[i]; - const conduit::Node &values = values_object[i]; + const conduit::Node& indices = element_ids[i]; + const conduit::Node& values = values_object[i]; - const IntElement *indices_ptr = indices.value(); - const FloatElement *values_ptr = values.value(); + const IntElement* indices_ptr = indices.value(); + const FloatElement* values_ptr = values.value(); - IntView indices_view(const_cast(indices_ptr), + IntView indices_view(const_cast(indices_ptr), indices.dtype().number_of_elements()); - FloatView values_view(const_cast(values_ptr), + FloatView values_view(const_cast(values_ptr), values.dtype().number_of_elements()); // Get the material number if we can. @@ -247,7 +247,7 @@ struct make_unibuffer_matset * * \return A UnibufferMaterialView. */ - static MatsetView view(const conduit::Node &n_matset) + static MatsetView view(const conduit::Node& n_matset) { namespace utils = axom::bump::utilities; verify(n_matset, "matset"); @@ -273,7 +273,7 @@ struct make_unibuffer_matset * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_unibuffer(const conduit::Node &matset, FuncType &&func) +bool dispatch_material_unibuffer(const conduit::Node& matset, FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -295,7 +295,7 @@ bool dispatch_material_unibuffer(const conduit::Node &matset, FuncType &&func) * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_element_dominant(const conduit::Node &matset, FuncType &&func) +bool dispatch_material_element_dominant(const conduit::Node& matset, FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -315,7 +315,7 @@ bool dispatch_material_element_dominant(const conduit::Node &matset, FuncType && * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material_material_dominant(const conduit::Node &matset, FuncType &&func) +bool dispatch_material_material_dominant(const conduit::Node& matset, FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -336,7 +336,7 @@ bool dispatch_material_material_dominant(const conduit::Node &matset, FuncType & * \return true if the dispatch worked, false otherwise. */ template -bool dispatch_material(const conduit::Node &matset, FuncType &&func) +bool dispatch_material(const conduit::Node& matset, FuncType&& func) { detail::verifyPositiveMaxMaterials(); bool retval = diff --git a/src/axom/bump/views/dispatch_material_field.hpp b/src/axom/bump/views/dispatch_material_field.hpp index 690aa4354e..421a66bf02 100644 --- a/src/axom/bump/views/dispatch_material_field.hpp +++ b/src/axom/bump/views/dispatch_material_field.hpp @@ -17,8 +17,8 @@ namespace views { namespace detail { -inline void verifyMatchingMaterialOrder(const conduit::Node &mat_values, - const conduit::Node &field_values) +inline void verifyMatchingMaterialOrder(const conduit::Node& mat_values, + const conduit::Node& field_values) { SLIC_ERROR_IF( mat_values.number_of_children() != field_values.number_of_children(), @@ -40,11 +40,11 @@ inline void verifyMatchingMaterialOrder(const conduit::Node &mat_values, * \tparam FuncType The function/lambda type to call on the MixedFieldView. */ template -bool dispatch_unibuffer_field(const conduit::Node &n_field, FuncType &&func) +bool dispatch_unibuffer_field(const conduit::Node& n_field, FuncType&& func) { bool rv = false; detail::verifyMixedField(n_field); - const conduit::Node &matset_values = n_field["matset_values"]; + const conduit::Node& matset_values = n_field["matset_values"]; SLIC_ERROR_IF(!matset_values.dtype().is_number(), "The matset_values must be a number."); // NOTE: For now support float, double types. axom::bump::views::floatNodeToArrayView(matset_values, [&](auto valuesView) { @@ -65,11 +65,11 @@ bool dispatch_unibuffer_field(const conduit::Node &n_field, FuncType &&func) * \tparam FuncType The function/lambda type to call on the MixedFieldView. */ template -bool dispatch_multibuffer_field(const conduit::Node &n_field, FuncType &&func) +bool dispatch_multibuffer_field(const conduit::Node& n_field, FuncType&& func) { bool rv = false; detail::verifyMixedField(n_field); - const conduit::Node &matset_values = n_field["matset_values"]; + const conduit::Node& matset_values = n_field["matset_values"]; SLIC_ERROR_IF(matset_values.number_of_children() < 1, "Missing fields in matset_values."); // NOTE: For now support float, double types. axom::bump::views::floatNodeToArrayView(matset_values[0], [&](auto firstValuesView) { @@ -99,9 +99,9 @@ bool dispatch_multibuffer_field(const conduit::Node &n_field, FuncType &&func) * \param func The function/lambda that will operate on the matset and mixed field views. */ template -bool dispatch_material_unibuffer_field(const conduit::Node &matset, - const conduit::Node &n_field, - FuncType &&func) +bool dispatch_material_unibuffer_field(const conduit::Node& matset, + const conduit::Node& n_field, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -130,9 +130,9 @@ bool dispatch_material_unibuffer_field(const conduit::Node &matset, * \param func The function/lambda that will operate on the matset and mixed field views. */ template -bool dispatch_material_element_dominant_field(const conduit::Node &matset, - const conduit::Node &n_field, - FuncType &&func) +bool dispatch_material_element_dominant_field(const conduit::Node& matset, + const conduit::Node& n_field, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -161,9 +161,9 @@ bool dispatch_material_element_dominant_field(const conduit::Node &matset, * \param func The function/lambda that will operate on the matset and mixed field views. */ template -bool dispatch_material_material_dominant_field(const conduit::Node &matset, - const conduit::Node &n_field, - FuncType &&func) +bool dispatch_material_material_dominant_field(const conduit::Node& matset, + const conduit::Node& n_field, + FuncType&& func) { detail::verifyPositiveMaxMaterials(); verify(matset, "matset"); @@ -193,7 +193,7 @@ bool dispatch_material_material_dominant_field(const conduit::Node &matset, * \param func The function/lambda that will operate on the matset and mixed field views. */ template -bool dispatch_material_field(const conduit::Node &matset, const conduit::Node &n_field, FuncType &&func) +bool dispatch_material_field(const conduit::Node& matset, const conduit::Node& n_field, FuncType&& func) { detail::verifyPositiveMaxMaterials(); bool retval = diff --git a/src/axom/bump/views/dispatch_rectilinear_topology.hpp b/src/axom/bump/views/dispatch_rectilinear_topology.hpp index d4285a10cc..1fcc38b093 100644 --- a/src/axom/bump/views/dispatch_rectilinear_topology.hpp +++ b/src/axom/bump/views/dispatch_rectilinear_topology.hpp @@ -38,14 +38,14 @@ struct make_rectilinear_topology<3> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); const auto axes = conduit::blueprint::mesh::utils::coordset::axes(*coordset); - const conduit::Node &values = coordset->fetch_existing("values"); + const conduit::Node& values = coordset->fetch_existing("values"); LogicalIndex zoneDims; zoneDims[0] = values.fetch_existing(axes[0]).dtype().number_of_elements() - 1; zoneDims[1] = values.fetch_existing(axes[1]).dtype().number_of_elements() - 1; @@ -58,7 +58,7 @@ struct make_rectilinear_topology<3> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -76,14 +76,14 @@ struct make_rectilinear_topology<2> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); const auto axes = conduit::blueprint::mesh::utils::coordset::axes(*coordset); - const conduit::Node &values = coordset->fetch_existing("values"); + const conduit::Node& values = coordset->fetch_existing("values"); LogicalIndex zoneDims; zoneDims[0] = values.fetch_existing(axes[0]).dtype().number_of_elements() - 1; zoneDims[1] = values.fetch_existing(axes[1]).dtype().number_of_elements() - 1; @@ -95,7 +95,7 @@ struct make_rectilinear_topology<2> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -113,14 +113,14 @@ struct make_rectilinear_topology<1> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); const auto axes = conduit::blueprint::mesh::utils::coordset::axes(*coordset); - const conduit::Node &values = coordset->fetch_existing("values"); + const conduit::Node& values = coordset->fetch_existing("values"); LogicalIndex zoneDims; zoneDims[0] = values.fetch_existing(axes[0]).dtype().number_of_elements() - 1; return Indexing(zoneDims); @@ -131,7 +131,7 @@ struct make_rectilinear_topology<1> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; namespace internal @@ -142,8 +142,8 @@ namespace internal template struct dispatch_one_rectilinear_topology { - static void execute(const conduit::Node &AXOM_UNUSED_PARAM(topo), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(const conduit::Node& AXOM_UNUSED_PARAM(topo), + FuncType&& AXOM_UNUSED_PARAM(func)) { } }; @@ -160,7 +160,7 @@ struct dispatch_one_rectilinear_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_rectilinear_topology<3>::view(topo); const std::string shape("hex"); @@ -181,7 +181,7 @@ struct dispatch_one_rectilinear_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_rectilinear_topology<2>::view(topo); const std::string shape("quad"); @@ -202,7 +202,7 @@ struct dispatch_one_rectilinear_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_rectilinear_topology<1>::view(topo); const std::string shape("line"); @@ -222,10 +222,10 @@ struct dispatch_one_rectilinear_topology * \param func The function to invoke using the view. */ template -void dispatch_rectilinear_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_rectilinear_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); const auto axes = conduit::blueprint::mesh::utils::coordset::axes(*coordset); diff --git a/src/axom/bump/views/dispatch_structured_topology.hpp b/src/axom/bump/views/dispatch_structured_topology.hpp index d87c736595..a329a170e0 100644 --- a/src/axom/bump/views/dispatch_structured_topology.hpp +++ b/src/axom/bump/views/dispatch_structured_topology.hpp @@ -47,7 +47,7 @@ struct make_strided_structured_topology<3> * \param topo The node containing the topology. * \return The indexing */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -91,7 +91,7 @@ struct make_strided_structured_topology<3> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -109,7 +109,7 @@ struct make_strided_structured_topology<2> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -146,7 +146,7 @@ struct make_strided_structured_topology<2> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -164,7 +164,7 @@ struct make_strided_structured_topology<1> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -189,7 +189,7 @@ struct make_strided_structured_topology<1> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -214,7 +214,7 @@ struct make_structured_topology<3> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); LogicalIndex zoneDims; @@ -230,7 +230,7 @@ struct make_structured_topology<3> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -248,7 +248,7 @@ struct make_structured_topology<2> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); LogicalIndex zoneDims; @@ -262,7 +262,7 @@ struct make_structured_topology<2> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -280,7 +280,7 @@ struct make_structured_topology<1> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); LogicalIndex zoneDims; @@ -294,7 +294,7 @@ struct make_structured_topology<1> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; //------------------------------------------------------------------------------ @@ -306,8 +306,8 @@ namespace internal template struct dispatch_only_structured_topology { - static void execute(const conduit::Node &AXOM_UNUSED_PARAM(topo), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(const conduit::Node& AXOM_UNUSED_PARAM(topo), + FuncType&& AXOM_UNUSED_PARAM(func)) { } }; @@ -324,7 +324,7 @@ struct dispatch_only_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("elements/dims/offsets"); const std::string stridesKey("elements/dims/strides"); @@ -355,7 +355,7 @@ struct dispatch_only_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("elements/dims/offsets"); const std::string stridesKey("elements/dims/strides"); @@ -386,7 +386,7 @@ struct dispatch_only_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("elements/dims/offsets"); const std::string stridesKey("elements/dims/strides"); @@ -411,8 +411,8 @@ struct dispatch_only_structured_topology template struct dispatch_any_structured_topology { - static void execute(const conduit::Node &AXOM_UNUSED_PARAM(topo), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(const conduit::Node& AXOM_UNUSED_PARAM(topo), + FuncType&& AXOM_UNUSED_PARAM(func)) { } }; @@ -429,7 +429,7 @@ struct dispatch_any_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("offsets"), stridesKey("strides"); const std::string type = topo.fetch_existing("type").as_string(); @@ -468,7 +468,7 @@ struct dispatch_any_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("offsets"), stridesKey("strides"); const std::string type = topo.fetch_existing("type").as_string(); @@ -506,7 +506,7 @@ struct dispatch_any_structured_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { const std::string offsetsKey("offsets"), stridesKey("strides"); const std::string type = topo.fetch_existing("type").as_string(); @@ -536,7 +536,7 @@ struct dispatch_any_structured_topology * \param func The function to invoke using the view. It should accept a string with the shape name and an auto parameter for the view. */ template -void dispatch_structured_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_structured_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); int ndims = 1; @@ -577,7 +577,7 @@ void dispatch_structured_topology(const conduit::Node &topo, FuncType &&func) * \note We try to initialize the topoView for each dimension and share the dispatch. */ template -void dispatch_structured_topologies(const conduit::Node &topo, FuncType &&func) +void dispatch_structured_topologies(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); const auto ndims = conduit::blueprint::mesh::utils::topology::dims(topo); diff --git a/src/axom/bump/views/dispatch_topology.hpp b/src/axom/bump/views/dispatch_topology.hpp index a9a208917d..7411338d24 100644 --- a/src/axom/bump/views/dispatch_topology.hpp +++ b/src/axom/bump/views/dispatch_topology.hpp @@ -32,7 +32,7 @@ namespace views * \param func The function to invoke using the view. It should accept a string with the shape name and an auto parameter for the view. */ template -void dispatch_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); const auto type = topo.fetch_existing("type").as_string(); diff --git a/src/axom/bump/views/dispatch_uniform_topology.hpp b/src/axom/bump/views/dispatch_uniform_topology.hpp index acb9ee361b..8e540e4976 100644 --- a/src/axom/bump/views/dispatch_uniform_topology.hpp +++ b/src/axom/bump/views/dispatch_uniform_topology.hpp @@ -40,13 +40,13 @@ struct make_uniform_topology<3> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); - const conduit::Node &n_dims = coordset->fetch_existing("dims"); + const conduit::Node& n_dims = coordset->fetch_existing("dims"); LogicalIndex zoneDims; zoneDims[0] = n_dims[0].to_index_t() - 1; zoneDims[1] = n_dims[1].to_index_t() - 1; @@ -59,7 +59,7 @@ struct make_uniform_topology<3> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -77,13 +77,13 @@ struct make_uniform_topology<2> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); - const conduit::Node &n_dims = coordset->fetch_existing("dims"); + const conduit::Node& n_dims = coordset->fetch_existing("dims"); LogicalIndex zoneDims; zoneDims[0] = n_dims[0].to_index_t() - 1; zoneDims[1] = n_dims[1].to_index_t() - 1; @@ -95,7 +95,7 @@ struct make_uniform_topology<2> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; /*! @@ -113,13 +113,13 @@ struct make_uniform_topology<1> * \param topo The node containing the topology. * \return The indexing. */ - static Indexing indexing(const conduit::Node &topo) + static Indexing indexing(const conduit::Node& topo) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); - const conduit::Node &n_dims = coordset->fetch_existing("dims"); + const conduit::Node& n_dims = coordset->fetch_existing("dims"); LogicalIndex zoneDims; zoneDims[0] = n_dims[0].to_index_t() - 1; return Indexing(zoneDims); @@ -130,7 +130,7 @@ struct make_uniform_topology<1> * \param topo The node containing the topology. * \return The topology view. */ - static TopoView view(const conduit::Node &topo) { return TopoView(indexing(topo)); } + static TopoView view(const conduit::Node& topo) { return TopoView(indexing(topo)); } }; namespace internal @@ -141,8 +141,8 @@ namespace internal template struct dispatch_one_uniform_topology { - static void execute(const conduit::Node &AXOM_UNUSED_PARAM(topo), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(const conduit::Node& AXOM_UNUSED_PARAM(topo), + FuncType&& AXOM_UNUSED_PARAM(func)) { } }; @@ -159,7 +159,7 @@ struct dispatch_one_uniform_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_uniform_topology<3>::view(topo); const std::string shape("hex"); @@ -180,7 +180,7 @@ struct dispatch_one_uniform_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_uniform_topology<2>::view(topo); const std::string shape("quad"); @@ -201,7 +201,7 @@ struct dispatch_one_uniform_topology * \param topo The node that contains the topology. * \param func The kernel to be invoked. */ - static void execute(const conduit::Node &topo, FuncType &&func) + static void execute(const conduit::Node& topo, FuncType&& func) { auto topoView = make_uniform_topology<1>::view(topo); const std::string shape("line"); @@ -221,13 +221,13 @@ struct dispatch_one_uniform_topology * \param func The function to invoke using the view. */ template -void dispatch_uniform_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_uniform_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); - const conduit::Node *coordset = + const conduit::Node* coordset = conduit::blueprint::mesh::utils::find_reference_node(topo, "coordset"); SLIC_ASSERT(coordset != nullptr); - const conduit::Node &n_dims = coordset->fetch_existing("dims"); + const conduit::Node& n_dims = coordset->fetch_existing("dims"); switch(n_dims.dtype().number_of_elements()) { case 3: diff --git a/src/axom/bump/views/dispatch_unstructured_topology.hpp b/src/axom/bump/views/dispatch_unstructured_topology.hpp index b03bbfe10a..33aa43e2ad 100644 --- a/src/axom/bump/views/dispatch_unstructured_topology.hpp +++ b/src/axom/bump/views/dispatch_unstructured_topology.hpp @@ -45,7 +45,7 @@ struct make_unstructured_single_shape_topology * * \return The topology view that wraps the Conduit data. */ - static TopologyView view(const conduit::Node &n_topo) + static TopologyView view(const conduit::Node& n_topo) { namespace utils = axom::bump::utilities; verify(n_topo, "topology"); @@ -94,7 +94,7 @@ struct make_unstructured_polyhedral_topology * * \return The topology view that wraps the Conduit data. */ - static TopologyView view(const conduit::Node &n_topo) + static TopologyView view(const conduit::Node& n_topo) { namespace utils = axom::bump::utilities; verify(n_topo, "topology"); @@ -126,7 +126,7 @@ struct make_unstructured_polyhedral_topology */ ///@{ template -void dispatch_unstructured_polyhedral_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_unstructured_polyhedral_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); const std::string shape = topo["elements/shape"].as_string(); @@ -158,7 +158,7 @@ void dispatch_unstructured_polyhedral_topology(const conduit::Node &topo, FuncTy } template -void typed_dispatch_unstructured_polyhedral_topology(const conduit::Node &topo, FuncType &&func) +void typed_dispatch_unstructured_polyhedral_topology(const conduit::Node& topo, FuncType&& func) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -185,7 +185,7 @@ void typed_dispatch_unstructured_polyhedral_topology(const conduit::Node &topo, */ ///@{ template -void dispatch_unstructured_mixed_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_unstructured_mixed_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); const std::string shape = topo["elements/shape"].as_string(); @@ -218,7 +218,7 @@ void dispatch_unstructured_mixed_topology(const conduit::Node &topo, FuncType && } template -void typed_dispatch_unstructured_mixed_topology(const conduit::Node &topo, FuncType &&func) +void typed_dispatch_unstructured_mixed_topology(const conduit::Node& topo, FuncType&& func) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -282,21 +282,21 @@ struct dispatch_shape /*! * \brief Execute method that gets generated when a shape is not enabled or supported. Do nothing. */ - static void execute(bool &AXOM_UNUSED_PARAM(eligible), - const std::string &AXOM_UNUSED_PARAM(shape), - const axom::ArrayView &AXOM_UNUSED_PARAM(connView), - const axom::ArrayView &AXOM_UNUSED_PARAM(sizesView), - const axom::ArrayView &AXOM_UNUSED_PARAM(offsetsView), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(bool& AXOM_UNUSED_PARAM(eligible), + const std::string& AXOM_UNUSED_PARAM(shape), + const axom::ArrayView& AXOM_UNUSED_PARAM(connView), + const axom::ArrayView& AXOM_UNUSED_PARAM(sizesView), + const axom::ArrayView& AXOM_UNUSED_PARAM(offsetsView), + FuncType&& AXOM_UNUSED_PARAM(func)) { } /*! * \brief Execute method that gets generated when a shape is not enabled or supported. Do nothing. */ - static void execute(bool &AXOM_UNUSED_PARAM(eligible), - const std::string &AXOM_UNUSED_PARAM(shape), - const conduit::Node &AXOM_UNUSED_PARAM(topo), - FuncType &&AXOM_UNUSED_PARAM(func)) + static void execute(bool& AXOM_UNUSED_PARAM(eligible), + const std::string& AXOM_UNUSED_PARAM(shape), + const conduit::Node& AXOM_UNUSED_PARAM(topo), + FuncType&& AXOM_UNUSED_PARAM(func)) { } }; @@ -305,12 +305,12 @@ struct dispatch_shape template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "tri") { @@ -324,12 +324,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "quad") { @@ -343,12 +343,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "polygonal") { @@ -364,12 +364,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "tet") { @@ -383,12 +383,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "pyramid") { @@ -404,12 +404,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "wedge") { @@ -425,12 +425,12 @@ struct dispatch_shape, FuncType> template struct dispatch_shape, FuncType> { - static void execute(bool &eligible, - const std::string &shape, - const axom::ArrayView &connView, - const axom::ArrayView &sizesView, - const axom::ArrayView &offsetsView, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const axom::ArrayView& connView, + const axom::ArrayView& sizesView, + const axom::ArrayView& offsetsView, + FuncType&& func) { if(eligible && shape == "hex") { @@ -447,10 +447,10 @@ struct SelectMixedShape template struct dispatch_shape { - static void execute(bool &eligible, - const std::string &shape, - const conduit::Node &topo, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const conduit::Node& topo, + FuncType&& func) { if(eligible && shape == "mixed") { @@ -466,10 +466,10 @@ struct SelectPHShape template struct dispatch_shape { - static void execute(bool &eligible, - const std::string &shape, - const conduit::Node &topo, - FuncType &&func) + static void execute(bool& eligible, + const std::string& shape, + const conduit::Node& topo, + FuncType&& func) { if(eligible && shape == "polyhedral") { @@ -493,7 +493,7 @@ struct dispatch_shape * \param func The function/lambda to call with the topology view. */ template -void typed_dispatch_unstructured_topology(const conduit::Node &topo, FuncType &&func) +void typed_dispatch_unstructured_topology(const conduit::Node& topo, FuncType&& func) { namespace utils = axom::bump::utilities; verify(topo, "topology"); @@ -594,7 +594,7 @@ void typed_dispatch_unstructured_topology(const conduit::Node &topo, FuncType && /// Dispatch in a way that does not care about the connectivity type. template -void dispatch_unstructured_topology(const conduit::Node &topo, FuncType &&func) +void dispatch_unstructured_topology(const conduit::Node& topo, FuncType&& func) { verify(topo, "topology"); indexNodeToArrayView(topo["elements/connectivity"], [&](auto connView) { diff --git a/src/axom/bump/views/dispatch_utilities.cpp b/src/axom/bump/views/dispatch_utilities.cpp index eaa58b4d1f..3f60e563d0 100644 --- a/src/axom/bump/views/dispatch_utilities.cpp +++ b/src/axom/bump/views/dispatch_utilities.cpp @@ -17,7 +17,7 @@ namespace bump namespace views { -static bool needToPerformCheck(const conduit::Node &obj, const std::string &protocol) +static bool needToPerformCheck(const conduit::Node& obj, const std::string& protocol) { bool performCheck = true; @@ -27,7 +27,7 @@ static bool needToPerformCheck(const conduit::Node &obj, const std::string &prot if(protocol == "topology") { - const conduit::Node &n_topo = obj; + const conduit::Node& n_topo = obj; if(n_topo["type"].as_string() == "unstructured" && n_topo.has_path("elements/shape")) { if(n_topo["elements/shape"].as_string() == "mixed" && n_topo.has_path("elements/shapes")) @@ -40,7 +40,7 @@ static bool needToPerformCheck(const conduit::Node &obj, const std::string &prot return performCheck; } -void verify(const conduit::Node &obj, const std::string &protocol) +void verify(const conduit::Node& obj, const std::string& protocol) { conduit::Node info; diff --git a/src/axom/bump/views/dispatch_utilities.hpp b/src/axom/bump/views/dispatch_utilities.hpp index cf7ef5c019..afcbeac67f 100644 --- a/src/axom/bump/views/dispatch_utilities.hpp +++ b/src/axom/bump/views/dispatch_utilities.hpp @@ -36,7 +36,7 @@ constexpr bool dimension_selected(int encoded_dims, int dim) { return encoded_di * \param protocol The name of the item to check in the mesh. If the string is empty, * \a obj node is treated as a mesh and it all gets checked. */ -void verify(const conduit::Node &obj, const std::string &protocol = std::string()); +void verify(const conduit::Node& obj, const std::string& protocol = std::string()); } // end namespace views } // end namespace bump diff --git a/src/axom/core/StaticArray.hpp b/src/axom/core/StaticArray.hpp index 9205886500..37a3ff8472 100644 --- a/src/axom/core/StaticArray.hpp +++ b/src/axom/core/StaticArray.hpp @@ -46,7 +46,7 @@ class StaticArray : public StackArray * \brief Copy Constructor * \param obj The object to be copied. */ - AXOM_HOST_DEVICE StaticArray(const StaticArray &obj) : StackArray(obj), m_size(obj.m_size) + AXOM_HOST_DEVICE StaticArray(const StaticArray& obj) : StackArray(obj), m_size(obj.m_size) { for(axom::IndexType i = 0; i < obj.m_size; i++) { @@ -63,7 +63,7 @@ class StaticArray : public StackArray * \brief Copy assignment operator. * \param obj The object to be copied. */ - AXOM_HOST_DEVICE StaticArray &operator=(const StaticArray &obj) + AXOM_HOST_DEVICE StaticArray& operator=(const StaticArray& obj) { if(this == &obj) { @@ -106,7 +106,7 @@ class StaticArray : public StackArray * will not modify the static array. */ AXOM_HOST_DEVICE - void push_back(const T &obj) + void push_back(const T& obj) { assert(m_size < capacity()); if(m_size < capacity()) @@ -149,9 +149,9 @@ class StaticArray : public StackArray * \param fill_value The fill value. */ AXOM_HOST_DEVICE - void fill(const T &fill_value) + void fill(const T& fill_value) { - for(T &datum : StackArray::m_data) + for(T& datum : StackArray::m_data) { datum = fill_value; } diff --git a/src/axom/core/examples/core_acceleration.cpp b/src/axom/core/examples/core_acceleration.cpp index 35e50e4de5..1e84a36b39 100644 --- a/src/axom/core/examples/core_acceleration.cpp +++ b/src/axom/core/examples/core_acceleration.cpp @@ -35,8 +35,8 @@ constexpr int N = 1000; void demoMemoryManageBasic() { // _membasic_start - int *dynamic_memory_array; - int *dyn_array_dst; + int* dynamic_memory_array; + int* dyn_array_dst; int len = 20; //Allocation looks similar to use of malloc() in C -- just template @@ -96,9 +96,9 @@ void demoAxomExecution() // _exebasic_start //This part of the code works regardless of Umpire's presence, allowing for generic //use of axom::allocate in C++ code. - int *A = axom::allocate(N); - int *B = axom::allocate(N); - int *C = axom::allocate(N); + int* A = axom::allocate(N); + int* B = axom::allocate(N); + int* C = axom::allocate(N); for(int i = 0; i < N; i++) { @@ -175,7 +175,7 @@ void demoAxomExecution() //_gpu_atomic_start - int *sum = axom::allocate(1, allocator_id); + int* sum = axom::allocate(1, allocator_id); *sum = 0; // Increment sum 100 times @@ -190,7 +190,7 @@ void demoAxomExecution() #endif } -int main(int AXOM_UNUSED_PARAM(argc), char **AXOM_UNUSED_PARAM(argv)) +int main(int AXOM_UNUSED_PARAM(argc), char** AXOM_UNUSED_PARAM(argv)) { demoMemoryManageBasic(); demoAxomExecution(); diff --git a/src/axom/core/execution/for_all.hpp b/src/axom/core/execution/for_all.hpp index 68c52bf9ac..a789ed67d5 100644 --- a/src/axom/core/execution/for_all.hpp +++ b/src/axom/core/execution/for_all.hpp @@ -50,7 +50,7 @@ namespace axom * */ template -inline void for_all(const IndexType &begin, const IndexType &end, KernelType &&kernel) noexcept +inline void for_all(const IndexType& begin, const IndexType& end, KernelType&& kernel) noexcept { AXOM_STATIC_ASSERT(execution_space::valid()); @@ -97,7 +97,7 @@ inline void for_all(const IndexType &begin, const IndexType &end, KernelType &&k * */ template -inline void for_all(const IndexType &N, KernelType &&kernel) noexcept +inline void for_all(const IndexType& N, KernelType&& kernel) noexcept { AXOM_STATIC_ASSERT(execution_space::valid()); for_all(0, N, std::forward(kernel)); @@ -136,9 +136,9 @@ inline void for_all(const IndexType &N, KernelType &&kernel) noexcept * */ template -inline void for_all(const axom::StackArray &iRange, - const axom::StackArray &jRange, - KernelType &&kernel) noexcept +inline void for_all(const axom::StackArray& iRange, + const axom::StackArray& jRange, + KernelType&& kernel) noexcept { AXOM_STATIC_ASSERT(execution_space::valid()); assert(iRange[1] >= iRange[0] && jRange[1] >= jRange[0]); @@ -191,7 +191,7 @@ inline void for_all(const axom::StackArray &iRange, */ template -inline void for_all(const axom::StackArray &shape, KernelType &&kernel) noexcept +inline void for_all(const axom::StackArray& shape, KernelType&& kernel) noexcept { for_all(axom::StackArray {{0, shape[0]}}, axom::StackArray {{0, shape[1]}}, @@ -234,10 +234,10 @@ inline void for_all(const axom::StackArray &shape, KernelType &&ke * */ template -inline void for_all(const axom::StackArray &iRange, - const axom::StackArray &jRange, - const axom::StackArray &kRange, - KernelType &&kernel) noexcept +inline void for_all(const axom::StackArray& iRange, + const axom::StackArray& jRange, + const axom::StackArray& kRange, + KernelType&& kernel) noexcept { AXOM_STATIC_ASSERT(execution_space::valid()); assert(iRange[1] >= iRange[0] && jRange[1] >= jRange[0] && kRange[1] >= kRange[0]); @@ -294,7 +294,7 @@ inline void for_all(const axom::StackArray &iRange, * */ template -inline void for_all(const StackArray &shape, KernelType &&kernel) noexcept +inline void for_all(const StackArray& shape, KernelType&& kernel) noexcept { for_all(axom::StackArray {{0, shape[0]}}, axom::StackArray {{0, shape[1]}}, diff --git a/src/axom/core/execution/reductions.hpp b/src/axom/core/execution/reductions.hpp index fedd16bdf5..2a56320d4a 100644 --- a/src/axom/core/execution/reductions.hpp +++ b/src/axom/core/execution/reductions.hpp @@ -68,7 +68,7 @@ class ReduceSum ReduceSum(T v_start) : m_value(v_start), m_value_ptr(&m_value) { } - ReduceSum(const ReduceSum &v) + ReduceSum(const ReduceSum& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) // this is where the magic happens @@ -82,7 +82,7 @@ class ReduceSum private: T m_value; - T *m_value_ptr; + T* m_value_ptr; }; /*! @@ -99,7 +99,7 @@ class ReduceMin ReduceMin(T v_start) : m_value(v_start), m_value_ptr(&m_value) { } - ReduceMin(const ReduceMin &v) + ReduceMin(const ReduceMin& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) // this is where the magic happens @@ -117,7 +117,7 @@ class ReduceMin private: T m_value; - T *m_value_ptr; + T* m_value_ptr; }; /*! @@ -144,7 +144,7 @@ class ReduceMinLoc , m_index_ptr(&m_index) { } - ReduceMinLoc(const ReduceMinLoc &v) + ReduceMinLoc(const ReduceMinLoc& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) @@ -169,9 +169,9 @@ class ReduceMinLoc private: T m_value; - T *m_value_ptr; + T* m_value_ptr; axom::IndexType m_index; - axom::IndexType *m_index_ptr; + axom::IndexType* m_index_ptr; }; /*! @@ -188,7 +188,7 @@ class ReduceMax ReduceMax(T v_start) : m_value(v_start), m_value_ptr(&m_value) { } - ReduceMax(const ReduceMax &v) + ReduceMax(const ReduceMax& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) // this is where the magic happens @@ -207,7 +207,7 @@ class ReduceMax private: T m_value; - T *m_value_ptr; + T* m_value_ptr; }; /*! @@ -234,7 +234,7 @@ class ReduceMaxLoc , m_index_ptr(&m_index) { } - ReduceMaxLoc(const ReduceMaxLoc &v) + ReduceMaxLoc(const ReduceMaxLoc& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) @@ -260,9 +260,9 @@ class ReduceMaxLoc private: T m_value; - T *m_value_ptr; + T* m_value_ptr; axom::IndexType m_index; - axom::IndexType *m_index_ptr; + axom::IndexType* m_index_ptr; }; /*! @@ -279,7 +279,7 @@ class ReduceBitAnd ReduceBitAnd(T v_start) : m_value(v_start), m_value_ptr(&m_value) { } - ReduceBitAnd(const ReduceBitAnd &v) + ReduceBitAnd(const ReduceBitAnd& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) // this is where the magic happens @@ -291,7 +291,7 @@ class ReduceBitAnd private: T m_value; - T *m_value_ptr; + T* m_value_ptr; }; /*! @@ -308,7 +308,7 @@ class ReduceBitOr ReduceBitOr(T v_start) : m_value(v_start), m_value_ptr(&m_value) { } - ReduceBitOr(const ReduceBitOr &v) + ReduceBitOr(const ReduceBitOr& v) : m_value(v.m_value) , // will be unused in copies m_value_ptr(v.m_value_ptr) // this is where the magic happens @@ -320,7 +320,7 @@ class ReduceBitOr private: T m_value; - T *m_value_ptr; + T* m_value_ptr; }; } // namespace reductions diff --git a/src/axom/core/execution/runtime_policy.hpp b/src/axom/core/execution/runtime_policy.hpp index 67f154c15a..565de60184 100644 --- a/src/axom/core/execution/runtime_policy.hpp +++ b/src/axom/core/execution/runtime_policy.hpp @@ -109,7 +109,7 @@ enum class Policy }; // clang-format on -inline Policy nameToPolicy(const std::string &name) { return s_nameToPolicy.find(name)->second; } +inline Policy nameToPolicy(const std::string& name) { return s_nameToPolicy.find(name)->second; } inline std::string policyToName(Policy policy) { return s_policyToName.find(policy)->second; } diff --git a/src/axom/core/execution/scans.hpp b/src/axom/core/execution/scans.hpp index ce9d1be99d..f011fc9ed6 100644 --- a/src/axom/core/execution/scans.hpp +++ b/src/axom/core/execution/scans.hpp @@ -57,7 +57,7 @@ namespace axom * */ template -inline void exclusive_scan(const Container1 &input, Container2 &&output) +inline void exclusive_scan(const Container1& input, Container2&& output) { assert(input.size() == output.size()); using OutContainer = std::remove_reference_t; @@ -108,7 +108,7 @@ inline void exclusive_scan(const Container1 &input, Container2 &&output) * type of data stored in the container. */ template -inline void exclusive_scan_inplace(Container &&input) +inline void exclusive_scan_inplace(Container&& input) { #if defined(AXOM_USE_RAJA) using loop_policy = typename axom::execution_space::loop_policy; @@ -163,7 +163,7 @@ inline void exclusive_scan_inplace(Container &&input) * */ template -inline void inclusive_scan(const Container1 &input, Container2 &&output) +inline void inclusive_scan(const Container1& input, Container2&& output) { assert(input.size() == output.size()); using OutContainer = std::remove_reference_t; @@ -204,7 +204,7 @@ inline void inclusive_scan(const Container1 &input, Container2 &&output) * type of data stored in the container. */ template -inline void inclusive_scan_inplace(Container &&input) +inline void inclusive_scan_inplace(Container&& input) { #if defined(AXOM_USE_RAJA) using loop_policy = typename axom::execution_space::loop_policy; diff --git a/src/axom/core/execution/sorts.hpp b/src/axom/core/execution/sorts.hpp index a36dc29e23..7a339909b7 100644 --- a/src/axom/core/execution/sorts.hpp +++ b/src/axom/core/execution/sorts.hpp @@ -33,7 +33,7 @@ namespace axom * \param size The number of elements to sort. */ template -inline void sort(T *input, axom::IndexType size) +inline void sort(T* input, axom::IndexType size) { #if defined(AXOM_USE_RAJA) // Sort using RAJA @@ -55,7 +55,7 @@ inline void sort(T *input, axom::IndexType size) * \param input The container to sort. */ template -inline void sort(ContiguousMemoryContainer &input) +inline void sort(ContiguousMemoryContainer& input) { sort(input.data(), input.size()); } @@ -72,7 +72,7 @@ inline void sort(ContiguousMemoryContainer &input) * \param input2 A second container to sort (according to input1's sort order). */ template -inline void sort_pairs(Container1 &input1, Container2 &input2) +inline void sort_pairs(Container1& input1, Container2& input2) { assert(input1.size() == input2.size()); @@ -103,7 +103,7 @@ inline void sort_pairs(Container1 &input1, Container2 &input2) * \param size The number of elements in input1 and input2. */ template -inline void stable_sort_pairs(T *input1, U *input2, axom::IndexType size) +inline void stable_sort_pairs(T* input1, U* input2, axom::IndexType size) { #if defined(AXOM_USE_RAJA) // Sort using RAJA @@ -146,7 +146,7 @@ inline void stable_sort_pairs(T *input1, U *input2, axom::IndexType size) * \param size The number of elements in input1 and input2. */ template -inline void stable_sort_pairs(Container1 &input1, Container2 &input2) +inline void stable_sort_pairs(Container1& input1, Container2& input2) { assert(input1.size() == input2.size()); stable_sort_pairs(input1.data(), input2.data(), input1.size()); diff --git a/src/axom/core/execution/timed_for_all.hpp b/src/axom/core/execution/timed_for_all.hpp index af49674de3..ebf0ec71f9 100644 --- a/src/axom/core/execution/timed_for_all.hpp +++ b/src/axom/core/execution/timed_for_all.hpp @@ -37,7 +37,7 @@ struct TimedForAll * \param n The number it items in the loop. * \param kernel The kernel to execute. */ - static void execute([[maybe_unused]] const std::string &name, axom::IndexType n, KernelType &&kernel) + static void execute([[maybe_unused]] const std::string& name, axom::IndexType n, KernelType&& kernel) { AXOM_ANNOTATE_SCOPE(name); axom::for_all(n, std::forward(kernel)); @@ -60,7 +60,7 @@ struct TimedForAll * \param n The number it items in the loop. * \param kernel The kernel to execute. */ - static void execute(const std::string &name, axom::IndexType n, KernelType &&kernel) + static void execute(const std::string& name, axom::IndexType n, KernelType&& kernel) { AXOM_ANNOTATE_BEGIN(name); const auto now1 = @@ -78,7 +78,7 @@ struct TimedForAll auto outer = [&](axom::IndexType i) { // Save the start time. - double &start = ompStartView[omp_get_thread_num()]; + double& start = ompStartView[omp_get_thread_num()]; if(start < 0.) { start = @@ -120,7 +120,7 @@ struct TimedForAll * \param kernel The kernel to execute. */ template -void timed_for_all(const std::string &name, axom::IndexType n, KernelType &&kernel) +void timed_for_all(const std::string& name, axom::IndexType n, KernelType&& kernel) { detail::TimedForAll::execute(name, n, std::forward(kernel)); } diff --git a/src/axom/core/numerics/transforms.hpp b/src/axom/core/numerics/transforms.hpp index 18149db4d9..287f2669e6 100644 --- a/src/axom/core/numerics/transforms.hpp +++ b/src/axom/core/numerics/transforms.hpp @@ -231,7 +231,7 @@ Matrix scale(T sx, T sy, int ndims = 3) * \return A 3x3 Matrix containing the scaling transform. */ template -Matrix scale(T sx, T sy, const axom::ArrayView ¢er) +Matrix scale(T sx, T sy, const axom::ArrayView& center) { assert(center.size() == 2); const T zero {0}; @@ -262,7 +262,7 @@ Matrix scale(T sx, T sy, const axom::ArrayView ¢er) * \return A 4x4 Matrix containing the scaling transform. */ template -Matrix scale(T sx, T sy, T sz, const axom::ArrayView ¢er) +Matrix scale(T sx, T sy, T sz, const axom::ArrayView& center) { assert(center.size() == 3); const T zero {0}; diff --git a/src/axom/core/tests/core_execution_for_all.hpp b/src/axom/core/tests/core_execution_for_all.hpp index a73a4c4b4f..94d3e7b923 100644 --- a/src/axom/core/tests/core_execution_for_all.hpp +++ b/src/axom/core/tests/core_execution_for_all.hpp @@ -34,13 +34,13 @@ template struct utility { static axom::IndexType numValues(axom::IndexType N) { return N; } - static void initialize(int *array, axom::IndexType N, int value) + static void initialize(int* array, axom::IndexType N, int value) { axom::for_all( N, AXOM_LAMBDA(axom::IndexType index) { array[index] = static_cast(index + value); }); } - static void modify(int *array, axom::IndexType N, int value) + static void modify(int* array, axom::IndexType N, int value) { axom::for_all( N, @@ -54,7 +54,7 @@ template struct utility { static axom::IndexType numValues(axom::IndexType N) { return N * N; } - static void initialize(int *array, axom::IndexType N, int value) + static void initialize(int* array, axom::IndexType N, int value) { axom::StackArray shape {{N, N}}; axom::for_all( @@ -64,7 +64,7 @@ struct utility array[index] = static_cast(index + value); }); } - static void modify(int *array, axom::IndexType N, int value) + static void modify(int* array, axom::IndexType N, int value) { axom::StackArray shape {{N, N}}; axom::for_all( @@ -82,7 +82,7 @@ template struct utility { static axom::IndexType numValues(axom::IndexType N) { return N * N * N; } - static void initialize(int *array, axom::IndexType N, int value) + static void initialize(int* array, axom::IndexType N, int value) { axom::StackArray shape {{N, N, N}}; axom::for_all( @@ -92,7 +92,7 @@ struct utility array[index] = static_cast(index + value); }); } - static void modify(int *array, axom::IndexType N, int value) + static void modify(int* array, axom::IndexType N, int value) { axom::StackArray shape {{N, N, N}}; axom::for_all( @@ -122,7 +122,7 @@ void check_for_all(axom::IndexType N) // STEP 3: allocate buffer const auto arraySize = utils::numValues(N); - int *a = axom::allocate(arraySize, allocID); + int* a = axom::allocate(arraySize, allocID); // STEP 4: initialize to (index + VALUE) utils::initialize(a, N, VALUE); @@ -133,7 +133,7 @@ void check_for_all(axom::IndexType N) } // STEP 5: check array - int *a_host = axom::allocate(arraySize, hostID); + int* a_host = axom::allocate(arraySize, hostID); axom::copy(a_host, a, arraySize * sizeof(int)); for(int i = 0; i < arraySize; ++i) diff --git a/src/axom/core/tests/core_execution_scans.hpp b/src/axom/core/tests/core_execution_scans.hpp index a4a95582f8..0a1b929b62 100644 --- a/src/axom/core/tests/core_execution_scans.hpp +++ b/src/axom/core/tests/core_execution_scans.hpp @@ -24,7 +24,7 @@ using axom::IndexType; // ----------------------------------------------------------------------------- template -std::vector reference_exclusive_scan(const InContainer &input) +std::vector reference_exclusive_scan(const InContainer& input) { std::vector result(input.size()); OutValue total = 0; @@ -37,7 +37,7 @@ std::vector reference_exclusive_scan(const InContainer &input) } template -std::vector reference_inclusive_scan(const InContainer &input) +std::vector reference_inclusive_scan(const InContainer& input) { std::vector result(input.size()); OutValue total = 0; @@ -82,7 +82,7 @@ std::vector make_mask(IndexType n, bool alternating, int stride = 1) // Create an axom::Array in the allocator for ExecSpace and fill it from host template -axom::Array create_exec_array_from_host(const std::vector &hostData) +axom::Array create_exec_array_from_host(const std::vector& hostData) { const IndexType n = static_cast(hostData.size()); const int allocatorID = axom::execution_space::allocatorID(); @@ -99,7 +99,7 @@ axom::Array create_exec_array_from_host(const std::vector &hostData) // Copy an axom::Array in exec-space back to a host std::vector template -std::vector copy_exec_array_to_host(const axom::Array &arr) +std::vector copy_exec_array_to_host(const axom::Array& arr) { const IndexType n = arr.size(); std::vector hostData(n); diff --git a/src/axom/core/tests/core_execution_space.hpp b/src/axom/core/tests/core_execution_space.hpp index 26385c8f57..749f953831 100644 --- a/src/axom/core/tests/core_execution_space.hpp +++ b/src/axom/core/tests/core_execution_space.hpp @@ -200,7 +200,7 @@ TEST(core_execution_space, check_cuda_exec_async) RAJA::cuda_synchronize>(allocator_id, IS_ASYNC, ON_DEVICE); } //------------------------------------------------------------------------------ -void build(axom::Array &values, axom::Array &ids, int allocatorID) +void build(axom::Array& values, axom::Array& ids, int allocatorID) { const std::vector data {{0, 1, 2, 3}}; const axom::IndexType n = static_cast(data.size()); diff --git a/src/axom/core/tests/core_flatmap_for_all.hpp b/src/axom/core/tests/core_flatmap_for_all.hpp index 6c0d105a3f..e16b39331a 100644 --- a/src/axom/core/tests/core_flatmap_for_all.hpp +++ b/src/axom/core/tests/core_flatmap_for_all.hpp @@ -421,7 +421,7 @@ AXOM_TYPED_TEST(core_flatmap_for_all, insert_batched_with_dups) // Check that we only have one instance of every key in the map axom::Array dedup_keys(NUM_ELEMS); - for(auto &pair : test_map) + for(auto& pair : test_map) { // Check that we haven't seen another K-V pair with the same key. EXPECT_EQ(dedup_keys[pair.first], 0); @@ -501,7 +501,7 @@ AXOM_TYPED_TEST(core_flatmap_for_all, insert_multiple_batch_with_dups) // Check that we only have one instance of every key in the map axom::Array dedup_keys(NUM_ELEMS); - for(auto &pair : test_map) + for(auto& pair : test_map) { // Check that we haven't seen another K-V pair with the same key. EXPECT_EQ(dedup_keys[pair.first], 0); @@ -627,7 +627,7 @@ AXOM_TYPED_TEST(core_flatmap_for_all, insert_batch_with_gaps_and_dups) // Check that we only have one instance of every key in the map axom::Array dedup_keys(NUM_ELEMS); - for(auto &pair : test_map) + for(auto& pair : test_map) { // Check that we haven't seen another K-V pair with the same key. EXPECT_EQ(dedup_keys[pair.first], 0); diff --git a/src/axom/core/tests/core_openmp_map.hpp b/src/axom/core/tests/core_openmp_map.hpp index 87a08cf45c..fcb185b46e 100644 --- a/src/axom/core/tests/core_openmp_map.hpp +++ b/src/axom/core/tests/core_openmp_map.hpp @@ -29,9 +29,9 @@ experimental::Map init(int N, int len) } template -void test_storage(experimental::Map &test) +void test_storage(experimental::Map& test) { - experimental::Map *test2 = &test; + experimental::Map* test2 = &test; axom::for_all(0, test.max_size(), [=](IndexType idx) { Key key = idx; T value = key * 27; @@ -49,9 +49,9 @@ void test_storage(experimental::Map &test) } template -void test_subscript(experimental::Map &test) +void test_subscript(experimental::Map& test) { - experimental::Map *test2 = &test; + experimental::Map* test2 = &test; axom::for_all(0, test.size(), [=](IndexType idx) { Key key = idx; EXPECT_EQ(key * 27, (*test2)[key]); @@ -59,9 +59,9 @@ void test_subscript(experimental::Map &test) } template -void test_insert_assign(experimental::Map &test) +void test_insert_assign(experimental::Map& test) { - experimental::Map *test2 = &test; + experimental::Map* test2 = &test; axom::for_all(0, test.max_size(), [=](IndexType idx) { Key key = idx; T value = key * 27; @@ -91,10 +91,10 @@ void test_insert_assign(experimental::Map &test) } template -void test_remove(experimental::Map &test) +void test_remove(experimental::Map& test) { std::size_t to_erase = test.size(); - experimental::Map *test2 = &test; + experimental::Map* test2 = &test; axom::for_all(0, to_erase, [=](IndexType idx) { Key key = (Key)idx; @@ -110,10 +110,10 @@ void test_remove(experimental::Map &test) } template -void test_rehash(experimental::Map &test, int num, int fact) +void test_rehash(experimental::Map& test, int num, int fact) { auto original_size = test.size(); - experimental::Map *test2 = &test; + experimental::Map* test2 = &test; test.rehash(num, fact); axom::for_all(0, original_size, [=](IndexType idx) { diff --git a/src/axom/core/tests/core_units.hpp b/src/axom/core/tests/core_units.hpp index be710c648c..b036187df1 100644 --- a/src/axom/core/tests/core_units.hpp +++ b/src/axom/core/tests/core_units.hpp @@ -66,7 +66,7 @@ TEST(Units, getLengthUnit) getLengthUnit("bad_units"); FAIL() << "Should have thrown"; } - catch(const std::invalid_argument &error) + catch(const std::invalid_argument& error) { EXPECT_NE(std::string::npos, std::string(error.what()).find("bad_units")); } diff --git a/src/axom/core/tests/core_utilities.hpp b/src/axom/core/tests/core_utilities.hpp index 8be7a68839..b6f89b4a96 100644 --- a/src/axom/core/tests/core_utilities.hpp +++ b/src/axom/core/tests/core_utilities.hpp @@ -127,7 +127,7 @@ TEST(core_utilities, qsort_sort_double) * \return True if all elements are in increasing order; False otherwise. */ template -bool is_increasing(const ArrayType &arr) +bool is_increasing(const ArrayType& arr) { bool retval = true; for(size_t i = 1; i < arr.size(); i++) @@ -143,7 +143,7 @@ bool is_increasing(const ArrayType &arr) * \return True if all elements are in decreasing order; False otherwise. */ template -bool is_decreasing(const ArrayType &arr) +bool is_decreasing(const ArrayType& arr) { bool retval = true; for(size_t i = 1; i < arr.size(); i++) diff --git a/src/axom/core/tests/utils_annotations.cpp b/src/axom/core/tests/utils_annotations.cpp index c6f17b9307..105bb7a899 100644 --- a/src/axom/core/tests/utils_annotations.cpp +++ b/src/axom/core/tests/utils_annotations.cpp @@ -95,7 +95,7 @@ TEST(utils_annotations, print_adiak_metadata) if(my_rank == 0) { std::cout << "Adiak metadata: \n"; - for(const auto &kv : updated_metadata) + for(const auto& kv : updated_metadata) { std::cout << axom::fmt::format("- {}: {}\n", kv.first, kv.second); } @@ -110,7 +110,7 @@ TEST(utils_annotations, check_modes) { EXPECT_TRUE(axom::utilities::annotations::detail::is_mode_valid("none")); - for(const auto &m : {"counts", "file", "trace", "report", "gputx", "nvprof", "nvtx", "roctx"}) + for(const auto& m : {"counts", "file", "trace", "report", "gputx", "nvprof", "nvtx", "roctx"}) { #ifdef AXOM_USE_CALIPER EXPECT_TRUE(axom::utilities::annotations::detail::is_mode_valid(m)); @@ -174,7 +174,7 @@ TEST(utils_annotations, print_help) SUCCEED(); } -int main(int argc, char **argv) +int main(int argc, char** argv) { ::testing::InitGoogleTest(&argc, argv); diff --git a/src/axom/core/utilities/About.hpp b/src/axom/core/utilities/About.hpp index c73625039c..65dd1e2728 100644 --- a/src/axom/core/utilities/About.hpp +++ b/src/axom/core/utilities/About.hpp @@ -28,7 +28,7 @@ void about(); * * \param [in,out] oss the target stream where to append the Axom info */ -void about(std::ostream &oss); +void about(std::ostream& oss); /*! * \brief Returns a string consisting of the Axom version. diff --git a/src/axom/core/utilities/Annotations.cpp b/src/axom/core/utilities/Annotations.cpp index 4c2ec8aeb5..8885af1786 100644 --- a/src/axom/core/utilities/Annotations.cpp +++ b/src/axom/core/utilities/Annotations.cpp @@ -33,7 +33,7 @@ namespace annotations static bool adiak_initialized = false; #ifdef AXOM_USE_CALIPER -static cali::ConfigManager *cali_mgr {nullptr}; +static cali::ConfigManager* cali_mgr {nullptr}; #endif namespace detail @@ -67,7 +67,7 @@ void initialize_adiak(MPI_Comm comm) return; } - adiak::init((void *)&comm); + adiak::init((void*)&comm); initialize_common_adiak_metadata(); adiak_initialized = true; @@ -95,17 +95,17 @@ void initialize_adiak() } #endif // AXOM_USE_MPI -void initialize_caliper(const std::string &mode) +void initialize_caliper(const std::string& mode) { #ifdef AXOM_USE_CALIPER cali::ConfigManager::argmap_t app_args; cali_mgr = new cali::ConfigManager(); cali_mgr->add(mode.c_str(), app_args); - for(const auto &kv : app_args) + for(const auto& kv : app_args) { - const std::string &cali_mode = kv.first; - const std::string &value = kv.second; + const std::string& cali_mode = kv.first; + const std::string& value = kv.second; if(cali_mode == "none") { @@ -160,7 +160,7 @@ void initialize_caliper(const std::string &mode) static const std::set axom_valid_caliper_args = {"counts", "file", "gputx", "none", "nvprof", "nvtx", "report", "trace", "roctx"}; -bool is_mode_valid(const std::string &mode) +bool is_mode_valid(const std::string& mode) { #ifdef AXOM_USE_CALIPER cali::ConfigManager test_mgr; @@ -175,10 +175,10 @@ bool is_mode_valid(const std::string &mode) return false; } - for(const auto &kv : app_args) + for(const auto& kv : app_args) { - const std::string &name = kv.first; - const std::string &val = kv.second; + const std::string& name = kv.first; + const std::string& val = kv.second; if(!name.empty() && !val.empty()) { @@ -212,7 +212,7 @@ std::string mode_help_string() } #ifdef AXOM_USE_ADIAK -static std::string adiak_value_as_string(adiak_value_t *val, adiak_datatype_t *t) +static std::string adiak_value_as_string(adiak_value_t* val, adiak_datatype_t* t) { // Implementation adapted from adiak user docs @@ -221,12 +221,12 @@ static std::string adiak_value_as_string(adiak_value_t *val, adiak_datatype_t *t return "ERROR"; } - auto get_vals_array = [](adiak_datatype_t *t, adiak_value_t *val, int count) { + auto get_vals_array = [](adiak_datatype_t* t, adiak_value_t* val, int count) { std::vector s; for(int i = 0; i < count; i++) { adiak_value_t subval; - adiak_datatype_t *subtype; + adiak_datatype_t* subtype; adiak_get_subval(t, val, i, &subtype, &subval); s.push_back(adiak_value_as_string(&subval, subtype)); } @@ -258,19 +258,19 @@ static std::string adiak_value_as_string(adiak_value_t *val, adiak_datatype_t *t std::chrono::system_clock::time_point {std::chrono::seconds {val->v_long}}); case adiak_timeval: { - const auto *tv = static_cast(val->v_ptr); + const auto* tv = static_cast(val->v_ptr); return axom::fmt::format( "{:%S} seconds:timeval", std::chrono::seconds {tv->tv_sec} + std::chrono::microseconds {tv->tv_usec}); } case adiak_version: - return axom::fmt::format("{}:version", static_cast(val->v_ptr)); + return axom::fmt::format("{}:version", static_cast(val->v_ptr)); case adiak_string: - return axom::fmt::format("{}", static_cast(val->v_ptr)); + return axom::fmt::format("{}", static_cast(val->v_ptr)); case adiak_catstring: - return axom::fmt::format("{}:catstring", static_cast(val->v_ptr)); + return axom::fmt::format("{}:catstring", static_cast(val->v_ptr)); case adiak_path: - return axom::fmt::format("{}:path", static_cast(val->v_ptr)); + return axom::fmt::format("{}:path", static_cast(val->v_ptr)); case adiak_range: return axom::fmt::format("{}", axom::fmt::join(get_vals_array(t, val, 2), " - ")); case adiak_set: @@ -287,16 +287,16 @@ static std::string adiak_value_as_string(adiak_value_t *val, adiak_datatype_t *t } } -static void get_namevals_as_map(const char *name, +static void get_namevals_as_map(const char* name, int AXOM_UNUSED_PARAM(category), - const char *AXOM_UNUSED_PARAM(subcategory), - adiak_value_t *value, - adiak_datatype_t *t, - void *opaque_value) + const char* AXOM_UNUSED_PARAM(subcategory), + adiak_value_t* value, + adiak_datatype_t* t, + void* opaque_value) { // add each name/value to adiak metadata map using kv_map = std::map; - auto &metadata = *static_cast(opaque_value); + auto& metadata = *static_cast(opaque_value); metadata[name] = adiak_value_as_string(value, t); } @@ -305,7 +305,7 @@ static void get_namevals_as_map(const char *name, } // namespace detail #ifdef AXOM_USE_MPI -void initialize(MPI_Comm comm, const std::string &mode) +void initialize(MPI_Comm comm, const std::string& mode) { detail::initialize_adiak(comm); detail::initialize_caliper(mode); @@ -314,7 +314,7 @@ void initialize(MPI_Comm comm, const std::string &mode) } #endif -void initialize(const std::string &mode) +void initialize(const std::string& mode) { detail::initialize_adiak(); detail::initialize_caliper(mode); @@ -342,7 +342,7 @@ void finalize() #endif } -void begin(const std::string &name) +void begin(const std::string& name) { #ifdef AXOM_USE_CALIPER cali_begin_region(name.c_str()); @@ -351,7 +351,7 @@ void begin(const std::string &name) #endif } -void end(const std::string &name) +void end(const std::string& name) { #ifdef AXOM_USE_CALIPER cali_end_region(name.c_str()); diff --git a/src/axom/core/utilities/CommandLineUtilities.hpp b/src/axom/core/utilities/CommandLineUtilities.hpp index 735779998c..988d677762 100644 --- a/src/axom/core/utilities/CommandLineUtilities.hpp +++ b/src/axom/core/utilities/CommandLineUtilities.hpp @@ -33,7 +33,7 @@ struct CaliperModeValidator : public axom::CLI::Validator CaliperModeValidator() { name_ = "MODE"; - func_ = [](const std::string &str) { + func_ = [](const std::string& str) { if(str == "help") { return axom::fmt::format("Valid caliper modes are:\n{}\n", diff --git a/src/axom/core/utilities/Sorting.hpp b/src/axom/core/utilities/Sorting.hpp index 8456d97490..dfc5eb1bdd 100644 --- a/src/axom/core/utilities/Sorting.hpp +++ b/src/axom/core/utilities/Sorting.hpp @@ -40,7 +40,7 @@ AXOM_HOST_DEVICE constexpr static T stack_size(T N) * param b The second value. */ template -AXOM_HOST_DEVICE inline void ifswap(T &a, T &b) +AXOM_HOST_DEVICE inline void ifswap(T& a, T& b) { if(a > b) { @@ -75,7 +75,7 @@ AXOM_HOST_DEVICE inline void internal_swap(axom::IndexType idx1, } template -AXOM_HOST_DEVICE inline void ifswap_multiple(Predicate &&predicate, +AXOM_HOST_DEVICE inline void ifswap_multiple(Predicate&& predicate, axom::IndexType idx1, axom::IndexType idx2, T values, @@ -97,7 +97,7 @@ AXOM_HOST_DEVICE inline void ifswap_multiple(Predicate &&predicate, * \return A new pivot. */ template -AXOM_HOST_DEVICE static axom::IndexType partitionMultiple(Predicate &&predicate, +AXOM_HOST_DEVICE static axom::IndexType partitionMultiple(Predicate&& predicate, axom::IndexType low, axom::IndexType high, T values, @@ -124,7 +124,7 @@ AXOM_HOST_DEVICE static axom::IndexType partitionMultiple(Predicate &&predicate, * \param n The number of values in the array. */ template -AXOM_HOST_DEVICE static void qsortMultiple(Predicate &&predicate, +AXOM_HOST_DEVICE static void qsortMultiple(Predicate&& predicate, axom::IndexType n, T values, Args... args) @@ -164,7 +164,7 @@ AXOM_HOST_DEVICE static void qsortMultiple(Predicate &&predicate, * \param args The rest of the arrays to be sorted the same way. */ template -AXOM_HOST_DEVICE static void insertionSortMultiple(Predicate &&predicate, +AXOM_HOST_DEVICE static void insertionSortMultiple(Predicate&& predicate, axom::IndexType n, T values, Args... args) @@ -196,7 +196,7 @@ struct Delimiter * \param args A parameter pack containing all other arrays to be sorted. */ template -AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate, +AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate&& predicate, axom::IndexType n, T first, Delimiter, @@ -217,7 +217,7 @@ AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate * \brief Shift args to end until the array length is at the desired position. */ template -AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate, +AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate&& predicate, T first, Delimiter d, axom::IndexType n, @@ -230,7 +230,7 @@ AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate * \brief Shift args to end until the array length is at the desired position. */ template -AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate, +AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate&& predicate, T first, Delimiter d, S second, @@ -245,7 +245,7 @@ AXOM_HOST_DEVICE inline static void sort_multiple_internal(Predicate &&predicate template struct less_than { - AXOM_HOST_DEVICE inline bool operator()(const T &a, const T &b) const { return a < b; } + AXOM_HOST_DEVICE inline bool operator()(const T& a, const T& b) const { return a < b; } }; /*! @@ -254,7 +254,7 @@ struct less_than template struct greater_than { - AXOM_HOST_DEVICE inline bool operator()(const T &a, const T &b) const { return a > b; } + AXOM_HOST_DEVICE inline bool operator()(const T& a, const T& b) const { return a > b; } }; } // end namespace detail @@ -328,7 +328,7 @@ struct Sorting * \param n The number of values in the array. */ AXOM_HOST_DEVICE - inline static void sort(T *values, int n) + inline static void sort(T* values, int n) { if(n < SORT_SIZE_CUTOFF) { @@ -351,7 +351,7 @@ struct Sorting * \param n The number of values in the array. */ AXOM_HOST_DEVICE - static void qsort(T *values, int n) + static void qsort(T* values, int n) { if(n <= 1) { @@ -393,7 +393,7 @@ struct Sorting * \return A new pivot. */ AXOM_HOST_DEVICE - static int partition(T *values, int low, int high) + static int partition(T* values, int low, int high) { // Median-of-three pivot selection const int mid = low + (high - low) / 2; @@ -428,7 +428,7 @@ struct Sorting * \param n The number of values in the array. */ AXOM_HOST_DEVICE - inline static void insertionSort(T *values, int n) + inline static void insertionSort(T* values, int n) { for(int i = 1; i < n; i++) { @@ -456,7 +456,7 @@ struct Sorting * \param[inout] values The array to be sorted. */ AXOM_HOST_DEVICE - inline static void sort(T *values, int AXOM_UNUSED_PARAM(n)) + inline static void sort(T* values, int AXOM_UNUSED_PARAM(n)) { detail::ifswap(values[0], values[1]); detail::ifswap(values[1], values[2]); @@ -477,7 +477,7 @@ struct Sorting * \param[inout] values The array to be sorted. */ AXOM_HOST_DEVICE - inline static void sort(T *values, int AXOM_UNUSED_PARAM(n)) + inline static void sort(T* values, int AXOM_UNUSED_PARAM(n)) { detail::ifswap(values[0], values[1]); detail::ifswap(values[2], values[3]); diff --git a/src/axom/core/utilities/Units.cpp b/src/axom/core/utilities/Units.cpp index 42e8d340c5..af0bf8ef47 100644 --- a/src/axom/core/utilities/Units.cpp +++ b/src/axom/core/utilities/Units.cpp @@ -31,7 +31,7 @@ struct LengthUnitHash std::size_t operator()(LengthUnit unit) const { return static_cast(unit); } }; -std::string unrecognizedUnitsMessage(const std::string &unitsAsString) +std::string unrecognizedUnitsMessage(const std::string& unitsAsString) { std::string message = "Unrecognized units: "; message += unitsAsString; @@ -39,7 +39,7 @@ std::string unrecognizedUnitsMessage(const std::string &unitsAsString) } } // namespace -LengthUnit getLengthUnit(const std::string &unit) +LengthUnit getLengthUnit(const std::string& unit) { std::string lowerUnit(unit); string::toLower(lowerUnit); diff --git a/src/axom/core/utilities/Units.hpp b/src/axom/core/utilities/Units.hpp index 2b1f54bfb9..5176908165 100644 --- a/src/axom/core/utilities/Units.hpp +++ b/src/axom/core/utilities/Units.hpp @@ -45,7 +45,7 @@ enum class LengthUnit * \return the length unit * \throws std::invalid_argument if the string does not represent known units */ -LengthUnit getLengthUnit(const std::string &unit); +LengthUnit getLengthUnit(const std::string& unit); /*! * Get the short name of a length unit. @@ -86,10 +86,10 @@ double convert(double sourceValue, LengthUnit sourceUnits, LengthUnit targetUnit * \param targetUnits the units to convert to */ template -void convertAll(T &values, LengthUnit sourceUnits, LengthUnit targetUnits) +void convertAll(T& values, LengthUnit sourceUnits, LengthUnit targetUnits) { double factor = getConversionFactor(sourceUnits, targetUnits); - for(double &value : values) + for(double& value : values) { value *= factor; } diff --git a/src/axom/inlet/SphinxWriter.cpp b/src/axom/inlet/SphinxWriter.cpp index 6d84c3e31f..298c172153 100644 --- a/src/axom/inlet/SphinxWriter.cpp +++ b/src/axom/inlet/SphinxWriter.cpp @@ -1,379 +1,379 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + /*! ******************************************************************************* * \file SphinxWriter.cpp * * \brief This file contains the class implementation of the SphinxWriter. ******************************************************************************* - */ - -#include "axom/inlet/SphinxWriter.hpp" - -#include - -#include "axom/slic.hpp" -#include "axom/inlet/Container.hpp" - -namespace axom -{ -namespace inlet -{ -namespace detail -{ + */ + +#include "axom/inlet/SphinxWriter.hpp" + +#include + +#include "axom/slic.hpp" +#include "axom/inlet/Container.hpp" + +namespace axom +{ +namespace inlet +{ +namespace detail +{ /** * \brief Determines whether a container is trivial (contains no fields/functions in its subtree) * * \param [in] container The container to evaluate - */ -bool isTrivial(const Container& container) -{ - if(!container.getChildFields().empty() || !container.getChildFunctions().empty()) - { - return false; - } - using value_type = std::decay::type::value_type; - return std::all_of(container.getChildContainers().begin(), - container.getChildContainers().end(), - [](const value_type& entry) { return isTrivial(*entry.second); }); -} - + */ +bool isTrivial(const Container& container) +{ + if(!container.getChildFields().empty() || !container.getChildFunctions().empty()) + { + return false; + } + using value_type = std::decay::type::value_type; + return std::all_of(container.getChildContainers().begin(), + container.getChildContainers().end(), + [](const value_type& entry) { return isTrivial(*entry.second); }); +} + /** * \brief Converts an enumeration to its underlying type * \param [in] e The enumeration value to convert * This function should be removed once C++23 is available * \see https://en.cppreference.com/w/cpp/utility/to_underlying - */ -template -constexpr typename std::underlying_type::type to_underlying(const E e) -{ - return static_cast::type>(e); -} - -} // namespace detail - -SphinxWriter::SphinxWriter(const std::string& fileName) - : m_fieldColLabels( - {"Field Name", "Description", "Default Value", "Range/Valid Values", "Required"}) - , m_functionColLabels({"Function Name", "Description", "Signature", "Required"}) -{ - m_fileName = fileName; - m_oss << ".. |uncheck| unicode:: U+2610 .. UNCHECKED BOX\n"; - m_oss << ".. |check| unicode:: U+2611 .. CHECKED BOX\n\n"; - writeTitle("Input file Options"); -} - -void SphinxWriter::documentContainer(const Container& container) -{ - const auto sidreGroup = container.sidreGroup(); - const std::string pathName = sidreGroup->getPathName(); - std::string containerName = sidreGroup->getName(); - bool isSelectedElement = false; - - // If the container is empty, ignore it - if(detail::isTrivial(container)) - { - return; - } - - // Replace the "implementation-defined" name with something a bit more readable - if(isCollectionGroup(containerName)) - { - containerName = "Collection contents:"; - } - - // If we've gotten to this point and are an element of an array/dict, - // mark it as the selected element - if(sidreGroup->getParent()->getName() == detail::COLLECTION_GROUP_NAME) - { - // The collection that this Container is a part of - const std::string collectionName = sidreGroup->getParent()->getParent()->getPathName(); - isSelectedElement = true; - } - - m_inletContainerPathNames.push_back(pathName); - auto& currContainer = - m_rstTables.emplace(pathName, ContainerData {m_fieldColLabels, m_functionColLabels}).first->second; - currContainer.containerName = containerName; - currContainer.isSelectedElement = isSelectedElement; - if(containerName != "" && sidreGroup->hasView("description")) - { - currContainer.description = sidreGroup->getView("description")->getString(); - } - - for(const auto& field_entry : container.getChildFields()) - { - extractFieldMetadata(field_entry.second->sidreGroup(), currContainer); - } - - for(const auto& function_entry : container.getChildFunctions()) - { - extractFunctionMetadata(function_entry.second->sidreGroup(), currContainer); - } -} - -void SphinxWriter::finalize() -{ - writeAllTables(); - m_outFile.open(m_fileName); - m_outFile << m_oss.str(); - m_outFile.close(); -} - -void SphinxWriter::writeTitle(const std::string& title) -{ - if(title != "") - { - std::string equals = std::string(title.length(), '='); - m_oss << equals << "\n" << title << "\n" << equals << "\n"; - } -} - -void SphinxWriter::writeSubtitle(const std::string& sub) -{ - if(sub != "") - { - std::string dashes = std::string(sub.length(), '-'); - m_oss << "\n" << dashes << "\n" << sub << "\n" << dashes << "\n\n"; - } -} - -void SphinxWriter::writeTable(const std::string& title, - const std::vector>& rstTable) -{ - SLIC_WARNING_IF(rstTable.size() <= 1, - "[Inlet] Vector for corresponding rst table must be nonempty"); - std::string result = ".. list-table:: " + title; - std::string widths = ":widths:"; - // This would be easier with an iterator adaptor like back_inserter but for - // concatenation - for(std::size_t i = 0u; i < rstTable.front().size(); i++) - { - widths += " 25"; - } - result += "\n " + widths + "\n"; - result += " :header-rows: 1\n :stub-columns: 1\n\n"; - for(unsigned int i = 0; i < rstTable.size(); ++i) - { - result += " * - "; - for(unsigned int j = 0; j < rstTable[i].size(); ++j) - { - if(j != 0) - { - result += " - "; - } - result += rstTable[i][j] + "\n"; - } - } - m_oss << result; -} - -void SphinxWriter::writeAllTables() -{ - for(std::string& pathName : m_inletContainerPathNames) - { - auto& currContainer = m_rstTables.at(pathName); - // If we're displaying a selected element, the title and description - // will already have been printed - if(currContainer.isSelectedElement) - { - m_oss << "The input schema defines a collection of this container.\n"; - m_oss << "For brevity, only one instance is displayed here.\n\n"; - } - else - { - writeSubtitle(currContainer.containerName); - if(currContainer.description != "") - { - m_oss << "Description: " << currContainer.description << "\n\n"; - } - } - if(currContainer.fieldTable.size() > 1) - { - writeTable("Fields", currContainer.fieldTable); - } - if(currContainer.functionTable.size() > 1) - { - writeTable("Functions", currContainer.functionTable); - } - } -} - -std::string SphinxWriter::getValueAsString(const axom::sidre::View* view) -{ - axom::sidre::TypeID type = view->getTypeID(); - if(type == axom::sidre::TypeID::INT8_ID) - { - std::int8_t val = view->getData(); - return val ? "True" : "False"; - } - else if(type == axom::sidre::TypeID::INT_ID) - { - int val = view->getData(); - return std::to_string(val); - } - else if(type == axom::sidre::TypeID::DOUBLE_ID) - { - double val = view->getData(); - return std::to_string(val); - } - return view->getString(); -} - -std::string SphinxWriter::getRangeAsString(const axom::sidre::View* view) -{ - std::ostringstream oss; - oss.precision(3); - oss << std::scientific; - - axom::sidre::TypeID type = view->getTypeID(); - if(type == axom::sidre::INT_ID) - { - const int* range = view->getData(); - oss << range[0] << " to " << range[1]; - } - else - { - const double* range = view->getData(); - oss << range[0] << " to " << range[1]; - } - return oss.str(); -} - -std::string SphinxWriter::getValidValuesAsString(const axom::sidre::View* view) -{ - const int* range = view->getData(); - size_t size = view->getBuffer()->getNumElements(); - std::string result = ""; - for(size_t i = 0; i < size; ++i) - { - if(i == size - 1) - { - result += std::to_string(range[i]); - } - else - { - result += std::to_string(range[i]) + ", "; - } - } - return result; -} - -std::string SphinxWriter::getValidStringValues(const axom::sidre::Group* sidreGroup) -{ - auto idx = sidreGroup->getFirstValidViewIndex(); - std::string validValues = ""; - while(axom::sidre::indexIsValid(idx)) - { - validValues += std::string(sidreGroup->getView(idx)->getString()); - idx = sidreGroup->getNextValidViewIndex(idx); - if(axom::sidre::indexIsValid(idx)) - { - validValues += ", "; - } - } - return validValues; -} - -void SphinxWriter::extractFieldMetadata(const axom::sidre::Group* sidreGroup, - ContainerData& currentContainer) -{ - std::vector fieldAttributes(m_fieldColLabels.size()); - - fieldAttributes[0] = sidreGroup->getName(); - - if(sidreGroup->hasView("description")) - { - fieldAttributes[1] = std::string(sidreGroup->getView("description")->getString()); - } - - if(sidreGroup->hasView("defaultValue")) - { - fieldAttributes[2] = getValueAsString(sidreGroup->getView("defaultValue")); - } - - if(sidreGroup->hasView("range")) - { - fieldAttributes[3] = getRangeAsString(sidreGroup->getView("range")); - } - else if(sidreGroup->hasView("validValues")) - { - fieldAttributes[3] = getValidValuesAsString(sidreGroup->getView("validValues")); - } - else if(sidreGroup->hasGroup("validStringValues")) - { - fieldAttributes[3] = getValidStringValues(sidreGroup->getGroup("validStringValues")); - } - - if(sidreGroup->hasView("required")) - { - std::int8_t required = sidreGroup->getView("required")->getData(); - fieldAttributes[4] = required ? "|check|" : "|uncheck|"; - } - else - { - fieldAttributes[4] = "|uncheck|"; - } - - currentContainer.fieldTable.push_back(fieldAttributes); -} - -std::string SphinxWriter::getSignatureAsString(const axom::sidre::Group* sidreGroup) -{ - using underlying = std::underlying_type::type; - static const auto type_names = []() { - std::unordered_map result; - result[detail::to_underlying(FunctionTag::Vector)] = "Vector"; - result[detail::to_underlying(FunctionTag::Double)] = "Double"; - result[detail::to_underlying(FunctionTag::Void)] = "Void"; - result[detail::to_underlying(FunctionTag::String)] = "String"; - return result; - }(); - - // View::getData does not have a const version... - const auto ret_type = static_cast(sidreGroup->getView("return_type")->getData()); - - const auto args_view = sidreGroup->getView("function_arguments"); - const underlying* arg_tags = args_view->getData(); - const int num_args = args_view->getNumElements(); - std::vector arg_types(num_args); - for(int i = 0; i < num_args; i++) - { - arg_types[i] = type_names.at(arg_tags[i]); - } - return fmt::format("{0}({1})", type_names.at(ret_type), fmt::join(arg_types, ", ")); -} - -void SphinxWriter::extractFunctionMetadata(const axom::sidre::Group* sidreGroup, - ContainerData& currentContainer) -{ - std::vector functionAttributes(m_functionColLabels.size()); - - functionAttributes[0] = sidreGroup->getName(); - - if(sidreGroup->hasView("description")) - { - functionAttributes[1] = std::string(sidreGroup->getView("description")->getString()); - } - - functionAttributes[2] = getSignatureAsString(sidreGroup); - - if(sidreGroup->hasView("required")) - { - std::int8_t required = sidreGroup->getView("required")->getData(); - functionAttributes[3] = required ? "|check|" : "|uncheck|"; - } - else - { - functionAttributes[3] = "|uncheck|"; - } - - currentContainer.functionTable.push_back(functionAttributes); -} - -} // namespace inlet -} // namespace axom + */ +template +constexpr typename std::underlying_type::type to_underlying(const E e) +{ + return static_cast::type>(e); +} + +} // namespace detail + +SphinxWriter::SphinxWriter(const std::string& fileName) + : m_fieldColLabels( + {"Field Name", "Description", "Default Value", "Range/Valid Values", "Required"}) + , m_functionColLabels({"Function Name", "Description", "Signature", "Required"}) +{ + m_fileName = fileName; + m_oss << ".. |uncheck| unicode:: U+2610 .. UNCHECKED BOX\n"; + m_oss << ".. |check| unicode:: U+2611 .. CHECKED BOX\n\n"; + writeTitle("Input file Options"); +} + +void SphinxWriter::documentContainer(const Container& container) +{ + const auto sidreGroup = container.sidreGroup(); + const std::string pathName = sidreGroup->getPathName(); + std::string containerName = sidreGroup->getName(); + bool isSelectedElement = false; + + // If the container is empty, ignore it + if(detail::isTrivial(container)) + { + return; + } + + // Replace the "implementation-defined" name with something a bit more readable + if(isCollectionGroup(containerName)) + { + containerName = "Collection contents:"; + } + + // If we've gotten to this point and are an element of an array/dict, + // mark it as the selected element + if(sidreGroup->getParent()->getName() == detail::COLLECTION_GROUP_NAME) + { + // The collection that this Container is a part of + const std::string collectionName = sidreGroup->getParent()->getParent()->getPathName(); + isSelectedElement = true; + } + + m_inletContainerPathNames.push_back(pathName); + auto& currContainer = + m_rstTables.emplace(pathName, ContainerData {m_fieldColLabels, m_functionColLabels}).first->second; + currContainer.containerName = containerName; + currContainer.isSelectedElement = isSelectedElement; + if(containerName != "" && sidreGroup->hasView("description")) + { + currContainer.description = sidreGroup->getView("description")->getString(); + } + + for(const auto& field_entry : container.getChildFields()) + { + extractFieldMetadata(field_entry.second->sidreGroup(), currContainer); + } + + for(const auto& function_entry : container.getChildFunctions()) + { + extractFunctionMetadata(function_entry.second->sidreGroup(), currContainer); + } +} + +void SphinxWriter::finalize() +{ + writeAllTables(); + m_outFile.open(m_fileName); + m_outFile << m_oss.str(); + m_outFile.close(); +} + +void SphinxWriter::writeTitle(const std::string& title) +{ + if(title != "") + { + std::string equals = std::string(title.length(), '='); + m_oss << equals << "\n" << title << "\n" << equals << "\n"; + } +} + +void SphinxWriter::writeSubtitle(const std::string& sub) +{ + if(sub != "") + { + std::string dashes = std::string(sub.length(), '-'); + m_oss << "\n" << dashes << "\n" << sub << "\n" << dashes << "\n\n"; + } +} + +void SphinxWriter::writeTable(const std::string& title, + const std::vector>& rstTable) +{ + SLIC_WARNING_IF(rstTable.size() <= 1, + "[Inlet] Vector for corresponding rst table must be nonempty"); + std::string result = ".. list-table:: " + title; + std::string widths = ":widths:"; + // This would be easier with an iterator adaptor like back_inserter but for + // concatenation + for(std::size_t i = 0u; i < rstTable.front().size(); i++) + { + widths += " 25"; + } + result += "\n " + widths + "\n"; + result += " :header-rows: 1\n :stub-columns: 1\n\n"; + for(unsigned int i = 0; i < rstTable.size(); ++i) + { + result += " * - "; + for(unsigned int j = 0; j < rstTable[i].size(); ++j) + { + if(j != 0) + { + result += " - "; + } + result += rstTable[i][j] + "\n"; + } + } + m_oss << result; +} + +void SphinxWriter::writeAllTables() +{ + for(std::string& pathName : m_inletContainerPathNames) + { + auto& currContainer = m_rstTables.at(pathName); + // If we're displaying a selected element, the title and description + // will already have been printed + if(currContainer.isSelectedElement) + { + m_oss << "The input schema defines a collection of this container.\n"; + m_oss << "For brevity, only one instance is displayed here.\n\n"; + } + else + { + writeSubtitle(currContainer.containerName); + if(currContainer.description != "") + { + m_oss << "Description: " << currContainer.description << "\n\n"; + } + } + if(currContainer.fieldTable.size() > 1) + { + writeTable("Fields", currContainer.fieldTable); + } + if(currContainer.functionTable.size() > 1) + { + writeTable("Functions", currContainer.functionTable); + } + } +} + +std::string SphinxWriter::getValueAsString(const axom::sidre::View* view) +{ + axom::sidre::TypeID type = view->getTypeID(); + if(type == axom::sidre::TypeID::INT8_ID) + { + std::int8_t val = view->getData(); + return val ? "True" : "False"; + } + else if(type == axom::sidre::TypeID::INT_ID) + { + int val = view->getData(); + return std::to_string(val); + } + else if(type == axom::sidre::TypeID::DOUBLE_ID) + { + double val = view->getData(); + return std::to_string(val); + } + return view->getString(); +} + +std::string SphinxWriter::getRangeAsString(const axom::sidre::View* view) +{ + std::ostringstream oss; + oss.precision(3); + oss << std::scientific; + + axom::sidre::TypeID type = view->getTypeID(); + if(type == axom::sidre::INT_ID) + { + const int* range = view->getData(); + oss << range[0] << " to " << range[1]; + } + else + { + const double* range = view->getData(); + oss << range[0] << " to " << range[1]; + } + return oss.str(); +} + +std::string SphinxWriter::getValidValuesAsString(const axom::sidre::View* view) +{ + const int* range = view->getData(); + size_t size = view->getBuffer()->getNumElements(); + std::string result = ""; + for(size_t i = 0; i < size; ++i) + { + if(i == size - 1) + { + result += std::to_string(range[i]); + } + else + { + result += std::to_string(range[i]) + ", "; + } + } + return result; +} + +std::string SphinxWriter::getValidStringValues(const axom::sidre::Group* sidreGroup) +{ + auto idx = sidreGroup->getFirstValidViewIndex(); + std::string validValues = ""; + while(axom::sidre::indexIsValid(idx)) + { + validValues += std::string(sidreGroup->getView(idx)->getString()); + idx = sidreGroup->getNextValidViewIndex(idx); + if(axom::sidre::indexIsValid(idx)) + { + validValues += ", "; + } + } + return validValues; +} + +void SphinxWriter::extractFieldMetadata(const axom::sidre::Group* sidreGroup, + ContainerData& currentContainer) +{ + std::vector fieldAttributes(m_fieldColLabels.size()); + + fieldAttributes[0] = sidreGroup->getName(); + + if(sidreGroup->hasView("description")) + { + fieldAttributes[1] = std::string(sidreGroup->getView("description")->getString()); + } + + if(sidreGroup->hasView("defaultValue")) + { + fieldAttributes[2] = getValueAsString(sidreGroup->getView("defaultValue")); + } + + if(sidreGroup->hasView("range")) + { + fieldAttributes[3] = getRangeAsString(sidreGroup->getView("range")); + } + else if(sidreGroup->hasView("validValues")) + { + fieldAttributes[3] = getValidValuesAsString(sidreGroup->getView("validValues")); + } + else if(sidreGroup->hasGroup("validStringValues")) + { + fieldAttributes[3] = getValidStringValues(sidreGroup->getGroup("validStringValues")); + } + + if(sidreGroup->hasView("required")) + { + std::int8_t required = sidreGroup->getView("required")->getData(); + fieldAttributes[4] = required ? "|check|" : "|uncheck|"; + } + else + { + fieldAttributes[4] = "|uncheck|"; + } + + currentContainer.fieldTable.push_back(fieldAttributes); +} + +std::string SphinxWriter::getSignatureAsString(const axom::sidre::Group* sidreGroup) +{ + using underlying = std::underlying_type::type; + static const auto type_names = []() { + std::unordered_map result; + result[detail::to_underlying(FunctionTag::Vector)] = "Vector"; + result[detail::to_underlying(FunctionTag::Double)] = "Double"; + result[detail::to_underlying(FunctionTag::Void)] = "Void"; + result[detail::to_underlying(FunctionTag::String)] = "String"; + return result; + }(); + + // View::getData does not have a const version... + const auto ret_type = static_cast(sidreGroup->getView("return_type")->getData()); + + const auto args_view = sidreGroup->getView("function_arguments"); + const underlying* arg_tags = args_view->getData(); + const int num_args = args_view->getNumElements(); + std::vector arg_types(num_args); + for(int i = 0; i < num_args; i++) + { + arg_types[i] = type_names.at(arg_tags[i]); + } + return fmt::format("{0}({1})", type_names.at(ret_type), fmt::join(arg_types, ", ")); +} + +void SphinxWriter::extractFunctionMetadata(const axom::sidre::Group* sidreGroup, + ContainerData& currentContainer) +{ + std::vector functionAttributes(m_functionColLabels.size()); + + functionAttributes[0] = sidreGroup->getName(); + + if(sidreGroup->hasView("description")) + { + functionAttributes[1] = std::string(sidreGroup->getView("description")->getString()); + } + + functionAttributes[2] = getSignatureAsString(sidreGroup); + + if(sidreGroup->hasView("required")) + { + std::int8_t required = sidreGroup->getView("required")->getData(); + functionAttributes[3] = required ? "|check|" : "|uncheck|"; + } + else + { + functionAttributes[3] = "|uncheck|"; + } + + currentContainer.functionTable.push_back(functionAttributes); +} + +} // namespace inlet +} // namespace axom diff --git a/src/axom/inlet/SphinxWriter.hpp b/src/axom/inlet/SphinxWriter.hpp index ad657fc5c8..9e717ca74d 100644 --- a/src/axom/inlet/SphinxWriter.hpp +++ b/src/axom/inlet/SphinxWriter.hpp @@ -1,31 +1,31 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + /*! ******************************************************************************* * \file SphinxWriter.hpp * * \brief This file contains the class definition of the SphinxWriter. ******************************************************************************* - */ - -#include -#include -#include -#include - -#include "axom/sidre.hpp" -#include "axom/inlet/Writer.hpp" - -namespace axom -{ -namespace inlet -{ + */ + +#include +#include +#include +#include + +#include "axom/sidre.hpp" +#include "axom/inlet/Writer.hpp" + +namespace axom +{ +namespace inlet +{ /*! ******************************************************************************* * \class SphinxWriter @@ -35,26 +35,26 @@ namespace inlet * * \see Writer ******************************************************************************* - */ -class SphinxWriter : public Writer -{ -public: + */ +class SphinxWriter : public Writer +{ +public: /*! ******************************************************************************* * \brief A constructor for SphinxWriter. * * \param [in] fileName The name of the file the documentation should be written to. ******************************************************************************* - */ - SphinxWriter(const std::string& fileName); - - void documentContainer(const Container& container) override; - - void finalize() override; - - virtual ~SphinxWriter() = default; - -private: + */ + SphinxWriter(const std::string& fileName); + + void documentContainer(const Container& container) override; + + void finalize() override; + + virtual ~SphinxWriter() = default; + +private: /*! ***************************************************************************** * \brief Writes the title in RST syntax. @@ -64,9 +64,9 @@ class SphinxWriter : public Writer * \param [in] title The title to be written * ***************************************************************************** - */ - void writeTitle(const std::string& title); - + */ + void writeTitle(const std::string& title); + /*! ***************************************************************************** * \brief Writes the sub-title in RST syntax. @@ -76,9 +76,9 @@ class SphinxWriter : public Writer * \param [in] sub The sub-title to be written * ***************************************************************************** - */ - void writeSubtitle(const std::string& sub); - + */ + void writeSubtitle(const std::string& sub); + /*! ***************************************************************************** * \brief Writes a 4 column table in RST syntax. @@ -92,9 +92,9 @@ class SphinxWriter : public Writer * be translated into an RST table * ***************************************************************************** - */ - void writeTable(const std::string& title, const std::vector>& rstTable); - + */ + void writeTable(const std::string& title, const std::vector>& rstTable); + /*! ***************************************************************************** * \brief Writes all tables and their respective titles and descriptions. @@ -103,9 +103,9 @@ class SphinxWriter : public Writer * documentation and writes it to the ostringstream. * ***************************************************************************** - */ - void writeAllTables(); - + */ + void writeAllTables(); + /*! ******************************************************************************* * \struct ContainerData @@ -113,9 +113,9 @@ class SphinxWriter : public Writer * \brief A struct to store data associated with each inlet::Container. * ******************************************************************************* - */ - struct ContainerData - { + */ + struct ContainerData + { /*! ******************************************************************************* * \brief A constructor for the ContainerData struct @@ -125,25 +125,25 @@ class SphinxWriter : public Writer * \param[in] labels The column labels for the RST table * ******************************************************************************* - */ - ContainerData(const std::vector& fieldLabels, - const std::vector& functionLabels) - { - fieldTable.push_back(fieldLabels); - functionTable.push_back(functionLabels); - } - - // Copying shouldn't be needed, these will always be managed in a container - ContainerData(const ContainerData&) = delete; - ContainerData(ContainerData&&) = default; - - std::string containerName; - std::string description; - bool isSelectedElement = false; - std::vector> fieldTable; - std::vector> functionTable; - }; - + */ + ContainerData(const std::vector& fieldLabels, + const std::vector& functionLabels) + { + fieldTable.push_back(fieldLabels); + functionTable.push_back(functionLabels); + } + + // Copying shouldn't be needed, these will always be managed in a container + ContainerData(const ContainerData&) = delete; + ContainerData(ContainerData&&) = default; + + std::string containerName; + std::string description; + bool isSelectedElement = false; + std::vector> fieldTable; + std::vector> functionTable; + }; + /*! ******************************************************************************* * \brief Extracts Field information from the given Sidre Group and stores it @@ -157,9 +157,9 @@ class SphinxWriter : public Writer * extracted and then stored. * \param [inout] currentTable The ContainerData object to write field information to ******************************************************************************* - */ - void extractFieldMetadata(const axom::sidre::Group* sidreGroup, ContainerData& currentContainer); - + */ + void extractFieldMetadata(const axom::sidre::Group* sidreGroup, ContainerData& currentContainer); + /*! ******************************************************************************* * \brief Extracts Function information from the given Sidre Group and stores it @@ -173,9 +173,9 @@ class SphinxWriter : public Writer * extracted and then stored. * \param [inout] currentTable The TableData object to write function information to ******************************************************************************* - */ - void extractFunctionMetadata(const axom::sidre::Group* sidreGroup, ContainerData& currentContainer); - + */ + void extractFunctionMetadata(const axom::sidre::Group* sidreGroup, ContainerData& currentContainer); + /*! ******************************************************************************* * \brief Gets value information from the given Sidre View and returns @@ -185,9 +185,9 @@ class SphinxWriter : public Writer * * \return String representation of value information. ******************************************************************************* - */ - std::string getValueAsString(const axom::sidre::View* view); - + */ + std::string getValueAsString(const axom::sidre::View* view); + /*! ******************************************************************************* * \brief Gets range information from the given Sidre View and returns @@ -197,9 +197,9 @@ class SphinxWriter : public Writer * * \return String representation of range information. ******************************************************************************* - */ - std::string getRangeAsString(const axom::sidre::View* view); - + */ + std::string getRangeAsString(const axom::sidre::View* view); + /*! ******************************************************************************* * \brief Gets valid value(s) information from the given Sidre View and returns @@ -209,9 +209,9 @@ class SphinxWriter : public Writer * * \return String representation of valid value(s) information. ******************************************************************************* - */ - std::string getValidValuesAsString(const axom::sidre::View* view); - + */ + std::string getValidValuesAsString(const axom::sidre::View* view); + /*! ******************************************************************************* * \brief Gets valid string value(s) information from the given Sidre Group. @@ -221,9 +221,9 @@ class SphinxWriter : public Writer * * \return String listing the valid string values. ******************************************************************************* - */ - std::string getValidStringValues(const axom::sidre::Group* sidreGroup); - + */ + std::string getValidStringValues(const axom::sidre::Group* sidreGroup); + /*! ******************************************************************************* * \brief Gets function signature information from the given Sidre Group. @@ -233,20 +233,20 @@ class SphinxWriter : public Writer * * \return C-style function signature, i.e., Double(Vector, Double) ******************************************************************************* - */ - std::string getSignatureAsString(const axom::sidre::Group* sidreGroup); - - std::ofstream m_outFile; - std::ostringstream m_oss; - // This is needed to preserve the traversal order of the Inlet::Containers - std::vector m_inletContainerPathNames; - std::unordered_map m_rstTables; - std::string m_fileName; - // Used for the RST tables for fields - std::vector m_fieldColLabels; - // Used for the RST tables for functions - std::vector m_functionColLabels; -}; - -} // namespace inlet -} // namespace axom + */ + std::string getSignatureAsString(const axom::sidre::Group* sidreGroup); + + std::ofstream m_outFile; + std::ostringstream m_oss; + // This is needed to preserve the traversal order of the Inlet::Containers + std::vector m_inletContainerPathNames; + std::unordered_map m_rstTables; + std::string m_fileName; + // Used for the RST tables for fields + std::vector m_fieldColLabels; + // Used for the RST tables for functions + std::vector m_functionColLabels; +}; + +} // namespace inlet +} // namespace axom diff --git a/src/axom/inlet/Writer.hpp b/src/axom/inlet/Writer.hpp index 1ee3ad83cd..0ddfa52345 100644 --- a/src/axom/inlet/Writer.hpp +++ b/src/axom/inlet/Writer.hpp @@ -1,26 +1,26 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + /*! ******************************************************************************* * \file Writer.hpp * * \brief This file contains the abstract base class definition of Writer. ******************************************************************************* - */ - -namespace axom -{ -namespace inlet -{ -// Forward declaration -class Container; - + */ + +namespace axom +{ +namespace inlet +{ +// Forward declaration +class Container; + /*! ******************************************************************************* * \class Writer @@ -33,12 +33,12 @@ class Container; * * \see SphinxWriter ******************************************************************************* - */ -class Writer -{ -public: - virtual ~Writer() = default; - + */ +class Writer +{ +public: + virtual ~Writer() = default; + /*! ***************************************************************************** * \brief Generates documentation for a Container and its child Fields/Functions @@ -47,18 +47,18 @@ class Writer * \note Implementers of this function are not responsible for generating * documentation for child Containers of this Container - only child Fields/Functions ***************************************************************************** - */ - virtual void documentContainer(const Container& container) = 0; - + */ + virtual void documentContainer(const Container& container) = 0; + /*! ***************************************************************************** * \brief Finalizes documentation generation (e.g., by writing it to a file) * * This is a hint to implementers that no further containers will be documented ***************************************************************************** - */ - virtual void finalize() = 0; -}; - -} // namespace inlet -} // namespace axom + */ + virtual void finalize() = 0; +}; + +} // namespace inlet +} // namespace axom diff --git a/src/axom/inlet/examples/arrays.cpp b/src/axom/inlet/examples/arrays.cpp index fb814d21a3..67ede75e9f 100644 --- a/src/axom/inlet/examples/arrays.cpp +++ b/src/axom/inlet/examples/arrays.cpp @@ -1,56 +1,56 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include -#include - -#include "axom/inlet.hpp" - -int main() -{ - auto lr = std::make_unique(); - - // Parse example input file - lr->parseString("values = { [1] = 'start', [2] = 'stop', [3] = 'pause' }"); - - // Initialize Inlet - axom::inlet::Inlet inlet(std::move(lr)); - - // Register the verifier, which will verify the array values - auto& vals = inlet.getGlobalContainer().addStringArray("values"); - vals.registerVerifier([](const axom::inlet::Container& container) -> bool { - auto map = container.get>(); - bool startFound = false; - bool stopFound = false; - for(auto p : map) - { - if(p.second == "start") - { - startFound = true; - std::cout << "Found start at index " << p.first << std::endl; - } - else if(p.second == "stop") - { - stopFound = true; - std::cout << "Found stop at index " << p.first << std::endl; - } - } - return startFound && stopFound; - }); - - // We expect verfication to pass since values array has 3 elements - inlet.verify() ? std::cout << "Verification passed\n" : std::cout << "Verification failed\n"; - - // Print contents of map - std::unordered_map map = inlet["values"]; - std::cout << "\nMap Contents:\n"; - for(auto p : map) - { - std::cout << p.first << " " << p.second << std::endl; - } - - return 0; -} +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include +#include + +#include "axom/inlet.hpp" + +int main() +{ + auto lr = std::make_unique(); + + // Parse example input file + lr->parseString("values = { [1] = 'start', [2] = 'stop', [3] = 'pause' }"); + + // Initialize Inlet + axom::inlet::Inlet inlet(std::move(lr)); + + // Register the verifier, which will verify the array values + auto& vals = inlet.getGlobalContainer().addStringArray("values"); + vals.registerVerifier([](const axom::inlet::Container& container) -> bool { + auto map = container.get>(); + bool startFound = false; + bool stopFound = false; + for(auto p : map) + { + if(p.second == "start") + { + startFound = true; + std::cout << "Found start at index " << p.first << std::endl; + } + else if(p.second == "stop") + { + stopFound = true; + std::cout << "Found stop at index " << p.first << std::endl; + } + } + return startFound && stopFound; + }); + + // We expect verfication to pass since values array has 3 elements + inlet.verify() ? std::cout << "Verification passed\n" : std::cout << "Verification failed\n"; + + // Print contents of map + std::unordered_map map = inlet["values"]; + std::cout << "\nMap Contents:\n"; + for(auto p : map) + { + std::cout << p.first << " " << p.second << std::endl; + } + + return 0; +} diff --git a/src/axom/inlet/examples/containers.cpp b/src/axom/inlet/examples/containers.cpp index 37bfdbf737..36835af539 100644 --- a/src/axom/inlet/examples/containers.cpp +++ b/src/axom/inlet/examples/containers.cpp @@ -1,15 +1,15 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include -#include - -#include "axom/inlet.hpp" -#include "axom/slic/core/SimpleLogger.hpp" - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include +#include + +#include "axom/inlet.hpp" +#include "axom/slic/core/SimpleLogger.hpp" + /* Input file snippet used for documentation //_inlet_simple_types_containers_input_start @@ -23,14 +23,14 @@ driver = { } //_inlet_simple_types_containers_input_end -*/ - -int main() -{ - // Inlet requires a SLIC logger to be initialized to output runtime information - // This is a generic basic SLIC logger - axom::slic::SimpleLogger logger; - +*/ + +int main() +{ + // Inlet requires a SLIC logger to be initialized to output runtime information + // This is a generic basic SLIC logger + axom::slic::SimpleLogger logger; + const std::string input = R"( driver = { name = "Speed Racer", @@ -40,51 +40,51 @@ int main() horsepower = 200 } } - )"; - - // Create Inlet Reader that supports Lua input files - auto lr = std::make_unique(); - - // Parse example input file string - // Note: the Reader class also supports parseFile(std::string filepath) - lr->parseString(input); - - // Inlet stores all input file in the Sidre DataStore - axom::sidre::DataStore ds; - - // Create Inlet with LuaReader and the Sidre Group which Inlet will use - axom::inlet::Inlet inlet(std::move(lr), ds.getRoot()); - - // Define and store the values in the input file - // _inlet_simple_types_containers_add_start - auto& driver_schema = inlet.addStruct("driver", "A description of driver"); - driver_schema.addString("name", "Name of driver"); - - auto& car_schema = driver_schema.addStruct("car", "Car of driver"); - car_schema.addString("make", "Make of car"); - car_schema.addString("color", "Color of car").defaultValue("red"); - car_schema.addInt("seats", "Number of seats"); - car_schema.addInt("horsepower", "Amount of horsepower"); - // _inlet_simple_types_containers_add_end - - // Access values stored in the Datastore via Inlet - // _inlet_simple_types_containers_access_start - // Access values by fully qualified name from Inlet instance - std::string name = inlet["driver/name"]; - - // ... or... Get car container then access values from there - auto car = inlet["driver/car"]; - std::string make = car["make"]; - std::string color = car["color"]; - int seats = car["seats"]; - int horsepower = car["horsepower"]; - // _inlet_simple_types_containers_access_end - - std::cout << "name = " << name << std::endl; - std::cout << "make = " << make << std::endl; - std::cout << "color = " << color << std::endl; - std::cout << "seats = " << seats << std::endl; - std::cout << "horsepower = " << horsepower << std::endl; - - return 0; -} + )"; + + // Create Inlet Reader that supports Lua input files + auto lr = std::make_unique(); + + // Parse example input file string + // Note: the Reader class also supports parseFile(std::string filepath) + lr->parseString(input); + + // Inlet stores all input file in the Sidre DataStore + axom::sidre::DataStore ds; + + // Create Inlet with LuaReader and the Sidre Group which Inlet will use + axom::inlet::Inlet inlet(std::move(lr), ds.getRoot()); + + // Define and store the values in the input file + // _inlet_simple_types_containers_add_start + auto& driver_schema = inlet.addStruct("driver", "A description of driver"); + driver_schema.addString("name", "Name of driver"); + + auto& car_schema = driver_schema.addStruct("car", "Car of driver"); + car_schema.addString("make", "Make of car"); + car_schema.addString("color", "Color of car").defaultValue("red"); + car_schema.addInt("seats", "Number of seats"); + car_schema.addInt("horsepower", "Amount of horsepower"); + // _inlet_simple_types_containers_add_end + + // Access values stored in the Datastore via Inlet + // _inlet_simple_types_containers_access_start + // Access values by fully qualified name from Inlet instance + std::string name = inlet["driver/name"]; + + // ... or... Get car container then access values from there + auto car = inlet["driver/car"]; + std::string make = car["make"]; + std::string color = car["color"]; + int seats = car["seats"]; + int horsepower = car["horsepower"]; + // _inlet_simple_types_containers_access_end + + std::cout << "name = " << name << std::endl; + std::cout << "make = " << make << std::endl; + std::cout << "color = " << color << std::endl; + std::cout << "seats = " << seats << std::endl; + std::cout << "horsepower = " << horsepower << std::endl; + + return 0; +} diff --git a/src/axom/inlet/examples/documentation_generation.cpp b/src/axom/inlet/examples/documentation_generation.cpp index f6b2eac726..05ba0d75da 100644 --- a/src/axom/inlet/examples/documentation_generation.cpp +++ b/src/axom/inlet/examples/documentation_generation.cpp @@ -1,205 +1,205 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -// usage : ./inlet_documentation_generation_example --enableDocs --fil lua_file.lua - -#include "axom/inlet.hpp" -#include "axom/core/NumericLimits.hpp" -#include "axom/slic/core/SimpleLogger.hpp" - -#include "axom/CLI11.hpp" -#include - -using axom::inlet::Inlet; -using axom::inlet::LuaReader; -using axom::inlet::SphinxWriter; -using axom::sidre::DataStore; - -void findStr(std::string path, const Inlet& inlet) -{ - auto proxy = inlet[path]; - if(proxy.type() == axom::inlet::InletType::String) - { - std::cout << "found " << proxy.get(); - } - else - { - std::cout << "not found "; - } - std::cout << std::endl; -} - -void findInt(std::string path, const Inlet& inlet) -{ - auto proxy = inlet[path]; - if(proxy.type() == axom::inlet::InletType::Integer) - { - std::cout << "found " << proxy.get(); - } - else - { - std::cout << "not found "; - } - std::cout << std::endl; -} - -void findDouble(std::string path, const Inlet& inlet) -{ - auto proxy = inlet[path]; - if(proxy.type() == axom::inlet::InletType::Double) - { - std::cout << "found " << proxy.get(); - } - else - { - std::cout << "not found "; - } - std::cout << std::endl; -} - -void defineSchema(Inlet& inlet) -{ - // Add the description to the thermal_solver/mesh/filename Field - auto& filename_field = inlet.addString("thermal_solver/mesh/filename", "mesh filename"); - // Set the field's required property to true - filename_field.required(); - - inlet.addInt("thermal_solver/mesh/serial", "number of serial refinements") - .range(0, axom::numeric_limits::max()) - .defaultValue(1); - - // The description for thermal_solver/mesh/parallel is left unspecified - inlet.addInt("thermal_solver/mesh/parallel").range(1, axom::numeric_limits::max()).defaultValue(1); - - inlet.addInt("thermal_solver/order", "polynomial order") - .required() - .range(1, axom::numeric_limits::max()); - - auto& timestep_field = inlet.addString("thermal_solver/timestepper", "thermal solver timestepper"); - timestep_field.defaultValue("quasistatic") - .validValues({"quasistatic", "forwardeuler", "backwardeuler"}); - - auto& coef_type_field = inlet.addString("thermal_solver/u0/type", "description for u0 type"); - coef_type_field.defaultValue("constant").validValues({"constant", "function"}); - - inlet.addString("thermal_solver/u0/func", "description for u0 func").required(); - - inlet.addString("thermal_solver/kappa/type", "description for kappa type") - .required() - .validValues({"constant", "function"}); - - inlet.addDouble("thermal_solver/kappa/constant", "thermal conductivity constant").required(); - - // Add description to solver container by using the addStruct function - auto& solver_schema = inlet.addStruct("thermal_solver/solver", "linear equation solver options"); - - // You can also add fields through a container - - auto& rel_tol_field = solver_schema.addDouble("rel_tol", "solver relative tolerance"); - rel_tol_field.required(false); - rel_tol_field.defaultValue(1.e-6); - rel_tol_field.range(0.0, axom::numeric_limits::max()); - - auto& abs_tol_field = solver_schema.addDouble("abs_tol", "solver absolute tolerance"); - abs_tol_field.required(true); - abs_tol_field.defaultValue(1.e-12); - abs_tol_field.range(0.0, axom::numeric_limits::max()); - - auto& print_level_field = solver_schema.addInt("print_level", "solver print/debug level"); - print_level_field.required(true); - print_level_field.defaultValue(0); - print_level_field.range(0, 3); - - auto& max_iter_field = solver_schema.addInt("max_iter", "maximum iteration limit"); - max_iter_field.required(false); - max_iter_field.defaultValue(100); - max_iter_field.range(1, axom::numeric_limits::max()); - - auto& dt_field = solver_schema.addDouble("dt", "time step"); - dt_field.required(true); - dt_field.defaultValue(1); - dt_field.range(0.0, axom::numeric_limits::max()); - - auto& steps_field = solver_schema.addInt("steps", "number of steps/cycles to take"); - steps_field.required(true); - steps_field.defaultValue(1); - steps_field.range(1, axom::numeric_limits::max()); -} - -// Checking the contents of the passed inlet -void checkValues(const Inlet& inlet) -{ - findStr("thermal_solver/mesh/filename", inlet); - findStr("thermal_solver/timestepper", inlet); - findStr("thermal_solver/u0/type", inlet); - findStr("thermal_solver/u0/func", inlet); - findStr("thermal_solver/kappa/type", inlet); - - findInt("thermal_solver/mesh/serial", inlet); - findInt("thermal_solver/mesh/parallel", inlet); - findInt("thermal_solver/order", inlet); - findInt("thermal_solver/solver/print_level", inlet); - findInt("thermal_solver/solver/max_iter", inlet); - findInt("thermal_solver/solver/steps", inlet); - - findDouble("thermal_solver/solver/dt", inlet); - findDouble("thermal_solver/solver/abs_tol", inlet); - findDouble("thermal_solver/solver/rel_tol", inlet); - findDouble("thermal_solver/kappa/constant", inlet); - - // Verify that contents of Inlet meet the requirements of the specified schema - if(inlet.verify()) - { - SLIC_INFO("Inlet verify successful."); - } - else - { - SLIC_INFO("Inlet verify failed."); - } -} - -int main(int argc, char** argv) -{ - // Inlet requires a SLIC logger to be initialized to output runtime information - // This is a generic basic SLIC logger - axom::slic::SimpleLogger logger; - - // Handle command line arguments - axom::CLI::App app {"Basic example of Axom's Inlet component"}; - bool docsEnabled {false}; - app.add_flag("--enableDocs", docsEnabled, "Enables documentation generation"); - - std::string inputFileName; - auto opt = app.add_option("--file", inputFileName, "Path to input file"); - opt->check(axom::CLI::ExistingFile); - - CLI11_PARSE(app, argc, argv); - - // Create inlet and parse input file data into the inlet - - DataStore ds; - auto lr = std::make_unique(); - lr->parseFile(inputFileName); - Inlet inlet(std::move(lr), ds.getRoot(), docsEnabled); - - defineSchema(inlet); - checkValues(inlet); - - // Generate the documentation - // _inlet_documentation_generation_start - inlet.write(SphinxWriter("example_doc.rst")); - // _inlet_documentation_generation_end - - inlet.write(axom::inlet::JSONSchemaWriter("example_doc.json")); - - if(docsEnabled) - { - SLIC_INFO("Sphinx documentation was written to example_doc.rst\n"); - SLIC_INFO("A JSON schema was written to example_doc.json\n"); - } - - return 0; -} +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +// usage : ./inlet_documentation_generation_example --enableDocs --fil lua_file.lua + +#include "axom/inlet.hpp" +#include "axom/core/NumericLimits.hpp" +#include "axom/slic/core/SimpleLogger.hpp" + +#include "axom/CLI11.hpp" +#include + +using axom::inlet::Inlet; +using axom::inlet::LuaReader; +using axom::inlet::SphinxWriter; +using axom::sidre::DataStore; + +void findStr(std::string path, const Inlet& inlet) +{ + auto proxy = inlet[path]; + if(proxy.type() == axom::inlet::InletType::String) + { + std::cout << "found " << proxy.get(); + } + else + { + std::cout << "not found "; + } + std::cout << std::endl; +} + +void findInt(std::string path, const Inlet& inlet) +{ + auto proxy = inlet[path]; + if(proxy.type() == axom::inlet::InletType::Integer) + { + std::cout << "found " << proxy.get(); + } + else + { + std::cout << "not found "; + } + std::cout << std::endl; +} + +void findDouble(std::string path, const Inlet& inlet) +{ + auto proxy = inlet[path]; + if(proxy.type() == axom::inlet::InletType::Double) + { + std::cout << "found " << proxy.get(); + } + else + { + std::cout << "not found "; + } + std::cout << std::endl; +} + +void defineSchema(Inlet& inlet) +{ + // Add the description to the thermal_solver/mesh/filename Field + auto& filename_field = inlet.addString("thermal_solver/mesh/filename", "mesh filename"); + // Set the field's required property to true + filename_field.required(); + + inlet.addInt("thermal_solver/mesh/serial", "number of serial refinements") + .range(0, axom::numeric_limits::max()) + .defaultValue(1); + + // The description for thermal_solver/mesh/parallel is left unspecified + inlet.addInt("thermal_solver/mesh/parallel").range(1, axom::numeric_limits::max()).defaultValue(1); + + inlet.addInt("thermal_solver/order", "polynomial order") + .required() + .range(1, axom::numeric_limits::max()); + + auto& timestep_field = inlet.addString("thermal_solver/timestepper", "thermal solver timestepper"); + timestep_field.defaultValue("quasistatic") + .validValues({"quasistatic", "forwardeuler", "backwardeuler"}); + + auto& coef_type_field = inlet.addString("thermal_solver/u0/type", "description for u0 type"); + coef_type_field.defaultValue("constant").validValues({"constant", "function"}); + + inlet.addString("thermal_solver/u0/func", "description for u0 func").required(); + + inlet.addString("thermal_solver/kappa/type", "description for kappa type") + .required() + .validValues({"constant", "function"}); + + inlet.addDouble("thermal_solver/kappa/constant", "thermal conductivity constant").required(); + + // Add description to solver container by using the addStruct function + auto& solver_schema = inlet.addStruct("thermal_solver/solver", "linear equation solver options"); + + // You can also add fields through a container + + auto& rel_tol_field = solver_schema.addDouble("rel_tol", "solver relative tolerance"); + rel_tol_field.required(false); + rel_tol_field.defaultValue(1.e-6); + rel_tol_field.range(0.0, axom::numeric_limits::max()); + + auto& abs_tol_field = solver_schema.addDouble("abs_tol", "solver absolute tolerance"); + abs_tol_field.required(true); + abs_tol_field.defaultValue(1.e-12); + abs_tol_field.range(0.0, axom::numeric_limits::max()); + + auto& print_level_field = solver_schema.addInt("print_level", "solver print/debug level"); + print_level_field.required(true); + print_level_field.defaultValue(0); + print_level_field.range(0, 3); + + auto& max_iter_field = solver_schema.addInt("max_iter", "maximum iteration limit"); + max_iter_field.required(false); + max_iter_field.defaultValue(100); + max_iter_field.range(1, axom::numeric_limits::max()); + + auto& dt_field = solver_schema.addDouble("dt", "time step"); + dt_field.required(true); + dt_field.defaultValue(1); + dt_field.range(0.0, axom::numeric_limits::max()); + + auto& steps_field = solver_schema.addInt("steps", "number of steps/cycles to take"); + steps_field.required(true); + steps_field.defaultValue(1); + steps_field.range(1, axom::numeric_limits::max()); +} + +// Checking the contents of the passed inlet +void checkValues(const Inlet& inlet) +{ + findStr("thermal_solver/mesh/filename", inlet); + findStr("thermal_solver/timestepper", inlet); + findStr("thermal_solver/u0/type", inlet); + findStr("thermal_solver/u0/func", inlet); + findStr("thermal_solver/kappa/type", inlet); + + findInt("thermal_solver/mesh/serial", inlet); + findInt("thermal_solver/mesh/parallel", inlet); + findInt("thermal_solver/order", inlet); + findInt("thermal_solver/solver/print_level", inlet); + findInt("thermal_solver/solver/max_iter", inlet); + findInt("thermal_solver/solver/steps", inlet); + + findDouble("thermal_solver/solver/dt", inlet); + findDouble("thermal_solver/solver/abs_tol", inlet); + findDouble("thermal_solver/solver/rel_tol", inlet); + findDouble("thermal_solver/kappa/constant", inlet); + + // Verify that contents of Inlet meet the requirements of the specified schema + if(inlet.verify()) + { + SLIC_INFO("Inlet verify successful."); + } + else + { + SLIC_INFO("Inlet verify failed."); + } +} + +int main(int argc, char** argv) +{ + // Inlet requires a SLIC logger to be initialized to output runtime information + // This is a generic basic SLIC logger + axom::slic::SimpleLogger logger; + + // Handle command line arguments + axom::CLI::App app {"Basic example of Axom's Inlet component"}; + bool docsEnabled {false}; + app.add_flag("--enableDocs", docsEnabled, "Enables documentation generation"); + + std::string inputFileName; + auto opt = app.add_option("--file", inputFileName, "Path to input file"); + opt->check(axom::CLI::ExistingFile); + + CLI11_PARSE(app, argc, argv); + + // Create inlet and parse input file data into the inlet + + DataStore ds; + auto lr = std::make_unique(); + lr->parseFile(inputFileName); + Inlet inlet(std::move(lr), ds.getRoot(), docsEnabled); + + defineSchema(inlet); + checkValues(inlet); + + // Generate the documentation + // _inlet_documentation_generation_start + inlet.write(SphinxWriter("example_doc.rst")); + // _inlet_documentation_generation_end + + inlet.write(axom::inlet::JSONSchemaWriter("example_doc.json")); + + if(docsEnabled) + { + SLIC_INFO("Sphinx documentation was written to example_doc.rst\n"); + SLIC_INFO("A JSON schema was written to example_doc.json\n"); + } + + return 0; +} diff --git a/src/axom/inlet/examples/fields.cpp b/src/axom/inlet/examples/fields.cpp index 0a4d68536b..39037c8f0e 100644 --- a/src/axom/inlet/examples/fields.cpp +++ b/src/axom/inlet/examples/fields.cpp @@ -1,15 +1,15 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include -#include - -#include "axom/inlet.hpp" -#include "axom/slic/core/SimpleLogger.hpp" - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include +#include + +#include "axom/inlet.hpp" +#include "axom/slic/core/SimpleLogger.hpp" + /* Input file snippet used for documentation //_inlet_simple_types_fields_input_start @@ -19,92 +19,92 @@ a_simple_double = 7.5 a_simple_string = 'such simplicity' //_inlet_simple_types_fields_input_end -*/ - -int main() -{ - // Inlet requires a SLIC logger to be initialized to output runtime information - // This is a generic basic SLIC logger - axom::slic::SimpleLogger logger; - +*/ + +int main() +{ + // Inlet requires a SLIC logger to be initialized to output runtime information + // This is a generic basic SLIC logger + axom::slic::SimpleLogger logger; + const std::string input = R"( a_simple_bool = true a_simple_int = 5 a_simple_double = 7.5 a_simple_string = 'such simplicity' - )"; - - // Create Inlet Reader that supports Lua input files - auto lr = std::make_unique(); - - // Parse example input file string - // Note: the Reader class also supports parseFile(std::string filepath) - lr->parseString(input); - - // Inlet stores all input file in the Sidre DataStore - axom::sidre::DataStore ds; - - // Create Inlet with LuaReader and the Sidre Group which Inlet will use - axom::inlet::Inlet inlet(std::move(lr), ds.getRoot()); - - // _inlet_simple_types_fields_add_start - - // Define and store the values in the input file - - // Add an optional top-level boolean - inlet.addBool("a_simple_bool", "A description of a_simple_bool"); - - // Add an optional top-level integer - inlet.addInt("a_simple_int", "A description of a_simple_int"); - - // Add a required top-level double - inlet.addDouble("a_simple_double", "A description of a_simple_double").required(); - - // Add an optional top-level string - inlet.addString("a_simple_string", "A description of a_simple_string"); - - // Add an optional top-level integer with a default value of 17 if not defined by the user - inlet.addInt("a_defaulted_int", "An int that has a default value").defaultValue(17); - - // Add an optional top-level string not defined in the input file for example purposes - inlet.addString("does_not_exist", "Shows that not all fields need to be present in input file"); - // _inlet_simple_types_fields_add_end - - // _inlet_simple_types_fields_access_start - // Access values stored in the Datastore via Inlet - - // Check if input file contained info before accessing optional fields - if(inlet.contains("a_simple_bool")) - { - // Access field via "[]" operator, save value first to avoid type ambiquity - bool a_simple_bool = inlet["a_simple_bool"]; - std::cout << "a_simple_bool = " << a_simple_bool << std::endl; - } - - if(inlet.contains("a_simple_int")) - { - // Access field via `get` directly, no ambiquity - std::cout << "a_simple_int = " << inlet.get("a_simple_int") << std::endl; - } - - // Because this field was marked required, we do not have to call contains before accessing - std::cout << "a_simple_double = " << inlet.get("a_simple_double") << std::endl; - - if(inlet.contains("a_simple_string")) - { - std::string a_simple_string = inlet["a_simple_string"]; - std::cout << "a_simple_string = " << a_simple_string << std::endl; - } - - // If the user did not provide a value, the default value will be used. Safe to use - // without checking contains - int a_defaulted_int = inlet["a_defaulted_int"]; - std::cout << "a_defaulted_int = " << a_defaulted_int << std::endl; - // We can also verify that the user did not provided a value - std::cout << "a_defaulted_int provided by user: " << inlet.isUserProvided("a_defaulted_int") - << std::endl; - - // _inlet_simple_types_fields_access_end - - return 0; -} + )"; + + // Create Inlet Reader that supports Lua input files + auto lr = std::make_unique(); + + // Parse example input file string + // Note: the Reader class also supports parseFile(std::string filepath) + lr->parseString(input); + + // Inlet stores all input file in the Sidre DataStore + axom::sidre::DataStore ds; + + // Create Inlet with LuaReader and the Sidre Group which Inlet will use + axom::inlet::Inlet inlet(std::move(lr), ds.getRoot()); + + // _inlet_simple_types_fields_add_start + + // Define and store the values in the input file + + // Add an optional top-level boolean + inlet.addBool("a_simple_bool", "A description of a_simple_bool"); + + // Add an optional top-level integer + inlet.addInt("a_simple_int", "A description of a_simple_int"); + + // Add a required top-level double + inlet.addDouble("a_simple_double", "A description of a_simple_double").required(); + + // Add an optional top-level string + inlet.addString("a_simple_string", "A description of a_simple_string"); + + // Add an optional top-level integer with a default value of 17 if not defined by the user + inlet.addInt("a_defaulted_int", "An int that has a default value").defaultValue(17); + + // Add an optional top-level string not defined in the input file for example purposes + inlet.addString("does_not_exist", "Shows that not all fields need to be present in input file"); + // _inlet_simple_types_fields_add_end + + // _inlet_simple_types_fields_access_start + // Access values stored in the Datastore via Inlet + + // Check if input file contained info before accessing optional fields + if(inlet.contains("a_simple_bool")) + { + // Access field via "[]" operator, save value first to avoid type ambiquity + bool a_simple_bool = inlet["a_simple_bool"]; + std::cout << "a_simple_bool = " << a_simple_bool << std::endl; + } + + if(inlet.contains("a_simple_int")) + { + // Access field via `get` directly, no ambiquity + std::cout << "a_simple_int = " << inlet.get("a_simple_int") << std::endl; + } + + // Because this field was marked required, we do not have to call contains before accessing + std::cout << "a_simple_double = " << inlet.get("a_simple_double") << std::endl; + + if(inlet.contains("a_simple_string")) + { + std::string a_simple_string = inlet["a_simple_string"]; + std::cout << "a_simple_string = " << a_simple_string << std::endl; + } + + // If the user did not provide a value, the default value will be used. Safe to use + // without checking contains + int a_defaulted_int = inlet["a_defaulted_int"]; + std::cout << "a_defaulted_int = " << a_defaulted_int << std::endl; + // We can also verify that the user did not provided a value + std::cout << "a_defaulted_int provided by user: " << inlet.isUserProvided("a_defaulted_int") + << std::endl; + + // _inlet_simple_types_fields_access_end + + return 0; +} diff --git a/src/axom/inlet/examples/lua_library.cpp b/src/axom/inlet/examples/lua_library.cpp index 8ab4099f29..959cf32fd6 100644 --- a/src/axom/inlet/examples/lua_library.cpp +++ b/src/axom/inlet/examples/lua_library.cpp @@ -1,83 +1,83 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include -#include -#include -#include - -#include "axom/inlet.hpp" -#include "axom/slic/core/SimpleLogger.hpp" - -// _inlet_sol_state_start -// Header required here because `axom::sol::state` is only forward declared in LuaReader.hpp. -#include "axom/sol.hpp" - -class SolStateReader : public axom::inlet::LuaReader -{ -public: - using LuaReader::solState; -}; -// _inlet_sol_state_end - -int main() -{ - const std::string test_file_name = "load_library_test_file"; - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include +#include +#include +#include + +#include "axom/inlet.hpp" +#include "axom/slic/core/SimpleLogger.hpp" + +// _inlet_sol_state_start +// Header required here because `axom::sol::state` is only forward declared in LuaReader.hpp. +#include "axom/sol.hpp" + +class SolStateReader : public axom::inlet::LuaReader +{ +public: + using LuaReader::solState; +}; +// _inlet_sol_state_end + +int main() +{ + const std::string test_file_name = "load_library_test_file"; + const std::string input = R"( read_str = function () file = io.open('load_library_test_file', 'r') return file:read() end - )"; - - // Inlet requires a SLIC logger to be initialized to output runtime information - // This is a generic basic SLIC logger - axom::slic::SimpleLogger logger; - - // Write test file - std::ofstream myfile; - myfile.open(test_file_name); - myfile << "test_string"; - myfile.close(); - - // _inlet_io_library_add_start - // Create Inlet Reader that supports Lua input files - auto reader = std::make_unique(); - - // Load extra io Lua library - reader->solState()->open_libraries(axom::sol::lib::io); - - // Parse example input string - reader->parseString(input); - // _inlet_io_library_add_end - - // Inlet stores all input information in the Sidre DataStore - axom::sidre::DataStore ds; - - // Create Inlet with LuaReader and the Sidre Group which Inlet will use - axom::inlet::Inlet myinlet(std::move(reader), ds.getRoot()); - - // Define and store the values in the input file - myinlet.addFunction("read_str", - axom::inlet::FunctionTag::String, // Return type - {}, // Argument types - "The function reads a double from a file"); - - auto result = myinlet["read_str"].call(); - - if(result != "test_string") - { - std::cerr << "Failed to read 'test_string' from test file." << std::endl; - return 1; - } - std::cout << "Successfully read 'test_string' from test file." << std::endl; - - // Clean up test file - remove(test_file_name.c_str()); - - return 0; -} + )"; + + // Inlet requires a SLIC logger to be initialized to output runtime information + // This is a generic basic SLIC logger + axom::slic::SimpleLogger logger; + + // Write test file + std::ofstream myfile; + myfile.open(test_file_name); + myfile << "test_string"; + myfile.close(); + + // _inlet_io_library_add_start + // Create Inlet Reader that supports Lua input files + auto reader = std::make_unique(); + + // Load extra io Lua library + reader->solState()->open_libraries(axom::sol::lib::io); + + // Parse example input string + reader->parseString(input); + // _inlet_io_library_add_end + + // Inlet stores all input information in the Sidre DataStore + axom::sidre::DataStore ds; + + // Create Inlet with LuaReader and the Sidre Group which Inlet will use + axom::inlet::Inlet myinlet(std::move(reader), ds.getRoot()); + + // Define and store the values in the input file + myinlet.addFunction("read_str", + axom::inlet::FunctionTag::String, // Return type + {}, // Argument types + "The function reads a double from a file"); + + auto result = myinlet["read_str"].call(); + + if(result != "test_string") + { + std::cerr << "Failed to read 'test_string' from test file." << std::endl; + return 1; + } + std::cout << "Successfully read 'test_string' from test file." << std::endl; + + // Clean up test file + remove(test_file_name.c_str()); + + return 0; +} diff --git a/src/axom/inlet/examples/verification.cpp b/src/axom/inlet/examples/verification.cpp index 3591e3e5ac..6ed7b655d8 100644 --- a/src/axom/inlet/examples/verification.cpp +++ b/src/axom/inlet/examples/verification.cpp @@ -1,14 +1,14 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include -#include "axom/inlet.hpp" -#include "axom/slic/core/SimpleLogger.hpp" - -// _inlet_verification_input_start +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include +#include "axom/inlet.hpp" +#include "axom/slic/core/SimpleLogger.hpp" + +// _inlet_verification_input_start const std::string input = R"( dimensions = 2 dim = 2 -- An example typo, should be "dimensions" and not "dim" @@ -17,115 +17,115 @@ const std::string input = R"( y = 2.0, z = 3.0 -- Only 2 component vectors are supported } -)"; -// _inlet_verification_input_end - -int main() -{ - // Inlet requires a SLIC logger to be initialized to output runtime information - // This is a generic basic SLIC logger - axom::slic::SimpleLogger logger; - - // Initialize Inlet - auto lr = std::make_unique(); - lr->parseString(input); - axom::inlet::Inlet myInlet(std::move(lr)); - - // _inlet_workflow_defining_schema_start - // defines a required global field named "dimensions" with a default value of 2 - myInlet.addInt("dimensions").required(true).defaultValue(2); - - // _inlet_verification_container_start - // defines a required container named vector with an internal field named 'x' - auto& v = myInlet.addStruct("vector").required(true); - // _inlet_verification_container_end - v.addDouble("x"); - // _inlet_workflow_defining_schema_end - - // _inlet_verification_strict_start - v.strict(); - // _inlet_verification_strict_end - - // _inlet_workflow_verification_start - v.registerVerifier([&myInlet](const axom::inlet::Container& container) -> bool { - int dim = myInlet["dimensions"]; - bool x_present = - container.contains("x") && (container["x"].type() == axom::inlet::InletType::Double); - bool y_present = - container.contains("y") && (container["y"].type() == axom::inlet::InletType::Double); - bool z_present = - container.contains("z") && (container["z"].type() == axom::inlet::InletType::Double); - if(dim == 1 && x_present) - { - return true; - } - else if(dim == 2 && x_present && y_present) - { - return true; - } - else if(dim == 3 && x_present && y_present && z_present) - { - return true; - } - return false; - }); - - std::string msg; - // We expect verification to be unsuccessful since the only Field - // in vector is x but 2 dimensions are expected - SLIC_INFO("This should fail due to a missing dimension:"); - myInlet.verify() ? msg = "Verification was successful\n" : msg = "Verification was unsuccessful\n"; - SLIC_INFO(msg); - - // Add required dimension to schema - v.addDouble("y"); - - // We expect the verification to succeed because vector now contains - // both x and y to match the 2 dimensions - SLIC_INFO("After adding the required dimension:"); - myInlet.verify() ? msg = "Verification was successful\n" : msg = "Verification was unsuccessful\n"; - SLIC_INFO(msg); - // _inlet_workflow_verification_end - - // _inlet_workflow_accessing_data_start - - // Get dimensions if it was present in input file - auto proxy = myInlet["dimensions"]; - if(proxy.type() == axom::inlet::InletType::Integer) - { - msg = "Dimensions = " + std::to_string(proxy.get()) + "\n"; - SLIC_INFO(msg); - } - - // Get vector information if it was present in input file - bool x_found = myInlet["vector/x"].type() == axom::inlet::InletType::Double; - bool y_found = myInlet["vector/y"].type() == axom::inlet::InletType::Double; - if(x_found && y_found) - { - msg = "Vector = " + std::to_string(myInlet["vector/x"].get()) + "," + - std::to_string(myInlet["vector/y"].get()) + "\n"; - SLIC_INFO(msg); - } - // _inlet_workflow_accessing_data_end - - // _inlet_verification_toplevel_unexpected_start - const std::vector all_unexpected_names = - myInlet.unexpectedNames(); // {"dim", "vector/z"} - // _inlet_verification_toplevel_unexpected_end - - for(const auto& name : all_unexpected_names) - { - SLIC_INFO("Entry '" << name << "' was not expected"); - } - - // _inlet_verification_container_unexpected_start - const std::vector vector_unexpected_names = v.unexpectedNames(); // {"vector/z"} - // _inlet_verification_container_unexpected_end - - for(const auto& name : vector_unexpected_names) - { - SLIC_INFO("Within the vector, entry '" << name << "' was not expected"); - } - - return 0; -} +)"; +// _inlet_verification_input_end + +int main() +{ + // Inlet requires a SLIC logger to be initialized to output runtime information + // This is a generic basic SLIC logger + axom::slic::SimpleLogger logger; + + // Initialize Inlet + auto lr = std::make_unique(); + lr->parseString(input); + axom::inlet::Inlet myInlet(std::move(lr)); + + // _inlet_workflow_defining_schema_start + // defines a required global field named "dimensions" with a default value of 2 + myInlet.addInt("dimensions").required(true).defaultValue(2); + + // _inlet_verification_container_start + // defines a required container named vector with an internal field named 'x' + auto& v = myInlet.addStruct("vector").required(true); + // _inlet_verification_container_end + v.addDouble("x"); + // _inlet_workflow_defining_schema_end + + // _inlet_verification_strict_start + v.strict(); + // _inlet_verification_strict_end + + // _inlet_workflow_verification_start + v.registerVerifier([&myInlet](const axom::inlet::Container& container) -> bool { + int dim = myInlet["dimensions"]; + bool x_present = + container.contains("x") && (container["x"].type() == axom::inlet::InletType::Double); + bool y_present = + container.contains("y") && (container["y"].type() == axom::inlet::InletType::Double); + bool z_present = + container.contains("z") && (container["z"].type() == axom::inlet::InletType::Double); + if(dim == 1 && x_present) + { + return true; + } + else if(dim == 2 && x_present && y_present) + { + return true; + } + else if(dim == 3 && x_present && y_present && z_present) + { + return true; + } + return false; + }); + + std::string msg; + // We expect verification to be unsuccessful since the only Field + // in vector is x but 2 dimensions are expected + SLIC_INFO("This should fail due to a missing dimension:"); + myInlet.verify() ? msg = "Verification was successful\n" : msg = "Verification was unsuccessful\n"; + SLIC_INFO(msg); + + // Add required dimension to schema + v.addDouble("y"); + + // We expect the verification to succeed because vector now contains + // both x and y to match the 2 dimensions + SLIC_INFO("After adding the required dimension:"); + myInlet.verify() ? msg = "Verification was successful\n" : msg = "Verification was unsuccessful\n"; + SLIC_INFO(msg); + // _inlet_workflow_verification_end + + // _inlet_workflow_accessing_data_start + + // Get dimensions if it was present in input file + auto proxy = myInlet["dimensions"]; + if(proxy.type() == axom::inlet::InletType::Integer) + { + msg = "Dimensions = " + std::to_string(proxy.get()) + "\n"; + SLIC_INFO(msg); + } + + // Get vector information if it was present in input file + bool x_found = myInlet["vector/x"].type() == axom::inlet::InletType::Double; + bool y_found = myInlet["vector/y"].type() == axom::inlet::InletType::Double; + if(x_found && y_found) + { + msg = "Vector = " + std::to_string(myInlet["vector/x"].get()) + "," + + std::to_string(myInlet["vector/y"].get()) + "\n"; + SLIC_INFO(msg); + } + // _inlet_workflow_accessing_data_end + + // _inlet_verification_toplevel_unexpected_start + const std::vector all_unexpected_names = + myInlet.unexpectedNames(); // {"dim", "vector/z"} + // _inlet_verification_toplevel_unexpected_end + + for(const auto& name : all_unexpected_names) + { + SLIC_INFO("Entry '" << name << "' was not expected"); + } + + // _inlet_verification_container_unexpected_start + const std::vector vector_unexpected_names = v.unexpectedNames(); // {"vector/z"} + // _inlet_verification_container_unexpected_end + + for(const auto& name : vector_unexpected_names) + { + SLIC_INFO("Within the vector, entry '" << name << "' was not expected"); + } + + return 0; +} diff --git a/src/axom/inlet/inlet_utils.cpp b/src/axom/inlet/inlet_utils.cpp index abcb7aa7fb..85cbb2d217 100644 --- a/src/axom/inlet/inlet_utils.cpp +++ b/src/axom/inlet/inlet_utils.cpp @@ -1,167 +1,167 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include "axom/inlet/inlet_utils.hpp" - -namespace axom -{ -namespace inlet -{ -void setWarningFlag(axom::sidre::Group* root) -{ - if(!root->hasView("warningFlag")) - { - root->createViewScalar("warningFlag", 1); - } -} - -void setFlag(axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag, bool value) -{ - const std::int8_t bval = value ? 1 : 0; - if(target.hasView(flag)) - { - auto flagView = target.getView(flag); - if(flagView->getData() != bval) - { - const std::string msg = - fmt::format("[Inlet] '{0}' value has already been defined for: {1}", flag, target.getName()); - - SLIC_WARNING(msg); - setWarningFlag(&root); - } - } - else - { - if(value) - { - target.createViewScalar(flag, bval); - } - else - { - target.createViewScalar(flag, bval); - } - } -} - -bool checkFlag(const axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag) -{ - if(!target.hasView(flag)) - { - return false; - } - const axom::sidre::View* valueView = target.getView(flag); - const std::int8_t intValue = valueView->getScalar(); - if(intValue < 0 || intValue > 1) - { - const std::string msg = fmt::format( - "[Inlet] Invalid integer value stored in " - " boolean value named {0} for flag '{1}'", - target.getName(), - flag); - SLIC_WARNING(msg); - setWarningFlag(&root); - return static_cast(intValue); - } - - return static_cast(intValue); -} - -bool verifyRequired(const axom::sidre::Group& target, - const bool condition, - const std::string& type, - std::vector* errors) -{ - // Assume that it wasn't found - ReaderResult status = ReaderResult::NotFound; - if(target.hasView("retrieval_status")) - { - status = - static_cast(static_cast(target.getView("retrieval_status")->getData())); - } - - if(target.hasView("required")) - { - std::int8_t required = target.getView("required")->getData(); - // If it wasn't found at all, it's only an error if the object was required and not provided - // The retrieval_status will typically (but not always) be NotFound in these cases, but that - // information isn't needed here unless it's a collection group - empty collections are permissible, - // so they shouldn't impede verification if they existed but were empty (hence Success check) - if(required && !condition && - (!isCollectionGroup(target.getPathName()) || status != ReaderResult::Success)) - { - const std::string msg = fmt::format( - "[Inlet] Required {0} not " - "specified: {1}", - type, - target.getPathName()); - INLET_VERIFICATION_WARNING(target.getPathName(), msg, errors); - return false; - } - } - - // If it was the wrong type or part of a non-homogeneous array, it's always an error, - // even if the object wasn't marked as required - if(status == ReaderResult::WrongType || status == ReaderResult::NotHomogeneous) - { - const std::string reason = - (status == ReaderResult::WrongType) ? "of the wrong type" : "not homogeneous"; - const std::string msg = - fmt::format("[Inlet] {0} '{1}' was {2}", type, target.getPathName(), reason); - INLET_VERIFICATION_WARNING(target.getPathName(), msg, errors); - return false; - } - return true; -} - -void markAsStructCollection(axom::sidre::Group& target) -{ - if(target.hasView(detail::STRUCT_COLLECTION_FLAG)) - { - // This flag should only ever be one, so we verify that and error otherwise - const sidre::View* flag = target.getView(detail::STRUCT_COLLECTION_FLAG); - SLIC_ERROR_IF(!flag->isScalar(), - fmt::format("[Inlet] Struct collection flag of group '{0}' was not a scalar", - target.getName())); - const std::int8_t value = flag->getScalar(); - SLIC_ERROR_IF(value != 1, - fmt::format("[Inlet] Struct collection flag of group '{0}' " - "had a value other than 1", - target.getName())); - } - else - { - target.createViewScalar(detail::STRUCT_COLLECTION_FLAG, static_cast(1)); - } -} - -void markRetrievalStatus(axom::sidre::Group& target, const ReaderResult result) -{ - if(!target.hasView("retrieval_status")) - { - target.createViewScalar("retrieval_status", static_cast(result)); - } -} - -ReaderResult collectionRetrievalResult(const bool contains_other_type, - const bool contains_requested_type) -{ - // First check if the collection was entirely the wrong type - if(contains_other_type && !contains_requested_type) - { - return ReaderResult::WrongType; - } - // Then check if some values were of the correct type, but others weren't - else if(contains_other_type) - { - return ReaderResult::NotHomogeneous; - } - // Otherwise we mark it as successful - having just an empty collection - // counts as success - return ReaderResult::Success; -} - -} // namespace inlet -} // namespace axom +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include "axom/inlet/inlet_utils.hpp" + +namespace axom +{ +namespace inlet +{ +void setWarningFlag(axom::sidre::Group* root) +{ + if(!root->hasView("warningFlag")) + { + root->createViewScalar("warningFlag", 1); + } +} + +void setFlag(axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag, bool value) +{ + const std::int8_t bval = value ? 1 : 0; + if(target.hasView(flag)) + { + auto flagView = target.getView(flag); + if(flagView->getData() != bval) + { + const std::string msg = + fmt::format("[Inlet] '{0}' value has already been defined for: {1}", flag, target.getName()); + + SLIC_WARNING(msg); + setWarningFlag(&root); + } + } + else + { + if(value) + { + target.createViewScalar(flag, bval); + } + else + { + target.createViewScalar(flag, bval); + } + } +} + +bool checkFlag(const axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag) +{ + if(!target.hasView(flag)) + { + return false; + } + const axom::sidre::View* valueView = target.getView(flag); + const std::int8_t intValue = valueView->getScalar(); + if(intValue < 0 || intValue > 1) + { + const std::string msg = fmt::format( + "[Inlet] Invalid integer value stored in " + " boolean value named {0} for flag '{1}'", + target.getName(), + flag); + SLIC_WARNING(msg); + setWarningFlag(&root); + return static_cast(intValue); + } + + return static_cast(intValue); +} + +bool verifyRequired(const axom::sidre::Group& target, + const bool condition, + const std::string& type, + std::vector* errors) +{ + // Assume that it wasn't found + ReaderResult status = ReaderResult::NotFound; + if(target.hasView("retrieval_status")) + { + status = + static_cast(static_cast(target.getView("retrieval_status")->getData())); + } + + if(target.hasView("required")) + { + std::int8_t required = target.getView("required")->getData(); + // If it wasn't found at all, it's only an error if the object was required and not provided + // The retrieval_status will typically (but not always) be NotFound in these cases, but that + // information isn't needed here unless it's a collection group - empty collections are permissible, + // so they shouldn't impede verification if they existed but were empty (hence Success check) + if(required && !condition && + (!isCollectionGroup(target.getPathName()) || status != ReaderResult::Success)) + { + const std::string msg = fmt::format( + "[Inlet] Required {0} not " + "specified: {1}", + type, + target.getPathName()); + INLET_VERIFICATION_WARNING(target.getPathName(), msg, errors); + return false; + } + } + + // If it was the wrong type or part of a non-homogeneous array, it's always an error, + // even if the object wasn't marked as required + if(status == ReaderResult::WrongType || status == ReaderResult::NotHomogeneous) + { + const std::string reason = + (status == ReaderResult::WrongType) ? "of the wrong type" : "not homogeneous"; + const std::string msg = + fmt::format("[Inlet] {0} '{1}' was {2}", type, target.getPathName(), reason); + INLET_VERIFICATION_WARNING(target.getPathName(), msg, errors); + return false; + } + return true; +} + +void markAsStructCollection(axom::sidre::Group& target) +{ + if(target.hasView(detail::STRUCT_COLLECTION_FLAG)) + { + // This flag should only ever be one, so we verify that and error otherwise + const sidre::View* flag = target.getView(detail::STRUCT_COLLECTION_FLAG); + SLIC_ERROR_IF(!flag->isScalar(), + fmt::format("[Inlet] Struct collection flag of group '{0}' was not a scalar", + target.getName())); + const std::int8_t value = flag->getScalar(); + SLIC_ERROR_IF(value != 1, + fmt::format("[Inlet] Struct collection flag of group '{0}' " + "had a value other than 1", + target.getName())); + } + else + { + target.createViewScalar(detail::STRUCT_COLLECTION_FLAG, static_cast(1)); + } +} + +void markRetrievalStatus(axom::sidre::Group& target, const ReaderResult result) +{ + if(!target.hasView("retrieval_status")) + { + target.createViewScalar("retrieval_status", static_cast(result)); + } +} + +ReaderResult collectionRetrievalResult(const bool contains_other_type, + const bool contains_requested_type) +{ + // First check if the collection was entirely the wrong type + if(contains_other_type && !contains_requested_type) + { + return ReaderResult::WrongType; + } + // Then check if some values were of the correct type, but others weren't + else if(contains_other_type) + { + return ReaderResult::NotHomogeneous; + } + // Otherwise we mark it as successful - having just an empty collection + // counts as success + return ReaderResult::Success; +} + +} // namespace inlet +} // namespace axom diff --git a/src/axom/inlet/inlet_utils.hpp b/src/axom/inlet/inlet_utils.hpp index fcafb8781c..83e510166f 100644 --- a/src/axom/inlet/inlet_utils.hpp +++ b/src/axom/inlet/inlet_utils.hpp @@ -1,49 +1,49 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - -#include -#include - -#include "axom/sidre.hpp" -#include "axom/fmt.hpp" -#include "axom/core/utilities/StringUtilities.hpp" -#include "axom/core/Path.hpp" - -namespace axom -{ -namespace inlet -{ -enum class ReaderResult -{ - Success, // Found with no issue - NotFound, // Path does not exist in the input file - NotHomogeneous, // Found, but elements of other type exist - WrongType // Found, but item at specified path was not of requested type -}; - +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + +#include +#include + +#include "axom/sidre.hpp" +#include "axom/fmt.hpp" +#include "axom/core/utilities/StringUtilities.hpp" +#include "axom/core/Path.hpp" + +namespace axom +{ +namespace inlet +{ +enum class ReaderResult +{ + Success, // Found with no issue + NotFound, // Path does not exist in the input file + NotHomogeneous, // Found, but elements of other type exist + WrongType // Found, but item at specified path was not of requested type +}; + /*! ***************************************************************************** * \brief Information on an Inlet verification error ***************************************************************************** - */ -struct VerificationError -{ - /// \brief The path to the container/field/function with the error - const axom::Path path; - /// \brief The error message - const std::string message; - /// \brief Returns whether a given substring is present in the error message - bool messageContains(const std::string substr) const - { - return message.find(substr) != std::string::npos; - } -}; - + */ +struct VerificationError +{ + /// \brief The path to the container/field/function with the error + const axom::Path path; + /// \brief The error message + const std::string message; + /// \brief Returns whether a given substring is present in the error message + bool messageContains(const std::string substr) const + { + return message.find(substr) != std::string::npos; + } +}; + /*! ***************************************************************************** * \brief Utility macro for selecting between logging to SLIC and logging @@ -52,17 +52,17 @@ struct VerificationError * \param msg The warning message * \param errs The list of errors, must be of type \p std::vector* ***************************************************************************** - */ -#define INLET_VERIFICATION_WARNING(path, msg, errs) \ - if(errs) \ - { \ - errs->push_back({axom::Path {path}, msg}); \ - } \ - else \ - { \ - SLIC_WARNING(msg); \ - } - + */ +#define INLET_VERIFICATION_WARNING(path, msg, errs) \ + if(errs) \ + { \ + errs->push_back({axom::Path {path}, msg}); \ + } \ + else \ + { \ + SLIC_WARNING(msg); \ + } + /*! ***************************************************************************** * \brief This function is used to mark if anything went wrong during the @@ -71,9 +71,9 @@ struct VerificationError * \param [in] root Pointer to the Sidre Root Group where the warning flag * will be set. ***************************************************************************** -*/ -void setWarningFlag(axom::sidre::Group* root); - +*/ +void setWarningFlag(axom::sidre::Group* root); + /*! ***************************************************************************** * \brief This function is used to add a flag to the Inlet object @@ -86,9 +86,9 @@ void setWarningFlag(axom::sidre::Group* root); * \param [in] flag The name of the flag to set * \param [in] value The value of the flag ***************************************************************************** -*/ -void setFlag(axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag, bool value); - +*/ +void setFlag(axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag, bool value); + /*! ***************************************************************************** * \brief This function is used to determine the value of a flag for the @@ -101,9 +101,9 @@ void setFlag(axom::sidre::Group& target, axom::sidre::Group& root, const std::st * \param [in] flag The name of the flag to check * \return The value of the flag ***************************************************************************** -*/ -bool checkFlag(const axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag); - +*/ +bool checkFlag(const axom::sidre::Group& target, axom::sidre::Group& root, const std::string& flag); + /*! ***************************************************************************** * \brief This function is used to verify the required-ness of the Inlet object @@ -118,40 +118,40 @@ bool checkFlag(const axom::sidre::Group& target, axom::sidre::Group& root, const * \return False if the object was required but \p condition was false, True otherwise * \post If the function returns False, a warning message will be emitted ***************************************************************************** -*/ -bool verifyRequired(const axom::sidre::Group& target, - const bool condition, - const std::string& type, - std::vector* errors = nullptr); - -namespace detail -{ +*/ +bool verifyRequired(const axom::sidre::Group& target, + const bool condition, + const std::string& type, + std::vector* errors = nullptr); + +namespace detail +{ /*! ******************************************************************************* * Names of the internal collection data and collection index groups/fields * used for managing arrays/dictionaries ******************************************************************************* - */ -const std::string COLLECTION_GROUP_NAME = "_inlet_collection"; -const std::string COLLECTION_INDICES_NAME = "_inlet_collection_indices"; -const std::string STRUCT_COLLECTION_FLAG = "_inlet_struct_collection"; -const std::string VARIANT_STRUCT_COLLECTION_FLAG = "_inlet_variant_struct_collection"; -const std::string REQUIRED_FLAG = "required"; -const std::string STRICT_FLAG = "strict"; -} // namespace detail - + */ +const std::string COLLECTION_GROUP_NAME = "_inlet_collection"; +const std::string COLLECTION_INDICES_NAME = "_inlet_collection_indices"; +const std::string STRUCT_COLLECTION_FLAG = "_inlet_struct_collection"; +const std::string VARIANT_STRUCT_COLLECTION_FLAG = "_inlet_variant_struct_collection"; +const std::string REQUIRED_FLAG = "required"; +const std::string STRICT_FLAG = "strict"; +} // namespace detail + /*! ***************************************************************************** * \brief Determines whether a Container is a collection group * * \param [in] name The name of the container ***************************************************************************** -*/ -inline bool isCollectionGroup(const std::string& name) -{ - return axom::utilities::string::endsWith(name, detail::COLLECTION_GROUP_NAME); -} - +*/ +inline bool isCollectionGroup(const std::string& name) +{ + return axom::utilities::string::endsWith(name, detail::COLLECTION_GROUP_NAME); +} + /*! ***************************************************************************** * \brief Marks the sidre::Group as a "struct collection" by adding a @@ -159,9 +159,9 @@ inline bool isCollectionGroup(const std::string& name) * * \param [inout] target The group to tag ***************************************************************************** -*/ -void markAsStructCollection(axom::sidre::Group& target); - +*/ +void markAsStructCollection(axom::sidre::Group& target); + /*! ***************************************************************************** * \brief Adds a ReaderResult to a sidre::Group corresponding to an inlet @@ -170,9 +170,9 @@ void markAsStructCollection(axom::sidre::Group& target); * \param [inout] target The group to tag * \param [in] result The retrieval result ***************************************************************************** -*/ -void markRetrievalStatus(axom::sidre::Group& target, const ReaderResult result); - +*/ +void markRetrievalStatus(axom::sidre::Group& target, const ReaderResult result); + /*! ***************************************************************************** * \brief Returns the corresponding retrieval result for a collection depending @@ -184,9 +184,9 @@ void markRetrievalStatus(axom::sidre::Group& target, const ReaderResult result); * \param [in] contains_requested_type Whether the collection of requested type * was not empty, i.e., if any elements of the requested type were present ***************************************************************************** -*/ -ReaderResult collectionRetrievalResult(const bool contains_other_type, - const bool contains_requested_type); - -} // namespace inlet -} // namespace axom +*/ +ReaderResult collectionRetrievalResult(const bool contains_other_type, + const bool contains_requested_type); + +} // namespace inlet +} // namespace axom diff --git a/src/axom/klee/Geometry.hpp b/src/axom/klee/Geometry.hpp index f7f477431e..3696b44dec 100644 --- a/src/axom/klee/Geometry.hpp +++ b/src/axom/klee/Geometry.hpp @@ -34,8 +34,8 @@ struct TransformableGeometryProperties * \param rhs the right-hand-side operand * \return true if and only if all properties are equal */ -bool operator==(const TransformableGeometryProperties &lhs, - const TransformableGeometryProperties &rhs); +bool operator==(const TransformableGeometryProperties& lhs, + const TransformableGeometryProperties& rhs); /** * Compare transformable properties for inequality. @@ -43,8 +43,8 @@ bool operator==(const TransformableGeometryProperties &lhs, * \param rhs the right-hand-side operand * \return false if and only if all properties are equal */ -inline bool operator!=(const TransformableGeometryProperties &lhs, - const TransformableGeometryProperties &rhs) +inline bool operator!=(const TransformableGeometryProperties& lhs, + const TransformableGeometryProperties& rhs) { return !(lhs == rhs); } @@ -69,7 +69,7 @@ class Geometry * \param path the path of the file * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, + Geometry(const TransformableGeometryProperties& startProperties, std::string format, std::string path, std::shared_ptr operator_); @@ -83,9 +83,9 @@ class Geometry * \param topology The blueprint topology to use. * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::sidre::Group *simplexMeshGroup, - const std::string &topology, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::sidre::Group* simplexMeshGroup, + const std::string& topology, std::shared_ptr operator_); /** @@ -95,8 +95,8 @@ class Geometry * \param tet Tetrahedron * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::primal::Tetrahedron &tet, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::primal::Tetrahedron& tet, std::shared_ptr operator_); /** @@ -106,8 +106,8 @@ class Geometry * \param hex Hexahedron * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::primal::Hexahedron &hex, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::primal::Hexahedron& hex, std::shared_ptr operator_); /** @@ -118,8 +118,8 @@ class Geometry * \param levelOfRefinement Number of refinement levels to use for discretizing the sphere. * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::primal::Sphere &sphere, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::primal::Sphere& sphere, axom::IndexType levelOfRefinement, std::shared_ptr operator_); @@ -138,10 +138,10 @@ class Geometry * * \c sorAxis should point in the direction of increasing z. */ - Geometry(const TransformableGeometryProperties &startProperties, + Geometry(const TransformableGeometryProperties& startProperties, axom::ArrayView discreteFunction, - const Point3D &sorOrigin, - const Vector3D &sorDirection, + const Point3D& sorOrigin, + const Vector3D& sorDirection, axom::IndexType levelOfRefinement, std::shared_ptr operator_); @@ -155,8 +155,8 @@ class Geometry * discretizing the sphere. * \param operator_ a possibly null operator to apply to the geometry. */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::primal::Cone &cone, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::primal::Cone& cone, axom::IndexType levelOfRefinement, std::shared_ptr operator_); @@ -169,16 +169,16 @@ class Geometry * * The space on the positive normal side of the plane is considered "inside the shape". */ - Geometry(const TransformableGeometryProperties &startProperties, - const axom::primal::Plane &plane, + Geometry(const TransformableGeometryProperties& startProperties, + const axom::primal::Plane& plane, std::shared_ptr operator_); /*! * @brief Geometry definition in hierarchical format. */ - const conduit::Node &asHierarchy() const { return m_geomInfo; } + const conduit::Node& asHierarchy() const { return m_geomInfo; } - conduit::Node &asHierarchy() { return m_geomInfo; } + conduit::Node& asHierarchy() { return m_geomInfo; } /** * \brief Get the format in which the geometry was specified. @@ -202,7 +202,7 @@ class Geometry * deprecate geometry-specific interfaces, so new shapes can be added * without modifying this code. */ - const std::string &getFormat() const { return m_format; } + const std::string& getFormat() const { return m_format; } /** * Get the path at which to find the specification of the geometry, @@ -210,7 +210,7 @@ class Geometry * * \return the path to the geometry file */ - const std::string &getPath() const { return m_path; } + const std::string& getPath() const { return m_path; } /** * Returns the dimensions of the geometry before applying operators @@ -226,13 +226,13 @@ class Geometry * \brief Return the blueprint mesh, for formats that are specified * by a blueprint mesh or have been converted to a blueprint mesh. */ - const axom::sidre::Group *getBlueprintMesh() const; + const axom::sidre::Group* getBlueprintMesh() const; /** * \brief Return the blueprint mesh topology, for formats that are specified * by a blueprint mesh or have been converted to a blueprint mesh. */ - const std::string &getBlueprintTopology() const; + const std::string& getBlueprintTopology() const; /// \brief Return the SOR axis direction. const Vector3D getSorDirection() const { return m_sorDirection; } @@ -257,7 +257,7 @@ class Geometry * * \return a potentially null operator to apply to the geometry */ - std::shared_ptr const &getGeometryOperator() const { return m_operator; } + std::shared_ptr const& getGeometryOperator() const { return m_operator; } /** * Get any operator transforms concatenated into a 4x4 matrix. If there are no @@ -273,7 +273,7 @@ class Geometry * * \return the initial transformable properties of this geometry */ - const TransformableGeometryProperties &getStartProperties() const { return m_startProperties; } + const TransformableGeometryProperties& getStartProperties() const { return m_startProperties; } /** * Get the final transformable properties of this geometry after operators are applied @@ -295,31 +295,31 @@ class Geometry * @brief Return the tet geometry, when the Geometry * represents a tetrahedron. */ - const axom::primal::Tetrahedron &getTet() const { return m_tet; } + const axom::primal::Tetrahedron& getTet() const { return m_tet; } /** * @brief Return the hex geometry, when the Geometry * represents a hexahedron. */ - const axom::primal::Hexahedron &getHex() const { return m_hex; } + const axom::primal::Hexahedron& getHex() const { return m_hex; } /** * @brief Return the sphere geometry, when the Geometry * represents an alalytical sphere. */ - const axom::primal::Sphere &getSphere() const { return m_sphere; } + const axom::primal::Sphere& getSphere() const { return m_sphere; } /** * @brief Return the cone geometry, when the Geometry * represents an alalytical cone. */ - const axom::primal::Cone &getCone() const { return m_cone; } + const axom::primal::Cone& getCone() const { return m_cone; } /** * @brief Return the plane geometry, when the Geometry * represents a plane. */ - const axom::primal::Plane &getPlane() const { return m_plane; } + const axom::primal::Plane& getPlane() const { return m_plane; } /** * @brief Get the discrete function used in surfaces of revolution. @@ -339,7 +339,7 @@ class Geometry std::string m_path; /// \brief Geometry blueprint simplex mesh, when/if it's in memory. - const axom::sidre::Group *m_meshGroup {nullptr}; + const axom::sidre::Group* m_meshGroup {nullptr}; /// \brief Topology of the blueprint simplex mesh, if it's in memory. std::string m_topology; diff --git a/src/axom/klee/GeometryOperators.cpp b/src/axom/klee/GeometryOperators.cpp index 2daf6af7c6..29499a0555 100644 --- a/src/axom/klee/GeometryOperators.cpp +++ b/src/axom/klee/GeometryOperators.cpp @@ -16,13 +16,13 @@ namespace axom { namespace klee { -GeometryOperator::GeometryOperator(const TransformableGeometryProperties &startProperties) +GeometryOperator::GeometryOperator(const TransformableGeometryProperties& startProperties) : m_startProperties(startProperties) { } -void CompositeOperator::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); } +void CompositeOperator::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); } -void CompositeOperator::addOperator(const OpPtr &op) +void CompositeOperator::addOperator(const OpPtr& op) { if(getEndProperties() != op->getStartProperties()) { @@ -40,8 +40,8 @@ TransformableGeometryProperties CompositeOperator::getEndProperties() const return (*m_operators.rbegin())->getEndProperties(); } -Translation::Translation(const primal::Vector3D &offset, - const TransformableGeometryProperties &startProperties) +Translation::Translation(const primal::Vector3D& offset, + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_offset {offset} { } @@ -51,12 +51,12 @@ numerics::Matrix Translation::toMatrix() const return axom::numerics::transforms::translate(m_offset[0], m_offset[1], m_offset[2]); } -void Translation::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); } +void Translation::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); } Rotation::Rotation(double angle, - const primal::Point3D ¢er, - const primal::Vector3D &axis, - const TransformableGeometryProperties &startProperties) + const primal::Point3D& center, + const primal::Vector3D& axis, + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_angle {angle} , m_center {center} @@ -104,16 +104,16 @@ numerics::Matrix Rotation::toMatrix() const return transformation; } -void Rotation::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); } +void Rotation::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); } -Scale::Scale(double xFactor, double yFactor, const TransformableGeometryProperties &startProperties) +Scale::Scale(double xFactor, double yFactor, const TransformableGeometryProperties& startProperties) : Scale(xFactor, yFactor, 1., startProperties) { } Scale::Scale(double xFactor, double yFactor, double zFactor, - const TransformableGeometryProperties &startProperties) + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_xFactor {xFactor} , m_yFactor {yFactor} @@ -123,16 +123,16 @@ Scale::Scale(double xFactor, Scale::Scale(double xFactor, double yFactor, - const primal::Point2D ¢er, - const TransformableGeometryProperties &startProperties) + const primal::Point2D& center, + const TransformableGeometryProperties& startProperties) : Scale(xFactor, yFactor, 1., primal::Point3D({center[0], center[1], 0.}), startProperties) { } Scale::Scale(double xFactor, double yFactor, double zFactor, - const primal::Point3D ¢er, - const TransformableGeometryProperties &startProperties) + const primal::Point3D& center, + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_xFactor {xFactor} , m_yFactor {yFactor} @@ -142,14 +142,14 @@ Scale::Scale(double xFactor, numerics::Matrix Scale::toMatrix() const { - axom::ArrayView centerView(const_cast(m_center.data()), 3); + axom::ArrayView centerView(const_cast(m_center.data()), 3); return axom::numerics::transforms::scale(m_xFactor, m_yFactor, m_zFactor, centerView); } -void Scale::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); } +void Scale::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); } UnitConverter::UnitConverter(LengthUnit endUnits, - const TransformableGeometryProperties &startProperties) + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_endUnits {endUnits} { } @@ -166,17 +166,17 @@ numerics::Matrix UnitConverter::toMatrix() const return scale.toMatrix(); } -void UnitConverter::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); }; +void UnitConverter::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); }; double UnitConverter::getConversionFactor() const { return utilities::getConversionFactor(getStartProperties().units, m_endUnits); }; -SliceOperator::SliceOperator(const primal::Point3D &origin, - const primal::Vector3D &normal, - const primal::Vector3D &up, - const TransformableGeometryProperties &startProperties) +SliceOperator::SliceOperator(const primal::Point3D& origin, + const primal::Vector3D& normal, + const primal::Vector3D& up, + const TransformableGeometryProperties& startProperties) : MatrixOperator {startProperties} , m_origin {origin} , m_normal {normal} @@ -238,7 +238,7 @@ primal::Vector3D SliceOperator::calculateRightVector() const return primal::Vector3D {unitRightAffine.data()}; } -void SliceOperator::accept(GeometryOperatorVisitor &visitor) const { visitor.visit(*this); } +void SliceOperator::accept(GeometryOperatorVisitor& visitor) const { visitor.visit(*this); } TransformableGeometryProperties SliceOperator::getEndProperties() const { diff --git a/src/axom/klee/GeometryOperators.hpp b/src/axom/klee/GeometryOperators.hpp index efa53a0233..61cb7cd8cd 100644 --- a/src/axom/klee/GeometryOperators.hpp +++ b/src/axom/klee/GeometryOperators.hpp @@ -40,7 +40,7 @@ class GeometryOperator * Create an operator with the given start properties * \param startProperties the properties before the operator is applied */ - explicit GeometryOperator(const TransformableGeometryProperties &startProperties); + explicit GeometryOperator(const TransformableGeometryProperties& startProperties); virtual ~GeometryOperator() = default; @@ -52,7 +52,7 @@ class GeometryOperator * * \return the properties which must be true before this operator is applied */ - const TransformableGeometryProperties &getStartProperties() const { return m_startProperties; } + const TransformableGeometryProperties& getStartProperties() const { return m_startProperties; } /** * Get the properties after this operator is applied @@ -71,7 +71,7 @@ class GeometryOperator * * \param visitor the visitor to accept. */ - virtual void accept(GeometryOperatorVisitor &visitor) const = 0; + virtual void accept(GeometryOperatorVisitor& visitor) const = 0; private: TransformableGeometryProperties m_startProperties; @@ -104,7 +104,7 @@ class CompositeOperator : public GeometryOperator std::string getName() const override { return "composite"; } - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; /** * Add the given operator to the end of the list of operators in this composite. @@ -112,14 +112,14 @@ class CompositeOperator : public GeometryOperator * \param op the operator to add * \throws std::invalid_argument if \a op cannot start from this composite's current end properties */ - void addOperator(const OpPtr &op); + void addOperator(const OpPtr& op); /** * Get a list of all the operators. They should be applied in order. * * \return the list of operators */ - const std::vector &getOperators() const { return m_operators; } + const std::vector& getOperators() const { return m_operators; } TransformableGeometryProperties getEndProperties() const override; @@ -138,20 +138,20 @@ class Translation : public MatrixOperator * \param startProperties the initial properties, as in the parent class. * If the number of dimensions is 2, the 3rd entry in the offset should be zero, but this is not checked. */ - Translation(const primal::Vector3D &offset, const TransformableGeometryProperties &startProperties); + Translation(const primal::Vector3D& offset, const TransformableGeometryProperties& startProperties); /** * Get the amount by which to offset points. * * \return a vector by which points should be offset */ - const primal::Vector3D &getOffset() const { return m_offset; } + const primal::Vector3D& getOffset() const { return m_offset; } std::string getName() const override { return "translate"; } numerics::Matrix toMatrix() const override; - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; private: primal::Vector3D m_offset; @@ -171,9 +171,9 @@ class Rotation : public MatrixOperator * If the number of dimensions is 2, the axis should be [0, 0, 1], but this is not checked. */ Rotation(double angle, - const primal::Point3D ¢er, - const primal::Vector3D &axis, - const TransformableGeometryProperties &startProperties); + const primal::Point3D& center, + const primal::Vector3D& axis, + const TransformableGeometryProperties& startProperties); /** * Get the angle of rotation. @@ -188,20 +188,20 @@ class Rotation : public MatrixOperator * \return the point about which to rotate in 2D, and in 3D, the point * which defines the axis of rotation along with getAxis(). */ - const primal::Point3D &getCenter() const { return m_center; } + const primal::Point3D& getCenter() const { return m_center; } /** * The direction of the axis of rotation. * * \return the vector, which when combined with the center, defines the axis of rotation. */ - const primal::Vector3D &getAxis() const { return m_axis; } + const primal::Vector3D& getAxis() const { return m_axis; } std::string getName() const override { return "rotate"; } numerics::Matrix toMatrix() const override; - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; private: double m_angle; @@ -222,7 +222,7 @@ class Scale : public MatrixOperator * * \note The scaling factor used for the 3rd dimension is 1. */ - Scale(double xFactor, double yFactor, const TransformableGeometryProperties &startProperties); + Scale(double xFactor, double yFactor, const TransformableGeometryProperties& startProperties); /** * Create a new Scale operator. @@ -237,7 +237,7 @@ class Scale : public MatrixOperator Scale(double xFactor, double yFactor, double zFactor, - const TransformableGeometryProperties &startProperties); + const TransformableGeometryProperties& startProperties); /** * Create a new Scale operator. @@ -251,8 +251,8 @@ class Scale : public MatrixOperator */ Scale(double xFactor, double yFactor, - const primal::Point2D ¢er, - const TransformableGeometryProperties &startProperties); + const primal::Point2D& center, + const TransformableGeometryProperties& startProperties); /** * Create a new Scale operator. @@ -268,8 +268,8 @@ class Scale : public MatrixOperator Scale(double xFactor, double yFactor, double zFactor, - const primal::Point3D ¢er, - const TransformableGeometryProperties &startProperties); + const primal::Point3D& center, + const TransformableGeometryProperties& startProperties); /** * Get the scale factor in the x direction. @@ -297,14 +297,14 @@ class Scale : public MatrixOperator * * \return the z scale factor */ - primal::Point3D &getCenter() { return m_center; } - const primal::Point3D &getCenter() const { return m_center; } + primal::Point3D& getCenter() { return m_center; } + const primal::Point3D& getCenter() const { return m_center; } std::string getName() const override { return "scale"; } numerics::Matrix toMatrix() const override; - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; private: double m_xFactor; @@ -322,7 +322,7 @@ class UnitConverter : public MatrixOperator * \param endUnits the units at the end of the operation * \param startProperties the properties before the operation */ - UnitConverter(LengthUnit endUnits, const TransformableGeometryProperties &startProperties); + UnitConverter(LengthUnit endUnits, const TransformableGeometryProperties& startProperties); std::string getName() const override { return "convert_units_to"; } @@ -336,7 +336,7 @@ class UnitConverter : public MatrixOperator */ numerics::Matrix toMatrix() const override; - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; /** * Get the conversion factor used to convert from the start units to the end units @@ -365,37 +365,37 @@ class SliceOperator : public MatrixOperator * \param startProperties the initial properties, as in the parent class. * The number of dimensions should be 3, though this is not checked. */ - SliceOperator(const primal::Point3D &origin, - const primal::Vector3D &normal, - const primal::Vector3D &up, - const TransformableGeometryProperties &startProperties); + SliceOperator(const primal::Point3D& origin, + const primal::Vector3D& normal, + const primal::Vector3D& up, + const TransformableGeometryProperties& startProperties); /** * Get the origin of the coordinate system. * * \return the system's origin */ - const primal::Point3D &getOrigin() const { return m_origin; } + const primal::Point3D& getOrigin() const { return m_origin; } /** * Get a vector normal to the slice plane. * * \return a vector normal to the slice plane */ - const primal::Vector3D &getNormal() const { return m_normal; } + const primal::Vector3D& getNormal() const { return m_normal; } /** * Get a vector in the direction of the positive Y axis. * * \return the direction of the positive Y axis */ - const primal::Vector3D &getUp() const { return m_up; } + const primal::Vector3D& getUp() const { return m_up; } std::string getName() const override { return "slice"; } numerics::Matrix toMatrix() const override; - void accept(GeometryOperatorVisitor &visitor) const override; + void accept(GeometryOperatorVisitor& visitor) const override; TransformableGeometryProperties getEndProperties() const override; @@ -420,17 +420,17 @@ class GeometryOperatorVisitor public: virtual ~GeometryOperatorVisitor() = default; - virtual void visit(const Translation &translation) = 0; + virtual void visit(const Translation& translation) = 0; - virtual void visit(const Rotation &rotation) = 0; + virtual void visit(const Rotation& rotation) = 0; - virtual void visit(const Scale &scale) = 0; + virtual void visit(const Scale& scale) = 0; - virtual void visit(const UnitConverter &converter) = 0; + virtual void visit(const UnitConverter& converter) = 0; - virtual void visit(const CompositeOperator &composite) = 0; + virtual void visit(const CompositeOperator& composite) = 0; - virtual void visit(const SliceOperator &slice) = 0; + virtual void visit(const SliceOperator& slice) = 0; }; } // namespace klee diff --git a/src/axom/klee/KleeError.cpp b/src/axom/klee/KleeError.cpp index b5c6bb295d..c08aa2808f 100644 --- a/src/axom/klee/KleeError.cpp +++ b/src/axom/klee/KleeError.cpp @@ -12,14 +12,14 @@ namespace axom { namespace klee { -KleeError::KleeError(const inlet::VerificationError &error) : m_errors {{error}} { } +KleeError::KleeError(const inlet::VerificationError& error) : m_errors {{error}} { } -KleeError::KleeError(const std::vector &errors) : m_errors {errors} +KleeError::KleeError(const std::vector& errors) : m_errors {errors} { SLIC_ASSERT_MSG(!m_errors.empty(), "Must provide at least one error"); } -const char *KleeError::what() const noexcept { return m_errors[0].message.data(); } +const char* KleeError::what() const noexcept { return m_errors[0].message.data(); } } // namespace klee } // namespace axom diff --git a/src/axom/klee/KleeError.hpp b/src/axom/klee/KleeError.hpp index 356dc4d446..52087f4988 100644 --- a/src/axom/klee/KleeError.hpp +++ b/src/axom/klee/KleeError.hpp @@ -28,7 +28,7 @@ class KleeError : public std::exception * Create a KleeError from a single verification error. * @param error the VerificationError describing the failure */ - explicit KleeError(const inlet::VerificationError &error); + explicit KleeError(const inlet::VerificationError& error); /** * Create a KleeError from a vector of verification errors. There must @@ -36,19 +36,19 @@ class KleeError : public std::exception * @param errors the list VerificationError describing the failures. Must * have at least one. */ - explicit KleeError(const std::vector &errors); + explicit KleeError(const std::vector& errors); /** * A description of the first error. * @return the message of the first error */ - const char *what() const noexcept override; + const char* what() const noexcept override; /** * Get the list of all the errors. * @return all the errors which caused this exception */ - const std::vector &getErrors() const { return m_errors; } + const std::vector& getErrors() const { return m_errors; } private: std::vector m_errors; diff --git a/src/axom/klee/Shape.cpp b/src/axom/klee/Shape.cpp index 74d63c2a4b..3f679efe29 100644 --- a/src/axom/klee/Shape.cpp +++ b/src/axom/klee/Shape.cpp @@ -25,7 +25,7 @@ namespace * \return whether the container contains the value */ template -bool contains(const Container &container, const typename Container::value_type &value) +bool contains(const Container& container, const typename Container::value_type& value) { auto endIter = std::end(container); return std::find(std::begin(container), endIter, value) != endIter; @@ -51,7 +51,7 @@ Shape::Shape(std::string name, } } -bool Shape::replaces(const std::string &material) const +bool Shape::replaces(const std::string& material) const { if(!m_materialsReplaced.empty()) { diff --git a/src/axom/klee/Shape.hpp b/src/axom/klee/Shape.hpp index fe26aca692..d40b673648 100644 --- a/src/axom/klee/Shape.hpp +++ b/src/axom/klee/Shape.hpp @@ -44,13 +44,13 @@ class Shape * Get the name of this shape. * \return the shape's name */ - const std::string &getName() const { return m_name; } + const std::string& getName() const { return m_name; } /** * Get the material this shape is made of. * \return the shape's material. */ - const std::string &getMaterial() const { return m_material; } + const std::string& getMaterial() const { return m_material; } /** * Check whether this shape can replace the given material (within the @@ -59,26 +59,26 @@ class Shape * \param material the material to check * \return whether this shape replaces the given material */ - bool replaces(const std::string &material) const; + bool replaces(const std::string& material) const; /** * Get the description fo the geometry for this shape. * * \return the shape's geometry */ - const Geometry &getGeometry() const { return m_geometry; } + const Geometry& getGeometry() const { return m_geometry; } /** * Get the vector of materials that this shape can replace. * \return A reference to the material name vector. */ - const std::vector &getMaterialsReplaced() const { return m_materialsReplaced; } + const std::vector& getMaterialsReplaced() const { return m_materialsReplaced; } /** * Get the vector of materials that this shape cannot replace. * \return A reference to the material name vector. */ - const std::vector &getMaterialsNotReplaced() const { return m_materialsNotReplaced; } + const std::vector& getMaterialsNotReplaced() const { return m_materialsNotReplaced; } private: std::string m_name; diff --git a/src/axom/klee/ShapeSet.cpp b/src/axom/klee/ShapeSet.cpp index 940c3fed48..30f4196e0a 100644 --- a/src/axom/klee/ShapeSet.cpp +++ b/src/axom/klee/ShapeSet.cpp @@ -17,7 +17,7 @@ namespace klee { void ShapeSet::setShapes(std::vector shapes) { m_shapes = std::move(shapes); } -void ShapeSet::setPath(const std::string &path) { m_path = path; } +void ShapeSet::setPath(const std::string& path) { m_path = path; } void ShapeSet::setDimensions(Dimensions dimensions) { diff --git a/src/axom/klee/ShapeSet.hpp b/src/axom/klee/ShapeSet.hpp index 18391f1604..a26e8c80b1 100644 --- a/src/axom/klee/ShapeSet.hpp +++ b/src/axom/klee/ShapeSet.hpp @@ -32,7 +32,7 @@ class ShapeSet * * \return the shapes in this set */ - std::vector const &getShapes() const { return m_shapes; } + std::vector const& getShapes() const { return m_shapes; } /** * Set the file path from which this ShapeSet was created. This must be @@ -40,14 +40,14 @@ class ShapeSet * * \param path the ShapeSet's path */ - void setPath(const std::string &path); + void setPath(const std::string& path); /** * Get the path of the file from which this ShapeSet was created. * * \return the path of the file. Can be empty. */ - const std::string &getPath() const { return m_path; } + const std::string& getPath() const { return m_path; } /** * Sets the dimensions for all shapes in the ShapeSet. diff --git a/src/axom/klee/Units.cpp b/src/axom/klee/Units.cpp index fecfaad07c..ecb011c76d 100644 --- a/src/axom/klee/Units.cpp +++ b/src/axom/klee/Units.cpp @@ -25,19 +25,19 @@ namespace internal * \return the parsed length unit * \throws KleeError if the unit string is invalid */ -LengthUnit parseLengthUnits(const std::string &unitsAsString, const std::string &path) +LengthUnit parseLengthUnits(const std::string& unitsAsString, const std::string& path) { try { return utilities::getLengthUnit(unitsAsString); } - catch(const std::invalid_argument &ex) + catch(const std::invalid_argument& ex) { throw KleeError({path, ex.what()}); } } -LengthUnit parseLengthUnits(const inlet::Proxy &unitsAsProxy) +LengthUnit parseLengthUnits(const inlet::Proxy& unitsAsProxy) { return parseLengthUnits(unitsAsProxy.get(), unitsAsProxy.name()); } diff --git a/src/axom/klee/Units.hpp b/src/axom/klee/Units.hpp index 7876274577..fb4794ef30 100644 --- a/src/axom/klee/Units.hpp +++ b/src/axom/klee/Units.hpp @@ -33,7 +33,7 @@ namespace internal * \return A LengthUnit containing the unit type. * \throws KleeError if the unit string is invalid */ -LengthUnit parseLengthUnits(const inlet::Proxy &unitsAsProxy); +LengthUnit parseLengthUnits(const inlet::Proxy& unitsAsProxy); } // namespace internal } // namespace klee diff --git a/src/axom/klee/io/GeometryOperatorsIO.cpp b/src/axom/klee/io/GeometryOperatorsIO.cpp index 9aee088b75..19b4baca26 100644 --- a/src/axom/klee/io/GeometryOperatorsIO.cpp +++ b/src/axom/klee/io/GeometryOperatorsIO.cpp @@ -30,13 +30,13 @@ namespace { using OpPtr = CompositeOperator::OpPtr; using OperatorParser = - std::function; + std::function; using internal::toDoubleVector; using primal::Point3D; using primal::Vector3D; using FieldSet = std::unordered_set; -std::string childName(const inlet::Container &container, const std::string &name) +std::string childName(const inlet::Container& container, const std::string& name) { std::string result = axom::utilities::string::removePrefix(container.name(), name); if(axom::utilities::string::startsWith(result, '/')) @@ -52,14 +52,14 @@ std::string childName(const inlet::Container &container, const std::string &name * @param container the Container whose children to get * @return the names of all the children */ -std::unordered_set getChildNames(const inlet::Container &container) +std::unordered_set getChildNames(const inlet::Container& container) { std::unordered_set allChildren; std::vector unexpectedNames = container.unexpectedNames(); allChildren.insert(unexpectedNames.begin(), unexpectedNames.end()); - for(auto &child : container.getChildContainers()) + for(auto& child : container.getChildContainers()) { if(child.second->exists()) { @@ -67,7 +67,7 @@ std::unordered_set getChildNames(const inlet::Container &container) } } - for(auto &child : container.getChildFields()) + for(auto& child : container.getChildFields()) { if(child.second->exists()) { @@ -75,7 +75,7 @@ std::unordered_set getChildNames(const inlet::Container &container) } } - for(auto &child : container.getChildFunctions()) + for(auto& child : container.getChildFunctions()) { if(*child.second) { @@ -115,15 +115,15 @@ std::unordered_set getChildNames(const inlet::Container &container) * \param optionalFields any additional optional fields * \throws KleeError if a required field is missing or an unexpected field is present */ -void verifyObjectFields(const inlet::Container &containerToTest, - const std::string &name, - const FieldSet &additionalRequiredFields, - const FieldSet &optionalFields) +void verifyObjectFields(const inlet::Container& containerToTest, + const std::string& name, + const FieldSet& additionalRequiredFields, + const FieldSet& optionalFields) { std::unordered_set requiredFields {additionalRequiredFields}; requiredFields.insert(name); - for(auto &requiredField : requiredFields) + for(auto& requiredField : requiredFields) { if(!containerToTest.contains(requiredField)) { @@ -133,7 +133,7 @@ void verifyObjectFields(const inlet::Container &containerToTest, } } - for(auto &child : getChildNames(containerToTest)) + for(auto& child : getChildNames(containerToTest)) { if(requiredFields.find(child) != requiredFields.end()) { @@ -157,8 +157,8 @@ void verifyObjectFields(const inlet::Container &containerToTest, * \return the created operator * \throws KleeError if the operator fields or vector dimensions are invalid */ -OpPtr parseTranslate(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties) +OpPtr parseTranslate(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties) { verifyObjectFields(opContainer, "translate", FieldSet {}, FieldSet {}); return std::make_shared(toVector(opContainer, "translate", startProperties.dimensions), @@ -173,8 +173,8 @@ OpPtr parseTranslate(const inlet::Container &opContainer, * \return the created operator * \throws KleeError if the rotation is invalid for the start dimensions or operator fields */ -OpPtr parseRotate(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties) +OpPtr parseRotate(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties) { switch(startProperties.dimensions) { @@ -219,8 +219,8 @@ OpPtr parseRotate(const inlet::Container &opContainer, OpPtr makeCheckedSlice(Point3D origin, Vector3D normal, Vector3D up, - const TransformableGeometryProperties &startProperties, - const Path &path) + const TransformableGeometryProperties& startProperties, + const Path& path) { if(normal.is_zero()) { @@ -242,9 +242,9 @@ OpPtr makeCheckedSlice(Point3D origin, * \return the point to use as the origin * \throws KleeError if the specified origin is not on the slice plane */ -primal::Point3D getPerpendicularSliceOrigin(const inlet::Container &sliceContainer, - char const *planeName, - const primal::Vector3D &defaultNormal) +primal::Point3D getPerpendicularSliceOrigin(const inlet::Container& sliceContainer, + char const* planeName, + const primal::Vector3D& defaultNormal) { double axisIntercept = sliceContainer[planeName]; @@ -280,8 +280,8 @@ primal::Point3D getPerpendicularSliceOrigin(const inlet::Container &sliceContain * \return the vector to use as the normal * \throws KleeError if the specified normal is not parallel to the slice plane normal */ -primal::Vector3D getPerpendicularSliceNormal(const inlet::Container &sliceContainer, - const primal::Vector3D &defaultNormal) +primal::Vector3D getPerpendicularSliceNormal(const inlet::Container& sliceContainer, + const primal::Vector3D& defaultNormal) { if(!sliceContainer.contains("normal")) { @@ -309,11 +309,11 @@ primal::Vector3D getPerpendicularSliceNormal(const inlet::Container &sliceContai * \return the parsed plane * \throws KleeError if the slice fields or values are invalid */ -OpPtr readPerpendicularSlice(const inlet::Container &sliceContainer, - char const *planeName, - Vector3D const &defaultNormal, - Vector3D const &defaultUp, - const TransformableGeometryProperties &startProperties) +OpPtr readPerpendicularSlice(const inlet::Container& sliceContainer, + char const* planeName, + Vector3D const& defaultNormal, + Vector3D const& defaultUp, + const TransformableGeometryProperties& startProperties) { verifyObjectFields(sliceContainer, planeName, FieldSet {}, {"origin", "normal", "up"}); const primal::Vector3D defaultNormalVec {defaultNormal.data()}; @@ -333,15 +333,15 @@ OpPtr readPerpendicularSlice(const inlet::Container &sliceContainer, * \return the created operator * \throws KleeError if the slice fields or values are invalid */ -OpPtr parseSlice(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties) +OpPtr parseSlice(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties) { if(startProperties.dimensions != Dimensions::Three) { throw KleeError({opContainer.name(), "Cannot do a slice from 2D"}); } verifyObjectFields(opContainer, "slice", FieldSet {}, FieldSet {}); - auto &sliceContainer = *opContainer.getChildContainers().at(opContainer.name() + "/slice").get(); + auto& sliceContainer = *opContainer.getChildContainers().at(opContainer.name() + "/slice").get(); if(sliceContainer.contains("x")) { return readPerpendicularSlice(sliceContainer, "x", {1, 0, 0}, {0, 0, 1}, startProperties); @@ -372,8 +372,8 @@ OpPtr parseSlice(const inlet::Container &opContainer, * \return the created operator * \throws KleeError if the scale fields or vector dimensions are invalid */ -OpPtr parseScale(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties) +OpPtr parseScale(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties) { verifyObjectFields(opContainer, "scale", FieldSet {}, FieldSet {"center"}); auto factors = opContainer["scale"].get>(); @@ -403,8 +403,8 @@ OpPtr parseScale(const inlet::Container &opContainer, * \return the created operator * \throws KleeError if the unit string or operator fields are invalid */ -OpPtr parseConvertUnits(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties) +OpPtr parseConvertUnits(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties) { verifyObjectFields(opContainer, "convert_units_to", FieldSet {}, FieldSet {}); auto endUnits = internal::parseLengthUnits(opContainer["convert_units_to"]); @@ -420,12 +420,12 @@ OpPtr parseConvertUnits(const inlet::Container &opContainer, * \return the created operator * \throws KleeError if the reference is missing or the operator fields are invalid */ -OpPtr parseRef(const inlet::Container &opContainer, - const TransformableGeometryProperties &startProperties, - const NamedOperatorMap &namedOperators) +OpPtr parseRef(const inlet::Container& opContainer, + const TransformableGeometryProperties& startProperties, + const NamedOperatorMap& namedOperators) { verifyObjectFields(opContainer, "ref", FieldSet {}, FieldSet {}); - std::string const &operatorName = opContainer["ref"]; + std::string const& operatorName = opContainer["ref"]; auto opIter = namedOperators.find(operatorName); if(opIter == namedOperators.end()) { @@ -468,9 +468,9 @@ OpPtr parseRef(const inlet::Container &opContainer, * \return the created operator * \throws KleeError if the operator type or fields are invalid */ -OpPtr convertOperator(SingleOperatorData const &data, +OpPtr convertOperator(SingleOperatorData const& data, TransformableGeometryProperties startProperties, - const NamedOperatorMap &namedOperators) + const NamedOperatorMap& namedOperators) { std::unordered_map parsers { {"translate", parseTranslate}, @@ -479,13 +479,13 @@ OpPtr convertOperator(SingleOperatorData const &data, {"scale", parseScale}, {"convert_units_to", parseConvertUnits}, {"ref", - [&namedOperators](const inlet::Container &opNode, - const TransformableGeometryProperties &startProperties) { + [&namedOperators](const inlet::Container& opNode, + const TransformableGeometryProperties& startProperties) { return parseRef(opNode, startProperties, namedOperators); }}, }; - for(auto &entry : parsers) + for(auto& entry : parsers) { if(data.m_container->contains(entry.first)) { @@ -498,22 +498,22 @@ OpPtr convertOperator(SingleOperatorData const &data, } // namespace -GeometryOperatorData::GeometryOperatorData(const Path &path) +GeometryOperatorData::GeometryOperatorData(const Path& path) : m_path {path} , m_singleOperatorData {} { } -GeometryOperatorData::GeometryOperatorData(const Path &path, - std::vector &&singleOperatorData) +GeometryOperatorData::GeometryOperatorData(const Path& path, + std::vector&& singleOperatorData) : m_path {path} , m_singleOperatorData {singleOperatorData} { } -inlet::Container &GeometryOperatorData::defineSchema(inlet::Container &parent, - const std::string &fieldName, - const std::string &description) +inlet::Container& GeometryOperatorData::defineSchema(inlet::Container& parent, + const std::string& fieldName, + const std::string& description) { - auto &opContainer = parent.addStructArray(fieldName, description).strict(); + auto& opContainer = parent.addStructArray(fieldName, description).strict(); opContainer.addDoubleArray("translate"); @@ -525,7 +525,7 @@ inlet::Container &GeometryOperatorData::defineSchema(inlet::Container &parent, opContainer.addString("convert_units_to"); - auto &slice = opContainer.addStruct("slice"); + auto& slice = opContainer.addStruct("slice"); slice.addDouble("x"); slice.addDouble("y"); slice.addDouble("z"); @@ -538,8 +538,8 @@ inlet::Container &GeometryOperatorData::defineSchema(inlet::Container &parent, } std::shared_ptr GeometryOperatorData::makeOperator( - const TransformableGeometryProperties &startProperties, - const NamedOperatorMap &namedOperators) const + const TransformableGeometryProperties& startProperties, + const NamedOperatorMap& namedOperators) const { if(m_singleOperatorData.empty()) { @@ -551,14 +551,14 @@ std::shared_ptr GeometryOperatorData::makeOperator( "Cannot specify operators without specifying units"}); } auto composite = std::make_shared(startProperties); - for(auto &data : m_singleOperatorData) + for(auto& data : m_singleOperatorData) { composite->addOperator(convertOperator(data, composite->getEndProperties(), namedOperators)); } return composite; } -void NamedOperatorData::defineSchema(inlet::Container &container) +void NamedOperatorData::defineSchema(inlet::Container& container) { container.addString("name").required(); defineDimensionsField(container, "start_dimensions", "The initial dimensions of the operator"); @@ -570,13 +570,13 @@ void NamedOperatorData::defineSchema(inlet::Container &container) "The operation to apply"); //.required(); } -NamedOperatorMapData::NamedOperatorMapData(std::vector &&operatorData) +NamedOperatorMapData::NamedOperatorMapData(std::vector&& operatorData) : m_operatorData {operatorData} { } -void NamedOperatorMapData::defineSchema(inlet::Container &parent, const std::string &name) +void NamedOperatorMapData::defineSchema(inlet::Container& parent, const std::string& name) { - auto &container = parent.addStructArray(name); + auto& container = parent.addStructArray(name); NamedOperatorData::defineSchema(container); } @@ -584,7 +584,7 @@ NamedOperatorMap NamedOperatorMapData::makeNamedOperatorMap(Dimensions fileDimen { NamedOperatorMap namedOperators; - for(auto &opData : m_operatorData) + for(auto& opData : m_operatorData) { Dimensions dimensions = fileDimensions; if(opData.startDimsSet) @@ -614,14 +614,14 @@ NamedOperatorMap NamedOperatorMapData::makeNamedOperatorMap(Dimensions fileDimen template <> struct FromInlet { - axom::klee::internal::SingleOperatorData operator()(const axom::inlet::Container &base) + axom::klee::internal::SingleOperatorData operator()(const axom::inlet::Container& base) { return axom::klee::internal::SingleOperatorData {&base}; } }; axom::klee::internal::GeometryOperatorData -FromInlet::operator()(const axom::inlet::Container &base) +FromInlet::operator()(const axom::inlet::Container& base) { std::vector v = base.get>(); @@ -629,7 +629,7 @@ FromInlet::operator()(const axom::in } axom::klee::internal::NamedOperatorData FromInlet::operator()( - const axom::inlet::Container &base) + const axom::inlet::Container& base) { axom::klee::internal::NamedOperatorData data; std::tie(data.startUnits, data.endUnits) = axom::klee::internal::getStartAndEndUnits(base); @@ -648,7 +648,7 @@ axom::klee::internal::NamedOperatorData FromInlet::operator()(const axom::inlet::Container &base) +FromInlet::operator()(const axom::inlet::Container& base) { return axom::klee::internal::NamedOperatorMapData { base.get>()}; diff --git a/src/axom/klee/io/GeometryOperatorsIO.hpp b/src/axom/klee/io/GeometryOperatorsIO.hpp index 570394c7ab..7686ff752e 100644 --- a/src/axom/klee/io/GeometryOperatorsIO.hpp +++ b/src/axom/klee/io/GeometryOperatorsIO.hpp @@ -28,7 +28,7 @@ using NamedOperatorMap = std::unordered_map &&singleOperatorData); + explicit GeometryOperatorData(const Path& path, + std::vector&& singleOperatorData); /** * Define the schema for geometry operators @@ -59,9 +59,9 @@ class GeometryOperatorData * @param description a description of the field * @return the Container for the new item */ - static inlet::Container &defineSchema(inlet::Container &parent, - const std::string &fieldName, - const std::string &description); + static inlet::Container& defineSchema(inlet::Container& parent, + const std::string& fieldName, + const std::string& description); /** * Make a (possibly null) operator describing the transformation to apply to the geometry @@ -71,14 +71,14 @@ class GeometryOperatorData * @return the (possibly null) operator * @throws KleeError if the operator data is invalid for the given properties */ - std::shared_ptr makeOperator(const TransformableGeometryProperties &startProperties, - const NamedOperatorMap &namedOperators) const; + std::shared_ptr makeOperator(const TransformableGeometryProperties& startProperties, + const NamedOperatorMap& namedOperators) const; /** * Get the path of this operator in the source document * @return the operator's path */ - const Path &getPath() const { return m_path; } + const Path& getPath() const { return m_path; } private: Path m_path; @@ -100,7 +100,7 @@ struct NamedOperatorData * * @param container the container in which to describe a single named operator */ - static void defineSchema(inlet::Container &container); + static void defineSchema(inlet::Container& container); }; /// Data for all a collection of named operators @@ -114,7 +114,7 @@ struct NamedOperatorMapData * * @param operatorData the data for all the named operators in this map */ - explicit NamedOperatorMapData(std::vector &&operatorData); + explicit NamedOperatorMapData(std::vector&& operatorData); /** * Convert the data to a NamedOperatorMap. @@ -132,7 +132,7 @@ struct NamedOperatorMapData * @param parent the parent object in which to define the operator map * @param name the name of the map */ - static void defineSchema(inlet::Container &parent, const std::string &name); + static void defineSchema(inlet::Container& parent, const std::string& name); private: std::vector m_operatorData; @@ -150,7 +150,7 @@ struct FromInlet * * @throws axom::klee::KleeError if nested operator data is invalid */ - axom::klee::internal::GeometryOperatorData operator()(const axom::inlet::Container &base); + axom::klee::internal::GeometryOperatorData operator()(const axom::inlet::Container& base); }; template <> @@ -161,7 +161,7 @@ struct FromInlet * * @throws axom::klee::KleeError if required unit fields are missing or invalid */ - axom::klee::internal::NamedOperatorData operator()(const axom::inlet::Container &base); + axom::klee::internal::NamedOperatorData operator()(const axom::inlet::Container& base); }; template <> @@ -172,5 +172,5 @@ struct FromInlet * * @throws axom::klee::KleeError if nested named operator data is invalid */ - axom::klee::internal::NamedOperatorMapData operator()(const axom::inlet::Container &base); + axom::klee::internal::NamedOperatorMapData operator()(const axom::inlet::Container& base); }; diff --git a/src/axom/klee/io/IO.cpp b/src/axom/klee/io/IO.cpp index 2fb5c591b0..a00a0bccab 100644 --- a/src/axom/klee/io/IO.cpp +++ b/src/axom/klee/io/IO.cpp @@ -65,7 +65,7 @@ struct ShapeData template <> struct FromInlet { - axom::klee::ShapeData operator()(const axom::inlet::Container &base) + axom::klee::ShapeData operator()(const axom::inlet::Container& base) { return axom::klee::ShapeData {base.get("name"), base.get("material"), @@ -78,7 +78,7 @@ struct FromInlet template <> struct FromInlet { - axom::klee::GeometryData operator()(const axom::inlet::Container &base) + axom::klee::GeometryData operator()(const axom::inlet::Container& base) { axom::klee::GeometryData data; data.format = base.contains("format") ? base.get("format") : ""; @@ -114,7 +114,7 @@ namespace * * @param geometry the Container representing a "geometry" object. */ -void defineGeometry(inlet::Container &geometry) +void defineGeometry(inlet::Container& geometry) { geometry.addString("format", "The format of the input file").required(); geometry.addString("path", @@ -143,22 +143,22 @@ void defineGeometry(inlet::Container &geometry) * * @param document the Inlet document for which to define the schema */ -void defineShapeList(inlet::Inlet &document) +void defineShapeList(inlet::Inlet& document) { - inlet::Container &shapeList = document.addStructArray("shapes", "The list of shapes"); + inlet::Container& shapeList = document.addStructArray("shapes", "The list of shapes"); shapeList.addString("name", "The shape's name").required(); shapeList.addString("material", "The shape's material").required(); shapeList.addStringArray("replaces", "The list of materials this shape replaces"); shapeList.addStringArray("does_not_replace", "The list of materials this shape does not replace"); - auto &geometry = + auto& geometry = shapeList.addStruct("geometry", "Contains information about the shape's geometry"); defineGeometry(geometry); // Verify syntax here, semantics later!!! shapeList.registerVerifier( - [](const inlet::Container &shape, std::vector *errors) -> bool { + [](const inlet::Container& shape, std::vector* errors) -> bool { if(shape.contains("replaces") && shape.contains("does_not_replace")) { INLET_VERIFICATION_WARNING(shape.name(), @@ -191,7 +191,7 @@ void defineShapeList(inlet::Inlet &document) * * @param document the Inlet document for which to define the schema */ -void defineKleeSchema(inlet::Inlet &document) +void defineKleeSchema(inlet::Inlet& document) { internal::defineDimensionsField(document.getGlobalContainer(), "dimensions").required(); defineShapeList(document); @@ -207,9 +207,9 @@ void defineKleeSchema(inlet::Inlet &document) * \return the geometry description for the shape * \throws KleeError if the converted geometry does not match the expected dimensions */ -Geometry convert(GeometryData const &data, +Geometry convert(GeometryData const& data, Dimensions fileDimensions, - internal::NamedOperatorMap const &namedOperators) + internal::NamedOperatorMap const& namedOperators) { const bool has_start_dims = data.startDimensions != Dimensions::Unspecified; const bool has_explicit_dims = data.explicitDimensions != Dimensions::Unspecified; @@ -258,9 +258,9 @@ Geometry convert(GeometryData const &data, * \throws KleeError if the geometry data is invalid * \throws std::logic_error if mutually exclusive material replacement lists are both populated */ -Shape convert(ShapeData const &data, +Shape convert(ShapeData const& data, Dimensions fileDimensions, - internal::NamedOperatorMap const &namedOperators) + internal::NamedOperatorMap const& namedOperators) { return Shape {data.name, data.material, @@ -279,13 +279,13 @@ Shape convert(ShapeData const &data, * \throws KleeError if any shape's geometry data is invalid * \throws std::logic_error if mutually exclusive material replacement lists are both populated */ -std::vector convert(std::vector const &shapeData, - Dimensions const &fileDimensions, - internal::NamedOperatorMap const &namedOperators) +std::vector convert(std::vector const& shapeData, + Dimensions const& fileDimensions, + internal::NamedOperatorMap const& namedOperators) { std::vector converted; converted.reserve(shapeData.size()); - for(auto &data : shapeData) + for(auto& data : shapeData) { converted.emplace_back(convert(data, fileDimensions, namedOperators)); } @@ -301,7 +301,7 @@ std::vector convert(std::vector const &shapeData, * \return all named operators read from the document * \throws KleeError if named operator conversion fails */ -internal::NamedOperatorMap getNamedOperators(const inlet::Inlet &doc, Dimensions startDimensions) +internal::NamedOperatorMap getNamedOperators(const inlet::Inlet& doc, Dimensions startDimensions) { if(doc.contains("named_operators")) { @@ -318,7 +318,7 @@ internal::NamedOperatorMap getNamedOperators(const inlet::Inlet &doc, Dimensions * \return the inferred input format * \throws KleeError if the file extension is not a supported Klee input extension */ -InputFormat inferInputFormat(const std::string &filePath) +InputFormat inferInputFormat(const std::string& filePath) { auto extension = utilities::filesystem::getFileExtension(filePath); utilities::string::toLower(extension); @@ -369,7 +369,7 @@ std::unique_ptr createReader(InputFormat format) throw KleeError({Path {""}, "Unsupported Klee input format."}); } -const char *inputFormatName(InputFormat format) +const char* inputFormatName(InputFormat format) { switch(format) { @@ -392,10 +392,10 @@ const char *inputFormatName(InputFormat format) * \throws KleeError if parsing fails or the reader throws while parsing */ template -void parseOrThrow(Parse &&parse, +void parseOrThrow(Parse&& parse, InputFormat format, - const Path &path, - const std::string &sourceDescription) + const Path& path, + const std::string& sourceDescription) { bool parsed = false; std::string details; @@ -403,7 +403,7 @@ void parseOrThrow(Parse &&parse, { parsed = parse(); } - catch(const std::exception &error) + catch(const std::exception& error) { details = error.what(); } @@ -418,10 +418,10 @@ void parseOrThrow(Parse &&parse, } } -void appendUnexpectedGlobalErrors(const inlet::Inlet &doc, - std::vector &errors) +void appendUnexpectedGlobalErrors(const inlet::Inlet& doc, + std::vector& errors) { - for(const auto &name : doc.unexpectedNames()) + for(const auto& name : doc.unexpectedNames()) { if(name.find('/') == std::string::npos) { @@ -473,9 +473,9 @@ ShapeSet readShapeSetFromReader(std::unique_ptr reader, bool reje } } // namespace -ShapeSet readShapeSet(std::istream &stream) { return readShapeSet(stream, InputFormat::YAML); } +ShapeSet readShapeSet(std::istream& stream) { return readShapeSet(stream, InputFormat::YAML); } -ShapeSet readShapeSet(std::istream &stream, InputFormat format) +ShapeSet readShapeSet(std::istream& stream, InputFormat format) { std::string contents {std::istreambuf_iterator(stream), {}}; @@ -487,12 +487,12 @@ ShapeSet readShapeSet(std::istream &stream, InputFormat format) return readShapeSetFromReader(std::move(reader), format == InputFormat::Lua); } -ShapeSet readShapeSet(const std::string &filePath) +ShapeSet readShapeSet(const std::string& filePath) { return readShapeSet(filePath, inferInputFormat(filePath)); } -ShapeSet readShapeSet(const std::string &filePath, InputFormat format) +ShapeSet readShapeSet(const std::string& filePath, InputFormat format) { auto reader = createReader(format); parseOrThrow([&]() { return reader->parseFile(filePath); }, diff --git a/src/axom/klee/io/IO.hpp b/src/axom/klee/io/IO.hpp index 359cf59172..2cd6d5e373 100644 --- a/src/axom/klee/io/IO.hpp +++ b/src/axom/klee/io/IO.hpp @@ -29,7 +29,7 @@ enum class InputFormat * \note This overload reads YAML for backward compatibility. * \throws KleeError if parsing, schema verification, or semantic validation fails */ -ShapeSet readShapeSet(std::istream &stream); +ShapeSet readShapeSet(std::istream& stream); /** * Read a ShapeSet from an input stream. @@ -39,7 +39,7 @@ ShapeSet readShapeSet(std::istream &stream); * \throws KleeError if parsing, schema verification, or semantic validation fails, * or if the requested input format is unsupported by this build */ -ShapeSet readShapeSet(std::istream &stream, InputFormat format); +ShapeSet readShapeSet(std::istream& stream, InputFormat format); /** * Read a ShapeSet from a specified file @@ -51,7 +51,7 @@ ShapeSet readShapeSet(std::istream &stream, InputFormat format); * \throws KleeError if the extension is unsupported or if parsing, * schema verification, or semantic validation fails */ -ShapeSet readShapeSet(const std::string &filePath); +ShapeSet readShapeSet(const std::string& filePath); /** * Read a ShapeSet from a specified file using an explicit input format. @@ -62,7 +62,7 @@ ShapeSet readShapeSet(const std::string &filePath); * \throws KleeError if parsing, schema verification, or semantic validation fails, * or if the requested input format is unsupported by this build */ -ShapeSet readShapeSet(const std::string &filePath, InputFormat format); +ShapeSet readShapeSet(const std::string& filePath, InputFormat format); } // namespace klee } // namespace axom diff --git a/src/axom/klee/io/IOUtil.cpp b/src/axom/klee/io/IOUtil.cpp index 7c8265443c..bea592bd01 100644 --- a/src/axom/klee/io/IOUtil.cpp +++ b/src/axom/klee/io/IOUtil.cpp @@ -15,9 +15,9 @@ namespace klee { namespace internal { -std::vector toDoubleVector(inlet::Proxy const &field, +std::vector toDoubleVector(inlet::Proxy const& field, Dimensions expectedDims, - char const *fieldName) + char const* fieldName) { auto expectedSize = static_cast(expectedDims); auto values = field.get>(); @@ -32,17 +32,17 @@ std::vector toDoubleVector(inlet::Proxy const &field, } template -T toArrayLike(inlet::Proxy const &parent, char const *fieldName, Dimensions expectedDims) +T toArrayLike(inlet::Proxy const& parent, char const* fieldName, Dimensions expectedDims) { auto values = toDoubleVector(parent[fieldName], expectedDims, fieldName); return T {values.data(), static_cast(expectedDims)}; } template -T toArrayLike(inlet::Proxy const &parent, - char const *fieldName, +T toArrayLike(inlet::Proxy const& parent, + char const* fieldName, Dimensions expectedDims, - const T &defaultValue) + const T& defaultValue) { if(parent.contains(fieldName)) { @@ -51,33 +51,33 @@ T toArrayLike(inlet::Proxy const &parent, return defaultValue; } -primal::Point3D toPoint(inlet::Container const &parent, char const *fieldName, Dimensions expectedDims) +primal::Point3D toPoint(inlet::Container const& parent, char const* fieldName, Dimensions expectedDims) { return toArrayLike(parent, fieldName, expectedDims); } -primal::Point3D toPoint(inlet::Container const &parent, - char const *fieldName, +primal::Point3D toPoint(inlet::Container const& parent, + char const* fieldName, Dimensions expectedDims, - const primal::Point3D &defaultValue) + const primal::Point3D& defaultValue) { return toArrayLike(parent, fieldName, expectedDims, defaultValue); } -primal::Vector3D toVector(inlet::Container const &parent, char const *fieldName, Dimensions expectedDims) +primal::Vector3D toVector(inlet::Container const& parent, char const* fieldName, Dimensions expectedDims) { return toArrayLike(parent, fieldName, expectedDims); } -primal::Vector3D toVector(inlet::Container const &parent, - char const *fieldName, +primal::Vector3D toVector(inlet::Container const& parent, + char const* fieldName, Dimensions expectedDims, - const primal::Vector3D &defaultValue) + const primal::Vector3D& defaultValue) { return toArrayLike(parent, fieldName, expectedDims, defaultValue); } -std::tuple getOptionalStartAndEndUnits(const inlet::Container &container) +std::tuple getOptionalStartAndEndUnits(const inlet::Container& container) { bool hasStartUnits = container.contains("start_units"); bool hasEndUnits = container.contains("end_units"); @@ -103,7 +103,7 @@ std::tuple getOptionalStartAndEndUnits(const inlet::Cont return std::make_tuple(LengthUnit::unspecified, LengthUnit::unspecified); } -std::tuple getStartAndEndUnits(const inlet::Container &container) +std::tuple getStartAndEndUnits(const inlet::Container& container) { auto units = getOptionalStartAndEndUnits(container); if(std::get<0>(units) == LengthUnit::unspecified) @@ -113,10 +113,10 @@ std::tuple getStartAndEndUnits(const inlet::Container &c return units; } -void defineUnitsSchema(inlet::Container &container, - const char *unitsDescription, - const char *startUnitsDescription, - const char *endUnitsDescription) +void defineUnitsSchema(inlet::Container& container, + const char* unitsDescription, + const char* startUnitsDescription, + const char* endUnitsDescription) { container.addString("start_units", startUnitsDescription); container.addString("end_units", endUnitsDescription); @@ -127,14 +127,14 @@ void defineUnitsSchema(inlet::Container &container, // figuring out which fields to use. } -inlet::VerifiableScalar &defineDimensionsField(inlet::Container &parent, - const char *name, - const char *description) +inlet::VerifiableScalar& defineDimensionsField(inlet::Container& parent, + const char* name, + const char* description) { return parent.addInt(name, description).range(2, 3); } -Dimensions toDimensions(const inlet::Proxy &dimProxy) +Dimensions toDimensions(const inlet::Proxy& dimProxy) { return static_cast(dimProxy.get()); } diff --git a/src/axom/klee/io/IOUtil.hpp b/src/axom/klee/io/IOUtil.hpp index a3f8e5a09f..c72b821d14 100644 --- a/src/axom/klee/io/IOUtil.hpp +++ b/src/axom/klee/io/IOUtil.hpp @@ -38,9 +38,9 @@ namespace internal * @return the field as a std::vector * @throws KleeError if the field does not have \a expectedDims entries */ -std::vector toDoubleVector(inlet::Proxy const &field, +std::vector toDoubleVector(inlet::Proxy const& field, Dimensions expectedDims, - char const *fieldName); + char const* fieldName); /** * Convert the specified field to a Point3D, ensuring that it @@ -52,7 +52,7 @@ std::vector toDoubleVector(inlet::Proxy const &field, * @return the field as a primal::Point3D * @throws KleeError if the field does not have \a expectedDims entries */ -primal::Point3D toPoint(inlet::Container const &parent, char const *fieldName, Dimensions expectedDims); +primal::Point3D toPoint(inlet::Container const& parent, char const* fieldName, Dimensions expectedDims); /** * Convert the specified field to a Point3D, ensuring that it @@ -65,10 +65,10 @@ primal::Point3D toPoint(inlet::Container const &parent, char const *fieldName, D * @return the field as a primal::Point3D * @throws KleeError if the field is present and does not have \a expectedDims entries */ -primal::Point3D toPoint(inlet::Container const &parent, - char const *fieldName, +primal::Point3D toPoint(inlet::Container const& parent, + char const* fieldName, Dimensions expectedDims, - const primal::Point3D &defaultValue); + const primal::Point3D& defaultValue); /** * Convert the specified field to a Vector3D, ensuring that it @@ -80,8 +80,8 @@ primal::Point3D toPoint(inlet::Container const &parent, * @return the field as a primal::Vector3D * @throws KleeError if the field does not have \a expectedDims entries */ -primal::Vector3D toVector(inlet::Container const &parent, - char const *fieldName, +primal::Vector3D toVector(inlet::Container const& parent, + char const* fieldName, Dimensions expectedDims); /** @@ -96,10 +96,10 @@ primal::Vector3D toVector(inlet::Container const &parent, * @return the field as a primal::Vector3D * @throws KleeError if the field is present and does not have \a expectedDims entries */ -primal::Vector3D toVector(inlet::Container const &parent, - char const *fieldName, +primal::Vector3D toVector(inlet::Container const& parent, + char const* fieldName, Dimensions expectedDims, - const primal::Vector3D &defaultValue); + const primal::Vector3D& defaultValue); /** * Get the start and end units in a Container. @@ -113,7 +113,7 @@ primal::Vector3D toVector(inlet::Container const &parent, * \return the start and end units * \throws KleeError if an invalid combination of fields is specified */ -std::tuple getOptionalStartAndEndUnits(const inlet::Container &container); +std::tuple getOptionalStartAndEndUnits(const inlet::Container& container); /** * Get the start and end units in a Container. @@ -127,7 +127,7 @@ std::tuple getOptionalStartAndEndUnits(const inlet::Cont * \throws KleeError if an invalid combination of fields is * specified or if no units are specified. */ -std::tuple getStartAndEndUnits(const inlet::Container &container); +std::tuple getStartAndEndUnits(const inlet::Container& container); /** * Define the schema for units. This is the schema that will be @@ -138,10 +138,10 @@ std::tuple getStartAndEndUnits(const inlet::Container &c * @param startUnitsDescription the description of the "start_units" field * @param endUnitsDescription the description of the "end_units" field */ -void defineUnitsSchema(inlet::Container &container, - const char *unitsDescription = "", - const char *startUnitsDescription = "", - const char *endUnitsDescription = ""); +void defineUnitsSchema(inlet::Container& container, + const char* unitsDescription = "", + const char* startUnitsDescription = "", + const char* endUnitsDescription = ""); /** * Define a field which can hold a number of dimensions @@ -151,9 +151,9 @@ void defineUnitsSchema(inlet::Container &container, * @param description and optional description of the field * @return the field, which can have additional restrictions set on it */ -inlet::VerifiableScalar &defineDimensionsField(inlet::Container &parent, - const char *name, - const char *description = ""); +inlet::VerifiableScalar& defineDimensionsField(inlet::Container& parent, + const char* name, + const char* description = ""); /** * Convert the given proxy to a Dimensions object. The field should have been @@ -162,7 +162,7 @@ inlet::VerifiableScalar &defineDimensionsField(inlet::Container &parent, * @param dimProxy the proxy to the dimensions field * @return the value of the dimensions */ -Dimensions toDimensions(const inlet::Proxy &dimProxy); +Dimensions toDimensions(const inlet::Proxy& dimProxy); } // namespace internal } // namespace klee diff --git a/src/axom/klee/tests/KleeTestUtils.cpp b/src/axom/klee/tests/KleeTestUtils.cpp index 49c6ff4f48..2bd041567e 100644 --- a/src/axom/klee/tests/KleeTestUtils.cpp +++ b/src/axom/klee/tests/KleeTestUtils.cpp @@ -12,7 +12,7 @@ namespace klee { namespace test { -numerics::Matrix affine(const std::array, 3> &values) +numerics::Matrix affine(const std::array, 3>& values) { numerics::Matrix m(4, 4); m(3, 3) = 1; diff --git a/src/axom/klee/tests/KleeTestUtils.hpp b/src/axom/klee/tests/KleeTestUtils.hpp index 87aa2cec78..c9cb6a4d3d 100644 --- a/src/axom/klee/tests/KleeTestUtils.hpp +++ b/src/axom/klee/tests/KleeTestUtils.hpp @@ -28,7 +28,7 @@ namespace test * \param values the values of the matrix, in row-major order * \return the affine transformation matrix represented by the rows */ -numerics::Matrix affine(const std::array, 3> &values); +numerics::Matrix affine(const std::array, 3>& values); class MockOperator : public GeometryOperator { @@ -36,7 +36,7 @@ class MockOperator : public GeometryOperator using GeometryOperator::GeometryOperator; MOCK_METHOD(std::string, getName, (), (const)); MOCK_METHOD(TransformableGeometryProperties, getEndProperties, (), (const)); - MOCK_METHOD(void, accept, (GeometryOperatorVisitor &), (const)); + MOCK_METHOD(void, accept, (GeometryOperatorVisitor&), (const)); TransformableGeometryProperties getBaseEndProperties() const { return GeometryOperator::getEndProperties(); diff --git a/src/axom/klee/tests/klee_dimensions.cpp b/src/axom/klee/tests/klee_dimensions.cpp index 4c97b44a65..626075de16 100644 --- a/src/axom/klee/tests/klee_dimensions.cpp +++ b/src/axom/klee/tests/klee_dimensions.cpp @@ -39,7 +39,7 @@ TEST(Dimensions, unspecified) std::cout << "The dimension is " << axom::fmt::format("{}", unspec) << "\n"; } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/klee/tests/klee_geometry_operators.cpp b/src/axom/klee/tests/klee_geometry_operators.cpp index c0fbaa7c3f..c6bf77fd1c 100644 --- a/src/axom/klee/tests/klee_geometry_operators.cpp +++ b/src/axom/klee/tests/klee_geometry_operators.cpp @@ -55,7 +55,7 @@ using primal::Vector3D; namespace { template -ColumnVector operator*(const numerics::Matrix &matrix, const ColumnVector &rhs) +ColumnVector operator*(const numerics::Matrix& matrix, const ColumnVector& rhs) { if(matrix.getNumRows() != matrix.getNumColumns() || matrix.getNumRows() != rhs.dimension()) { @@ -66,14 +66,14 @@ ColumnVector operator*(const numerics::Matrix &matrix, const ColumnVecto return result; } -primal::Vector affineVec(const Vector3D &vec3d) +primal::Vector affineVec(const Vector3D& vec3d) { primal::Vector vector {vec3d.data(), 3}; vector[3] = 0; return vector; } -primal::Point affinePoint(const Point3D &point3d) +primal::Point affinePoint(const Point3D& point3d) { primal::Point point {point3d.data(), 3}; point[3] = 1; @@ -86,12 +86,12 @@ Dimensions ALL_DIMS[] = {Dimensions::Two, Dimensions::Three}; class MockVisitor : public GeometryOperatorVisitor { public: - MOCK_METHOD(void, visit, (const Translation &translation), (override)); - MOCK_METHOD(void, visit, (const Rotation &rotation), (override)); - MOCK_METHOD(void, visit, (const Scale &scale), (override)); - MOCK_METHOD(void, visit, (const UnitConverter &converter), (override)); - MOCK_METHOD(void, visit, (const CompositeOperator &op), (override)); - MOCK_METHOD(void, visit, (const SliceOperator &op), (override)); + MOCK_METHOD(void, visit, (const Translation& translation), (override)); + MOCK_METHOD(void, visit, (const Rotation& rotation), (override)); + MOCK_METHOD(void, visit, (const Scale& scale), (override)); + MOCK_METHOD(void, visit, (const UnitConverter& converter), (override)); + MOCK_METHOD(void, visit, (const CompositeOperator& op), (override)); + MOCK_METHOD(void, visit, (const SliceOperator& op), (override)); }; TEST(GeometryOperator, getProperties) @@ -151,7 +151,7 @@ TEST(Translation, accept) { Translation translation {{10, 20, 30}, {Dimensions::Two, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(translation)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(translation)))); translation.accept(visitor); } @@ -245,7 +245,7 @@ TEST(Rotation, accept) { Rotation rotation {90, {0, 0, 0}, {1, 2, 3}, {Dimensions::Three, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(rotation)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(rotation)))); rotation.accept(visitor); } @@ -318,7 +318,7 @@ TEST(Scale, accept) { Scale scale {1, 2, 3, {Dimensions::Three, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(scale)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(scale)))); scale.accept(visitor); } @@ -341,7 +341,7 @@ TEST(UnitConverter, accept) { UnitConverter converter {LengthUnit::m, {Dimensions::Three, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(converter)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(converter)))); converter.accept(visitor); } @@ -415,7 +415,7 @@ TEST(CompositeOperator, accept) { CompositeOperator composite {{Dimensions::Three, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(composite)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(composite)))); composite.accept(visitor); } @@ -481,6 +481,6 @@ TEST(Slice, accept) { SliceOperator slice {{0, 0, 0}, {1, 0, 0}, {0, 1, 0}, {Dimensions::Three, LengthUnit::cm}}; MockVisitor visitor; - EXPECT_CALL(visitor, visit(Matcher(Ref(slice)))); + EXPECT_CALL(visitor, visit(Matcher(Ref(slice)))); slice.accept(visitor); } diff --git a/src/axom/klee/tests/klee_geometry_operators_io.cpp b/src/axom/klee/tests/klee_geometry_operators_io.cpp index 2ab39c0a08..7c19ad909d 100644 --- a/src/axom/klee/tests/klee_geometry_operators_io.cpp +++ b/src/axom/klee/tests/klee_geometry_operators_io.cpp @@ -61,9 +61,9 @@ using OperatorPointer = CompositeOperator::OpPtr; * \param an optional map of named operators * \return the operators that were read. */ -OperatorPointer readOperators(const TransformableGeometryProperties &startProperties, - const std::string &input, - const NamedOperatorMap &namedOperators = NamedOperatorMap {}) +OperatorPointer readOperators(const TransformableGeometryProperties& startProperties, + const std::string& input, + const NamedOperatorMap& namedOperators = NamedOperatorMap {}) { auto reader = std::unique_ptr(new inlet::YAMLReader()); std::string wrappedInput = "test_list:\n "; @@ -90,7 +90,7 @@ OperatorPointer readOperators(const TransformableGeometryProperties &startProper * \param input the operators expressed in yaml * \return the named operators that were read */ -NamedOperatorMap readNamedOperators(Dimensions startingDimensions, const std::string &input) +NamedOperatorMap readNamedOperators(Dimensions startingDimensions, const std::string& input) { auto reader = std::unique_ptr(new inlet::YAMLReader()); std::string wrappedInput = "op_list:\n"; @@ -118,9 +118,9 @@ NamedOperatorMap readNamedOperators(Dimensions startingDimensions, const std::st * \throws std::logic error if the pointer is of the wrong type */ template -T copyOperator(const OperatorPointer &ptr) +T copyOperator(const OperatorPointer& ptr) { - auto desired = dynamic_cast(ptr.get()); + auto desired = dynamic_cast(ptr.get()); if(desired == nullptr) { throw KleeError {inlet::VerificationError {Path {""}, "Did not get expected type"}}; @@ -137,9 +137,9 @@ T copyOperator(const OperatorPointer &ptr) * \throws std::logic error if the pointer is of the wrong type */ template -T getSingleOperatorFromComposite(const OperatorPointer &ptr) +T getSingleOperatorFromComposite(const OperatorPointer& ptr) { - auto composite = dynamic_cast(ptr.get()); + auto composite = dynamic_cast(ptr.get()); if(composite == nullptr) { throw KleeError {inlet::VerificationError {Path {""}, "Did not get CompositeOperator"}}; @@ -164,9 +164,9 @@ T getSingleOperatorFromComposite(const OperatorPointer &ptr) * the specified type. */ template -T readSingleOperator(const TransformableGeometryProperties &startProperties, - const std::string &input, - const std::unordered_map &namedOperators = +T readSingleOperator(const TransformableGeometryProperties& startProperties, + const std::string& input, + const std::unordered_map& namedOperators = std::unordered_map {}) { std::string wrappedInput {"-\n"}; @@ -186,7 +186,7 @@ T readSingleOperator(const TransformableGeometryProperties &startProperties, * \throws KleeError if any of the operators are of the wrong type */ template -T getSingleNamedOperator(const NamedOperatorMap &operators, std::string const &name) +T getSingleNamedOperator(const NamedOperatorMap& operators, std::string const& name) { auto iter = operators.find(name); if(iter == operators.end()) @@ -217,7 +217,7 @@ TEST(GeometryOperatorsIO, readMultipleOperatorsIncluded) )"); FAIL() << "Should have thrown"; } - catch(KleeError const &error) + catch(KleeError const& error) { EXPECT_THAT(error.what(), HasSubstr("translate")); EXPECT_THAT(error.what(), HasSubstr("rotate")); @@ -257,7 +257,7 @@ TEST(GeometryOperatorsIO, readTranslation_unknownKeys) )"); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("UNKNOWN_KEY")); } @@ -300,7 +300,7 @@ TEST(GeometryOperatorsIO, readRotation_2D_axisNotAllowed) )"); FAIL() << "Should have thrown an exception"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("rotate")); EXPECT_THAT(ex.what(), HasSubstr("axis")); @@ -345,7 +345,7 @@ TEST(GeometryOperatorsIO, readRotation_3D_axisMissing) )"); FAIL() << "Should not have parsed"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("axis")); } @@ -534,7 +534,7 @@ TEST(GeometryOperatorsIO, readSlice_zeroNormal) )"); FAIL() << "Should have thrown a message about the normal being zero"; } - catch(KleeError &ex) + catch(KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("normal")); EXPECT_THAT(ex.what(), HasSubstr("zero")); @@ -554,7 +554,7 @@ TEST(GeometryOperatorsIO, readSlice_upAndNormalNotNormal) FAIL() << "Should have thrown a message about the normal and up " "vectors not being perpendicular"; } - catch(KleeError &ex) + catch(KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("normal")); EXPECT_THAT(ex.what(), HasSubstr("up")); @@ -630,7 +630,7 @@ TEST(GeometryOperatorsIO, readMultiple_unknownOperator) )"); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { EXPECT_THAT(error.what(), HasSubstr("UNKNOWN_OPERATOR")); } @@ -645,7 +645,7 @@ TEST(GeometryOperatorsIO, readRef_missing) )"); FAIL() << "Should have thrown"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("MISSING")); } @@ -671,7 +671,7 @@ class RefIoUnitsMismatchTest : public ::testing::Test protected: void SetUp() override; std::shared_ptr referencedOperator; - CompositeOperator readOperator(const TransformableGeometryProperties &startProperties) const; + CompositeOperator readOperator(const TransformableGeometryProperties& startProperties) const; }; void RefIoUnitsMismatchTest::SetUp() @@ -688,7 +688,7 @@ void RefIoUnitsMismatchTest::SetUp() } CompositeOperator RefIoUnitsMismatchTest::readOperator( - const TransformableGeometryProperties &startProperties) const + const TransformableGeometryProperties& startProperties) const { NamedOperatorMap namedOperators = { {"op1", referencedOperator}, @@ -855,7 +855,7 @@ TEST(GeometryOperatorsIO, readNamedOperators_errorInEndUnits) )"); FAIL() << "Should have thrown"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("units")); } @@ -880,7 +880,7 @@ TEST(GeometryOperatorsIO, readNamedOperators_ref) EXPECT_THAT(translation.getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); auto op2 = readOperators["op2"]; - auto composite = dynamic_cast(op2.get()); + auto composite = dynamic_cast(op2.get()); ASSERT_NE(nullptr, composite); TransformableGeometryProperties expectedOp2Units {Dimensions::Two, LengthUnit::inches}; EXPECT_EQ(expectedOp2Units, composite->getStartProperties()); @@ -898,7 +898,7 @@ TEST(GeometryOperatorsIO, readNamedOperators_ref) EXPECT_THAT(referencedTranslation.getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/klee/tests/klee_io.cpp b/src/axom/klee/tests/klee_io.cpp index 8f9b8a1334..9643cf1165 100644 --- a/src/axom/klee/tests/klee_io.cpp +++ b/src/axom/klee/tests/klee_io.cpp @@ -45,13 +45,13 @@ using ::testing::Truly; namespace { -ShapeSet readShapeSetFromString(const std::string &input) +ShapeSet readShapeSetFromString(const std::string& input) { std::istringstream istream(input); return klee::readShapeSet(istream); } -ShapeSet readShapeSetFromString(const std::string &input, InputFormat format) +ShapeSet readShapeSetFromString(const std::string& input, InputFormat format) { std::istringstream istream(input); return klee::readShapeSet(istream, format); @@ -78,7 +78,7 @@ TEST(IOTest, readShapeSet_invalidDimensions) shapes: [])"); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("dimensions")); } @@ -96,16 +96,16 @@ TEST(IOTest, readShapeSet_shapeWithNoReplacementLists) path: path/to/file.format )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; + auto& shape = shapes[0]; EXPECT_TRUE(shape.replaces("mat1")); EXPECT_TRUE(shape.replaces("mat2")); EXPECT_EQ("wheel", shape.getName()); EXPECT_EQ("steel", shape.getMaterial()); - auto &geometry = shape.getGeometry(); + auto& geometry = shape.getGeometry(); EXPECT_EQ("test_format", geometry.getFormat()); EXPECT_EQ("path/to/file.format", geometry.getPath()); EXPECT_FALSE(geometry.getGeometryOperator()); @@ -127,10 +127,10 @@ TEST(IOTest, readShapeSet_shapeWithReplacesList) path: path/to/file.format )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; + auto& shape = shapes[0]; EXPECT_TRUE(shape.replaces("mat1")); EXPECT_TRUE(shape.replaces("mat2")); EXPECT_FALSE(shape.replaces("material_not_in_list")); @@ -149,10 +149,10 @@ TEST(IOTest, readShapeSet_shapeWithDoesNotReplaceList) path: path/to/file.format )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; + auto& shape = shapes[0]; EXPECT_FALSE(shape.replaces("mat1")); EXPECT_FALSE(shape.replaces("mat2")); EXPECT_TRUE(shape.replaces("material_not_in_list")); @@ -175,7 +175,7 @@ TEST(IOTest, readShapeSet_missingName) readShapeSetFromString(input); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("name")); } @@ -198,7 +198,7 @@ TEST(IOTest, readShapeSet_missingMaterial) readShapeSetFromString(input); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("material")); } @@ -224,7 +224,7 @@ TEST(IOTest, readShapeSet_missingGeometryPath) readShapeSetFromString(input); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("Provided format")); } @@ -247,7 +247,7 @@ TEST(IOTest, readShapeSet_missingGeometryPath) readShapeSetFromString(input); SUCCEED(); } - catch(const KleeError &err) + catch(const KleeError& err) { FAIL() << "Should not have thrown. Error message: " << err.what(); } @@ -271,7 +271,7 @@ TEST(IOTest, readShapeSet_formatGeometryFormat) readShapeSetFromString(input); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("format")); } @@ -325,7 +325,7 @@ TEST(IOTest, readShapeSet_fileWithoutExtensionDefaultsToYaml) klee::readShapeSet(fileName); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { ASSERT_EQ(1u, error.getErrors().size()); EXPECT_EQ(axom::Path {fileName}, error.getErrors()[0].path); @@ -354,7 +354,7 @@ TEST(IOTest, readShapeSet_explicitFormatReportsParseFailure) klee::readShapeSet(input.getPath(), InputFormat::YAML); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { ASSERT_EQ(1u, error.getErrors().size()); EXPECT_EQ(axom::Path {input.getPath()}, error.getErrors()[0].path); @@ -369,7 +369,7 @@ TEST(IOTest, readShapeSet_emptyStreamReportsParseFailure) readShapeSetFromString("", InputFormat::YAML); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { ASSERT_EQ(1u, error.getErrors().size()); EXPECT_EQ(axom::Path {""}, error.getErrors()[0].path); @@ -385,7 +385,7 @@ TEST(IOTest, readShapeSet_missingFileReportsParseFailure) klee::readShapeSet(fileName); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { ASSERT_EQ(1u, error.getErrors().size()); EXPECT_EQ(axom::Path {fileName}, error.getErrors()[0].path); @@ -400,7 +400,7 @@ TEST(IOTest, readShapeSet_unsupportedFileExtension) klee::readShapeSet("testFile.json"); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("Unsupported Klee input file extension '.json'")); EXPECT_THAT(err.what(), HasSubstr(".yaml, .yml, and .lua")); @@ -417,7 +417,7 @@ TEST(IOTest, readShapeSet_streamDefaultsToYaml) )"); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_THAT(err.what(), HasSubstr("dimensions")); } @@ -435,7 +435,7 @@ TEST(IOTest, readShapeSet_luaUnavailableDiagnostic) InputFormat::Lua); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { EXPECT_STREQ( "Lua input files require Axom configured with AXOM_ENABLE_LUA=ON and Sol library " @@ -465,7 +465,7 @@ TEST(IOTest, readShapeSet_malformedLuaReportsParseFailure) readShapeSetFromString("dimensions =", InputFormat::Lua); FAIL() << "Should have thrown"; } - catch(const KleeError &error) + catch(const KleeError& error) { ASSERT_EQ(1u, error.getErrors().size()); EXPECT_EQ(axom::Path {""}, error.getErrors()[0].path); @@ -491,7 +491,7 @@ TEST(IOTest, readShapeSet_luaStreamMinimalShapeList) InputFormat::Lua); ASSERT_EQ(1u, shapeSet.getShapes().size()); - const auto &shape = shapeSet.getShapes()[0]; + const auto& shape = shapeSet.getShapes()[0]; EXPECT_EQ("wheel", shape.getName()); EXPECT_EQ("steel", shape.getMaterial()); EXPECT_EQ("test_format", shape.getGeometry().getFormat()); @@ -607,21 +607,21 @@ TEST(IOTest, readShapeSet_luaGeometryOperators) InputFormat::Lua); ASSERT_EQ(2u, shapeSet.getShapes().size()); - const auto &geometryOperator = shapeSet.getShapes()[0].getGeometry().getGeometryOperator(); + const auto& geometryOperator = shapeSet.getShapes()[0].getGeometry().getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); ASSERT_EQ(4u, composite->getOperators().size()); - auto rotation = dynamic_cast(composite->getOperators()[0].get()); + auto rotation = dynamic_cast(composite->getOperators()[0].get()); ASSERT_NE(rotation, nullptr); EXPECT_EQ(rotation->getAngle(), 90); - auto translation = dynamic_cast(composite->getOperators()[1].get()); + auto translation = dynamic_cast(composite->getOperators()[1].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {10, 20, 30})); - auto scale = dynamic_cast(composite->getOperators()[2].get()); + auto scale = dynamic_cast(composite->getOperators()[2].get()); ASSERT_NE(scale, nullptr); EXPECT_DOUBLE_EQ(1.5, scale->getXFactor()); EXPECT_DOUBLE_EQ(2.5, scale->getYFactor()); @@ -681,13 +681,13 @@ TEST(IOTest, readShapeSet_luaNamedGeometryOperatorsWithNestedRef) shapeSet.getShapes()[0].getGeometry().getGeometryOperator()); ASSERT_TRUE(composite); ASSERT_EQ(1u, composite->getOperators().size()); - auto referenced = dynamic_cast(composite->getOperators()[0].get()); + auto referenced = dynamic_cast(composite->getOperators()[0].get()); ASSERT_NE(referenced, nullptr); ASSERT_EQ(2u, referenced->getOperators().size()); - auto nested = dynamic_cast(referenced->getOperators()[0].get()); + auto nested = dynamic_cast(referenced->getOperators()[0].get()); ASSERT_NE(nested, nullptr); EXPECT_EQ(1u, nested->getOperators().size()); - auto translation = dynamic_cast(referenced->getOperators()[1].get()); + auto translation = dynamic_cast(referenced->getOperators()[1].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); } @@ -765,7 +765,7 @@ TEST(IOTest, readShapeSet_luaGeneratedOrdinaryTableValues) shapeSet.getShapes()[0].getGeometry().getGeometryOperator()); ASSERT_TRUE(composite); ASSERT_EQ(1u, composite->getOperators().size()); - auto translation = dynamic_cast(composite->getOperators()[0].get()); + auto translation = dynamic_cast(composite->getOperators()[0].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {4, 8, 0})); } @@ -784,7 +784,7 @@ TEST(IOTest, readShapeSet_luaUnexpectedGlobalDiagnostic) InputFormat::Lua); FAIL() << "Should have thrown"; } - catch(const KleeError &err) + catch(const KleeError& err) { ASSERT_EQ(1u, err.getErrors().size()); EXPECT_EQ(axom::Path {"unexpected_global"}, err.getErrors()[0].path); @@ -835,9 +835,9 @@ TEST(IOTest, readShapeSet_shapeWithReplacesAndDoesNotReplaceLists) { readShapeSetFromString(input); } - catch(const KleeError &error) + catch(const KleeError& error) { - EXPECT_THAT(error.getErrors(), Contains(Truly([](const inlet::VerificationError &err) { + EXPECT_THAT(error.getErrors(), Contains(Truly([](const inlet::VerificationError& err) { return err.path == axom::Path {"shapes/_inlet_collection/0"} && err.messageContains("replaces") && err.messageContains("does_not_replace"); }))); @@ -859,21 +859,21 @@ TEST(IOTest, readShapeSet_geometryOperators) - rotate: 90 - translate: [10, 20] )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; - auto &geometryOperator = shape.getGeometry().getGeometryOperator(); + auto& shape = shapes[0]; + auto& geometryOperator = shape.getGeometry().getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); EXPECT_EQ(2u, composite->getOperators().size()); - auto rotation = dynamic_cast(composite->getOperators()[0].get()); + auto rotation = dynamic_cast(composite->getOperators()[0].get()); ASSERT_NE(rotation, nullptr); EXPECT_EQ(rotation->getAngle(), 90); - auto translation = dynamic_cast(composite->getOperators()[1].get()); + auto translation = dynamic_cast(composite->getOperators()[1].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); EXPECT_EQ(LengthUnit::m, translation->getEndProperties().units); @@ -895,16 +895,16 @@ TEST(IOTest, readShapeSet_geometryOperators_scaleWithCenter) - scale: [1.5, 2.5] center: [10, 20] )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &geometryOperator = shapes[0].getGeometry().getGeometryOperator(); + auto& geometryOperator = shapes[0].getGeometry().getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); ASSERT_EQ(1u, composite->getOperators().size()); - auto scale = dynamic_cast(composite->getOperators()[0].get()); + auto scale = dynamic_cast(composite->getOperators()[0].get()); ASSERT_NE(scale, nullptr); EXPECT_DOUBLE_EQ(1.5, scale->getXFactor()); EXPECT_DOUBLE_EQ(2.5, scale->getYFactor()); @@ -930,7 +930,7 @@ TEST(IOTest, readShapeSet_geometryOperatorsWithoutUnits) )"); FAIL() << "Expected a failure"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("operator")); EXPECT_THAT(ex.what(), HasSubstr("units")); @@ -952,17 +952,17 @@ TEST(IOTest, readShapeSet_geometryOperatorsWithUnits) - rotate: 90 - translate: [10, 20] )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &geometryOperator = shapes[0].getGeometry().getGeometryOperator(); + auto& geometryOperator = shapes[0].getGeometry().getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); EXPECT_EQ(2u, composite->getOperators().size()); - auto translation = dynamic_cast(composite->getOperators()[1].get()); + auto translation = dynamic_cast(composite->getOperators()[1].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); } @@ -983,16 +983,16 @@ TEST(IOTest, readShapeSet_differentDimensions) - slice: x: 10 )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; - auto &geometry = shape.getGeometry(); + auto& shape = shapes[0]; + auto& geometry = shape.getGeometry(); TransformableGeometryProperties expectedStartProperties {Dimensions::Three, LengthUnit::cm}; TransformableGeometryProperties expectedEndProperties {Dimensions::Two, LengthUnit::cm}; EXPECT_EQ(expectedStartProperties, geometry.getStartProperties()); EXPECT_EQ(expectedEndProperties, geometry.getEndProperties()); EXPECT_EQ(shapeSet.getDimensions(), geometry.getEndProperties().dimensions); - auto &geometryOperator = geometry.getGeometryOperator(); + auto& geometryOperator = geometry.getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); @@ -1041,7 +1041,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) x: 10 )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(4u, shapes.size()); const Dimensions exp_global_dims {Dimensions::Two}; @@ -1049,7 +1049,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // no_explicit_dims -- should be same as global dims { - auto &geometry = shapes[0].getGeometry(); + auto& geometry = shapes[0].getGeometry(); const Dimensions exp_start_dims {Dimensions::Two}; const Dimensions exp_end_dims {Dimensions::Two}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1059,7 +1059,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_same_as_global -- should be same as global dims { - auto &geometry = shapes[1].getGeometry(); + auto& geometry = shapes[1].getGeometry(); const Dimensions exp_start_dims {Dimensions::Two}; const Dimensions exp_end_dims {Dimensions::Two}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1068,7 +1068,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_different_from_global -- differs from global dims { - auto &geometry = shapes[2].getGeometry(); + auto& geometry = shapes[2].getGeometry(); const Dimensions exp_start_dims {Dimensions::Three}; const Dimensions exp_end_dims {Dimensions::Three}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1077,7 +1077,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_with_start_dim -- changes dimension { - auto &geometry = shapes[3].getGeometry(); + auto& geometry = shapes[3].getGeometry(); const Dimensions exp_start_dims {Dimensions::Three}; const Dimensions exp_end_dims {Dimensions::Two}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1123,7 +1123,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) x: 10 )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(4u, shapes.size()); const Dimensions exp_global_dims {Dimensions::Three}; @@ -1131,7 +1131,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // no_explicit_dims -- should be same as global dims { - auto &geometry = shapes[0].getGeometry(); + auto& geometry = shapes[0].getGeometry(); const Dimensions exp_start_dims {Dimensions::Three}; const Dimensions exp_end_dims {Dimensions::Three}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1141,7 +1141,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_same_as_global -- should be same as global dims { - auto &geometry = shapes[1].getGeometry(); + auto& geometry = shapes[1].getGeometry(); const Dimensions exp_start_dims {Dimensions::Three}; const Dimensions exp_end_dims {Dimensions::Three}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1150,7 +1150,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_different_from_global -- differs from global dims { - auto &geometry = shapes[2].getGeometry(); + auto& geometry = shapes[2].getGeometry(); const Dimensions exp_start_dims {Dimensions::Two}; const Dimensions exp_end_dims {Dimensions::Two}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1159,7 +1159,7 @@ TEST(IOTest, readShapeSet_explicitDimensions) // explicit_dims_with_start_dim -- changes dimension { - auto &geometry = shapes[3].getGeometry(); + auto& geometry = shapes[3].getGeometry(); const Dimensions exp_start_dims {Dimensions::Three}; const Dimensions exp_end_dims {Dimensions::Two}; EXPECT_EQ(exp_start_dims, geometry.getInputDimensions()); @@ -1184,7 +1184,7 @@ TEST(IOTest, readShapeSet_wrongEndDimensions) )"); FAIL() << "Expected an error"; } - catch(const KleeError &ex) + catch(const KleeError& ex) { EXPECT_THAT(ex.what(), HasSubstr("dimensions")); } @@ -1212,22 +1212,22 @@ TEST(IOTest, readShapeSet_namedGeometryOperators) - rotate: 90 - translate: [10, 20] )"); - auto &shapes = shapeSet.getShapes(); + auto& shapes = shapeSet.getShapes(); ASSERT_EQ(1u, shapes.size()); - auto &shape = shapes[0]; - auto &geometryOperator = shape.getGeometry().getGeometryOperator(); + auto& shape = shapes[0]; + auto& geometryOperator = shape.getGeometry().getGeometryOperator(); ASSERT_TRUE(geometryOperator); auto composite = std::dynamic_pointer_cast(geometryOperator); ASSERT_TRUE(composite); EXPECT_EQ(1u, composite->getOperators().size()); - auto referenced = dynamic_cast(composite->getOperators()[0].get()); + auto referenced = dynamic_cast(composite->getOperators()[0].get()); EXPECT_EQ(2u, referenced->getOperators().size()); - auto translation = dynamic_cast(referenced->getOperators()[1].get()); + auto translation = dynamic_cast(referenced->getOperators()[1].get()); ASSERT_NE(translation, nullptr); EXPECT_THAT(translation->getOffset(), AlmostEqVector(Vector3D {10, 20, 0})); } -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/klee/tests/klee_io_util.cpp b/src/axom/klee/tests/klee_io_util.cpp index f345edd825..ae9bb8b53d 100644 --- a/src/axom/klee/tests/klee_io_util.cpp +++ b/src/axom/klee/tests/klee_io_util.cpp @@ -30,7 +30,7 @@ using test::AlmostEqPoint; using test::AlmostEqVector; using ::testing::ElementsAre; -static std::unique_ptr readYaml(const std::string &input) +static std::unique_ptr readYaml(const std::string& input) { auto reader = std::unique_ptr(new inlet::YAMLReader()); reader->parseString(input); @@ -41,7 +41,7 @@ class InletTestData { public: template - InletTestData(const std::string &input, DefOp defOp); + InletTestData(const std::string& input, DefOp defOp); private: sidre::DataStore m_store; @@ -51,7 +51,7 @@ class InletTestData }; template -InletTestData::InletTestData(const std::string &input, DefOp defOp) +InletTestData::InletTestData(const std::string& input, DefOp defOp) : m_store {} , doc {readYaml(input), m_store.getRoot()} { @@ -66,11 +66,11 @@ InletTestData::InletTestData(const std::string &input, DefOp defOp) } } -std::vector parseDoubleVector(const std::string &vectorInput, Dimensions dims) +std::vector parseDoubleVector(const std::string& vectorInput, Dimensions dims) { std::string fullInput = "values: "; fullInput += vectorInput; - InletTestData data {fullInput, [](inlet::Container &c) { c.addDoubleArray("values"); }}; + InletTestData data {fullInput, [](inlet::Container& c) { c.addDoubleArray("values"); }}; return toDoubleVector(data.doc["values"], dims, "values"); } @@ -82,11 +82,11 @@ TEST(io_util, toDoubleVector) EXPECT_THROW(parseDoubleVector("[a, b]", Dimensions::Three), KleeError) << "Wrong type"; } -Dimensions defineAndParseDimension(const char *input) +Dimensions defineAndParseDimension(const char* input) { std::string fullInput = "dims: "; fullInput += input; - InletTestData data {fullInput, [](inlet::Container &c) { + InletTestData data {fullInput, [](inlet::Container& c) { defineDimensionsField(c, "dims", "some description"); }}; return toDimensions(data.doc["dims"]); @@ -105,7 +105,7 @@ TEST(io_util, defineAndConvertDimensions) * * @param container the Container on which to define the units fields */ -void defineUnitsSchemaWithDefaults(inlet::Container &container) { defineUnitsSchema(container); } +void defineUnitsSchemaWithDefaults(inlet::Container& container) { defineUnitsSchema(container); } TEST(io_util, getOptionalStartAndEndUnits_nothingSpecified) { @@ -171,16 +171,16 @@ TEST(io_util, getStartAndEndUnits_nothingSpecified) } template -T parseArray(const char *value, Dimensions dims, Op op) +T parseArray(const char* value, Dimensions dims, Op op) { std::string input = "value: "; input += value; - InletTestData data {input, [](inlet::Container &c) { c.addDoubleArray("value"); }}; + InletTestData data {input, [](inlet::Container& c) { c.addDoubleArray("value"); }}; return op(data.doc.getGlobalContainer(), "value", dims); } template -T parseArray(const char *value, Dimensions dims, const T &defaultValue, Op op) +T parseArray(const char* value, Dimensions dims, const T& defaultValue, Op op) { std::string input; if(value != nullptr) @@ -193,43 +193,43 @@ T parseArray(const char *value, Dimensions dims, const T &defaultValue, Op op) // avoid warning about empty input input = "foo: bar"; } - InletTestData data {input, [](inlet::Container &c) { c.addDoubleArray("value"); }}; + InletTestData data {input, [](inlet::Container& c) { c.addDoubleArray("value"); }}; return op(data.doc.getGlobalContainer(), "value", dims, defaultValue); } -Point3D parsePoint(const char *value, Dimensions dims) +Point3D parsePoint(const char* value, Dimensions dims) { return parseArray( value, dims, - static_cast(toPoint)); + static_cast(toPoint)); } -Point3D parsePoint(const char *value, Dimensions dims, Point3D defaultValue) +Point3D parsePoint(const char* value, Dimensions dims, Point3D defaultValue) { return parseArray( value, dims, defaultValue, - static_cast( + static_cast( toPoint)); } -Vector3D parseVector(const char *value, Dimensions dims) +Vector3D parseVector(const char* value, Dimensions dims) { return parseArray( value, dims, - static_cast(toVector)); + static_cast(toVector)); } -Vector3D parseVector(const char *value, Dimensions dims, Vector3D defaultValue) +Vector3D parseVector(const char* value, Dimensions dims, Vector3D defaultValue) { return parseArray( value, dims, defaultValue, - static_cast( + static_cast( toVector)); } @@ -277,7 +277,7 @@ TEST(io_util, toVector_default) } // namespace klee } // namespace axom -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/mint/execution/internal/for_all_faces.hpp b/src/axom/mint/execution/internal/for_all_faces.hpp index c24963e73e..c811ebbb7d 100644 --- a/src/axom/mint/execution/internal/for_all_faces.hpp +++ b/src/axom/mint/execution/internal/for_all_faces.hpp @@ -1,946 +1,946 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - -// Axom core includes -#include "axom/config.hpp" // compile time definitions -#include "axom/core/execution/execution_space.hpp" // for execution_space traits -#include "axom/core/execution/for_all.hpp" // for axom::for_all - -// mint includes -#include "axom/mint/execution/xargs.hpp" // for xargs -#include "axom/mint/config.hpp" // for compile-time definitions -#include "axom/mint/mesh/Mesh.hpp" // for Mesh -#include "axom/mint/mesh/StructuredMesh.hpp" // for StructuredMesh -#include "axom/mint/mesh/UniformMesh.hpp" // for UniformMesh -#include "axom/mint/mesh/RectilinearMesh.hpp" // for RectilinearMesh -#include "axom/mint/mesh/CurvilinearMesh.hpp" // for CurvilinearMesh -#include "axom/mint/execution/internal/helpers.hpp" // for for_all_coords -#include "axom/core/execution/nested_for_exec.hpp" - -#include "axom/core/numerics/Matrix.hpp" // for Matrix - -namespace axom -{ -namespace mint -{ -namespace internal -{ -namespace helpers -{ -//------------------------------------------------------------------------------ -template -inline void for_all_I_faces(xargs::ij, const StructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() != 2, "Mesh must be 2D."); - - const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); - const IndexType Ni = INodeResolution; - const IndexType Nj = m.getCellResolution(J_DIRECTION); - - axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}; - axom::for_all( - i_range, - j_range, - AXOM_LAMBDA(IndexType i, IndexType j) { - const IndexType faceID = i + j * INodeResolution; - kernel(faceID, i, j); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_I_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be a 3D."); - - const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); - const IndexType numIFacesInKSlice = INodeResolution * m.getCellResolution(J_DIRECTION); - const IndexType Ni = INodeResolution; - const IndexType Nj = m.getCellResolution(J_DIRECTION); - const IndexType Nk = m.getCellResolution(K_DIRECTION); - - axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; - axom::for_all( - i_range, - j_range, - k_range, - AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { - const IndexType faceID = i + j * INodeResolution + k * numIFacesInKSlice; - kernel(faceID, i, j, k); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_J_faces(xargs::ij, const StructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() != 2, "Mesh must be 2D."); - - const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); - const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); - const IndexType Ni = ICellResolution; - const IndexType Nj = m.getNodeResolution(J_DIRECTION); - - axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}; - axom::for_all( - i_range, - j_range, - AXOM_LAMBDA(IndexType i, IndexType j) { - const IndexType faceID = numIFaces + i + j * ICellResolution; - kernel(faceID, i, j); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_J_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be 3D."); - - const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); - const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); - const IndexType numJFacesInKSlice = ICellResolution * m.getNodeResolution(J_DIRECTION); - const IndexType Ni = ICellResolution; - const IndexType Nj = m.getNodeResolution(J_DIRECTION); - const IndexType Nk = m.getCellResolution(K_DIRECTION); - - axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; - axom::for_all( - i_range, - j_range, - k_range, - AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { - const IndexType jp = j * ICellResolution; - const IndexType kp = k * numJFacesInKSlice; - const IndexType faceID = numIFaces + i + jp + kp; - kernel(faceID, i, j, k); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_K_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be 3D."); - - const IndexType numIJFaces = m.getTotalNumFaces(I_DIRECTION) + m.getTotalNumFaces(J_DIRECTION); - const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); - const IndexType cellKp = m.cellKp(); - const IndexType Ni = ICellResolution; - const IndexType Nj = m.getCellResolution(J_DIRECTION); - const IndexType Nk = m.getNodeResolution(K_DIRECTION); - - axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; - axom::for_all( - i_range, - j_range, - k_range, - AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { - const IndexType jp = j * ICellResolution; - const IndexType kp = k * cellKp; - const IndexType faceID = numIJFaces + i + jp + kp; - kernel(faceID, i, j, k); - }); -} - -} /* namespace helpers */ - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::index, const Mesh& m, KernelType&& kernel) -{ - const IndexType numFaces = m.getNumberOfFaces(); - axom::for_all(numFaces, std::forward(kernel)); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces(xargs::index, const Mesh& m, KernelType&& kernel) -{ - return for_all_faces_impl(xargs::index(), m, std::forward(kernel)); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::nodeids, const StructuredMesh& m, KernelType&& kernel) -{ - const IndexType dimension = m.getDimension(); - const IndexType* offsets = m.getCellNodeOffsetsArray(); - const IndexType cellNodeOffset3 = offsets[3]; - - if(dimension == 2) - { - const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); - - helpers::for_all_I_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType AXOM_UNUSED_PARAM(j)) { - IndexType nodes[2]; - nodes[0] = faceID; - nodes[1] = nodes[0] + cellNodeOffset3; - kernel(faceID, nodes, 2); - }); - - helpers::for_all_J_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { - const IndexType shiftedID = faceID - numIFaces; - IndexType nodes[2]; - nodes[0] = shiftedID + j; - nodes[1] = nodes[0] + 1; - kernel(faceID, nodes, 2); - }); - } - else - { - SLIC_ERROR_IF(dimension != 3, "for_all_faces is only valid for 2 or 3D meshes."); - - const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); - const IndexType numIJFaces = numIFaces + m.getTotalNumFaces(J_DIRECTION); - const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); - const IndexType JNodeResolution = m.getNodeResolution(J_DIRECTION); - const IndexType KFaceNodeStride = - m.getCellResolution(I_DIRECTION) + m.getCellResolution(J_DIRECTION) + 1; - - const IndexType cellNodeOffset2 = offsets[2]; - const IndexType cellNodeOffset4 = offsets[4]; - const IndexType cellNodeOffset5 = offsets[5]; - const IndexType cellNodeOffset7 = offsets[7]; - - helpers::for_all_I_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, - IndexType AXOM_UNUSED_PARAM(i), - IndexType AXOM_UNUSED_PARAM(j), - IndexType k) { - IndexType nodes[4]; - nodes[0] = faceID + k * INodeResolution; - nodes[1] = nodes[0] + cellNodeOffset4; - nodes[2] = nodes[0] + cellNodeOffset7; - nodes[3] = nodes[0] + cellNodeOffset3; - kernel(faceID, nodes, 4); - }); - - helpers::for_all_J_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { - const IndexType shiftedID = faceID - numIFaces; - IndexType nodes[4]; - nodes[0] = shiftedID + j + k * JNodeResolution; - nodes[1] = nodes[0] + 1; - nodes[2] = nodes[0] + cellNodeOffset5; - nodes[3] = nodes[0] + cellNodeOffset4; - kernel(faceID, nodes, 4); - }); - - helpers::for_all_K_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { - const IndexType shiftedID = faceID - numIJFaces; - IndexType nodes[4]; - nodes[0] = shiftedID + j + k * KFaceNodeStride; - nodes[1] = nodes[0] + 1; - nodes[2] = nodes[0] + cellNodeOffset2; - nodes[3] = nodes[0] + cellNodeOffset3; - kernel(faceID, nodes, 4); - }); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::nodeids, - const UnstructuredMesh& m, - KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, - "No faces in the mesh, perhaps you meant to call " - << "UnstructuredMesh::initializeFaceConnectivity first."); - - constexpr bool on_device = axom::execution_space::onDevice(); - const int device_allocator = axom::execution_space::allocatorID(); - - auto faces_to_nodes_h = - axom::ArrayView(m.getFaceNodesArray(), m.getFaceNodesSize()); - - // Move faces to nodes onto device - axom::Array faces_to_nodes_d = on_device - ? axom::Array(faces_to_nodes_h, device_allocator) - : axom::Array(); - - auto faces_to_nodes_view = on_device ? faces_to_nodes_d.view() : faces_to_nodes_h; - - const IndexType num_nodes = m.getNumberOfFaceNodes(); - - for_all_faces_impl( - xargs::index(), - m, - AXOM_LAMBDA(IndexType faceID) { - kernel(faceID, faces_to_nodes_view.data() + faceID * num_nodes, num_nodes); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::nodeids, - const UnstructuredMesh& m, - KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, - "No faces in the mesh, perhaps you meant to call " - << "UnstructuredMesh::initializeFaceConnectivity first."); - - constexpr bool on_device = axom::execution_space::onDevice(); - const int device_allocator = axom::execution_space::allocatorID(); - - auto faces_to_nodes_h = - axom::ArrayView(m.getFaceNodesArray(), m.getFaceNodesSize()); - auto offsets_h = - axom::ArrayView(m.getFaceNodesOffsetsArray(), m.getNumberOfFaces() + 1); - - // Move faces to nodes and offsets onto device - axom::Array faces_to_nodes_d = on_device - ? axom::Array(faces_to_nodes_h, device_allocator) - : axom::Array(); - axom::Array offsets_d = - on_device ? axom::Array(offsets_h, device_allocator) : axom::Array(); - - auto faces_to_nodes_view = on_device ? faces_to_nodes_d.view() : faces_to_nodes_h; - auto offsets_view = on_device ? offsets_d.view() : offsets_h; - - for_all_faces_impl( - xargs::index(), - m, - AXOM_LAMBDA(IndexType faceID) { - const IndexType num_nodes = offsets_view[faceID + 1] - offsets_view[faceID]; - kernel(faceID, faces_to_nodes_view.data() + offsets_view[faceID], num_nodes); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces(xargs::nodeids, const Mesh& m, KernelType&& kernel) -{ - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - if(m.isStructured()) - { - const StructuredMesh& sm = static_cast(m); - for_all_faces_impl(xargs::nodeids(), sm, std::forward(kernel)); - } - else if(m.hasMixedCellTypes()) - { - const UnstructuredMesh& um = static_cast&>(m); - for_all_faces_impl(xargs::nodeids(), um, std::forward(kernel)); - } - else - { - const UnstructuredMesh& um = static_cast&>(m); - for_all_faces_impl(xargs::nodeids(), um, std::forward(kernel)); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::cellids, const StructuredMesh& m, KernelType&& kernel) -{ - const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); - const IndexType JCellResolution = m.getCellResolution(J_DIRECTION); - const IndexType cellJp = m.cellJp(); - const int dimension = m.getDimension(); - - if(dimension == 2) - { - helpers::for_all_I_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - IndexType cellIDTwo = i + j * cellJp; - IndexType cellIDOne = cellIDTwo - 1; - if(i == 0) - { - cellIDOne = cellIDTwo; - cellIDTwo = -1; - } - else if(i == ICellResolution) - { - cellIDTwo = -1; - } - - kernel(faceID, cellIDOne, cellIDTwo); - }); - - helpers::for_all_J_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - IndexType cellIDTwo = i + j * cellJp; - IndexType cellIDOne = cellIDTwo - cellJp; - if(j == 0) - { - cellIDOne = cellIDTwo; - cellIDTwo = -1; - } - else if(j == JCellResolution) - { - cellIDTwo = -1; - } - - kernel(faceID, cellIDOne, cellIDTwo); - }); - } - else - { - SLIC_ERROR_IF(dimension != 3, "for_all_faces only valid for 2 or 3D meshes."); - - const IndexType KCellResolution = m.getCellResolution(K_DIRECTION); - const IndexType cellKp = m.cellKp(); - - helpers::for_all_I_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - IndexType cellIDTwo = i + j * cellJp + k * cellKp; - IndexType cellIDOne = cellIDTwo - 1; - if(i == 0) - { - cellIDOne = cellIDTwo; - cellIDTwo = -1; - } - else if(i == ICellResolution) - { - cellIDTwo = -1; - } - - kernel(faceID, cellIDOne, cellIDTwo); - }); - - helpers::for_all_J_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - IndexType cellIDTwo = i + j * cellJp + k * cellKp; - IndexType cellIDOne = cellIDTwo - cellJp; - if(j == 0) - { - cellIDOne = cellIDTwo; - cellIDTwo = -1; - } - else if(j == JCellResolution) - { - cellIDTwo = -1; - } - - kernel(faceID, cellIDOne, cellIDTwo); - }); - - helpers::for_all_K_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - IndexType cellIDTwo = i + j * cellJp + k * cellKp; - IndexType cellIDOne = cellIDTwo - cellKp; - if(k == 0) - { - cellIDOne = cellIDTwo; - cellIDTwo = -1; - } - else if(k == KCellResolution) - { - cellIDTwo = -1; - } - - kernel(faceID, cellIDOne, cellIDTwo); - }); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::cellids, const UnstructuredMesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, - "No faces in the mesh, perhaps you meant to call " - << "UnstructuredMesh::initializeFaceConnectivity first."); - - constexpr bool on_device = axom::execution_space::onDevice(); - const int device_allocator = axom::execution_space::allocatorID(); - - auto faces_to_cells_h = - axom::ArrayView(m.getFaceCellsArray(), 2 * m.getNumberOfFaces()); - - // Move faces to cells onto device - axom::Array faces_to_cells_d = on_device - ? axom::Array(faces_to_cells_h, device_allocator) - : axom::Array(); - - auto faces_to_cells_view = on_device ? faces_to_cells_d.view() : faces_to_cells_h; - - for_all_faces_impl( - xargs::index(), - m, - AXOM_LAMBDA(IndexType faceID) { - const IndexType offset = 2 * faceID; - kernel(faceID, faces_to_cells_view[offset], faces_to_cells_view[offset + 1]); - }); -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces(xargs::cellids, const Mesh& m, KernelType&& kernel) -{ - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - if(m.isStructured()) - { - const StructuredMesh& sm = static_cast(m); - for_all_faces_impl(xargs::cellids(), sm, std::forward(kernel)); - } - else if(m.hasMixedCellTypes()) - { - const UnstructuredMesh& um = static_cast&>(m); - for_all_faces_impl(xargs::cellids(), um, std::forward(kernel)); - } - else - { - const UnstructuredMesh& um = static_cast&>(m); - for_all_faces_impl(xargs::cellids(), um, std::forward(kernel)); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::coords, const UniformMesh& m, KernelType&& kernel) -{ - constexpr bool NO_COPY = true; - - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - const int dimension = m.getDimension(); - const double* origin = m.getOrigin(); - const double* spacing = m.getSpacing(); - const IndexType nodeJp = m.nodeJp(); - const IndexType nodeKp = m.nodeKp(); - - const double x0 = origin[0]; - const double dx = spacing[0]; - - const double y0 = origin[1]; - const double dy = spacing[1]; - - const double z0 = origin[2]; - const double dz = spacing[2]; - - if(dimension == 2) - { - helpers::for_all_I_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - const IndexType n0 = i + j * nodeJp; - const IndexType nodeIDs[2] = {n0, n0 + nodeJp}; - - double coords[4] = {x0 + i * dx, y0 + j * dy, x0 + i * dx, y0 + (j + 1) * dy}; - - numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_J_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - const IndexType n0 = i + j * nodeJp; - const IndexType nodeIDs[2] = {n0, n0 + 1}; - - double coords[4] = {x0 + i * dx, y0 + j * dy, x0 + (i + 1) * dx, y0 + j * dy}; - - numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } - else - { - helpers::for_all_I_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + nodeKp, n0 + nodeJp + nodeKp, n0 + nodeJp}; - - double coords[12] = {x0 + i * dx, - y0 + j * dy, - z0 + k * dz, - x0 + i * dx, - y0 + j * dy, - z0 + (k + 1) * dz, - x0 + i * dx, - y0 + (j + 1) * dy, - z0 + (k + 1) * dz, - x0 + i * dx, - y0 + (j + 1) * dy, - z0 + k * dz}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_J_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeKp, n0 + nodeKp}; - - double coords[12] = {x0 + i * dx, - y0 + j * dy, - z0 + k * dz, - x0 + (i + 1) * dx, - y0 + j * dy, - z0 + k * dz, - x0 + (i + 1) * dx, - y0 + j * dy, - z0 + (k + 1) * dz, - x0 + i * dx, - y0 + j * dy, - z0 + (k + 1) * dz}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_K_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; - - double coords[12] = {x0 + i * dx, - y0 + j * dy, - z0 + k * dz, - x0 + (i + 1) * dx, - y0 + j * dy, - z0 + k * dz, - x0 + (i + 1) * dx, - y0 + (j + 1) * dy, - z0 + k * dz, - x0 + i * dx, - y0 + (j + 1) * dy, - z0 + k * dz}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::coords, const RectilinearMesh& m, KernelType&& kernel) -{ - constexpr bool NO_COPY = true; - - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - constexpr bool on_device = axom::execution_space::onDevice(); - const int device_allocator = axom::execution_space::allocatorID(); - - const int dimension = m.getDimension(); - const IndexType nodeJp = m.nodeJp(); - const IndexType nodeKp = m.nodeKp(); - - auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), - m.getNodeResolution(X_COORDINATE)); - auto y_vals_h = axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), - m.getNodeResolution(Y_COORDINATE)); - - // Move xy values onto device - axom::Array x_vals_d = - on_device ? axom::Array(x_vals_h, device_allocator) : axom::Array(); - axom::Array y_vals_d = - on_device ? axom::Array(y_vals_h, device_allocator) : axom::Array(); - - auto x_vals_view = on_device ? x_vals_d.view() : x_vals_h; - auto y_vals_view = on_device ? y_vals_d.view() : y_vals_h; - - if(dimension == 2) - { - helpers::for_all_I_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - const IndexType n0 = i + j * nodeJp; - const IndexType nodeIDs[2] = {n0, n0 + nodeJp}; - - double coords[4] = {x_vals_view[i], y_vals_view[j], x_vals_view[i], y_vals_view[j + 1]}; - - numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_J_faces( - xargs::ij(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { - const IndexType n0 = i + j * nodeJp; - const IndexType nodeIDs[2] = {n0, n0 + 1}; - - double coords[4] = {x_vals_view[i], y_vals_view[j], x_vals_view[i + 1], y_vals_view[j]}; - - numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } - else - { - auto z_vals_h = axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), - m.getNodeResolution(Z_COORDINATE)); - - // Move z values onto device - axom::Array z_vals_d = - on_device ? axom::Array(z_vals_h, device_allocator) : axom::Array(); - - auto z_vals_view = on_device ? z_vals_d.view() : z_vals_h; - - helpers::for_all_I_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + nodeKp, n0 + nodeJp + nodeKp, n0 + nodeJp}; - - double coords[12] = {x_vals_view[i], - y_vals_view[j], - z_vals_view[k], - x_vals_view[i], - y_vals_view[j], - z_vals_view[k + 1], - x_vals_view[i], - y_vals_view[j + 1], - z_vals_view[k + 1], - x_vals_view[i], - y_vals_view[j + 1], - z_vals_view[k]}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_J_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeKp, n0 + nodeKp}; - - double coords[12] = {x_vals_view[i], - y_vals_view[j], - z_vals_view[k], - x_vals_view[i + 1], - y_vals_view[j], - z_vals_view[k], - x_vals_view[i + 1], - y_vals_view[j], - z_vals_view[k + 1], - x_vals_view[i], - y_vals_view[j], - z_vals_view[k + 1]}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - - helpers::for_all_K_faces( - xargs::ijk(), - m, - AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { - const IndexType n0 = i + j * nodeJp + k * nodeKp; - const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; - - double coords[12] = {x_vals_view[i], - y_vals_view[j], - z_vals_view[k], - x_vals_view[i + 1], - y_vals_view[j], - z_vals_view[k], - x_vals_view[i + 1], - y_vals_view[j + 1], - z_vals_view[k], - x_vals_view[i], - y_vals_view[j + 1], - z_vals_view[k]}; - - numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } -} - -//------------------------------------------------------------------------------ -struct for_all_face_nodes_functor -{ - template - inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), - const MeshType& m, - KernelType&& kernel) const - { - constexpr bool valid_mesh_type = std::is_base_of::value; - AXOM_STATIC_ASSERT(valid_mesh_type); - - for_all_faces_impl(xargs::nodeids(), m, std::forward(kernel)); - } -}; - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::coords, const CurvilinearMesh& m, KernelType&& kernel) -{ - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - const int dimension = m.getDimension(); - if(dimension == 2) - { - for_all_coords(for_all_face_nodes_functor(), - m, - std::forward(kernel)); - } - else - { - for_all_coords(for_all_face_nodes_functor(), - m, - std::forward(kernel)); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces_impl(xargs::coords, const UnstructuredMesh& m, KernelType&& kernel) -{ - constexpr bool NO_COPY = true; - - SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); - - constexpr bool on_device = axom::execution_space::onDevice(); - const int device_allocator = axom::execution_space::allocatorID(); - - const int dimension = m.getDimension(); - - IndexType coordinate_size = m.getNumberOfNodes(); - - auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), coordinate_size); - auto y_vals_h = axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), coordinate_size); - - // Move xy values onto device - axom::Array x_vals_d = - on_device ? axom::Array(x_vals_h, device_allocator) : axom::Array(); - axom::Array y_vals_d = - on_device ? axom::Array(y_vals_h, device_allocator) : axom::Array(); - - auto x_vals_view = on_device ? x_vals_d.view() : x_vals_h; - auto y_vals_view = on_device ? y_vals_d.view() : y_vals_h; - - if(dimension == 2) - { - for_all_faces_impl( - xargs::nodeids(), - m, - AXOM_LAMBDA(IndexType faceID, const IndexType* nodeIDs, IndexType numNodes) { - double coords[2 * MAX_FACE_NODES]; - for(int i = 0; i < numNodes; ++i) - { - const IndexType nodeID = nodeIDs[i]; - coords[2 * i] = x_vals_view[nodeID]; - coords[2 * i + 1] = y_vals_view[nodeID]; - } - - numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } - else - { - auto z_vals_h = - axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), coordinate_size); - - // Move z values onto device - axom::Array z_vals_d = - on_device ? axom::Array(z_vals_h, device_allocator) : axom::Array(); - - auto z_vals_view = on_device ? z_vals_d.view() : z_vals_h; - - for_all_faces_impl( - xargs::nodeids(), - m, - AXOM_LAMBDA(IndexType faceID, const IndexType* nodeIDs, IndexType numNodes) { - double coords[3 * MAX_FACE_NODES]; - for(int i = 0; i < numNodes; ++i) - { - const IndexType nodeID = nodeIDs[i]; - coords[3 * i] = x_vals_view[nodeID]; - coords[3 * i + 1] = y_vals_view[nodeID]; - coords[3 * i + 2] = z_vals_view[nodeID]; - } - - numerics::Matrix coordsMatrix(dimension, numNodes, coords, NO_COPY); - kernel(faceID, coordsMatrix, nodeIDs); - }); - } -} - -//------------------------------------------------------------------------------ -template -inline void for_all_faces(xargs::coords, const Mesh& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getDimension() <= 1 || m.getDimension() > 3, "Invalid dimension"); - - if(m.getMeshType() == STRUCTURED_UNIFORM_MESH) - { - const UniformMesh& um = static_cast(m); - for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); - } - else if(m.getMeshType() == STRUCTURED_RECTILINEAR_MESH) - { - const RectilinearMesh& rm = static_cast(m); - for_all_faces_impl(xargs::coords(), rm, std::forward(kernel)); - } - else if(m.getMeshType() == STRUCTURED_CURVILINEAR_MESH) - { - const CurvilinearMesh& cm = static_cast(m); - for_all_faces_impl(xargs::coords(), cm, std::forward(kernel)); - } - else if(m.getMeshType() == UNSTRUCTURED_MESH) - { - if(m.hasMixedCellTypes()) - { - const UnstructuredMesh& um = static_cast&>(m); - - for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); - } - else - { - const UnstructuredMesh& um = - static_cast&>(m); - - for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); - } - } - else - { - SLIC_ERROR("Unknown mesh type."); - } -} - -} /* namespace internal */ -} /* namespace mint */ -} /* namespace axom */ +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + +// Axom core includes +#include "axom/config.hpp" // compile time definitions +#include "axom/core/execution/execution_space.hpp" // for execution_space traits +#include "axom/core/execution/for_all.hpp" // for axom::for_all + +// mint includes +#include "axom/mint/execution/xargs.hpp" // for xargs +#include "axom/mint/config.hpp" // for compile-time definitions +#include "axom/mint/mesh/Mesh.hpp" // for Mesh +#include "axom/mint/mesh/StructuredMesh.hpp" // for StructuredMesh +#include "axom/mint/mesh/UniformMesh.hpp" // for UniformMesh +#include "axom/mint/mesh/RectilinearMesh.hpp" // for RectilinearMesh +#include "axom/mint/mesh/CurvilinearMesh.hpp" // for CurvilinearMesh +#include "axom/mint/execution/internal/helpers.hpp" // for for_all_coords +#include "axom/core/execution/nested_for_exec.hpp" + +#include "axom/core/numerics/Matrix.hpp" // for Matrix + +namespace axom +{ +namespace mint +{ +namespace internal +{ +namespace helpers +{ +//------------------------------------------------------------------------------ +template +inline void for_all_I_faces(xargs::ij, const StructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() != 2, "Mesh must be 2D."); + + const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); + const IndexType Ni = INodeResolution; + const IndexType Nj = m.getCellResolution(J_DIRECTION); + + axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}; + axom::for_all( + i_range, + j_range, + AXOM_LAMBDA(IndexType i, IndexType j) { + const IndexType faceID = i + j * INodeResolution; + kernel(faceID, i, j); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_I_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be a 3D."); + + const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); + const IndexType numIFacesInKSlice = INodeResolution * m.getCellResolution(J_DIRECTION); + const IndexType Ni = INodeResolution; + const IndexType Nj = m.getCellResolution(J_DIRECTION); + const IndexType Nk = m.getCellResolution(K_DIRECTION); + + axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; + axom::for_all( + i_range, + j_range, + k_range, + AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { + const IndexType faceID = i + j * INodeResolution + k * numIFacesInKSlice; + kernel(faceID, i, j, k); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_J_faces(xargs::ij, const StructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() != 2, "Mesh must be 2D."); + + const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); + const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); + const IndexType Ni = ICellResolution; + const IndexType Nj = m.getNodeResolution(J_DIRECTION); + + axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}; + axom::for_all( + i_range, + j_range, + AXOM_LAMBDA(IndexType i, IndexType j) { + const IndexType faceID = numIFaces + i + j * ICellResolution; + kernel(faceID, i, j); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_J_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be 3D."); + + const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); + const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); + const IndexType numJFacesInKSlice = ICellResolution * m.getNodeResolution(J_DIRECTION); + const IndexType Ni = ICellResolution; + const IndexType Nj = m.getNodeResolution(J_DIRECTION); + const IndexType Nk = m.getCellResolution(K_DIRECTION); + + axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; + axom::for_all( + i_range, + j_range, + k_range, + AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { + const IndexType jp = j * ICellResolution; + const IndexType kp = k * numJFacesInKSlice; + const IndexType faceID = numIFaces + i + jp + kp; + kernel(faceID, i, j, k); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_K_faces(xargs::ijk, const StructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() != 3, "Mesh must be 3D."); + + const IndexType numIJFaces = m.getTotalNumFaces(I_DIRECTION) + m.getTotalNumFaces(J_DIRECTION); + const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); + const IndexType cellKp = m.cellKp(); + const IndexType Ni = ICellResolution; + const IndexType Nj = m.getCellResolution(J_DIRECTION); + const IndexType Nk = m.getNodeResolution(K_DIRECTION); + + axom::StackArray i_range {{0, Ni}}, j_range {{0, Nj}}, k_range {{0, Nk}}; + axom::for_all( + i_range, + j_range, + k_range, + AXOM_LAMBDA(IndexType i, IndexType j, IndexType k) { + const IndexType jp = j * ICellResolution; + const IndexType kp = k * cellKp; + const IndexType faceID = numIJFaces + i + jp + kp; + kernel(faceID, i, j, k); + }); +} + +} /* namespace helpers */ + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::index, const Mesh& m, KernelType&& kernel) +{ + const IndexType numFaces = m.getNumberOfFaces(); + axom::for_all(numFaces, std::forward(kernel)); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces(xargs::index, const Mesh& m, KernelType&& kernel) +{ + return for_all_faces_impl(xargs::index(), m, std::forward(kernel)); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::nodeids, const StructuredMesh& m, KernelType&& kernel) +{ + const IndexType dimension = m.getDimension(); + const IndexType* offsets = m.getCellNodeOffsetsArray(); + const IndexType cellNodeOffset3 = offsets[3]; + + if(dimension == 2) + { + const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); + + helpers::for_all_I_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType AXOM_UNUSED_PARAM(j)) { + IndexType nodes[2]; + nodes[0] = faceID; + nodes[1] = nodes[0] + cellNodeOffset3; + kernel(faceID, nodes, 2); + }); + + helpers::for_all_J_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j) { + const IndexType shiftedID = faceID - numIFaces; + IndexType nodes[2]; + nodes[0] = shiftedID + j; + nodes[1] = nodes[0] + 1; + kernel(faceID, nodes, 2); + }); + } + else + { + SLIC_ERROR_IF(dimension != 3, "for_all_faces is only valid for 2 or 3D meshes."); + + const IndexType numIFaces = m.getTotalNumFaces(I_DIRECTION); + const IndexType numIJFaces = numIFaces + m.getTotalNumFaces(J_DIRECTION); + const IndexType INodeResolution = m.getNodeResolution(I_DIRECTION); + const IndexType JNodeResolution = m.getNodeResolution(J_DIRECTION); + const IndexType KFaceNodeStride = + m.getCellResolution(I_DIRECTION) + m.getCellResolution(J_DIRECTION) + 1; + + const IndexType cellNodeOffset2 = offsets[2]; + const IndexType cellNodeOffset4 = offsets[4]; + const IndexType cellNodeOffset5 = offsets[5]; + const IndexType cellNodeOffset7 = offsets[7]; + + helpers::for_all_I_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, + IndexType AXOM_UNUSED_PARAM(i), + IndexType AXOM_UNUSED_PARAM(j), + IndexType k) { + IndexType nodes[4]; + nodes[0] = faceID + k * INodeResolution; + nodes[1] = nodes[0] + cellNodeOffset4; + nodes[2] = nodes[0] + cellNodeOffset7; + nodes[3] = nodes[0] + cellNodeOffset3; + kernel(faceID, nodes, 4); + }); + + helpers::for_all_J_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { + const IndexType shiftedID = faceID - numIFaces; + IndexType nodes[4]; + nodes[0] = shiftedID + j + k * JNodeResolution; + nodes[1] = nodes[0] + 1; + nodes[2] = nodes[0] + cellNodeOffset5; + nodes[3] = nodes[0] + cellNodeOffset4; + kernel(faceID, nodes, 4); + }); + + helpers::for_all_K_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType AXOM_UNUSED_PARAM(i), IndexType j, IndexType k) { + const IndexType shiftedID = faceID - numIJFaces; + IndexType nodes[4]; + nodes[0] = shiftedID + j + k * KFaceNodeStride; + nodes[1] = nodes[0] + 1; + nodes[2] = nodes[0] + cellNodeOffset2; + nodes[3] = nodes[0] + cellNodeOffset3; + kernel(faceID, nodes, 4); + }); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::nodeids, + const UnstructuredMesh& m, + KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, + "No faces in the mesh, perhaps you meant to call " + << "UnstructuredMesh::initializeFaceConnectivity first."); + + constexpr bool on_device = axom::execution_space::onDevice(); + const int device_allocator = axom::execution_space::allocatorID(); + + auto faces_to_nodes_h = + axom::ArrayView(m.getFaceNodesArray(), m.getFaceNodesSize()); + + // Move faces to nodes onto device + axom::Array faces_to_nodes_d = on_device + ? axom::Array(faces_to_nodes_h, device_allocator) + : axom::Array(); + + auto faces_to_nodes_view = on_device ? faces_to_nodes_d.view() : faces_to_nodes_h; + + const IndexType num_nodes = m.getNumberOfFaceNodes(); + + for_all_faces_impl( + xargs::index(), + m, + AXOM_LAMBDA(IndexType faceID) { + kernel(faceID, faces_to_nodes_view.data() + faceID * num_nodes, num_nodes); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::nodeids, + const UnstructuredMesh& m, + KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, + "No faces in the mesh, perhaps you meant to call " + << "UnstructuredMesh::initializeFaceConnectivity first."); + + constexpr bool on_device = axom::execution_space::onDevice(); + const int device_allocator = axom::execution_space::allocatorID(); + + auto faces_to_nodes_h = + axom::ArrayView(m.getFaceNodesArray(), m.getFaceNodesSize()); + auto offsets_h = + axom::ArrayView(m.getFaceNodesOffsetsArray(), m.getNumberOfFaces() + 1); + + // Move faces to nodes and offsets onto device + axom::Array faces_to_nodes_d = on_device + ? axom::Array(faces_to_nodes_h, device_allocator) + : axom::Array(); + axom::Array offsets_d = + on_device ? axom::Array(offsets_h, device_allocator) : axom::Array(); + + auto faces_to_nodes_view = on_device ? faces_to_nodes_d.view() : faces_to_nodes_h; + auto offsets_view = on_device ? offsets_d.view() : offsets_h; + + for_all_faces_impl( + xargs::index(), + m, + AXOM_LAMBDA(IndexType faceID) { + const IndexType num_nodes = offsets_view[faceID + 1] - offsets_view[faceID]; + kernel(faceID, faces_to_nodes_view.data() + offsets_view[faceID], num_nodes); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces(xargs::nodeids, const Mesh& m, KernelType&& kernel) +{ + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + if(m.isStructured()) + { + const StructuredMesh& sm = static_cast(m); + for_all_faces_impl(xargs::nodeids(), sm, std::forward(kernel)); + } + else if(m.hasMixedCellTypes()) + { + const UnstructuredMesh& um = static_cast&>(m); + for_all_faces_impl(xargs::nodeids(), um, std::forward(kernel)); + } + else + { + const UnstructuredMesh& um = static_cast&>(m); + for_all_faces_impl(xargs::nodeids(), um, std::forward(kernel)); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::cellids, const StructuredMesh& m, KernelType&& kernel) +{ + const IndexType ICellResolution = m.getCellResolution(I_DIRECTION); + const IndexType JCellResolution = m.getCellResolution(J_DIRECTION); + const IndexType cellJp = m.cellJp(); + const int dimension = m.getDimension(); + + if(dimension == 2) + { + helpers::for_all_I_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + IndexType cellIDTwo = i + j * cellJp; + IndexType cellIDOne = cellIDTwo - 1; + if(i == 0) + { + cellIDOne = cellIDTwo; + cellIDTwo = -1; + } + else if(i == ICellResolution) + { + cellIDTwo = -1; + } + + kernel(faceID, cellIDOne, cellIDTwo); + }); + + helpers::for_all_J_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + IndexType cellIDTwo = i + j * cellJp; + IndexType cellIDOne = cellIDTwo - cellJp; + if(j == 0) + { + cellIDOne = cellIDTwo; + cellIDTwo = -1; + } + else if(j == JCellResolution) + { + cellIDTwo = -1; + } + + kernel(faceID, cellIDOne, cellIDTwo); + }); + } + else + { + SLIC_ERROR_IF(dimension != 3, "for_all_faces only valid for 2 or 3D meshes."); + + const IndexType KCellResolution = m.getCellResolution(K_DIRECTION); + const IndexType cellKp = m.cellKp(); + + helpers::for_all_I_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + IndexType cellIDTwo = i + j * cellJp + k * cellKp; + IndexType cellIDOne = cellIDTwo - 1; + if(i == 0) + { + cellIDOne = cellIDTwo; + cellIDTwo = -1; + } + else if(i == ICellResolution) + { + cellIDTwo = -1; + } + + kernel(faceID, cellIDOne, cellIDTwo); + }); + + helpers::for_all_J_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + IndexType cellIDTwo = i + j * cellJp + k * cellKp; + IndexType cellIDOne = cellIDTwo - cellJp; + if(j == 0) + { + cellIDOne = cellIDTwo; + cellIDTwo = -1; + } + else if(j == JCellResolution) + { + cellIDTwo = -1; + } + + kernel(faceID, cellIDOne, cellIDTwo); + }); + + helpers::for_all_K_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + IndexType cellIDTwo = i + j * cellJp + k * cellKp; + IndexType cellIDOne = cellIDTwo - cellKp; + if(k == 0) + { + cellIDOne = cellIDTwo; + cellIDTwo = -1; + } + else if(k == KCellResolution) + { + cellIDTwo = -1; + } + + kernel(faceID, cellIDOne, cellIDTwo); + }); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::cellids, const UnstructuredMesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getNumberOfFaces() <= 0, + "No faces in the mesh, perhaps you meant to call " + << "UnstructuredMesh::initializeFaceConnectivity first."); + + constexpr bool on_device = axom::execution_space::onDevice(); + const int device_allocator = axom::execution_space::allocatorID(); + + auto faces_to_cells_h = + axom::ArrayView(m.getFaceCellsArray(), 2 * m.getNumberOfFaces()); + + // Move faces to cells onto device + axom::Array faces_to_cells_d = on_device + ? axom::Array(faces_to_cells_h, device_allocator) + : axom::Array(); + + auto faces_to_cells_view = on_device ? faces_to_cells_d.view() : faces_to_cells_h; + + for_all_faces_impl( + xargs::index(), + m, + AXOM_LAMBDA(IndexType faceID) { + const IndexType offset = 2 * faceID; + kernel(faceID, faces_to_cells_view[offset], faces_to_cells_view[offset + 1]); + }); +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces(xargs::cellids, const Mesh& m, KernelType&& kernel) +{ + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + if(m.isStructured()) + { + const StructuredMesh& sm = static_cast(m); + for_all_faces_impl(xargs::cellids(), sm, std::forward(kernel)); + } + else if(m.hasMixedCellTypes()) + { + const UnstructuredMesh& um = static_cast&>(m); + for_all_faces_impl(xargs::cellids(), um, std::forward(kernel)); + } + else + { + const UnstructuredMesh& um = static_cast&>(m); + for_all_faces_impl(xargs::cellids(), um, std::forward(kernel)); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::coords, const UniformMesh& m, KernelType&& kernel) +{ + constexpr bool NO_COPY = true; + + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + const int dimension = m.getDimension(); + const double* origin = m.getOrigin(); + const double* spacing = m.getSpacing(); + const IndexType nodeJp = m.nodeJp(); + const IndexType nodeKp = m.nodeKp(); + + const double x0 = origin[0]; + const double dx = spacing[0]; + + const double y0 = origin[1]; + const double dy = spacing[1]; + + const double z0 = origin[2]; + const double dz = spacing[2]; + + if(dimension == 2) + { + helpers::for_all_I_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + const IndexType n0 = i + j * nodeJp; + const IndexType nodeIDs[2] = {n0, n0 + nodeJp}; + + double coords[4] = {x0 + i * dx, y0 + j * dy, x0 + i * dx, y0 + (j + 1) * dy}; + + numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_J_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + const IndexType n0 = i + j * nodeJp; + const IndexType nodeIDs[2] = {n0, n0 + 1}; + + double coords[4] = {x0 + i * dx, y0 + j * dy, x0 + (i + 1) * dx, y0 + j * dy}; + + numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } + else + { + helpers::for_all_I_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + nodeKp, n0 + nodeJp + nodeKp, n0 + nodeJp}; + + double coords[12] = {x0 + i * dx, + y0 + j * dy, + z0 + k * dz, + x0 + i * dx, + y0 + j * dy, + z0 + (k + 1) * dz, + x0 + i * dx, + y0 + (j + 1) * dy, + z0 + (k + 1) * dz, + x0 + i * dx, + y0 + (j + 1) * dy, + z0 + k * dz}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_J_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeKp, n0 + nodeKp}; + + double coords[12] = {x0 + i * dx, + y0 + j * dy, + z0 + k * dz, + x0 + (i + 1) * dx, + y0 + j * dy, + z0 + k * dz, + x0 + (i + 1) * dx, + y0 + j * dy, + z0 + (k + 1) * dz, + x0 + i * dx, + y0 + j * dy, + z0 + (k + 1) * dz}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_K_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; + + double coords[12] = {x0 + i * dx, + y0 + j * dy, + z0 + k * dz, + x0 + (i + 1) * dx, + y0 + j * dy, + z0 + k * dz, + x0 + (i + 1) * dx, + y0 + (j + 1) * dy, + z0 + k * dz, + x0 + i * dx, + y0 + (j + 1) * dy, + z0 + k * dz}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::coords, const RectilinearMesh& m, KernelType&& kernel) +{ + constexpr bool NO_COPY = true; + + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + constexpr bool on_device = axom::execution_space::onDevice(); + const int device_allocator = axom::execution_space::allocatorID(); + + const int dimension = m.getDimension(); + const IndexType nodeJp = m.nodeJp(); + const IndexType nodeKp = m.nodeKp(); + + auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), + m.getNodeResolution(X_COORDINATE)); + auto y_vals_h = axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), + m.getNodeResolution(Y_COORDINATE)); + + // Move xy values onto device + axom::Array x_vals_d = + on_device ? axom::Array(x_vals_h, device_allocator) : axom::Array(); + axom::Array y_vals_d = + on_device ? axom::Array(y_vals_h, device_allocator) : axom::Array(); + + auto x_vals_view = on_device ? x_vals_d.view() : x_vals_h; + auto y_vals_view = on_device ? y_vals_d.view() : y_vals_h; + + if(dimension == 2) + { + helpers::for_all_I_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + const IndexType n0 = i + j * nodeJp; + const IndexType nodeIDs[2] = {n0, n0 + nodeJp}; + + double coords[4] = {x_vals_view[i], y_vals_view[j], x_vals_view[i], y_vals_view[j + 1]}; + + numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_J_faces( + xargs::ij(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j) { + const IndexType n0 = i + j * nodeJp; + const IndexType nodeIDs[2] = {n0, n0 + 1}; + + double coords[4] = {x_vals_view[i], y_vals_view[j], x_vals_view[i + 1], y_vals_view[j]}; + + numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } + else + { + auto z_vals_h = axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), + m.getNodeResolution(Z_COORDINATE)); + + // Move z values onto device + axom::Array z_vals_d = + on_device ? axom::Array(z_vals_h, device_allocator) : axom::Array(); + + auto z_vals_view = on_device ? z_vals_d.view() : z_vals_h; + + helpers::for_all_I_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + nodeKp, n0 + nodeJp + nodeKp, n0 + nodeJp}; + + double coords[12] = {x_vals_view[i], + y_vals_view[j], + z_vals_view[k], + x_vals_view[i], + y_vals_view[j], + z_vals_view[k + 1], + x_vals_view[i], + y_vals_view[j + 1], + z_vals_view[k + 1], + x_vals_view[i], + y_vals_view[j + 1], + z_vals_view[k]}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_J_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeKp, n0 + nodeKp}; + + double coords[12] = {x_vals_view[i], + y_vals_view[j], + z_vals_view[k], + x_vals_view[i + 1], + y_vals_view[j], + z_vals_view[k], + x_vals_view[i + 1], + y_vals_view[j], + z_vals_view[k + 1], + x_vals_view[i], + y_vals_view[j], + z_vals_view[k + 1]}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + + helpers::for_all_K_faces( + xargs::ijk(), + m, + AXOM_LAMBDA(IndexType faceID, IndexType i, IndexType j, IndexType k) { + const IndexType n0 = i + j * nodeJp + k * nodeKp; + const IndexType nodeIDs[4] = {n0, n0 + 1, n0 + 1 + nodeJp, n0 + nodeJp}; + + double coords[12] = {x_vals_view[i], + y_vals_view[j], + z_vals_view[k], + x_vals_view[i + 1], + y_vals_view[j], + z_vals_view[k], + x_vals_view[i + 1], + y_vals_view[j + 1], + z_vals_view[k], + x_vals_view[i], + y_vals_view[j + 1], + z_vals_view[k]}; + + numerics::Matrix coordsMatrix(dimension, 4, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } +} + +//------------------------------------------------------------------------------ +struct for_all_face_nodes_functor +{ + template + inline void operator()(ExecPolicy AXOM_UNUSED_PARAM(policy), + const MeshType& m, + KernelType&& kernel) const + { + constexpr bool valid_mesh_type = std::is_base_of::value; + AXOM_STATIC_ASSERT(valid_mesh_type); + + for_all_faces_impl(xargs::nodeids(), m, std::forward(kernel)); + } +}; + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::coords, const CurvilinearMesh& m, KernelType&& kernel) +{ + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + const int dimension = m.getDimension(); + if(dimension == 2) + { + for_all_coords(for_all_face_nodes_functor(), + m, + std::forward(kernel)); + } + else + { + for_all_coords(for_all_face_nodes_functor(), + m, + std::forward(kernel)); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces_impl(xargs::coords, const UnstructuredMesh& m, KernelType&& kernel) +{ + constexpr bool NO_COPY = true; + + SLIC_ASSERT(m.getDimension() > 1 && m.getDimension() <= 3); + + constexpr bool on_device = axom::execution_space::onDevice(); + const int device_allocator = axom::execution_space::allocatorID(); + + const int dimension = m.getDimension(); + + IndexType coordinate_size = m.getNumberOfNodes(); + + auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), coordinate_size); + auto y_vals_h = axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), coordinate_size); + + // Move xy values onto device + axom::Array x_vals_d = + on_device ? axom::Array(x_vals_h, device_allocator) : axom::Array(); + axom::Array y_vals_d = + on_device ? axom::Array(y_vals_h, device_allocator) : axom::Array(); + + auto x_vals_view = on_device ? x_vals_d.view() : x_vals_h; + auto y_vals_view = on_device ? y_vals_d.view() : y_vals_h; + + if(dimension == 2) + { + for_all_faces_impl( + xargs::nodeids(), + m, + AXOM_LAMBDA(IndexType faceID, const IndexType* nodeIDs, IndexType numNodes) { + double coords[2 * MAX_FACE_NODES]; + for(int i = 0; i < numNodes; ++i) + { + const IndexType nodeID = nodeIDs[i]; + coords[2 * i] = x_vals_view[nodeID]; + coords[2 * i + 1] = y_vals_view[nodeID]; + } + + numerics::Matrix coordsMatrix(dimension, 2, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } + else + { + auto z_vals_h = + axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), coordinate_size); + + // Move z values onto device + axom::Array z_vals_d = + on_device ? axom::Array(z_vals_h, device_allocator) : axom::Array(); + + auto z_vals_view = on_device ? z_vals_d.view() : z_vals_h; + + for_all_faces_impl( + xargs::nodeids(), + m, + AXOM_LAMBDA(IndexType faceID, const IndexType* nodeIDs, IndexType numNodes) { + double coords[3 * MAX_FACE_NODES]; + for(int i = 0; i < numNodes; ++i) + { + const IndexType nodeID = nodeIDs[i]; + coords[3 * i] = x_vals_view[nodeID]; + coords[3 * i + 1] = y_vals_view[nodeID]; + coords[3 * i + 2] = z_vals_view[nodeID]; + } + + numerics::Matrix coordsMatrix(dimension, numNodes, coords, NO_COPY); + kernel(faceID, coordsMatrix, nodeIDs); + }); + } +} + +//------------------------------------------------------------------------------ +template +inline void for_all_faces(xargs::coords, const Mesh& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getDimension() <= 1 || m.getDimension() > 3, "Invalid dimension"); + + if(m.getMeshType() == STRUCTURED_UNIFORM_MESH) + { + const UniformMesh& um = static_cast(m); + for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); + } + else if(m.getMeshType() == STRUCTURED_RECTILINEAR_MESH) + { + const RectilinearMesh& rm = static_cast(m); + for_all_faces_impl(xargs::coords(), rm, std::forward(kernel)); + } + else if(m.getMeshType() == STRUCTURED_CURVILINEAR_MESH) + { + const CurvilinearMesh& cm = static_cast(m); + for_all_faces_impl(xargs::coords(), cm, std::forward(kernel)); + } + else if(m.getMeshType() == UNSTRUCTURED_MESH) + { + if(m.hasMixedCellTypes()) + { + const UnstructuredMesh& um = static_cast&>(m); + + for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); + } + else + { + const UnstructuredMesh& um = + static_cast&>(m); + + for_all_faces_impl(xargs::coords(), um, std::forward(kernel)); + } + } + else + { + SLIC_ERROR("Unknown mesh type."); + } +} + +} /* namespace internal */ +} /* namespace mint */ +} /* namespace axom */ diff --git a/src/axom/mint/execution/internal/helpers.hpp b/src/axom/mint/execution/internal/helpers.hpp index af65d10b04..b06110dd78 100644 --- a/src/axom/mint/execution/internal/helpers.hpp +++ b/src/axom/mint/execution/internal/helpers.hpp @@ -1,25 +1,25 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - -// mint includes -#include "axom/mint/config.hpp" // for compile-time definitions -#include "axom/mint/mesh/Mesh.hpp" // for Mesh - -#include "axom/core/Macros.hpp" -#include "axom/core/StackArray.hpp" // for axom::StackArray -#include "axom/core/numerics/Matrix.hpp" // for Matrix - -namespace axom -{ -namespace mint -{ -namespace internal -{ +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + +// mint includes +#include "axom/mint/config.hpp" // for compile-time definitions +#include "axom/mint/mesh/Mesh.hpp" // for Mesh + +#include "axom/core/Macros.hpp" +#include "axom/core/StackArray.hpp" // for axom::StackArray +#include "axom/core/numerics/Matrix.hpp" // for Matrix + +namespace axom +{ +namespace mint +{ +namespace internal +{ /*! * \brief Iterate over the objects (cells or faces) in a mesh and for each * object construct a NDIM x NNODES matrix of the nodal coordinates of the @@ -38,77 +38,77 @@ namespace internal * \param [in] m the Mesh to iterate over. * \param [in] kernel the kernel to call on each object. * - */ - -template -inline void for_all_coords(const FOR_ALL_FUNCTOR& for_all_nodes, const MeshType& m, KernelType&& kernel) -{ - SLIC_ERROR_IF(m.getMeshType() == STRUCTURED_UNIFORM_MESH, "Not valid for UniformMesh."); - SLIC_ERROR_IF(m.getMeshType() == STRUCTURED_RECTILINEAR_MESH, "Not valid for RectilinearMesh."); - - AXOM_STATIC_ASSERT_MSG(NDIM >= 1 && NDIM <= 3, "NDIM must be a valid dimension."); - AXOM_STATIC_ASSERT_MSG(NNODES > 0, "NNODES must be greater than zero."); - - constexpr bool valid_mesh_type = std::is_base_of::value; - AXOM_STATIC_ASSERT(valid_mesh_type); - - SLIC_ERROR_IF(m.getDimension() != NDIM, "Dimension mismatch!"); - - const int device_allocator = axom::execution_space::allocatorID(); - - constexpr bool NO_COPY = true; - - IndexType coordinate_size = m.getNumberOfNodes(); - - // Extract coordinate values into an axom::ArrayView - auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), coordinate_size); - auto y_vals_h = (NDIM > 1) - ? axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), coordinate_size) - : axom::ArrayView(); - auto z_vals_h = (NDIM > 2) - ? axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), coordinate_size) - : axom::ArrayView(); - - // Move xyz values onto device - axom::Array x_vals_d = axom::Array(x_vals_h, device_allocator); - auto x_vals_view = x_vals_d.view(); - - axom::Array y_vals_d = - (NDIM > 1) ? axom::Array(y_vals_h, device_allocator) : axom::Array(); - auto y_vals_view = (NDIM > 1) ? y_vals_d.view() : y_vals_h; - - axom::Array z_vals_d = - (NDIM > 2) ? axom::Array(z_vals_h, device_allocator) : axom::Array(); - auto z_vals_view = (NDIM > 2) ? z_vals_d.view() : z_vals_h; - - for_all_nodes( - ExecPolicy(), - m, - AXOM_LAMBDA(IndexType objectID, const IndexType* nodeIDs, IndexType numNodes) { - AXOM_UNUSED_VAR(numNodes); - assert(numNodes == NNODES); - - double localCoords[NDIM * NNODES]; - for(int i = 0; i < NNODES; ++i) - { - const int i_offset = NDIM * i; - - localCoords[i_offset] = x_vals_view[nodeIDs[i]]; - if(NDIM > 1) - { - localCoords[i_offset + 1] = y_vals_view[nodeIDs[i]]; - } - if(NDIM > 2) - { - localCoords[i_offset + 2] = z_vals_view[nodeIDs[i]]; - } - } - - numerics::Matrix coordsMatrix(NDIM, NNODES, localCoords, NO_COPY); - kernel(objectID, coordsMatrix, nodeIDs); - }); -} - -} /* namespace internal */ -} /* namespace mint */ -} /* namespace axom */ + */ + +template +inline void for_all_coords(const FOR_ALL_FUNCTOR& for_all_nodes, const MeshType& m, KernelType&& kernel) +{ + SLIC_ERROR_IF(m.getMeshType() == STRUCTURED_UNIFORM_MESH, "Not valid for UniformMesh."); + SLIC_ERROR_IF(m.getMeshType() == STRUCTURED_RECTILINEAR_MESH, "Not valid for RectilinearMesh."); + + AXOM_STATIC_ASSERT_MSG(NDIM >= 1 && NDIM <= 3, "NDIM must be a valid dimension."); + AXOM_STATIC_ASSERT_MSG(NNODES > 0, "NNODES must be greater than zero."); + + constexpr bool valid_mesh_type = std::is_base_of::value; + AXOM_STATIC_ASSERT(valid_mesh_type); + + SLIC_ERROR_IF(m.getDimension() != NDIM, "Dimension mismatch!"); + + const int device_allocator = axom::execution_space::allocatorID(); + + constexpr bool NO_COPY = true; + + IndexType coordinate_size = m.getNumberOfNodes(); + + // Extract coordinate values into an axom::ArrayView + auto x_vals_h = axom::ArrayView(m.getCoordinateArray(X_COORDINATE), coordinate_size); + auto y_vals_h = (NDIM > 1) + ? axom::ArrayView(m.getCoordinateArray(Y_COORDINATE), coordinate_size) + : axom::ArrayView(); + auto z_vals_h = (NDIM > 2) + ? axom::ArrayView(m.getCoordinateArray(Z_COORDINATE), coordinate_size) + : axom::ArrayView(); + + // Move xyz values onto device + axom::Array x_vals_d = axom::Array(x_vals_h, device_allocator); + auto x_vals_view = x_vals_d.view(); + + axom::Array y_vals_d = + (NDIM > 1) ? axom::Array(y_vals_h, device_allocator) : axom::Array(); + auto y_vals_view = (NDIM > 1) ? y_vals_d.view() : y_vals_h; + + axom::Array z_vals_d = + (NDIM > 2) ? axom::Array(z_vals_h, device_allocator) : axom::Array(); + auto z_vals_view = (NDIM > 2) ? z_vals_d.view() : z_vals_h; + + for_all_nodes( + ExecPolicy(), + m, + AXOM_LAMBDA(IndexType objectID, const IndexType* nodeIDs, IndexType numNodes) { + AXOM_UNUSED_VAR(numNodes); + assert(numNodes == NNODES); + + double localCoords[NDIM * NNODES]; + for(int i = 0; i < NNODES; ++i) + { + const int i_offset = NDIM * i; + + localCoords[i_offset] = x_vals_view[nodeIDs[i]]; + if(NDIM > 1) + { + localCoords[i_offset + 1] = y_vals_view[nodeIDs[i]]; + } + if(NDIM > 2) + { + localCoords[i_offset + 2] = z_vals_view[nodeIDs[i]]; + } + } + + numerics::Matrix coordsMatrix(NDIM, NNODES, localCoords, NO_COPY); + kernel(objectID, coordsMatrix, nodeIDs); + }); +} + +} /* namespace internal */ +} /* namespace mint */ +} /* namespace axom */ diff --git a/src/axom/mint/tests/mint_execution_face_traversals.cpp b/src/axom/mint/tests/mint_execution_face_traversals.cpp index b6e1800e3d..5ae4d4e278 100644 --- a/src/axom/mint/tests/mint_execution_face_traversals.cpp +++ b/src/axom/mint/tests/mint_execution_face_traversals.cpp @@ -1,506 +1,506 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -// Axom includes -#include "axom/config.hpp" // compile-time definitions -#include "axom/core/execution/execution_space.hpp" // for execution_space traits - -// Mint includes -#include "axom/mint/config.hpp" // mint compile-time definitions -#include "axom/mint/execution/interface.hpp" // for_all() - -// Slic includes -#include "axom/slic.hpp" // for SLIC macros - -#include "mint_test_utilities.hpp" - -// gtest includes -#include "gtest/gtest.h" // for gtest - -namespace axom -{ -namespace mint -{ -//------------------------------------------------------------------------------ -// HELPER METHODS -//------------------------------------------------------------------------------ -namespace -{ -template -void check_for_all_faces(int dimension) -{ - constexpr char* mesh_name = internal::mesh_type::name(); - SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() - << ", mesh_type=" << mesh_name); - - // Get ids of necessary allocators - const int host_allocator = axom::execution_space::allocatorID(); - const int device_allocator = axom::execution_space::allocatorID(); - - const IndexType Ni = 20; - const IndexType Nj = (dimension >= 2) ? Ni : -1; - const IndexType Nk = (dimension == 3) ? Ni : -1; - - const double lo[] = {-10, -9, -8}; - const double hi[] = {10, 9, 8}; - UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); - - using MESH = typename internal::mesh_type::MeshType; - MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); - EXPECT_TRUE(test_mesh != nullptr); - - const IndexType numFaces = test_mesh->getNumberOfFaces(); - - axom::Array field_d(numFaces, numFaces, device_allocator); - - auto field_v = field_d.view(); - - for_all_faces(test_mesh, AXOM_LAMBDA(IndexType faceID) { field_v[faceID] = faceID; }); - - // Copy field back to host - axom::Array field_h = axom::Array(field_d, host_allocator); - - // Create mesh field from buffer - IndexType* f1_field = - test_mesh->template createField("f1", FACE_CENTERED, field_h.data()); - - for(IndexType faceID = 0; faceID < numFaces; ++faceID) - { - EXPECT_EQ(f1_field[faceID], faceID); - } - - delete test_mesh; - test_mesh = nullptr; -} - -//------------------------------------------------------------------------------ -template -void check_for_all_face_nodes(int dimension) -{ - constexpr char* mesh_name = internal::mesh_type::name(); - SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() - << ", mesh_type=" << mesh_name); - - // Get ids of necessary allocators - const int host_allocator = axom::execution_space::allocatorID(); - const int device_allocator = axom::execution_space::allocatorID(); - - const IndexType Ni = 20; - const IndexType Nj = (dimension >= 2) ? Ni : -1; - const IndexType Nk = (dimension == 3) ? Ni : -1; - - const double lo[] = {-10, -9, -8}; - const double hi[] = {10, 9, 8}; - UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); - - using MESH = typename internal::mesh_type::MeshType; - MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); - EXPECT_TRUE(test_mesh != nullptr); - - const IndexType numFaces = test_mesh->getNumberOfFaces(); - - axom::Array conn_d(numFaces * MAX_FACE_NODES, numFaces * MAX_FACE_NODES, device_allocator); - - auto conn_v = conn_d.view(); - - for_all_faces( - test_mesh, - AXOM_LAMBDA(IndexType faceID, const IndexType* nodes, IndexType N) { - for(int i = 0; i < N; ++i) - { - conn_v[faceID * MAX_FACE_NODES + i] = nodes[i]; - } // END for all face nodes - }); - - // Copy field back to host - axom::Array conn_h = axom::Array(conn_d, host_allocator); - - // Create mesh field from buffer - IndexType* conn_field = - test_mesh->template createField("f1", FACE_CENTERED, conn_h.data()); - - IndexType faceNodes[MAX_FACE_NODES]; - for(IndexType faceID = 0; faceID < numFaces; ++faceID) - { - const IndexType N = test_mesh->getFaceNodeIDs(faceID, faceNodes); - for(int i = 0; i < N; ++i) - { - EXPECT_EQ(conn_field[faceID * MAX_FACE_NODES + i], faceNodes[i]); - } - } // END for all cells - - /* clean up */ - delete test_mesh; - test_mesh = nullptr; -} - -//------------------------------------------------------------------------------ -template -void check_for_all_face_coords(int dimension) -{ - constexpr char* mesh_name = internal::mesh_type::name(); - SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() - << ", mesh_type=" << mesh_name); - - // Get ids of necessary allocators - const int host_allocator = axom::execution_space::allocatorID(); - const int device_allocator = axom::execution_space::allocatorID(); - - const IndexType Ni = 20; - const IndexType Nj = (dimension >= 2) ? Ni : -1; - const IndexType Nk = (dimension == 3) ? Ni : -1; - - const double lo[] = {-10, -9, -8}; - const double hi[] = {10, 9, 8}; - UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); - - using MESH = typename internal::mesh_type::MeshType; - MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); - EXPECT_TRUE(test_mesh != nullptr); - - const IndexType numFaces = test_mesh->getNumberOfFaces(); - axom::Array conn_d(numFaces * MAX_FACE_NODES, numFaces * MAX_FACE_NODES, device_allocator); - axom::Array coords_d(numFaces * dimension * MAX_FACE_NODES, - numFaces * dimension * MAX_FACE_NODES, - device_allocator); - - auto conn_v = conn_d.view(); - auto coords_v = coords_d.view(); - - for_all_faces( - test_mesh, - AXOM_LAMBDA(IndexType faceID, const numerics::Matrix& coordsMatrix, const IndexType* nodes) { - const IndexType numNodes = coordsMatrix.getNumColumns(); - for(int i = 0; i < numNodes; ++i) - { - conn_v[faceID * MAX_FACE_NODES + i] = nodes[i]; - - for(int dim = 0; dim < dimension; ++dim) - { - coords_v[faceID * dimension * MAX_FACE_NODES + i * dimension + dim] = coordsMatrix(dim, i); - } - } // END for all face nodes - }); - - // Copy data back to host - axom::Array conn_h = axom::Array(conn_d, host_allocator); - axom::Array coords_h = axom::Array(coords_d, host_allocator); - - // Create mesh fields from buffers - IndexType* conn_field = - test_mesh->template createField("conn", FACE_CENTERED, conn_h.data(), MAX_FACE_NODES); - double* coords_field = test_mesh->template createField("coords", - FACE_CENTERED, - coords_h.data(), - dimension * MAX_FACE_NODES); - - double nodeCoords[3]; - IndexType faceNodes[MAX_FACE_NODES]; - for(IndexType faceID = 0; faceID < numFaces; ++faceID) - { - const IndexType numNodes = test_mesh->getFaceNodeIDs(faceID, faceNodes); - for(int i = 0; i < numNodes; ++i) - { - EXPECT_EQ(conn_field[faceID * MAX_FACE_NODES + i], faceNodes[i]); - - for(int dim = 0; dim < dimension; ++dim) - { - test_mesh->getNode(faceNodes[i], nodeCoords); - EXPECT_NEAR(coords_field[faceID * dimension * MAX_FACE_NODES + i * dimension + dim], - nodeCoords[dim], - 1e-8); - } - } - } // END for all cells - - /* clean up */ - delete test_mesh; - test_mesh = nullptr; -} - -//------------------------------------------------------------------------------ -template -void check_for_all_face_cells(int dimension) -{ - constexpr char* mesh_name = internal::mesh_type::name(); - SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() - << ", mesh_type=" << mesh_name); - - // Get ids of necessary allocators - const int host_allocator = axom::execution_space::allocatorID(); - const int device_allocator = axom::execution_space::allocatorID(); - - const IndexType Ni = 20; - const IndexType Nj = (dimension >= 2) ? Ni : -1; - const IndexType Nk = (dimension == 3) ? Ni : -1; - - const double lo[] = {-10, -9, -8}; - const double hi[] = {10, 9, 8}; - UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); - - using MESH = typename internal::mesh_type::MeshType; - MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); - EXPECT_TRUE(test_mesh != nullptr); - - const IndexType numFaces = test_mesh->getNumberOfFaces(); - axom::Array face_cells_d(numFaces * 2, numFaces * 2, device_allocator); - - auto face_cells_v = face_cells_d.view(); - - for_all_faces( - test_mesh, - AXOM_LAMBDA(IndexType faceID, IndexType cellIDOne, IndexType cellIDTwo) { - face_cells_v[2 * faceID + 0] = cellIDOne; - face_cells_v[2 * faceID + 1] = cellIDTwo; - }); - - // Copy field back to host - axom::Array face_cells_h = axom::Array(face_cells_d, host_allocator); - - // Create mesh field from buffer - IndexType* face_cells_field = - test_mesh->template createField("f1", FACE_CENTERED, face_cells_h.data(), 2); - - for(IndexType faceID = 0; faceID < numFaces; ++faceID) - { - IndexType cellIDOne, cellIDTwo; - test_mesh->getFaceCellIDs(faceID, cellIDOne, cellIDTwo); - - EXPECT_EQ(face_cells_field[2 * faceID + 0], cellIDOne); - EXPECT_EQ(face_cells_field[2 * faceID + 1], cellIDTwo); - } - - /* clean up */ - delete test_mesh; - test_mesh = nullptr; -} - -} /* end anonymous namespace */ - -//------------------------------------------------------------------------------ -// UNIT TESTS -//------------------------------------------------------------------------------ - -AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_nodeids) -{ - for(int dim = 2; dim <= 3; ++dim) - { - using seq_exec = axom::SEQ_EXEC; - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) - - using omp_exec = axom::OMP_EXEC; - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ - defined(AXOM_USE_UMPIRE) - - using cuda_exec = axom::CUDA_EXEC<512>; - - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ - defined(AXOM_USE_UMPIRE) - - using hip_exec = axom::HIP_EXEC<512>; - - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - - } // END for all dimensions -} - -AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_coords) -{ - for(int dim = 2; dim <= 3; ++dim) - { - using seq_exec = axom::SEQ_EXEC; - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) - - using omp_exec = axom::OMP_EXEC; - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ - defined(AXOM_USE_UMPIRE) - - using cuda_exec = axom::CUDA_EXEC<512>; - - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ - defined(AXOM_USE_UMPIRE) - - using hip_exec = axom::HIP_EXEC<512>; - - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - check_for_all_face_coords(dim); - -#endif - - } // END for all dimensions -} - -AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_cellids) -{ - for(int dim = 2; dim <= 3; ++dim) - { - using seq_exec = axom::SEQ_EXEC; - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) - - using omp_exec = axom::OMP_EXEC; - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ - defined(AXOM_USE_UMPIRE) - - using cuda_exec = axom::CUDA_EXEC<512>; - - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ - defined(AXOM_USE_UMPIRE) - - using hip_exec = axom::HIP_EXEC<512>; - - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_cells(dim); - check_for_all_face_nodes(dim); - check_for_all_face_nodes(dim); - -#endif - - } // END for all dimensions -} - -//------------------------------------------------------------------------------ -AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_faces_index) -{ - for(int dim = 2; dim <= 3; ++dim) - { - using seq_exec = axom::SEQ_EXEC; - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) - - using omp_exec = axom::OMP_EXEC; - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ - defined(AXOM_USE_UMPIRE) - - using cuda_exec = axom::CUDA_EXEC<512>; - - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - -#endif - -#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ - defined(AXOM_USE_UMPIRE) - - using hip_exec = axom::HIP_EXEC<512>; - - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - check_for_all_faces(dim); - -#endif - - } // END for all dimensions -} - -} /* namespace mint */ -} /* namespace axom */ - -//------------------------------------------------------------------------------ -int main(int argc, char* argv[]) -{ - int result = 0; - - ::testing::InitGoogleTest(&argc, argv); - axom::slic::SimpleLogger logger; - - result = RUN_ALL_TESTS(); - - return result; -} +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +// Axom includes +#include "axom/config.hpp" // compile-time definitions +#include "axom/core/execution/execution_space.hpp" // for execution_space traits + +// Mint includes +#include "axom/mint/config.hpp" // mint compile-time definitions +#include "axom/mint/execution/interface.hpp" // for_all() + +// Slic includes +#include "axom/slic.hpp" // for SLIC macros + +#include "mint_test_utilities.hpp" + +// gtest includes +#include "gtest/gtest.h" // for gtest + +namespace axom +{ +namespace mint +{ +//------------------------------------------------------------------------------ +// HELPER METHODS +//------------------------------------------------------------------------------ +namespace +{ +template +void check_for_all_faces(int dimension) +{ + constexpr char* mesh_name = internal::mesh_type::name(); + SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() + << ", mesh_type=" << mesh_name); + + // Get ids of necessary allocators + const int host_allocator = axom::execution_space::allocatorID(); + const int device_allocator = axom::execution_space::allocatorID(); + + const IndexType Ni = 20; + const IndexType Nj = (dimension >= 2) ? Ni : -1; + const IndexType Nk = (dimension == 3) ? Ni : -1; + + const double lo[] = {-10, -9, -8}; + const double hi[] = {10, 9, 8}; + UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); + + using MESH = typename internal::mesh_type::MeshType; + MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); + EXPECT_TRUE(test_mesh != nullptr); + + const IndexType numFaces = test_mesh->getNumberOfFaces(); + + axom::Array field_d(numFaces, numFaces, device_allocator); + + auto field_v = field_d.view(); + + for_all_faces(test_mesh, AXOM_LAMBDA(IndexType faceID) { field_v[faceID] = faceID; }); + + // Copy field back to host + axom::Array field_h = axom::Array(field_d, host_allocator); + + // Create mesh field from buffer + IndexType* f1_field = + test_mesh->template createField("f1", FACE_CENTERED, field_h.data()); + + for(IndexType faceID = 0; faceID < numFaces; ++faceID) + { + EXPECT_EQ(f1_field[faceID], faceID); + } + + delete test_mesh; + test_mesh = nullptr; +} + +//------------------------------------------------------------------------------ +template +void check_for_all_face_nodes(int dimension) +{ + constexpr char* mesh_name = internal::mesh_type::name(); + SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() + << ", mesh_type=" << mesh_name); + + // Get ids of necessary allocators + const int host_allocator = axom::execution_space::allocatorID(); + const int device_allocator = axom::execution_space::allocatorID(); + + const IndexType Ni = 20; + const IndexType Nj = (dimension >= 2) ? Ni : -1; + const IndexType Nk = (dimension == 3) ? Ni : -1; + + const double lo[] = {-10, -9, -8}; + const double hi[] = {10, 9, 8}; + UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); + + using MESH = typename internal::mesh_type::MeshType; + MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); + EXPECT_TRUE(test_mesh != nullptr); + + const IndexType numFaces = test_mesh->getNumberOfFaces(); + + axom::Array conn_d(numFaces * MAX_FACE_NODES, numFaces * MAX_FACE_NODES, device_allocator); + + auto conn_v = conn_d.view(); + + for_all_faces( + test_mesh, + AXOM_LAMBDA(IndexType faceID, const IndexType* nodes, IndexType N) { + for(int i = 0; i < N; ++i) + { + conn_v[faceID * MAX_FACE_NODES + i] = nodes[i]; + } // END for all face nodes + }); + + // Copy field back to host + axom::Array conn_h = axom::Array(conn_d, host_allocator); + + // Create mesh field from buffer + IndexType* conn_field = + test_mesh->template createField("f1", FACE_CENTERED, conn_h.data()); + + IndexType faceNodes[MAX_FACE_NODES]; + for(IndexType faceID = 0; faceID < numFaces; ++faceID) + { + const IndexType N = test_mesh->getFaceNodeIDs(faceID, faceNodes); + for(int i = 0; i < N; ++i) + { + EXPECT_EQ(conn_field[faceID * MAX_FACE_NODES + i], faceNodes[i]); + } + } // END for all cells + + /* clean up */ + delete test_mesh; + test_mesh = nullptr; +} + +//------------------------------------------------------------------------------ +template +void check_for_all_face_coords(int dimension) +{ + constexpr char* mesh_name = internal::mesh_type::name(); + SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() + << ", mesh_type=" << mesh_name); + + // Get ids of necessary allocators + const int host_allocator = axom::execution_space::allocatorID(); + const int device_allocator = axom::execution_space::allocatorID(); + + const IndexType Ni = 20; + const IndexType Nj = (dimension >= 2) ? Ni : -1; + const IndexType Nk = (dimension == 3) ? Ni : -1; + + const double lo[] = {-10, -9, -8}; + const double hi[] = {10, 9, 8}; + UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); + + using MESH = typename internal::mesh_type::MeshType; + MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); + EXPECT_TRUE(test_mesh != nullptr); + + const IndexType numFaces = test_mesh->getNumberOfFaces(); + axom::Array conn_d(numFaces * MAX_FACE_NODES, numFaces * MAX_FACE_NODES, device_allocator); + axom::Array coords_d(numFaces * dimension * MAX_FACE_NODES, + numFaces * dimension * MAX_FACE_NODES, + device_allocator); + + auto conn_v = conn_d.view(); + auto coords_v = coords_d.view(); + + for_all_faces( + test_mesh, + AXOM_LAMBDA(IndexType faceID, const numerics::Matrix& coordsMatrix, const IndexType* nodes) { + const IndexType numNodes = coordsMatrix.getNumColumns(); + for(int i = 0; i < numNodes; ++i) + { + conn_v[faceID * MAX_FACE_NODES + i] = nodes[i]; + + for(int dim = 0; dim < dimension; ++dim) + { + coords_v[faceID * dimension * MAX_FACE_NODES + i * dimension + dim] = coordsMatrix(dim, i); + } + } // END for all face nodes + }); + + // Copy data back to host + axom::Array conn_h = axom::Array(conn_d, host_allocator); + axom::Array coords_h = axom::Array(coords_d, host_allocator); + + // Create mesh fields from buffers + IndexType* conn_field = + test_mesh->template createField("conn", FACE_CENTERED, conn_h.data(), MAX_FACE_NODES); + double* coords_field = test_mesh->template createField("coords", + FACE_CENTERED, + coords_h.data(), + dimension * MAX_FACE_NODES); + + double nodeCoords[3]; + IndexType faceNodes[MAX_FACE_NODES]; + for(IndexType faceID = 0; faceID < numFaces; ++faceID) + { + const IndexType numNodes = test_mesh->getFaceNodeIDs(faceID, faceNodes); + for(int i = 0; i < numNodes; ++i) + { + EXPECT_EQ(conn_field[faceID * MAX_FACE_NODES + i], faceNodes[i]); + + for(int dim = 0; dim < dimension; ++dim) + { + test_mesh->getNode(faceNodes[i], nodeCoords); + EXPECT_NEAR(coords_field[faceID * dimension * MAX_FACE_NODES + i * dimension + dim], + nodeCoords[dim], + 1e-8); + } + } + } // END for all cells + + /* clean up */ + delete test_mesh; + test_mesh = nullptr; +} + +//------------------------------------------------------------------------------ +template +void check_for_all_face_cells(int dimension) +{ + constexpr char* mesh_name = internal::mesh_type::name(); + SLIC_INFO("dimension=" << dimension << ", policy=" << execution_space::name() + << ", mesh_type=" << mesh_name); + + // Get ids of necessary allocators + const int host_allocator = axom::execution_space::allocatorID(); + const int device_allocator = axom::execution_space::allocatorID(); + + const IndexType Ni = 20; + const IndexType Nj = (dimension >= 2) ? Ni : -1; + const IndexType Nk = (dimension == 3) ? Ni : -1; + + const double lo[] = {-10, -9, -8}; + const double hi[] = {10, 9, 8}; + UniformMesh uniform_mesh(lo, hi, Ni, Nj, Nk); + + using MESH = typename internal::mesh_type::MeshType; + MESH* test_mesh = dynamic_cast(internal::create_mesh(uniform_mesh)); + EXPECT_TRUE(test_mesh != nullptr); + + const IndexType numFaces = test_mesh->getNumberOfFaces(); + axom::Array face_cells_d(numFaces * 2, numFaces * 2, device_allocator); + + auto face_cells_v = face_cells_d.view(); + + for_all_faces( + test_mesh, + AXOM_LAMBDA(IndexType faceID, IndexType cellIDOne, IndexType cellIDTwo) { + face_cells_v[2 * faceID + 0] = cellIDOne; + face_cells_v[2 * faceID + 1] = cellIDTwo; + }); + + // Copy field back to host + axom::Array face_cells_h = axom::Array(face_cells_d, host_allocator); + + // Create mesh field from buffer + IndexType* face_cells_field = + test_mesh->template createField("f1", FACE_CENTERED, face_cells_h.data(), 2); + + for(IndexType faceID = 0; faceID < numFaces; ++faceID) + { + IndexType cellIDOne, cellIDTwo; + test_mesh->getFaceCellIDs(faceID, cellIDOne, cellIDTwo); + + EXPECT_EQ(face_cells_field[2 * faceID + 0], cellIDOne); + EXPECT_EQ(face_cells_field[2 * faceID + 1], cellIDTwo); + } + + /* clean up */ + delete test_mesh; + test_mesh = nullptr; +} + +} /* end anonymous namespace */ + +//------------------------------------------------------------------------------ +// UNIT TESTS +//------------------------------------------------------------------------------ + +AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_nodeids) +{ + for(int dim = 2; dim <= 3; ++dim) + { + using seq_exec = axom::SEQ_EXEC; + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) + + using omp_exec = axom::OMP_EXEC; + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ + defined(AXOM_USE_UMPIRE) + + using cuda_exec = axom::CUDA_EXEC<512>; + + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ + defined(AXOM_USE_UMPIRE) + + using hip_exec = axom::HIP_EXEC<512>; + + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + + } // END for all dimensions +} + +AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_coords) +{ + for(int dim = 2; dim <= 3; ++dim) + { + using seq_exec = axom::SEQ_EXEC; + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) + + using omp_exec = axom::OMP_EXEC; + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ + defined(AXOM_USE_UMPIRE) + + using cuda_exec = axom::CUDA_EXEC<512>; + + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ + defined(AXOM_USE_UMPIRE) + + using hip_exec = axom::HIP_EXEC<512>; + + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + check_for_all_face_coords(dim); + +#endif + + } // END for all dimensions +} + +AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_face_cellids) +{ + for(int dim = 2; dim <= 3; ++dim) + { + using seq_exec = axom::SEQ_EXEC; + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) + + using omp_exec = axom::OMP_EXEC; + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ + defined(AXOM_USE_UMPIRE) + + using cuda_exec = axom::CUDA_EXEC<512>; + + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ + defined(AXOM_USE_UMPIRE) + + using hip_exec = axom::HIP_EXEC<512>; + + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_cells(dim); + check_for_all_face_nodes(dim); + check_for_all_face_nodes(dim); + +#endif + + } // END for all dimensions +} + +//------------------------------------------------------------------------------ +AXOM_CUDA_TEST(mint_execution_face_traversals, for_all_faces_index) +{ + for(int dim = 2; dim <= 3; ++dim) + { + using seq_exec = axom::SEQ_EXEC; + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_OPENMP) && defined(RAJA_ENABLE_OPENMP) + + using omp_exec = axom::OMP_EXEC; + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_CUDA) && defined(RAJA_ENABLE_CUDA) && \ + defined(AXOM_USE_UMPIRE) + + using cuda_exec = axom::CUDA_EXEC<512>; + + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + +#endif + +#if defined(AXOM_USE_RAJA) && defined(AXOM_USE_HIP) && defined(RAJA_ENABLE_HIP) && \ + defined(AXOM_USE_UMPIRE) + + using hip_exec = axom::HIP_EXEC<512>; + + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + check_for_all_faces(dim); + +#endif + + } // END for all dimensions +} + +} /* namespace mint */ +} /* namespace axom */ + +//------------------------------------------------------------------------------ +int main(int argc, char* argv[]) +{ + int result = 0; + + ::testing::InitGoogleTest(&argc, argv); + axom::slic::SimpleLogger logger; + + result = RUN_ALL_TESTS(); + + return result; +} diff --git a/src/axom/mint/tests/mint_mesh_face_relation.cpp b/src/axom/mint/tests/mint_mesh_face_relation.cpp index 2b1726e89b..d2a0db3007 100644 --- a/src/axom/mint/tests/mint_mesh_face_relation.cpp +++ b/src/axom/mint/tests/mint_mesh_face_relation.cpp @@ -29,7 +29,7 @@ struct MeshFaceTest MeshFaceTest() : name(""), mesh(nullptr), initShouldSucceed(false), totalFaceCount(-1) { } MeshFaceTest(std::string thename, - Mesh *themesh, + Mesh* themesh, bool itsInitShouldSucceed, IndexType theTotalFaceCount, std::vector theCellFaceCount, @@ -50,7 +50,7 @@ struct MeshFaceTest ~MeshFaceTest() { delete mesh; } std::string name; - Mesh *mesh; + Mesh* mesh; bool initShouldSucceed; IndexType totalFaceCount; std::vector cellFaceCount; @@ -64,9 +64,9 @@ struct MeshFaceTest /*! Generate the tests in mint_mesh_face_relation.svg. * Caller must clean up. */ -std::vector generateFaceTestCases() +std::vector generateFaceTestCases() { - std::vector tests; + std::vector tests; // Each test mesh in "Face relation tests.svg" is instantiated // and put into tests. @@ -77,7 +77,7 @@ std::vector generateFaceTestCases() { // 1. tri =============================================================== - UnstructuredMesh *tri = new UnstructuredMesh(TWO_D, TRIANGLE); + UnstructuredMesh* tri = new UnstructuredMesh(TWO_D, TRIANGLE); double trinodes[] = {0, 0, 1, 0, 0, 1}; IndexType tricells[] = {0, 1, 2}; @@ -99,7 +99,7 @@ std::vector generateFaceTestCases() { // 2. two tris ========================================================== - UnstructuredMesh *twotris = new UnstructuredMesh(TWO_D, TRIANGLE); + UnstructuredMesh* twotris = new UnstructuredMesh(TWO_D, TRIANGLE); double twotrisnodes[] = {0, 0, 1, 0, 0, 1, 0.8, 1.2}; IndexType twotriscells[] = {0, 1, 2, 1, 3, 2}; @@ -123,7 +123,7 @@ std::vector generateFaceTestCases() { // 3. three quads and a tri ============================================= - UnstructuredMesh *thrqtri = new UnstructuredMesh(TWO_D); + UnstructuredMesh* thrqtri = new UnstructuredMesh(TWO_D); double thrqtrixs[] = {-1, -1, -1, 0, 0, 0, 1, 1}; double thrqtriys[] = {-1, 0, 1, -1, 0, 1, 0, 1}; IndexType thrqtricells[] = {0, @@ -168,7 +168,7 @@ std::vector generateFaceTestCases() { // 4. four tris, with a hole ============================================ - UnstructuredMesh *fourtris = new UnstructuredMesh(TWO_D, TRIANGLE); + UnstructuredMesh* fourtris = new UnstructuredMesh(TWO_D, TRIANGLE); double fourtrisxs[] = {-1, 0, 0, -.2, .2, 1}; double fourtrisys[] = {-.1, -1, 0, 1, -.2, 0}; IndexType fourtriscells[] = {0, 1, 2, 0, 2, 3, 1, 5, 4, 2, 5, 3}; @@ -195,7 +195,7 @@ std::vector generateFaceTestCases() { // 5. one 3D tri ======================================================== - UnstructuredMesh *threeDtri = new UnstructuredMesh(THREE_D, TRIANGLE); + UnstructuredMesh* threeDtri = new UnstructuredMesh(THREE_D, TRIANGLE); double threeDtrinodes[] = {-1, 0, 0, 0, 1, 0.5, 1.2, -.2, 3}; IndexType threeDtricells[] = {0, 1, 2}; @@ -220,7 +220,7 @@ std::vector generateFaceTestCases() { // 6. a tri not far from a quad ========================================= - UnstructuredMesh *qandtri = new UnstructuredMesh(THREE_D); + UnstructuredMesh* qandtri = new UnstructuredMesh(THREE_D); double qandtrixs[] = {-1, 1, 0, 0.3, 0.9, 2, 1.4}; double qandtriys[] = {0, 0, 0.8, 0.9, 0.2, 0.5, 1.5}; double qandtrizs[] = {1, 0, 0, 0, 0, 0, 0}; @@ -257,7 +257,7 @@ std::vector generateFaceTestCases() { // 7. tet from four tris ================================================ - UnstructuredMesh *tettris = new UnstructuredMesh(THREE_D, TRIANGLE); + UnstructuredMesh* tettris = new UnstructuredMesh(THREE_D, TRIANGLE); double tettrisxs[] = {0, 1, 1, 1}; double tettrisys[] = {0, 0, 1, 1}; double tettriszs[] = {0, -.1, 0.2, 1}; @@ -284,7 +284,7 @@ std::vector generateFaceTestCases() { // 8. hex from six quads ================================================ - UnstructuredMesh *hexquads = new UnstructuredMesh(THREE_D, QUAD); + UnstructuredMesh* hexquads = new UnstructuredMesh(THREE_D, QUAD); double hexquadsxs[] = {0, 1, 1, 0, 0, 1, 1, 0}; double hexquadsys[] = {0, 0, 1, 1, 0, 0, 1, 1}; double hexquadszs[] = {0, 0, 0, 0, 1, 1, 1, 1}; @@ -313,7 +313,7 @@ std::vector generateFaceTestCases() { // 9. pyramid from a quad and four tris ================================= - UnstructuredMesh *pyr = new UnstructuredMesh(THREE_D); + UnstructuredMesh* pyr = new UnstructuredMesh(THREE_D); double pyrxs[] = {-1, 0, 0, 1, 0}; double pyrys[] = {0, -1, 1, 0, 0}; double pyrzs[] = {0, 0, 0, 0, 1}; @@ -358,7 +358,7 @@ std::vector generateFaceTestCases() { // 10. two tris back to back, forming a closed surface ================== - UnstructuredMesh *b2btris = new UnstructuredMesh(THREE_D, TRIANGLE); + UnstructuredMesh* b2btris = new UnstructuredMesh(THREE_D, TRIANGLE); double b2btrisnodes[] = {0, 0, 0, 2, -.3, -.1, 1, 1, 1}; IndexType b2btriscells[] = {0, 1, 2, 0, 2, 1}; @@ -383,7 +383,7 @@ std::vector generateFaceTestCases() { // 11. three quads (corner of a box) ==================================== - UnstructuredMesh *threeq = new UnstructuredMesh(THREE_D); + UnstructuredMesh* threeq = new UnstructuredMesh(THREE_D); // for variety, you can use a MIXED_SHAPE for a homogeneous mesh--- // it just means a little more typing. double threeqxs[] = {0, 1, 1, 0, 1.4, 1.4, 0.4}; @@ -416,7 +416,7 @@ std::vector generateFaceTestCases() { // 12. two quads, two tris ============================================== - UnstructuredMesh *twoqtwot = new UnstructuredMesh(THREE_D); + UnstructuredMesh* twoqtwot = new UnstructuredMesh(THREE_D); double twoqtwotxs[] = {0, 1, 1, 0, 1.4, 1.4, 0.4}; double twoqtwotys[] = {0, 0, 1, 1, 0.4, 1.4, 1.4}; double twoqtwotzs[] = {0, 0, 0, 0, 0.4, 0.4, 0.4}; @@ -448,7 +448,7 @@ std::vector generateFaceTestCases() { // 13. two quads, two tris forming a prism open at both ends ============ - UnstructuredMesh *oprism = new UnstructuredMesh(THREE_D); + UnstructuredMesh* oprism = new UnstructuredMesh(THREE_D); double oprismxs[] = {0, 1, 2, 0, 1, 2}; double oprismys[] = {0, -1, 1, 0, -1, 1}; double oprismzs[] = {0, 0, 0, 1, 1, 1}; @@ -480,7 +480,7 @@ std::vector generateFaceTestCases() { // 14. cracked tet ====================================================== - UnstructuredMesh *crackedtet = + UnstructuredMesh* crackedtet = new UnstructuredMesh(THREE_D, TRIANGLE); double crackedtetxs[] = {0, 1, 1, 1, 0.9}; double crackedtetys[] = {0, 0, 1, 1, 0.9}; @@ -508,7 +508,7 @@ std::vector generateFaceTestCases() { // 15. cracked pyramid ================================================== - UnstructuredMesh *crackedpyr = new UnstructuredMesh(THREE_D); + UnstructuredMesh* crackedpyr = new UnstructuredMesh(THREE_D); double crackedpyrxs[] = {-1, 0, 0, 1, 0, 0.2}; double crackedpyrys[] = {0, -1, 1, 0, 0, -0.2}; double crackedpyrzs[] = {0, 0, 0, 0, 1, 1}; @@ -555,7 +555,7 @@ std::vector generateFaceTestCases() { // 16. not a manifold =================================================== - UnstructuredMesh *notmanf = new UnstructuredMesh(THREE_D, TRIANGLE); + UnstructuredMesh* notmanf = new UnstructuredMesh(THREE_D, TRIANGLE); double notmanfxs[] = {-1, 0, 0, 0.2, 1}; double notmanfys[] = {0, 0, 0, -.6, 0}; double notmanfzs[] = {0.6, 0, 1, 0.4, 0.4}; @@ -583,7 +583,7 @@ std::vector generateFaceTestCases() { // 17. egregiously not a manifold ======================================= - UnstructuredMesh *egreg = new UnstructuredMesh(THREE_D); + UnstructuredMesh* egreg = new UnstructuredMesh(THREE_D); double egregxs[] = {0, 1, 1, 0, 0, 1, 0, 1, 1}; double egregys[] = {0, 0, 1, 1, 0.8, 0, 0, -0.4, -0.9}; double egregzs[] = {0, 0, 0, 0, 0.4, 1, 1, 1.2, 0.5}; @@ -628,7 +628,7 @@ std::vector generateFaceTestCases() { // 18. 3D tet =========================================================== - UnstructuredMesh *tet = new UnstructuredMesh(THREE_D, TET); + UnstructuredMesh* tet = new UnstructuredMesh(THREE_D, TET); double tetxs[] = {0, 1, 1, 1}; double tetys[] = {0, 0, 1, 1}; double tetzs[] = {0, -.1, 0.2, 1}; @@ -654,7 +654,7 @@ std::vector generateFaceTestCases() { // 19. two hexs ========================================================= - UnstructuredMesh *hexs = new UnstructuredMesh(THREE_D, HEX); + UnstructuredMesh* hexs = new UnstructuredMesh(THREE_D, HEX); double hexsxs[] = {0, 1, 2, 0, 1, 3, 0, 1, 2, 0, 1, 3}; double hexsys[] = {0, 0, 0, 1, 0.8, 1, 0, 0.2, 0, 1, 1, 1}; double hexszs[] = {0, 0.2, 0, 0, 0, 0, 1, 1, 1, 1, 0.8, 1}; @@ -681,7 +681,7 @@ std::vector generateFaceTestCases() { // 20. three hexs ======================================================= - UnstructuredMesh *hexs3 = new UnstructuredMesh(THREE_D, HEX); + UnstructuredMesh* hexs3 = new UnstructuredMesh(THREE_D, HEX); double hexs3xs[] = {0, 0, 1, 1, 1, 2, 2, 0, 0, 1, 1, 1, 2, 2}; double hexs3ys[] = {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1}; double hexs3zs[] = {0, 2, -1, 1, 3, 0, 2, 0, 2, -1, 1, 3, 0, 2}; @@ -711,7 +711,7 @@ std::vector generateFaceTestCases() { // 21. two coincident tets, one inside-out, forming a closed manifold === - UnstructuredMesh *mtet = new UnstructuredMesh(THREE_D, TET); + UnstructuredMesh* mtet = new UnstructuredMesh(THREE_D, TET); double mtetxs[] = {0, 1, 1, 1}; double mtetys[] = {0, 0, 1, 1}; double mtetzs[] = {0, -.1, 0.2, 1}; @@ -738,7 +738,7 @@ std::vector generateFaceTestCases() { // 22. bad tet mesh (not a manifold) ==================================== - UnstructuredMesh *badtets = new UnstructuredMesh(THREE_D, TET); + UnstructuredMesh* badtets = new UnstructuredMesh(THREE_D, TET); double badtetsxs[] = {0, 1, 1, 1, 0, 0.3}; double badtetsys[] = {0, 0, 1, 1, 1, 1.2}; double badtetszs[] = {0, -.1, 0.2, 1, 0.5, 0.8}; @@ -767,7 +767,7 @@ std::vector generateFaceTestCases() { // 23. 3D pyramid ======================================================= - UnstructuredMesh *pyramid = new UnstructuredMesh(THREE_D); + UnstructuredMesh* pyramid = new UnstructuredMesh(THREE_D); double pyramidxs[] = {-1, 0, 0, 1, 0}; double pyramidys[] = {0, -1, 1, 0, 0}; double pyramidzs[] = {0, 0, 0, 0, 1}; @@ -803,7 +803,7 @@ std::vector generateFaceTestCases() * * \returns true if testnbrs contains all values in nbrs and none extra. */ -bool verifyNeighbors(IndexType facecount, IndexType *testnbrs, IndexType *nbrs) +bool verifyNeighbors(IndexType facecount, IndexType* testnbrs, IndexType* nbrs) { std::map testnbrset, nbrset; @@ -856,7 +856,7 @@ struct FaceTypeNodes { FaceTypeNodes() : facetype(UNDEFINED_CELL) { } - FaceTypeNodes(CellType ftype, std::vector &fnodes) : facetype(ftype), facenodes(fnodes) + FaceTypeNodes(CellType ftype, std::vector& fnodes) : facetype(ftype), facenodes(fnodes) { } CellType facetype; @@ -866,9 +866,9 @@ struct FaceTypeNodes /*! If fn is empty, return true. Otherwise, return false * and compose an error message. */ -bool checkAndReportFaceNodes(std::map &fn, +bool checkAndReportFaceNodes(std::map& fn, std::string label, - std::stringstream &mesg) + std::stringstream& mesg) { bool success = true; if(fn.size() > 0) @@ -877,7 +877,7 @@ bool checkAndReportFaceNodes(std::map &fn, mesg << fcount << label << std::endl; for(auto fit = fn.begin(), fend = fn.end(); fit != fend; ++fit) { - FaceTypeNodes &ftn = fit->second; + FaceTypeNodes& ftn = fit->second; mesg << "Type " << getCellInfo(ftn.facetype).name << " ("; mesg << internal::join_ints_into_string(static_cast(ftn.facenodes.size()), ftn.facenodes.data(), @@ -892,7 +892,7 @@ bool checkAndReportFaceNodes(std::map &fn, /*! Return true if a and b contain the same contents, even if shifted. */ template -bool matchRotateList(std::vector &a, std::vector &b) +bool matchRotateList(std::vector& a, std::vector& b) { if(a.size() != b.size() || a.size() < 1) { @@ -917,7 +917,7 @@ bool matchRotateList(std::vector &a, std::vector &b) } /*! Check face type and (possibly shifted) face nodes for equality. */ -bool faceMatches(FaceTypeNodes &a, FaceTypeNodes &b) +bool faceMatches(FaceTypeNodes& a, FaceTypeNodes& b) { return (a.facetype == b.facetype && matchRotateList(a.facenodes, b.facenodes)); } @@ -943,13 +943,13 @@ bool faceMatches(FaceTypeNodes &a, FaceTypeNodes &b) * test and answer data. */ bool verifyFaceNodesTypes(IndexType fcount, - IndexType *f2n, - IndexType *f2noffsets, - CellType *f2ntypes, + IndexType* f2n, + IndexType* f2noffsets, + CellType* f2ntypes, IndexType stdfacecount, - IndexType *stdFaceNodes, - CellType *stdFaceTypes, - std::string &errmesg) + IndexType* stdFaceNodes, + CellType* stdFaceTypes, + std::string& errmesg) { using FaceBuilderType = std::map; @@ -1025,7 +1025,7 @@ bool verifyFaceNodesTypes(IndexType fcount, * This function uses gtest's SCOPED_TRACE to distinguish the tests it runs * and uses EXPECT_ predicates to record test success or failure. */ -void runMeshFaceTest(internal::MeshFaceTest *t) +void runMeshFaceTest(internal::MeshFaceTest* t) { IndexType facecount = -1; Array f2c; @@ -1057,7 +1057,7 @@ void runMeshFaceTest(internal::MeshFaceTest *t) // initFaces() succeeded where it should have! SCOPED_TRACE(t->name); - Mesh *m = t->mesh; + Mesh* m = t->mesh; // do we have enough faces on each of the cells? IndexType cellcount = m->getNumberOfCells(); @@ -1320,7 +1320,7 @@ TEST(mint_mesh_face_relation, tf_faceMatches) */ TEST(mint_mesh_face_relation, correct_construction) { - std::vector tests = axom::mint::generateFaceTestCases(); + std::vector tests = axom::mint::generateFaceTestCases(); for(auto t : tests) { @@ -1334,7 +1334,7 @@ TEST(mint_mesh_face_relation, correct_construction) } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/mir/ElviraAlgorithm.hpp b/src/axom/mir/ElviraAlgorithm.hpp index 2bf6911b76..f375aac1e9 100644 --- a/src/axom/mir/ElviraAlgorithm.hpp +++ b/src/axom/mir/ElviraAlgorithm.hpp @@ -115,9 +115,9 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * \param coordsetView The coordset view to use for the input data. * \param matsetView The matset view to use for the input data. */ - ElviraAlgorithm(const TopologyView &topoView, - const CoordsetView &coordsetView, - const MatsetView &matsetView) + ElviraAlgorithm(const TopologyView& topoView, + const CoordsetView& coordsetView, + const MatsetView& matsetView) : axom::mir::MIRAlgorithm() , m_topologyView(topoView) , m_coordsetView(coordsetView) @@ -168,15 +168,15 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * \param[out] n_newMatset A Conduit node that will contain the new matset. * */ - virtual void executeDomain(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_matset, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) override + virtual void executeDomain(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_matset, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) override { namespace utils = axom::bump::utilities; @@ -219,9 +219,9 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm n_root[localPath(n_coordset)].set_external(n_coordset); n_root[localPath(n_topo)].set_external(n_topo); n_root[localPath(n_matset)].set_external(n_matset); - conduit::Node &n_root_coordset = n_root[localPath(n_coordset)]; - conduit::Node &n_root_topo = n_root[localPath(n_topo)]; - conduit::Node &n_root_matset = n_root[localPath(n_matset)]; + conduit::Node& n_root_coordset = n_root[localPath(n_coordset)]; + conduit::Node& n_root_topo = n_root[localPath(n_topo)]; + conduit::Node& n_root_matset = n_root[localPath(n_matset)]; conduit::Node n_root_fields = n_root["fields"]; // Make the clean mesh. @@ -316,9 +316,9 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm n_root[localPath(n_coordset)].set_external(n_coordset); n_root[localPath(n_topo)].set_external(n_topo); n_root[localPath(n_matset)].set_external(n_matset); - conduit::Node &n_root_coordset = n_root[localPath(n_coordset)]; - conduit::Node &n_root_topo = n_root[localPath(n_topo)]; - conduit::Node &n_root_matset = n_root[localPath(n_matset)]; + conduit::Node& n_root_coordset = n_root[localPath(n_coordset)]; + conduit::Node& n_root_topo = n_root[localPath(n_topo)]; + conduit::Node& n_root_matset = n_root[localPath(n_matset)]; conduit::Node n_root_fields = n_root["fields"]; conduit::Node n_cleanOutput; @@ -350,10 +350,10 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * \param n_mirOutput The mesh that contains the MIR output. * \param[out] n_merged The output node for the merged mesh. */ - void merge(const std::string &topoName, - conduit::Node &n_cleanOutput, - conduit::Node &n_mirOutput, - conduit::Node &n_merged) const + void merge(const std::string& topoName, + conduit::Node& n_cleanOutput, + conduit::Node& n_mirOutput, + conduit::Node& n_merged) const { AXOM_ANNOTATE_SCOPE("merge"); @@ -391,9 +391,9 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * \param selectedZonesView A view containing the values to store in the field. * */ - void addOriginal(conduit::Node &n_field, - const std::string &topoName, - const std::string &association, + void addOriginal(conduit::Node& n_field, + const std::string& topoName, + const std::string& association, axom::ArrayView selectedZonesView) const { AXOM_ANNOTATE_SCOPE("addOriginal"); @@ -430,13 +430,13 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * * \return The number of nodes in the clean mesh output. */ - void makeCleanZones(const axom::ArrayView &cleanZones, - const conduit::Node &n_root, - const conduit::Node &n_topology, - const conduit::Node &n_coordset, - const conduit::Node &n_matset, - const conduit::Node &n_options, - conduit::Node &n_cleanOutput) const + void makeCleanZones(const axom::ArrayView& cleanZones, + const conduit::Node& n_root, + const conduit::Node& n_topology, + const conduit::Node& n_coordset, + const conduit::Node& n_matset, + const conduit::Node& n_options, + conduit::Node& n_cleanOutput) const { AXOM_ANNOTATE_SCOPE("makeCleanZones"); namespace utils = axom::bump::utilities; @@ -474,7 +474,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm n_ezopts["originalElementsField"] = opts.originalElementsField(); // Forward some options involved in naming the objects. const std::vector keys {"topologyName", "coordsetName", "matsetName"}; - for(const auto &key : keys) + for(const auto& key : keys) { if(n_options.has_path(key)) { @@ -519,15 +519,15 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm * */ void processMixedZones(const axom::ArrayView mixedZonesView, - const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &AXOM_UNUSED_PARAM(n_fields), - const conduit::Node &n_matset, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) + const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& AXOM_UNUSED_PARAM(n_fields), + const conduit::Node& n_matset, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) { AXOM_ANNOTATE_SCOPE("processMixedZones"); namespace utils = axom::bump::utilities; @@ -571,7 +571,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm #if defined(AXOM_ELVIRA_GATHER_INFO) // Let's output the normals - conduit::Node *n_result = new conduit::Node; + conduit::Node* n_result = new conduit::Node; #endif //-------------------------------------------------------------------------- @@ -621,7 +621,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm #if defined(AXOM_ELVIRA_GATHER_INFO) if(!axom::execution_space::onDevice()) { - conduit::Node &n_group1 = n_result->operator[]("group1"); + conduit::Node& n_group1 = n_result->operator[]("group1"); n_group1["mixedZones"].set(mixedZonesView.data(), mixedZonesView.size()); n_group1["matZone"].set(matZoneView.data(), matZoneView.size()); n_group1["matCount"].set(matCountView.data(), matCountView.size()); @@ -645,7 +645,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm #if defined(AXOM_ELVIRA_GATHER_INFO) if(!axom::execution_space::onDevice()) { - conduit::Node &n_group2 = n_result->operator[]("group2"); + conduit::Node& n_group2 = n_result->operator[]("group2"); n_group2["matZone"].set(matZoneView.data(), matZoneView.size()); n_group2["matCount"].set(matCountView.data(), matCountView.size()); n_group2["offsets"].set(matOffsetView.data(), matOffsetView.size()); @@ -673,7 +673,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm #if defined(AXOM_ELVIRA_GATHER_INFO) if(!axom::execution_space::onDevice()) { - conduit::Node &n_group3 = n_result->operator[]("group3"); + conduit::Node& n_group3 = n_result->operator[]("group3"); n_group3["xview"].set(xview.data(), xview.size()); n_group3["yview"].set(yview.data(), yview.size()); n_group3["zview"].set(zview.data(), zview.size()); @@ -789,7 +789,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm auto fragmentVectorsView = fragmentVectors.view(); #if defined(AXOM_ELVIRA_GATHER_INFO) - conduit::Node *n_group4 = &(n_result->operator[]("group4")); + conduit::Node* n_group4 = &(n_result->operator[]("group4")); #endif axom::for_all( @@ -804,14 +804,14 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm // Compute Jacobian here since we have coordinate stencil data. double jac[3][3]; const auto coordIndex = szIndex * StencilSize; - const double *xcStencil = xcStencilView.data() + coordIndex; - const double *ycStencil = ycStencilView.data() + coordIndex; - const double *zcStencil = zcStencilView.data() + coordIndex; + const double* xcStencil = xcStencilView.data() + coordIndex; + const double* ycStencil = ycStencilView.data() + coordIndex; + const double* zcStencil = zcStencilView.data() + coordIndex; elvira::computeJacobian(xcStencil, ycStencil, zcStencil, NDIMS, jac); // The starting addresses for fragments in the current zone. - const double *fragmentVFStencilStart = fragmentVFStencilView.data() + offset * StencilSize; - double *fragmentVectorsStart = fragmentVectorsView.data() + offset * numVectorComponents; + const double* fragmentVFStencilStart = fragmentVFStencilView.data() + offset * StencilSize; + double* fragmentVectorsStart = fragmentVectorsView.data() + offset * numVectorComponents; // Produce normal for each material in this zone. int iskip = matCount - 1; @@ -820,7 +820,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm #if defined(AXOM_ELVIRA_GATHER_INFO) && !defined(AXOM_DEVICE_CODE) // The selected zone index in the whole mesh. const auto zoneIndex = matZoneView[szIndex]; - conduit::Node &n_thisZone = n_group4->append(); + conduit::Node& n_thisZone = n_group4->append(); n_thisZone["szIndex"] = szIndex; n_thisZone["zone"] = zoneIndex; n_thisZone["matCount"] = matCount; @@ -829,12 +829,12 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm n_thisZone["ycStencil"].set(ycStencil, StencilSize); n_thisZone["zcStencil"].set(zcStencil, StencilSize); n_thisZone["jacobian"].set(&jac[0][0], 9); - conduit::Node &n_mats = n_thisZone["mats"]; - const double *vf = fragmentVFStencilStart; - double *n = fragmentVectorsStart; + conduit::Node& n_mats = n_thisZone["mats"]; + const double* vf = fragmentVFStencilStart; + double* n = fragmentVectorsStart; for(axom::IndexType m = 0; m < matCount; m++) { - conduit::Node &n_thismat = n_mats.append(); + conduit::Node& n_thismat = n_mats.append(); n_thismat["mat"] = sortedMaterialIdsView[offset + m]; n_thismat["stencil"].set(vf, StencilSize); n_thismat["normal"].set(n, 3); @@ -846,7 +846,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm // Transform the normals. for(axom::IndexType m = 0; m < matCount; m++) { - double *normal = fragmentVectorsView.data() + ((offset + m) * numVectorComponents); + double* normal = fragmentVectorsView.data() + ((offset + m) * numVectorComponents); elvira::transform(normal, jac); #if defined(AXOM_ELVIRA_GATHER_INFO) && !defined(AXOM_DEVICE_CODE) n_thisZone["mats"][m]["transformed_normal"].set(normal, 3); @@ -988,7 +988,7 @@ class ElviraAlgorithm : public axom::mir::MIRAlgorithm const auto fragmentIndex = offset + m; // Get this material fragment's normal and material id. const auto matId = sortedMaterialIdsView[fragmentIndex]; - const double *normalPtr = + const double* normalPtr = fragmentVectorsView.data() + (fragmentIndex * numVectorComponents); // Compute the desired fragment volume. diff --git a/src/axom/mir/EquiZAlgorithm.hpp b/src/axom/mir/EquiZAlgorithm.hpp index 89e3e6b266..c889df854b 100644 --- a/src/axom/mir/EquiZAlgorithm.hpp +++ b/src/axom/mir/EquiZAlgorithm.hpp @@ -71,9 +71,9 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param coordsetView The coordset view to use for the input data. * \param matsetView The matset view to use for the input data. */ - EquiZAlgorithm(const TopologyView &topoView, - const CoordsetView &coordsetView, - const MatsetView &matsetView) + EquiZAlgorithm(const TopologyView& topoView, + const CoordsetView& coordsetView, + const MatsetView& matsetView) : axom::mir::MIRAlgorithm() , m_topologyView(topoView) , m_coordsetView(coordsetView) @@ -125,15 +125,15 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[out] n_newMatset A Conduit node that will contain the new matset. * */ - virtual void executeDomain(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_matset, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) override + virtual void executeDomain(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_matset, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) override { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("EquizAlgorithm"); @@ -174,10 +174,10 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm n_root[localPath(n_coordset)].set_external(n_coordset); n_root[localPath(n_topo)].set_external(n_topo); n_root[localPath(n_matset)].set_external(n_matset); - conduit::Node &n_root_coordset = n_root[localPath(n_coordset)]; - conduit::Node &n_root_topo = n_root[localPath(n_topo)]; - conduit::Node &n_root_matset = n_root[localPath(n_matset)]; - conduit::Node &n_root_fields = n_root["fields"]; + conduit::Node& n_root_coordset = n_root[localPath(n_coordset)]; + conduit::Node& n_root_topo = n_root[localPath(n_topo)]; + conduit::Node& n_root_matset = n_root[localPath(n_matset)]; + conduit::Node& n_root_fields = n_root["fields"]; for(conduit::index_t i = 0; i < n_fields.number_of_children(); i++) { n_root_fields[n_fields[i].name()].set_external(n_fields[i]); @@ -318,9 +318,9 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * so we can process them specially since mixed zones require much * more work. */ - void makeZoneLists(const conduit::Node &n_options, - axom::Array &cleanZones, - axom::Array &mixedZones) const + void makeZoneLists(const conduit::Node& n_options, + axom::Array& cleanZones, + axom::Array& mixedZones) const { // Call variants of the ZoneListBuilder methods that take into account adjacent // zones materials when determining if a zone should be mixed. @@ -356,17 +356,17 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param n_mirOutput The mesh that contains the MIR output. * \param[out] n_merged The output node for the merged mesh. */ - void merge(const std::string &topoName, - conduit::Node &n_cleanOutput, - conduit::Node &n_mirOutput, - conduit::Node &n_merged) const + void merge(const std::string& topoName, + conduit::Node& n_cleanOutput, + conduit::Node& n_mirOutput, + conduit::Node& n_merged) const { AXOM_ANNOTATE_SCOPE("merge"); namespace utils = axom::bump::utilities; // Make node map and slice info for merging. axom::Array nodeMap, nodeSlice; - conduit::Node &n_mir_fields = n_mirOutput["fields"]; + conduit::Node& n_mir_fields = n_mirOutput["fields"]; createNodeMapAndSlice(n_mir_fields, nodeMap, nodeSlice); // Create a MergeMeshesAndMatsets type that will operate on the material @@ -406,9 +406,9 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * of which nodes are original nodes in the output. Blended nodes may not have good values * but there is a mask field that can identify those nodes. */ - void addOriginal(conduit::Node &n_field, - const std::string &topoName, - const std::string &association, + void addOriginal(conduit::Node& n_field, + const std::string& topoName, + const std::string& association, axom::IndexType nvalues) const { AXOM_ANNOTATE_SCOPE("addOriginal"); @@ -440,11 +440,11 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * * \return The number of nodes in the clean mesh output. */ - void makeCleanZones(const conduit::Node &n_root, - const std::string &topoName, - const conduit::Node &n_options, - const axom::ArrayView &cleanZones, - conduit::Node &n_cleanOutput) const + void makeCleanZones(const conduit::Node& n_root, + const std::string& topoName, + const conduit::Node& n_options, + const axom::ArrayView& cleanZones, + conduit::Node& n_cleanOutput) const { AXOM_ANNOTATE_SCOPE("makeCleanZones"); namespace utils = axom::bump::utilities; @@ -460,7 +460,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm n_ezopts["originalElementsField"] = axom::bump::Options(n_options).originalElementsField(); // Forward some options involved in naming the objects. const std::vector keys {"topologyName", "coordsetName", "matsetName"}; - for(const auto &key : keys) + for(const auto& key : keys) { if(n_options.has_path(key)) { @@ -484,9 +484,9 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[out] nodeMap An array used to map node ids from the MIR output to their node ids in the merged mesh. * \param[out] nodeSlice An array that identifies new blended node ids in the MIR output so they can be appended into coordsets and fields during merge. */ - void createNodeMapAndSlice(conduit::Node &n_newFields, - axom::Array &nodeMap, - axom::Array &nodeSlice) const + void createNodeMapAndSlice(conduit::Node& n_newFields, + axom::Array& nodeMap, + axom::Array& nodeSlice) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("createNodeMapAndSlice"); @@ -496,12 +496,12 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm const axom::IndexType numCleanNodes = m_coordsetView.numberOfNodes(); // These are the original node ids. - const conduit::Node &n_output_orig_nodes = n_newFields[originalNodesFieldName() + "/values"]; + const conduit::Node& n_output_orig_nodes = n_newFields[originalNodesFieldName() + "/values"]; auto numOutputNodes = n_output_orig_nodes.dtype().number_of_elements(); auto outputOrigNodesView = utils::make_array_view(n_output_orig_nodes); // __equiz_new_nodes is the int mask field that identifies new nodes created from blending. - const conduit::Node &n_new_nodes_values = n_newFields[newNodesFieldName() + "/values"]; + const conduit::Node& n_new_nodes_values = n_newFields[newNodesFieldName() + "/values"]; const auto maskView = utils::make_array_view(n_new_nodes_values); // Count new nodes created from blending. @@ -566,15 +566,15 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[out] n_newMatset A Conduit node that will contain the new matset. * */ - void processMixedZones(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_matset, - conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) const + void processMixedZones(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_matset, + conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) const { AXOM_ANNOTATE_SCOPE("processMixedZones"); namespace views = axom::bump::views; @@ -582,9 +582,9 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm // Make some nodes that will contain the inputs to subsequent iterations. // Store them under a single node so the nodes will have names. conduit::Node n_Input; - conduit::Node &n_InputTopo = n_Input[localPath(n_topo)]; - conduit::Node &n_InputCoordset = n_Input[localPath(n_coordset)]; - conduit::Node &n_InputFields = n_Input[localPath(n_fields)]; + conduit::Node& n_InputTopo = n_Input[localPath(n_topo)]; + conduit::Node& n_InputCoordset = n_Input[localPath(n_coordset)]; + conduit::Node& n_InputFields = n_Input[localPath(n_fields)]; // Get the materials from the matset and determine which of them are clean/mixed. axom::bump::views::MaterialInformation allMats, cleanMats, mixedMats; @@ -598,7 +598,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm n_InputFields.reset(); for(conduit::index_t i = 0; i < n_fields.number_of_children(); i++) { - const conduit::Node &n_field = n_fields[i]; + const conduit::Node& n_field = n_fields[i]; if(n_field["topology"].as_string() == n_newTopo.name()) { n_InputFields[n_fields[i].name()].set_external(n_fields[i]); @@ -666,7 +666,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm views::typed_dispatch_unstructured_topology::selected_shapes()>( n_InputTopo, - [&](const auto &AXOM_UNUSED_PARAM(shape), auto topologyView) { + [&](const auto& AXOM_UNUSED_PARAM(shape), auto topologyView) { // Do the next iteration (uses new topologyView type). iteration(i, topologyView, @@ -694,7 +694,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm // Cleanup. { AXOM_ANNOTATE_SCOPE("cleanup"); - for(const auto &mat : allMats) + for(const auto& mat : allMats) { const std::string nodalMatName(nodalFieldName(mat.m_number)); if(n_newFields.has_child(nodalMatName)) @@ -735,10 +735,10 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[out] cleanMats A vector of the clean materials. * \param[out] mixedMats A vector of the mixed materials. */ - void classifyMaterials(const conduit::Node &n_matset, - axom::bump::views::MaterialInformation &allMats, - axom::bump::views::MaterialInformation &cleanMats, - axom::bump::views::MaterialInformation &mixedMats) const + void classifyMaterials(const conduit::Node& n_matset, + axom::bump::views::MaterialInformation& allMats, + axom::bump::views::MaterialInformation& cleanMats, + axom::bump::views::MaterialInformation& mixedMats) const { AXOM_ANNOTATE_SCOPE("classifyMaterials"); @@ -802,10 +802,10 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[inout] A Conduit node where the new fields will be added. * \param mixedMats A vector of mixed materials. */ - void makeNodeCenteredVFs(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - conduit::Node &n_fields, - const axom::bump::views::MaterialInformation &mixedMats) const + void makeNodeCenteredVFs(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + conduit::Node& n_fields, + const axom::bump::views::MaterialInformation& mixedMats) const { AXOM_ANNOTATE_SCOPE("makeNodeCenteredVFs"); @@ -830,11 +830,11 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm const auto nnodes = m_coordsetView.numberOfNodes(); { AXOM_ANNOTATE_SCOPE("zonal"); - for(const auto &mat : mixedMats) + for(const auto& mat : mixedMats) { const int matNumber = mat.m_number; const std::string zonalName = zonalFieldName(matNumber); - conduit::Node &n_zonalField = n_fields[zonalName]; + conduit::Node& n_zonalField = n_fields[zonalName]; n_zonalField["topology"] = n_topo.name(); n_zonalField["association"] = "element"; n_zonalField["values"].set_allocator(conduitAllocatorID); @@ -855,15 +855,15 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm { AXOM_ANNOTATE_SCOPE("recenter"); - for(const auto &mat : mixedMats) + for(const auto& mat : mixedMats) { const int matNumber = mat.m_number; const std::string zonalName = zonalFieldName(matNumber); - conduit::Node &n_zonalField = n_fields[zonalName]; + conduit::Node& n_zonalField = n_fields[zonalName]; // Make a nodal field for the current material by recentering. const std::string nodalName = nodalFieldName(matNumber); - conduit::Node &n_nodalField = n_fields[nodalName]; + conduit::Node& n_nodalField = n_fields[nodalName]; n_nodalField["topology"] = n_topo.name(); n_nodalField["association"] = "vertex"; n_nodalField["values"].set_allocator(conduitAllocatorID); @@ -889,10 +889,10 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param cleanMats A vector of clean materials. * \param mixedMats A vector of mixed materials. */ - void makeWorkingFields(const conduit::Node &n_topo, - conduit::Node &n_fields, - const axom::bump::views::MaterialInformation &cleanMats, - const axom::bump::views::MaterialInformation &AXOM_UNUSED_PARAM(mixedMats)) const + void makeWorkingFields(const conduit::Node& n_topo, + conduit::Node& n_fields, + const axom::bump::views::MaterialInformation& cleanMats, + const axom::bump::views::MaterialInformation& AXOM_UNUSED_PARAM(mixedMats)) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("makeWorkingFields"); @@ -904,7 +904,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm const auto nzones = m_topologyView.numberOfZones(); // Make the zonal id field. - conduit::Node &n_zonalIDField = n_fields[zonalMaterialIDName()]; + conduit::Node& n_zonalIDField = n_fields[zonalMaterialIDName()]; n_zonalIDField["topology"] = n_topo.name(); n_zonalIDField["association"] = "element"; n_zonalIDField["values"].set_allocator(conduitAllocatorID); @@ -919,7 +919,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm // Fill in the clean zones. using FloatType = typename MatsetView::FloatType; MatsetView deviceMatsetView(m_matsetView); - for(const auto &mat : cleanMats) + for(const auto& mat : cleanMats) { const int matNumber = mat.m_number; axom::for_all( @@ -958,21 +958,21 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm */ template void iteration(int iter, - const ITopologyView &topoView, - const ICoordsetView &coordsetView, + const ITopologyView& topoView, + const ICoordsetView& coordsetView, - const axom::bump::views::MaterialInformation &allMats, - const axom::bump::views::Material ¤tMat, + const axom::bump::views::MaterialInformation& allMats, + const axom::bump::views::Material& currentMat, - const conduit::Node &n_topo, - const conduit::Node &n_coordset, - conduit::Node &n_fields, + const conduit::Node& n_topo, + const conduit::Node& n_coordset, + conduit::Node& n_fields, - const conduit::Node &n_options, + const conduit::Node& n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields) const + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields) const { namespace utils = axom::bump::utilities; namespace bpmeshutils = conduit::blueprint::mesh::utils; @@ -1116,7 +1116,7 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm const auto nzonesNew = colorView.size(); // Get zonalMaterialID field so we can make adjustments. - conduit::Node &n_zonalMaterialID = + conduit::Node& n_zonalMaterialID = n_newFields.fetch_existing(zonalMaterialIDName() + "/values"); auto zonalMaterialID = utils::make_array_view(n_zonalMaterialID); const int currentMatNumber = currentMat.m_number; @@ -1162,15 +1162,15 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm * \param[inout] n_newFields The Conduit node that contains the fields for the MIR output. * \param[out] n_newMatset The node that contains the new matset. */ - void buildNewMatset(const conduit::Node &n_matset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) const + void buildNewMatset(const conduit::Node& n_matset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) const { namespace utils = axom::bump::utilities; AXOM_ANNOTATE_SCOPE("buildNewMatset"); // Get the zonalMaterialID field that has our new material ids. - conduit::Node &n_zonalMaterialID = n_newFields[zonalMaterialIDName() + "/values"]; + conduit::Node& n_zonalMaterialID = n_newFields[zonalMaterialIDName() + "/values"]; auto zonalMaterialID = utils::make_array_view(n_zonalMaterialID); const auto nzones = n_zonalMaterialID.dtype().number_of_elements(); @@ -1185,11 +1185,11 @@ class EquiZAlgorithm : public axom::mir::MIRAlgorithm } // Make new nodes in the matset. - conduit::Node &n_material_ids = n_newMatset["material_ids"]; - conduit::Node &n_volume_fractions = n_newMatset["volume_fractions"]; - conduit::Node &n_sizes = n_newMatset["sizes"]; - conduit::Node &n_offsets = n_newMatset["offsets"]; - conduit::Node &n_indices = n_newMatset["indices"]; + conduit::Node& n_material_ids = n_newMatset["material_ids"]; + conduit::Node& n_volume_fractions = n_newMatset["volume_fractions"]; + conduit::Node& n_sizes = n_newMatset["sizes"]; + conduit::Node& n_offsets = n_newMatset["offsets"]; + conduit::Node& n_indices = n_newMatset["indices"]; const auto conduitAllocatorID = axom::sidre::ConduitMemory::axomAllocIdToConduit(getAllocatorID()); diff --git a/src/axom/mir/MIRAlgorithm.cpp b/src/axom/mir/MIRAlgorithm.cpp index 281f688149..340ecda78a 100644 --- a/src/axom/mir/MIRAlgorithm.cpp +++ b/src/axom/mir/MIRAlgorithm.cpp @@ -18,9 +18,9 @@ namespace axom { namespace mir { -void MIRAlgorithm::execute(const conduit::Node &n_input, - const conduit::Node &n_options, - conduit::Node &n_output) +void MIRAlgorithm::execute(const conduit::Node& n_input, + const conduit::Node& n_options, + conduit::Node& n_output) { const auto domains = conduit::blueprint::mesh::domains(n_input); if(domains.size() > 1) @@ -30,14 +30,14 @@ void MIRAlgorithm::execute(const conduit::Node &n_input, else if(domains.size() > 0) { // Handle single domain - const conduit::Node &n_domain = *domains[0]; + const conduit::Node& n_domain = *domains[0]; executeSetup(n_domain, n_options, n_output); } } -void MIRAlgorithm::executeSetup(const conduit::Node &n_domain, - const conduit::Node &n_options, - conduit::Node &n_newDomain) +void MIRAlgorithm::executeSetup(const conduit::Node& n_domain, + const conduit::Node& n_options, + conduit::Node& n_newDomain) { axom::bump::Options options(n_options); @@ -45,14 +45,14 @@ void MIRAlgorithm::executeSetup(const conduit::Node &n_domain, const std::string matset = options.matset(); // Which topology is that matset defined on? - const conduit::Node &n_matsets = n_domain.fetch_existing("matsets"); - const conduit::Node &n_matset = n_matsets.fetch_existing(matset); - const conduit::Node *n_topo = + const conduit::Node& n_matsets = n_domain.fetch_existing("matsets"); + const conduit::Node& n_matset = n_matsets.fetch_existing(matset); + const conduit::Node* n_topo = conduit::blueprint::mesh::utils::find_reference_node(n_matset, "topology"); SLIC_ASSERT(n_topo != nullptr); // Which coordset is used by that topology? - const conduit::Node *n_coordset = + const conduit::Node* n_coordset = conduit::blueprint::mesh::utils::find_reference_node(*n_topo, "coordset"); SLIC_ASSERT(n_coordset != nullptr); @@ -62,12 +62,12 @@ void MIRAlgorithm::executeSetup(const conduit::Node &n_domain, const std::string newMatsetName = options.matsetName(matset); // Make some new nodes in the output. - conduit::Node &newCoordset = n_newDomain["coordsets/" + newCoordsetName]; - conduit::Node &newTopo = n_newDomain["topologies/" + newTopoName]; + conduit::Node& newCoordset = n_newDomain["coordsets/" + newCoordsetName]; + conduit::Node& newTopo = n_newDomain["topologies/" + newTopoName]; newTopo["coordset"] = newCoordsetName; - conduit::Node &newMatset = n_newDomain["matsets/" + newMatsetName]; + conduit::Node& newMatset = n_newDomain["matsets/" + newMatsetName]; newMatset["topology"] = newTopoName; - conduit::Node &newFields = n_newDomain["fields"]; + conduit::Node& newFields = n_newDomain["fields"]; // Execute the algorithm on the domain. if(n_domain.has_path("state")) @@ -100,7 +100,7 @@ void MIRAlgorithm::executeSetup(const conduit::Node &n_domain, { // There are no input fields, but make sure n_fields has a name. conduit::Node tmp; - conduit::Node &n_fields = tmp["fields"]; + conduit::Node& n_fields = tmp["fields"]; executeDomain(*n_topo, *n_coordset, n_fields, @@ -123,16 +123,16 @@ void MIRAlgorithm::executeSetup(const conduit::Node &n_domain, } } -void MIRAlgorithm::updateNames(const std::string &origTopoName, - const std::string &newTopoName, - const std::string &origCoordsetName, - const std::string &newCoordsetName, - const std::string &AXOM_UNUSED_PARAM(origMatsetName), - const std::string &AXOM_UNUSED_PARAM(newMatsetName), - conduit::Node &n_newTopo, - conduit::Node &AXOM_UNUSED_PARAM(n_newCoordset), - conduit::Node &n_newFields, - conduit::Node &n_newMatset) +void MIRAlgorithm::updateNames(const std::string& origTopoName, + const std::string& newTopoName, + const std::string& origCoordsetName, + const std::string& newCoordsetName, + const std::string& AXOM_UNUSED_PARAM(origMatsetName), + const std::string& AXOM_UNUSED_PARAM(newMatsetName), + conduit::Node& n_newTopo, + conduit::Node& AXOM_UNUSED_PARAM(n_newCoordset), + conduit::Node& n_newFields, + conduit::Node& n_newMatset) { // If the coordset was renamed in the output, make sure it the new topology references that new name. if(origCoordsetName != newCoordsetName) @@ -146,7 +146,7 @@ void MIRAlgorithm::updateNames(const std::string &origTopoName, for(conduit::index_t i = 0; i < n_newFields.number_of_children(); i++) { - conduit::Node &n_field = n_newFields[i]; + conduit::Node& n_field = n_newFields[i]; if(n_field["topology"].as_string() == origTopoName) { n_field["topology"] = newTopoName; @@ -155,13 +155,13 @@ void MIRAlgorithm::updateNames(const std::string &origTopoName, } } -void MIRAlgorithm::copyState(const conduit::Node &srcState, conduit::Node &destState) const +void MIRAlgorithm::copyState(const conduit::Node& srcState, conduit::Node& destState) const { for(conduit::index_t i = 0; i < srcState.number_of_children(); i++) destState[srcState[i].name()].set(srcState[i]); } -void MIRAlgorithm::printNode(const conduit::Node &n) const +void MIRAlgorithm::printNode(const conduit::Node& n) const { conduit::Node options; options["num_children_threshold"] = 10000; @@ -173,7 +173,7 @@ void MIRAlgorithm::printNode(const conduit::Node &n) const n_host.to_summary_string_stream(std::cout, options); } -void MIRAlgorithm::saveMesh(const conduit::Node &n_mesh, const std::string &filebase) const +void MIRAlgorithm::saveMesh(const conduit::Node& n_mesh, const std::string& filebase) const { // Make sure data are on host. conduit::Node n_mesh_host; @@ -192,7 +192,7 @@ void MIRAlgorithm::saveMesh(const conduit::Node &n_mesh, const std::string &file #endif } -std::string MIRAlgorithm::localPath(const conduit::Node &obj) const +std::string MIRAlgorithm::localPath(const conduit::Node& obj) const { std::string path(obj.path()); const auto dpos = path.find("domain"); diff --git a/src/axom/mir/MIRAlgorithm.hpp b/src/axom/mir/MIRAlgorithm.hpp index 4a50579eaa..5f0a52b55d 100644 --- a/src/axom/mir/MIRAlgorithm.hpp +++ b/src/axom/mir/MIRAlgorithm.hpp @@ -59,9 +59,9 @@ class MIRAlgorithm \param[out] n_output A node that will contain the new entities. */ - virtual void execute(const conduit::Node &n_input, - const conduit::Node &n_options, - conduit::Node &n_output); + virtual void execute(const conduit::Node& n_input, + const conduit::Node& n_options, + conduit::Node& n_output); protected: /*! @@ -71,9 +71,9 @@ class MIRAlgorithm * \param n_options The MIR options. * \param n_newDomain The output domain. */ - void executeSetup(const conduit::Node &n_domain, - const conduit::Node &n_options, - conduit::Node &n_newDomain); + void executeSetup(const conduit::Node& n_domain, + const conduit::Node& n_options, + conduit::Node& n_newDomain); /*! * \brief Perform material interface reconstruction on a single domain. Derived classes @@ -91,15 +91,15 @@ class MIRAlgorithm * \param[out] n_newMatset A Conduit node that will contain the new matset. * */ - virtual void executeDomain(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_matset, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset) = 0; + virtual void executeDomain(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_matset, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset) = 0; /*! * \brief Update names in some of the objects when we can tell they have been renamed. @@ -117,23 +117,23 @@ class MIRAlgorithm * * \note This method is used internally mainly when MIR copies the input mesh to the output when MIR is no-op. */ - void updateNames(const std::string &origTopoName, - const std::string &newTopoName, - const std::string &origCoordsetName, - const std::string &newCoordsetName, - const std::string &origMatsetName, - const std::string &newMatsetName, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields, - conduit::Node &n_newMatset); + void updateNames(const std::string& origTopoName, + const std::string& newTopoName, + const std::string& origCoordsetName, + const std::string& newCoordsetName, + const std::string& origMatsetName, + const std::string& newMatsetName, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields, + conduit::Node& n_newMatset); /*! * \brief Copy state from the src domain to the destination domain. * \param srcState The node that contains the state in the source domain. * \param destState The node that contains the state in the destination domain. */ - void copyState(const conduit::Node &srcState, conduit::Node &destState) const; + void copyState(const conduit::Node& srcState, conduit::Node& destState) const; /*! * \brief This is a utility method for printing a Conduit node with large limits @@ -141,7 +141,7 @@ class MIRAlgorithm * * \param n The Conduit node to print. */ - void printNode(const conduit::Node &n) const; + void printNode(const conduit::Node& n) const; /*! * \brief Save a Blueprint mesh to disk (YAML and HDF5, if available). @@ -149,7 +149,7 @@ class MIRAlgorithm * \param n_mesh The mesh to save. * \param filebase The base filename to use when writing files. Extensions may be added. */ - void saveMesh(const conduit::Node &n_mesh, const std::string &filebase) const; + void saveMesh(const conduit::Node& n_mesh, const std::string& filebase) const; /*! * \brief Return the local path name, stripping off a domain path prefix. Blueprint domains @@ -160,7 +160,7 @@ class MIRAlgorithm * * \return The path without the domain prefix. */ - std::string localPath(const conduit::Node &obj) const; + std::string localPath(const conduit::Node& obj) const; }; } // end namespace mir diff --git a/src/axom/mir/detail/elvira_detail.hpp b/src/axom/mir/detail/elvira_detail.hpp index 21535f385b..daf6f8b974 100644 --- a/src/axom/mir/detail/elvira_detail.hpp +++ b/src/axom/mir/detail/elvira_detail.hpp @@ -37,7 +37,7 @@ class ELVIRAOptions : public axom::bump::Options * * \param options The node that contains the clipping options. */ - ELVIRAOptions(const conduit::Node &options) : axom::bump::Options(options) { } + ELVIRAOptions(const conduit::Node& options) : axom::bump::Options(options) { } /** * \brief Get whether the plane equation fields should appear in the output. @@ -83,8 +83,8 @@ struct clip_precision * make a clipping plane for the shape. */ template -AXOM_HOST_DEVICE inline void computeRange(const ShapeType &shape, - const axom::primal::Vector &normal, +AXOM_HOST_DEVICE inline void computeRange(const ShapeType& shape, + const axom::primal::Vector& normal, axom::primal::Point range[2]) { // Compute the shape bounding box. @@ -126,13 +126,13 @@ AXOM_HOST_DEVICE inline void computeRange(const ShapeType &shape, * \param[out] pt The origin of the clipping plane that was used. */ template -AXOM_HOST_DEVICE inline ClipResultType clipToVolume(const ShapeType &shape, - const axom::primal::Vector &normal, +AXOM_HOST_DEVICE inline ClipResultType clipToVolume(const ShapeType& shape, + const axom::primal::Vector& normal, const axom::primal::Point _range[2], double matVolume, int max_iterations, double tolerance, - axom::primal::Point &pt) + axom::primal::Point& pt) { namespace utils = axom::bump::utilities; // The range for the interval @@ -261,11 +261,11 @@ class TopologyBuilder::allocatorID()) { namespace utils = axom::bump::utilities; @@ -298,7 +298,7 @@ class TopologyBuilder::id, numCoordValues)); m_view.m_connectivity = utils::make_array_view(n_conn); @@ -317,32 +317,32 @@ class TopologyBuilder::id, numFragments)); m_view.m_sizes = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_topology["elements/offsets"]; + conduit::Node& n_offsets = n_topology["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_offsets = utils::make_array_view(n_offsets); // Make new fields. - conduit::Node &n_origElem = n_fields[originalElementsField]; + conduit::Node& n_origElem = n_fields[originalElementsField]; n_origElem["topology"] = n_topology.name(); n_origElem["association"] = "element"; - conduit::Node &n_orig_elem_values = n_origElem["values"]; + conduit::Node& n_orig_elem_values = n_origElem["values"]; n_orig_elem_values.set_allocator(conduitAllocatorId); n_orig_elem_values.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_original_zones = utils::make_array_view(n_orig_elem_values); if(m_view.m_makePlane) { - conduit::Node &n_normal = n_fields["normal"]; + conduit::Node& n_normal = n_fields["normal"]; n_normal["topology"] = n_topology.name(); n_normal["association"] = "element"; - conduit::Node &n_x = n_normal["values/x"]; - conduit::Node &n_y = n_normal["values/y"]; + conduit::Node& n_x = n_normal["values/x"]; + conduit::Node& n_y = n_normal["values/y"]; n_x.set_allocator(conduitAllocatorId); n_x.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_norm_x = utils::make_array_view(n_x); @@ -350,10 +350,10 @@ class TopologyBuilder::id, numFragments)); m_view.m_norm_y = utils::make_array_view(n_y); - conduit::Node &n_planeOffset = n_fields["offset"]; + conduit::Node& n_planeOffset = n_fields["offset"]; n_planeOffset["topology"] = n_topology.name(); n_planeOffset["association"] = "element"; - conduit::Node &n_values = n_planeOffset["values"]; + conduit::Node& n_values = n_planeOffset["values"]; n_values.set_allocator(conduitAllocatorId); n_values.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_plane_offset = utils::make_array_view(n_values); @@ -361,22 +361,22 @@ class TopologyBuilder::id, numFragments)); m_view.m_volume_fractions = utils::make_array_view(n_volume_fractions); - conduit::Node &n_material_ids = n_matset["material_ids"]; + conduit::Node& n_material_ids = n_matset["material_ids"]; n_material_ids.set_allocator(conduitAllocatorId); n_material_ids.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_material_ids = utils::make_array_view(n_material_ids); - conduit::Node &n_indices = n_matset["indices"]; + conduit::Node& n_indices = n_matset["indices"]; n_indices.set_allocator(conduitAllocatorId); n_indices.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_mat_indices = utils::make_array_view(n_indices); - conduit::Node &n_mat_sizes = n_matset["sizes"]; + conduit::Node& n_mat_sizes = n_matset["sizes"]; n_mat_sizes.set_allocator(conduitAllocatorId); n_mat_sizes.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_mat_sizes = utils::make_array_view(n_mat_sizes); @@ -387,7 +387,7 @@ class TopologyBuilder::id, numFragments)); m_view.m_mat_offsets = utils::make_array_view(n_mat_offsets); @@ -412,11 +412,11 @@ class TopologyBuilder &AXOM_UNUSED_PARAM(selectedIds)) const + conduit::Node& AXOM_UNUSED_PARAM(n_topology), + axom::Array& AXOM_UNUSED_PARAM(selectedIds)) const { } private: @@ -557,11 +557,11 @@ class TopologyBuilder::allocatorID()) { namespace utils = axom::bump::utilities; @@ -616,7 +616,7 @@ class TopologyBuilder::id, numConnValues)); m_view.m_connectivity = utils::make_array_view(n_conn); @@ -626,12 +626,12 @@ class TopologyBuilder::id, numFragments)); m_view.m_sizes = utils::make_array_view(n_sizes); - conduit::Node &n_offsets = n_topology["elements/offsets"]; + conduit::Node& n_offsets = n_topology["elements/offsets"]; n_offsets.set_allocator(conduitAllocatorId); n_offsets.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_offsets = utils::make_array_view(n_offsets); @@ -641,7 +641,7 @@ class TopologyBuilder::id, seConnSize)); @@ -652,13 +652,13 @@ class TopologyBuilder::id, numFragments * m_view.m_maxFacesPerFragment)); m_view.m_subelement_sizes = utils::make_array_view(n_se_sizes); - conduit::Node &n_se_offsets = n_topology["subelements/offsets"]; + conduit::Node& n_se_offsets = n_topology["subelements/offsets"]; n_se_offsets.set_allocator(conduitAllocatorId); n_se_offsets.set(conduit::DataType(utils::cpp2conduit::id, numFragments * m_view.m_maxFacesPerFragment)); @@ -677,22 +677,22 @@ class TopologyBuilder::id, numFragments)); m_view.m_original_zones = utils::make_array_view(n_orig_elem_values); if(m_view.m_makePlane) { - conduit::Node &n_normal = n_fields["normal"]; + conduit::Node& n_normal = n_fields["normal"]; n_normal["topology"] = n_topology.name(); n_normal["association"] = "element"; - conduit::Node &n_x = n_normal["values/x"]; - conduit::Node &n_y = n_normal["values/y"]; - conduit::Node &n_z = n_normal["values/z"]; + conduit::Node& n_x = n_normal["values/x"]; + conduit::Node& n_y = n_normal["values/y"]; + conduit::Node& n_z = n_normal["values/z"]; n_x.set_allocator(conduitAllocatorId); n_x.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_norm_x = utils::make_array_view(n_x); @@ -703,10 +703,10 @@ class TopologyBuilder::id, numFragments)); m_view.m_norm_z = utils::make_array_view(n_z); - conduit::Node &n_planeOffset = n_fields["offset"]; + conduit::Node& n_planeOffset = n_fields["offset"]; n_planeOffset["topology"] = n_topology.name(); n_planeOffset["association"] = "element"; - conduit::Node &n_values = n_planeOffset["values"]; + conduit::Node& n_values = n_planeOffset["values"]; n_values.set_allocator(conduitAllocatorId); n_values.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_plane_offset = utils::make_array_view(n_values); @@ -714,22 +714,22 @@ class TopologyBuilder::id, numFragments)); m_view.m_volume_fractions = utils::make_array_view(n_volume_fractions); - conduit::Node &n_material_ids = n_matset["material_ids"]; + conduit::Node& n_material_ids = n_matset["material_ids"]; n_material_ids.set_allocator(conduitAllocatorId); n_material_ids.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_material_ids = utils::make_array_view(n_material_ids); - conduit::Node &n_indices = n_matset["indices"]; + conduit::Node& n_indices = n_matset["indices"]; n_indices.set_allocator(conduitAllocatorId); n_indices.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_mat_indices = utils::make_array_view(n_indices); - conduit::Node &n_mat_sizes = n_matset["sizes"]; + conduit::Node& n_mat_sizes = n_matset["sizes"]; n_mat_sizes.set_allocator(conduitAllocatorId); n_mat_sizes.set(conduit::DataType(utils::cpp2conduit::id, numFragments)); m_view.m_mat_sizes = utils::make_array_view(n_mat_sizes); @@ -740,7 +740,7 @@ class TopologyBuilder::id, numFragments)); m_view.m_mat_offsets = utils::make_array_view(n_mat_offsets); @@ -765,11 +765,11 @@ class TopologyBuilder &selectedIds) const + conduit::Node& n_topology, + axom::Array& selectedIds) const { AXOM_ANNOTATE_SCOPE("cleanMesh"); @@ -969,9 +969,9 @@ class TopologyBuilder(n_se_conn); const auto se_sizes = utils::make_array_view(n_se_sizes); @@ -1023,13 +1023,13 @@ struct MakeCleanZones * \param[out] n_cleanOutput The node that will contain the new mesh. * \param allocator_id The allocator to use. */ - static void execute(const axom::ArrayView &cleanZones, - const conduit::Node &n_mesh, - const conduit::Node &n_options, - const TopologyView &topologyView, - const CoordsetView &coordsetView, - const MatsetView &matsetView, - conduit::Node &n_cleanOutput, + static void execute(const axom::ArrayView& cleanZones, + const conduit::Node& n_mesh, + const conduit::Node& n_options, + const TopologyView& topologyView, + const CoordsetView& coordsetView, + const MatsetView& matsetView, + conduit::Node& n_cleanOutput, int allocator_id) { // Make the clean mesh. @@ -1068,13 +1068,13 @@ struct MakeCleanZones * \param[out] n_cleanOutput The node that will contain the new mesh. * \param allocator_id The allocator to use. */ - static void execute(const axom::ArrayView &cleanZones, - const conduit::Node &n_mesh, - const conduit::Node &n_options, - const TopologyView &topologyView, - const CoordsetView &coordsetView, - const MatsetView &matsetView, - conduit::Node &n_cleanOutput, + static void execute(const axom::ArrayView& cleanZones, + const conduit::Node& n_mesh, + const conduit::Node& n_options, + const TopologyView& topologyView, + const CoordsetView& coordsetView, + const MatsetView& matsetView, + conduit::Node& n_cleanOutput, int allocator_id) { using IndexingPolicy = typename TopologyView::IndexingPolicy; diff --git a/src/axom/mir/detail/elvira_impl.hpp b/src/axom/mir/detail/elvira_impl.hpp index bb9767aab3..a4b0b4a766 100644 --- a/src/axom/mir/detail/elvira_impl.hpp +++ b/src/axom/mir/detail/elvira_impl.hpp @@ -106,9 +106,9 @@ inline AXOM_HOST_DEVICE Difference reverseDifference(Difference value) * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void elvira2d(Result2D &result, - const FloatType *vf, - const int *ivf, +AXOM_HOST_DEVICE void elvira2d(Result2D& result, + const FloatType* vf, + const int* ivf, Direction direction) { const FloatType jb = vf[ivf[0]] + vf[ivf[1]] + vf[ivf[2]]; // bottom row @@ -173,9 +173,9 @@ AXOM_HOST_DEVICE void elvira2d(Result2D &result, * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE inline FloatType elvira_chisq(const FloatType *vf, - const FloatType *vfs, - const int *ivf, +AXOM_HOST_DEVICE inline FloatType elvira_chisq(const FloatType* vf, + const FloatType* vfs, + const int* ivf, int k) { FloatType chisq = 0.0; @@ -412,7 +412,7 @@ AXOM_HOST_DEVICE FloatType vf_1cube(FloatType d, FloatType n1, FloatType n2, Flo * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE FloatType cub4p(const FloatType *x, const FloatType *y) +AXOM_HOST_DEVICE FloatType cub4p(const FloatType* x, const FloatType* y) { FloatType dstar; FloatType e0 = 0.0, e1 = 0.0, e2 = 0.0, ep, em, ea, eb; @@ -773,7 +773,7 @@ AXOM_HOST_DEVICE FloatType d_3cube(const FloatType n[3], FloatType vf13) * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void vf_3cube(FloatType n[3], FloatType pd, FloatType *vfs, const int *ivf, int k) +AXOM_HOST_DEVICE void vf_3cube(FloatType n[3], FloatType pd, FloatType* vfs, const int* ivf, int k) { // Find node of lowest d // as 0 or 1 offset for each coord. @@ -812,7 +812,7 @@ AXOM_HOST_DEVICE void vf_3cube(FloatType n[3], FloatType pd, FloatType *vfs, con * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void elvira2xy(const FloatType *vf, FloatType n[3]) +AXOM_HOST_DEVICE void elvira2xy(const FloatType* vf, FloatType n[3]) { // These are indices into the volume fractions that pull out values in the XY plane. const int ivf[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; @@ -882,7 +882,7 @@ AXOM_HOST_DEVICE void elvira2xy(const FloatType *vf, FloatType n[3]) * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE FloatType det_variance(const FloatType *vf, const int *ivf) +AXOM_HOST_DEVICE FloatType det_variance(const FloatType* vf, const int* ivf) { /* "andfn" selects these zones from the ivf stencil. * *---*---*---* @@ -925,7 +925,7 @@ AXOM_HOST_DEVICE FloatType det_variance(const FloatType *vf, const int *ivf) * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void pick_elv(Result2D elv2d[2], const FloatType *vf) +AXOM_HOST_DEVICE void pick_elv(Result2D elv2d[2], const FloatType* vf) { const int ivf[19] = {1, 3, 4, 5, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25}; const int idiff[5] = {0, 0, 1, 2, 2}; @@ -1007,7 +1007,7 @@ AXOM_HOST_DEVICE void missvol1(FloatType c00, // Center column sum. FloatType v10, FloatType c01, FloatType v01, - FloatType &vma, + FloatType& vma, int is_far) { constexpr FloatType one6 = 1. / 6.; @@ -1367,7 +1367,7 @@ AXOM_HOST_DEVICE void correct1(Result2D elv2d[2], FloatType n2a[2][2]; for(int i = 0; i < 2; i++) { - const FloatType *n2 = elv2d[i].normal[differenceToInt(elv2d[i].difference_used)]; + const FloatType* n2 = elv2d[i].normal[differenceToInt(elv2d[i].difference_used)]; for(int k = 0; k < 2; k++) { n2a[i][k] = axom::utilities::abs(n2[k]); @@ -1414,7 +1414,7 @@ AXOM_HOST_DEVICE void correct1(Result2D elv2d[2], * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void elvira3d(const FloatType *vf, FloatType n[3]) +AXOM_HOST_DEVICE void elvira3d(const FloatType* vf, FloatType n[3]) { const int stencil2d[3][9] = {{1, 4, 7, 10, 13, 16, 19, 22, 25}, // yz {3, 12, 21, 4, 13, 22, 5, 14, 23}, // zx @@ -1468,7 +1468,7 @@ AXOM_HOST_DEVICE void elvira3d(const FloatType *vf, FloatType n[3]) * \note Adapted from code by Jeff Grandy */ template -AXOM_HOST_DEVICE void transform(FloatType *normal, const FloatType jac[3][3]) +AXOM_HOST_DEVICE void transform(FloatType* normal, const FloatType jac[3][3]) { SLIC_ASSERT(normal != nullptr); @@ -1523,9 +1523,9 @@ AXOM_HOST_DEVICE void transform(FloatType *normal, const FloatType jac[3][3]) * \note Adapted from code by Jeff Grandy. */ template -AXOM_HOST_DEVICE void computeJacobian(const FloatType *xcst, - const FloatType *ycst, - const FloatType *zcst, +AXOM_HOST_DEVICE void computeJacobian(const FloatType* xcst, + const FloatType* ycst, + const FloatType* zcst, int ndims, FloatType jac[3][3]) { @@ -1538,7 +1538,7 @@ AXOM_HOST_DEVICE void computeJacobian(const FloatType *xcst, const int idx_2D[6] = {3, 5, 1, 7, 4, 4}; const int idx_3D[6] = {12, 14, 10, 16, 4, 22}; - const int *idx = (ndims == 3) ? idx_3D : idx_2D; + const int* idx = (ndims == 3) ? idx_3D : idx_2D; /* * Note face convention : opposite face pairs (01), (23), (45) form @@ -1639,15 +1639,15 @@ struct elvira<2> */ AXOM_HOST_DEVICE static void execute(int matCount, - const double *fragmentVFStencilStart, - double *fragmentVectorsStart, + const double* fragmentVFStencilStart, + double* fragmentVectorsStart, int iskip) { constexpr int StencilSize = getStencilSize(NDIMS); constexpr int numVectorComponents = 3; - const double *vol_fracs = fragmentVFStencilStart; - double *normal = fragmentVectorsStart; + const double* vol_fracs = fragmentVFStencilStart; + double* normal = fragmentVectorsStart; for(int m = 0; m < matCount; m++) { @@ -1691,15 +1691,15 @@ struct elvira<3> */ AXOM_HOST_DEVICE static void execute(int matCount, - const double *fragmentVFStencilStart, - double *fragmentVectorsStart, + const double* fragmentVFStencilStart, + double* fragmentVectorsStart, int iskip) { constexpr int StencilSize = getStencilSize(NDIMS); constexpr int numVectorComponents = 3; - const double *vol_fracs = fragmentVFStencilStart; - double *normal = fragmentVectorsStart; + const double* vol_fracs = fragmentVFStencilStart; + double* normal = fragmentVectorsStart; for(int m = 0; m < matCount; m++) { diff --git a/src/axom/mir/detail/equiz_detail.hpp b/src/axom/mir/detail/equiz_detail.hpp index 0dbb05987d..c2af64964d 100644 --- a/src/axom/mir/detail/equiz_detail.hpp +++ b/src/axom/mir/detail/equiz_detail.hpp @@ -66,7 +66,7 @@ class MaterialIntersector */ AXOM_HOST_DEVICE axom::IndexType determineTableCase(axom::IndexType zoneIndex, - const ConnectivityView &nodeIdsView) const + const ConnectivityView& nodeIdsView) const { // Determine the matvf view index for the material that owns the zone. int backgroundIndex = INVALID_INDEX; @@ -152,19 +152,19 @@ class MaterialIntersector /// Helper initialization methods for the host. - void addMaterial(const MaterialVFView &matvf) { m_matvfViews.push_back(matvf); } + void addMaterial(const MaterialVFView& matvf) { m_matvfViews.push_back(matvf); } - void setMaterialNumbers(const axom::ArrayView &matNumbersView) + void setMaterialNumbers(const axom::ArrayView& matNumbersView) { m_matNumbersView = matNumbersView; } - void setMaterialIndices(const axom::ArrayView &matIndicesView) + void setMaterialIndices(const axom::ArrayView& matIndicesView) { m_matIndicesView = matIndicesView; } - void setZoneMaterialID(const axom::ArrayView &zoneMatsView) + void setZoneMaterialID(const axom::ArrayView& zoneMatsView) { m_zoneMatNumberView = zoneMatsView; } @@ -188,12 +188,12 @@ class MaterialIntersector * \param n_options The node that contains the options. * \param n_fields The node that contains fields. */ - void initialize(const TopologyView &AXOM_UNUSED_PARAM(topologyView), - const CoordsetView &AXOM_UNUSED_PARAM(coordsetView), - const conduit::Node &AXOM_UNUSED_PARAM(n_options), - const conduit::Node &AXOM_UNUSED_PARAM(n_topology), - const conduit::Node &AXOM_UNUSED_PARAM(n_coordset), - const conduit::Node &AXOM_UNUSED_PARAM(n_fields)) + void initialize(const TopologyView& AXOM_UNUSED_PARAM(topologyView), + const CoordsetView& AXOM_UNUSED_PARAM(coordsetView), + const conduit::Node& AXOM_UNUSED_PARAM(n_options), + const conduit::Node& AXOM_UNUSED_PARAM(n_topology), + const conduit::Node& AXOM_UNUSED_PARAM(n_coordset), + const conduit::Node& AXOM_UNUSED_PARAM(n_fields)) { } /*! @@ -202,27 +202,27 @@ class MaterialIntersector * \param n_options The options. * \return The name of the toplogy on which to operate. */ - std::string getTopologyName(const conduit::Node &AXOM_UNUSED_PARAM(n_input), - const conduit::Node &n_options) const + std::string getTopologyName(const conduit::Node& AXOM_UNUSED_PARAM(n_input), + const conduit::Node& n_options) const { return n_options["topology"].as_string(); } /// Set various attributes. - void addMaterial(const MaterialVFView &matvf) { m_view.addMaterial(matvf); } + void addMaterial(const MaterialVFView& matvf) { m_view.addMaterial(matvf); } - void setMaterialNumbers(const axom::ArrayView &matNumbers) + void setMaterialNumbers(const axom::ArrayView& matNumbers) { m_view.setMaterialNumbers(matNumbers); } - void setMaterialIndices(const axom::ArrayView &matIndices) + void setMaterialIndices(const axom::ArrayView& matIndices) { m_view.setMaterialIndices(matIndices); } - void setZoneMaterialID(const axom::ArrayView &zoneMatsView) + void setZoneMaterialID(const axom::ArrayView& zoneMatsView) { m_view.setZoneMaterialID(zoneMatsView); } diff --git a/src/axom/mir/examples/concentric_circles/MIRApplication.cpp b/src/axom/mir/examples/concentric_circles/MIRApplication.cpp index 8f89c15b03..2631d278d2 100644 --- a/src/axom/mir/examples/concentric_circles/MIRApplication.cpp +++ b/src/axom/mir/examples/concentric_circles/MIRApplication.cpp @@ -34,7 +34,7 @@ MIRApplication::MIRApplication() { } //-------------------------------------------------------------------------------- -int MIRApplication::initialize(int argc, char **argv) +int MIRApplication::initialize(int argc, char** argv) { axom::CLI::App app; app.add_flag("--handler", handler) @@ -90,12 +90,12 @@ int MIRApplication::initialize(int argc, char **argv) app.parse(argc, argv); writeFiles = !disable_write; } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << app.help() << std::endl; retval = -1; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; @@ -122,12 +122,12 @@ int MIRApplication::execute() { retval = runMIR(); } - catch(std::invalid_argument const &e) + catch(std::invalid_argument const& e) { SLIC_WARNING("Bad input. " << e.what()); retval = -2; } - catch(std::out_of_range const &e) + catch(std::out_of_range const& e) { SLIC_WARNING("Integer overflow. " << e.what()); retval = -3; @@ -136,7 +136,7 @@ int MIRApplication::execute() } //-------------------------------------------------------------------------------- -bool MIRApplication::requiresStructuredMesh(const std::string &method) const +bool MIRApplication::requiresStructuredMesh(const std::string& method) const { return method == "elvira"; } @@ -244,10 +244,10 @@ size_t MIRApplication::estimateMemoryPoolSize() const } //-------------------------------------------------------------------------------- -void MIRApplication::adjustMesh(conduit::Node &) { } +void MIRApplication::adjustMesh(conduit::Node&) { } //-------------------------------------------------------------------------------- -void MIRApplication::saveMesh(const conduit::Node &n_mesh, const std::string &path) +void MIRApplication::saveMesh(const conduit::Node& n_mesh, const std::string& path) { #if defined(CONDUIT_RELAY_IO_HDF5_ENABLED) std::string protocol("hdf5"); @@ -258,7 +258,7 @@ void MIRApplication::saveMesh(const conduit::Node &n_mesh, const std::string &pa } //-------------------------------------------------------------------------------- -void MIRApplication::conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) +void MIRApplication::conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { SLIC_ERROR(axom::fmt::format("Error from Conduit: s1={}, s2={}, i1={}", s1, s2, i1)); // This is on purpose. diff --git a/src/axom/mir/examples/concentric_circles/MIRApplication.hpp b/src/axom/mir/examples/concentric_circles/MIRApplication.hpp index c88c34a9ee..2fb78b4bfe 100644 --- a/src/axom/mir/examples/concentric_circles/MIRApplication.hpp +++ b/src/axom/mir/examples/concentric_circles/MIRApplication.hpp @@ -26,7 +26,7 @@ class MIRApplication * \brief Initialize the application from command line args. * \return 0 on success; less than zero otherwise. */ - int initialize(int argc, char **argv); + int initialize(int argc, char** argv); /*! * \brief Execute the main application logic. @@ -39,7 +39,7 @@ class MIRApplication * \brief Returns whether a structured mesh is needed. * \return True if structured mesh is needed; false otherwise. */ - bool requiresStructuredMesh(const std::string &method) const; + bool requiresStructuredMesh(const std::string& method) const; /*! * \brief Invoke the MIR appropriate for the selected runtime policy. @@ -50,7 +50,7 @@ class MIRApplication /*! * \brief Make any adjustments to the mesh. */ - virtual void adjustMesh(conduit::Node &); + virtual void adjustMesh(conduit::Node&); /*! * \brief Save the mesh to a file. @@ -58,7 +58,7 @@ class MIRApplication * \param path The filepath where the file will be saved. * \param n_mesh The mesh to be saved. */ - virtual void saveMesh(const conduit::Node &n_mesh, const std::string &path); + virtual void saveMesh(const conduit::Node& n_mesh, const std::string& path); /*! * \brief Estimate memory needed to perform MIR operations. @@ -70,7 +70,7 @@ class MIRApplication /*! * \brief A static error handler for Conduit. */ - static void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1); + static void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1); bool handler; int gridSize; diff --git a/src/axom/mir/examples/concentric_circles/mir_concentric_circles.cpp b/src/axom/mir/examples/concentric_circles/mir_concentric_circles.cpp index 393a853a6a..8039b8cf7d 100644 --- a/src/axom/mir/examples/concentric_circles/mir_concentric_circles.cpp +++ b/src/axom/mir/examples/concentric_circles/mir_concentric_circles.cpp @@ -6,7 +6,7 @@ #include "MIRApplication.hpp" -int main(int argc, char **argv) +int main(int argc, char** argv) { MIRApplication app; int retval = app.initialize(argc, argv); diff --git a/src/axom/mir/examples/concentric_circles/mir_concentric_circles_mpi.cpp b/src/axom/mir/examples/concentric_circles/mir_concentric_circles_mpi.cpp index 8ef2cd1d07..a81d6f6671 100644 --- a/src/axom/mir/examples/concentric_circles/mir_concentric_circles_mpi.cpp +++ b/src/axom/mir/examples/concentric_circles/mir_concentric_circles_mpi.cpp @@ -27,7 +27,7 @@ class MIRApplicationMPI : public MIRApplication * * \param n_mesh The mesh to modify. */ - virtual void adjustMesh(conduit::Node &n_mesh) override + virtual void adjustMesh(conduit::Node& n_mesh) override { int rank = 0; MPI_Comm_rank(MPI_COMM_WORLD, &rank); @@ -76,7 +76,7 @@ class MIRApplicationMPI : public MIRApplication * \param path The filepath where the file will be saved. * \param n_mesh The mesh to be saved. */ - virtual void saveMesh(const conduit::Node &n_mesh, const std::string &path) override + virtual void saveMesh(const conduit::Node& n_mesh, const std::string& path) override { #if defined(CONDUIT_RELAY_IO_HDF5_ENABLED) std::string protocol("hdf5"); @@ -88,7 +88,7 @@ class MIRApplicationMPI : public MIRApplication } }; -int main(int argc, char **argv) +int main(int argc, char** argv) { MPI_Init(&argc, &argv); diff --git a/src/axom/mir/examples/concentric_circles/runMIR.hpp b/src/axom/mir/examples/concentric_circles/runMIR.hpp index 650b650b3e..7b979d3202 100644 --- a/src/axom/mir/examples/concentric_circles/runMIR.hpp +++ b/src/axom/mir/examples/concentric_circles/runMIR.hpp @@ -66,7 +66,7 @@ int installAllocator([[maybe_unused]] size_t initialPoolSizeBytes) { int allocator_id = axom::execution_space::allocatorID(); #if defined(AXOM_USE_UMPIRE) - auto &rm = umpire::ResourceManager::getInstance(); + auto& rm = umpire::ResourceManager::getInstance(); umpire::Allocator allocator = rm.getAllocator(allocator_id); const std::string newName = allocator.getName() + "_POOL"; @@ -89,7 +89,7 @@ int installAllocator([[maybe_unused]] size_t initialPoolSizeBytes) //-------------------------------------------------------------------------------- template -int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit::Node &hostResult) +int runMIR(const conduit::Node& hostMesh, const conduit::Node& options, conduit::Node& hostResult) { AXOM_ANNOTATE_SCOPE("runMIR"); @@ -141,9 +141,9 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: utils::copy(deviceMesh, hostMesh, allocator_id); } - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - const conduit::Node &n_topology = deviceMesh["topologies/mesh"]; - const conduit::Node &n_matset = deviceMesh["matsets/mat"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_topology = deviceMesh["topologies/mesh"]; + const conduit::Node& n_matset = deviceMesh["matsets/mat"]; conduit::Node deviceResult; for(int trial = 0; trial < trials; trial++) { @@ -210,7 +210,7 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: #if defined(AXOM_USE_UMPIRE) try { - auto &rm = umpire::ResourceManager::getInstance(); + auto& rm = umpire::ResourceManager::getInstance(); umpire::Allocator allocator = rm.getAllocator(allocator_id); SLIC_INFO("Allocator Information:"); SLIC_INFO(axom::fmt::format("\tname: {}", allocator.getName())); @@ -231,18 +231,18 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: // Prototypes. int runMIR_seq(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_omp(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_cuda(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_hip(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); diff --git a/src/axom/mir/examples/concentric_circles/runMIR_cuda.cpp b/src/axom/mir/examples/concentric_circles/runMIR_cuda.cpp index b2034524b6..35daf2b962 100644 --- a/src/axom/mir/examples/concentric_circles/runMIR_cuda.cpp +++ b/src/axom/mir/examples/concentric_circles/runMIR_cuda.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) int runMIR_cuda(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { constexpr int CUDA_BLOCK_SIZE = 256; using cuda_exec = axom::CUDA_EXEC; @@ -26,9 +26,9 @@ int runMIR_cuda(int dimension, } #else int runMIR_cuda(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/concentric_circles/runMIR_hip.cpp b/src/axom/mir/examples/concentric_circles/runMIR_hip.cpp index dccdc65404..15963d899f 100644 --- a/src/axom/mir/examples/concentric_circles/runMIR_hip.cpp +++ b/src/axom/mir/examples/concentric_circles/runMIR_hip.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) int runMIR_hip(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { constexpr int HIP_BLOCK_SIZE = 64; using hip_exec = axom::HIP_EXEC; @@ -26,9 +26,9 @@ int runMIR_hip(int dimension, } #else int runMIR_hip(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/concentric_circles/runMIR_omp.cpp b/src/axom/mir/examples/concentric_circles/runMIR_omp.cpp index 439ef31b84..f2762a3476 100644 --- a/src/axom/mir/examples/concentric_circles/runMIR_omp.cpp +++ b/src/axom/mir/examples/concentric_circles/runMIR_omp.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) int runMIR_omp(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { int retval = 0; if(dimension == 3) @@ -24,9 +24,9 @@ int runMIR_omp(int dimension, } #else int runMIR_omp(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/concentric_circles/runMIR_seq.cpp b/src/axom/mir/examples/concentric_circles/runMIR_seq.cpp index e9e0a6d493..da936cf1ec 100644 --- a/src/axom/mir/examples/concentric_circles/runMIR_seq.cpp +++ b/src/axom/mir/examples/concentric_circles/runMIR_seq.cpp @@ -6,9 +6,9 @@ #include "runMIR.hpp" int runMIR_seq(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { int retval = 0; if(dimension == 3) diff --git a/src/axom/mir/examples/heavily_mixed/HMApplication.cpp b/src/axom/mir/examples/heavily_mixed/HMApplication.cpp index 6ad94f41fe..bc734337bf 100644 --- a/src/axom/mir/examples/heavily_mixed/HMApplication.cpp +++ b/src/axom/mir/examples/heavily_mixed/HMApplication.cpp @@ -31,11 +31,11 @@ namespace detail * \param n_field The field used for matset creation. * \param nmats The number of materials to make. */ -void heavily_mixed_matset(const std::string &topoName, +void heavily_mixed_matset(const std::string& topoName, int dims[3], int refinement, - conduit::Node &n_coarse, - const conduit::Node &n_field, + conduit::Node& n_coarse, + const conduit::Node& n_field, int nmats) { const auto fine = n_field.as_float64_accessor(); @@ -101,9 +101,9 @@ void heavily_mixed_matset(const std::string &topoName, } } } - conduit::Node &n_matset = n_coarse["matsets/mat"]; + conduit::Node& n_matset = n_coarse["matsets/mat"]; n_matset["topology"] = topoName; - conduit::Node &n_material_map = n_matset["material_map"]; + conduit::Node& n_material_map = n_matset["material_map"]; for(int i = 0; i < nmats; i++) { int matno = i + 1; @@ -122,7 +122,7 @@ void heavily_mixed_matset(const std::string &topoName, } template -void heavily_mixed(conduit::Node &n_mesh, int dims[3], int refinement, int nmats) +void heavily_mixed(conduit::Node& n_mesh, int dims[3], int refinement, int nmats) { const int rdims[] = {refinement * dims[0], refinement * dims[1], refinement * dims[2]}; @@ -158,7 +158,7 @@ void heavily_mixed(conduit::Node &n_mesh, int dims[3], int refinement, int nmats conduit::Node n_field; n_field.set(conduit::DataType::int32(rdims[0] * rdims[1] * rdims[2])); - conduit::int32 *destPtr = n_field.as_int32_ptr(); + conduit::int32* destPtr = n_field.as_int32_ptr(); axom::for_all(rdims[2], [&](int k) { const auto t = static_cast(k) / (dims[2] - 1); // Interpolate the window @@ -168,9 +168,9 @@ void heavily_mixed(conduit::Node &n_mesh, int dims[3], int refinement, int nmats const conduit::float64 y1 = axom::utilities::lerp(y_max, y1_max, t); conduit::Node n_rmesh; conduit::blueprint::mesh::examples::julia(rdims[0], rdims[1], x0, x1, y0, y1, c_re, c_im, n_rmesh); - const conduit::Node &n_src_field = n_rmesh["fields/iters/values"]; - const conduit::int32 *srcPtr = n_src_field.as_int32_ptr(); - conduit::int32 *currentDestPtr = destPtr + k * rdims[0] * rdims[1]; + const conduit::Node& n_src_field = n_rmesh["fields/iters/values"]; + const conduit::int32* srcPtr = n_src_field.as_int32_ptr(); + conduit::int32* currentDestPtr = destPtr + k * rdims[0] * rdims[1]; axom::copy(currentDestPtr, srcPtr, rdims[0] * rdims[1] * sizeof(conduit::int32)); #ifndef AXOM_DEVICE_CODE SLIC_INFO(axom::fmt::format("Made slice {}/{}", k + 1, rdims[2])); @@ -195,7 +195,7 @@ void heavily_mixed(conduit::Node &n_mesh, int dims[3], int refinement, int nmats n_rmesh); // Make a matset based on the higher resolution julia field. - const conduit::Node &n_field = n_rmesh["fields/iters/values"]; + const conduit::Node& n_field = n_rmesh["fields/iters/values"]; heavily_mixed_matset("topo", dims, refinement, n_mesh, n_field, nmats); } } @@ -217,7 +217,7 @@ HMApplication::HMApplication() { } //-------------------------------------------------------------------------------- -int HMApplication::initialize(int argc, char **argv) +int HMApplication::initialize(int argc, char** argv) { axom::CLI::App app; app.add_flag("--handler", m_handler) @@ -277,12 +277,12 @@ int HMApplication::initialize(int argc, char **argv) app.parse(argc, argv); m_writeFiles = !disable_write; } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << app.help() << std::endl; retval = -1; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; @@ -315,12 +315,12 @@ int HMApplication::execute() { retval = runMIR(); } - catch(std::invalid_argument const &e) + catch(std::invalid_argument const& e) { SLIC_WARNING("Bad input. " << e.what()); retval = -2; } - catch(std::out_of_range const &e) + catch(std::out_of_range const& e) { SLIC_WARNING("Integer overflow. " << e.what()); retval = -3; @@ -434,10 +434,10 @@ size_t HMApplication::estimateMemoryPoolSize() const } //-------------------------------------------------------------------------------- -void HMApplication::adjustMesh(conduit::Node &) { } +void HMApplication::adjustMesh(conduit::Node&) { } //-------------------------------------------------------------------------------- -void HMApplication::saveMesh(const conduit::Node &n_mesh, const std::string &path) +void HMApplication::saveMesh(const conduit::Node& n_mesh, const std::string& path) { #if defined(CONDUIT_RELAY_IO_HDF5_ENABLED) std::string protocol("hdf5"); @@ -448,7 +448,7 @@ void HMApplication::saveMesh(const conduit::Node &n_mesh, const std::string &pat } //-------------------------------------------------------------------------------- -void HMApplication::conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1) +void HMApplication::conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1) { SLIC_ERROR(axom::fmt::format("Error from Conduit: s1={}, s2={}, i1={}", s1, s2, i1)); // This is on purpose. diff --git a/src/axom/mir/examples/heavily_mixed/HMApplication.hpp b/src/axom/mir/examples/heavily_mixed/HMApplication.hpp index 1f1fa2316b..2cc8d7ecb9 100644 --- a/src/axom/mir/examples/heavily_mixed/HMApplication.hpp +++ b/src/axom/mir/examples/heavily_mixed/HMApplication.hpp @@ -26,7 +26,7 @@ class HMApplication * \brief Initialize the application from command line args. * \return 0 on success; less than zero otherwise. */ - int initialize(int argc, char **argv); + int initialize(int argc, char** argv); /*! * \brief Execute the main application logic. @@ -44,7 +44,7 @@ class HMApplication /*! * \brief Make any adjustments to the mesh. */ - virtual void adjustMesh(conduit::Node &); + virtual void adjustMesh(conduit::Node&); /*! * \brief Save the mesh to a file. @@ -52,7 +52,7 @@ class HMApplication * \param path The filepath where the file will be saved. * \param n_mesh The mesh to be saved. */ - virtual void saveMesh(const conduit::Node &n_mesh, const std::string &path); + virtual void saveMesh(const conduit::Node& n_mesh, const std::string& path); /*! * \brief Estimate memory needed to perform MIR operations. @@ -64,7 +64,7 @@ class HMApplication /*! * \brief A static error handler for Conduit. */ - static void conduit_debug_err_handler(const std::string &s1, const std::string &s2, int i1); + static void conduit_debug_err_handler(const std::string& s1, const std::string& s2, int i1); bool m_handler; axom::StackArray m_dims; diff --git a/src/axom/mir/examples/heavily_mixed/mir_heavily_mixed.cpp b/src/axom/mir/examples/heavily_mixed/mir_heavily_mixed.cpp index 7b38769854..62afd29546 100644 --- a/src/axom/mir/examples/heavily_mixed/mir_heavily_mixed.cpp +++ b/src/axom/mir/examples/heavily_mixed/mir_heavily_mixed.cpp @@ -6,7 +6,7 @@ #include "HMApplication.hpp" -int main(int argc, char **argv) +int main(int argc, char** argv) { HMApplication app; int retval = app.initialize(argc, argv); diff --git a/src/axom/mir/examples/heavily_mixed/runMIR.hpp b/src/axom/mir/examples/heavily_mixed/runMIR.hpp index 9424cb8da3..0f7e85f9d1 100644 --- a/src/axom/mir/examples/heavily_mixed/runMIR.hpp +++ b/src/axom/mir/examples/heavily_mixed/runMIR.hpp @@ -18,7 +18,7 @@ int installAllocator([[maybe_unused]] size_t initialPoolSizeBytes) { int allocator_id = axom::execution_space::allocatorID(); #if defined(AXOM_USE_UMPIRE) - auto &rm = umpire::ResourceManager::getInstance(); + auto& rm = umpire::ResourceManager::getInstance(); umpire::Allocator allocator = rm.getAllocator(allocator_id); const std::string newName = allocator.getName() + "_POOL"; @@ -41,7 +41,7 @@ int installAllocator([[maybe_unused]] size_t initialPoolSizeBytes) //-------------------------------------------------------------------------------- template -int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit::Node &hostResult) +int runMIR(const conduit::Node& hostMesh, const conduit::Node& options, conduit::Node& hostResult) { AXOM_ANNOTATE_SCOPE("runMIR"); @@ -92,9 +92,9 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: utils::copy(deviceMesh, hostMesh); } - const conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - const conduit::Node &n_topology = deviceMesh["topologies/topo"]; - const conduit::Node &n_matset = deviceMesh["matsets/mat"]; + const conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + const conduit::Node& n_topology = deviceMesh["topologies/topo"]; + const conduit::Node& n_matset = deviceMesh["matsets/mat"]; conduit::Node deviceResult; for(int trial = 0; trial < trials; trial++) { @@ -140,7 +140,7 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: #if defined(AXOM_USE_UMPIRE) try { - auto &rm = umpire::ResourceManager::getInstance(); + auto& rm = umpire::ResourceManager::getInstance(); umpire::Allocator allocator = rm.getAllocator(allocator_id); SLIC_INFO("Allocator Information:"); SLIC_INFO(axom::fmt::format("\tname: {}", allocator.getName())); @@ -161,18 +161,18 @@ int runMIR(const conduit::Node &hostMesh, const conduit::Node &options, conduit: // Prototypes. int runMIR_seq(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_omp(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_cuda(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); int runMIR_hip(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result); + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result); diff --git a/src/axom/mir/examples/heavily_mixed/runMIR_cuda.cpp b/src/axom/mir/examples/heavily_mixed/runMIR_cuda.cpp index b2034524b6..35daf2b962 100644 --- a/src/axom/mir/examples/heavily_mixed/runMIR_cuda.cpp +++ b/src/axom/mir/examples/heavily_mixed/runMIR_cuda.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) int runMIR_cuda(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { constexpr int CUDA_BLOCK_SIZE = 256; using cuda_exec = axom::CUDA_EXEC; @@ -26,9 +26,9 @@ int runMIR_cuda(int dimension, } #else int runMIR_cuda(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/heavily_mixed/runMIR_hip.cpp b/src/axom/mir/examples/heavily_mixed/runMIR_hip.cpp index dccdc65404..15963d899f 100644 --- a/src/axom/mir/examples/heavily_mixed/runMIR_hip.cpp +++ b/src/axom/mir/examples/heavily_mixed/runMIR_hip.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) int runMIR_hip(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { constexpr int HIP_BLOCK_SIZE = 64; using hip_exec = axom::HIP_EXEC; @@ -26,9 +26,9 @@ int runMIR_hip(int dimension, } #else int runMIR_hip(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/heavily_mixed/runMIR_omp.cpp b/src/axom/mir/examples/heavily_mixed/runMIR_omp.cpp index 439ef31b84..f2762a3476 100644 --- a/src/axom/mir/examples/heavily_mixed/runMIR_omp.cpp +++ b/src/axom/mir/examples/heavily_mixed/runMIR_omp.cpp @@ -7,9 +7,9 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) int runMIR_omp(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { int retval = 0; if(dimension == 3) @@ -24,9 +24,9 @@ int runMIR_omp(int dimension, } #else int runMIR_omp(int AXOM_UNUSED_PARAM(dimension), - const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) + const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/heavily_mixed/runMIR_seq.cpp b/src/axom/mir/examples/heavily_mixed/runMIR_seq.cpp index e9e0a6d493..da936cf1ec 100644 --- a/src/axom/mir/examples/heavily_mixed/runMIR_seq.cpp +++ b/src/axom/mir/examples/heavily_mixed/runMIR_seq.cpp @@ -6,9 +6,9 @@ #include "runMIR.hpp" int runMIR_seq(int dimension, - const conduit::Node &mesh, - const conduit::Node &options, - conduit::Node &result) + const conduit::Node& mesh, + const conduit::Node& options, + conduit::Node& result) { int retval = 0; if(dimension == 3) diff --git a/src/axom/mir/examples/tutorial_simple/mir_tutorial_simple.cpp b/src/axom/mir/examples/tutorial_simple/mir_tutorial_simple.cpp index a2011d0778..391b39187a 100644 --- a/src/axom/mir/examples/tutorial_simple/mir_tutorial_simple.cpp +++ b/src/axom/mir/examples/tutorial_simple/mir_tutorial_simple.cpp @@ -44,7 +44,7 @@ struct Input axom::CLI::App m_app {}; /// Parse command line. - void parse(int argc, char **argv) + void parse(int argc, char** argv) { m_app.add_option("--test-case", m_test_case) ->check(axom::CLI::Range(1, 5)) @@ -105,7 +105,7 @@ struct Input //-------------------------------------------------------------------------------- /// Print a Conduit node. -void printNode(const conduit::Node &n) +void printNode(const conduit::Node& n) { conduit::Node options; options["num_children_threshold"] = 10000; @@ -117,7 +117,7 @@ void printNode(const conduit::Node &n) /*! * \brief Tutorial main showing how to initialize test cases and perform mir. */ -int main(int argc, char **argv) +int main(int argc, char** argv) { axom::slic::SimpleLogger logger(axom::slic::message::Info); @@ -127,7 +127,7 @@ int main(int argc, char **argv) { params.parse(argc, argv); } - catch(const axom::CLI::ParseError &e) + catch(const axom::CLI::ParseError& e) { return params.m_app.exit(e); } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR.hpp b/src/axom/mir/examples/tutorial_simple/runMIR.hpp index db0f50bd09..18311ce891 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR.hpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR.hpp @@ -25,7 +25,7 @@ * \param hostResult A conduit node that will contain the MIR results. */ template -int runMIR_tri(const conduit::Node &hostMesh, const conduit::Node &options, conduit::Node &hostResult) +int runMIR_tri(const conduit::Node& hostMesh, const conduit::Node& options, conduit::Node& hostResult) { AXOM_ANNOTATE_SCOPE("runMIR_tri"); namespace utils = axom::bump::utilities; @@ -40,9 +40,9 @@ int runMIR_tri(const conduit::Node &hostMesh, const conduit::Node &options, cond utils::copy(deviceMesh, hostMesh); } - conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - conduit::Node &n_topo = deviceMesh["topologies/mesh"]; - conduit::Node &n_matset = deviceMesh["matsets/mat"]; + conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + conduit::Node& n_topo = deviceMesh["topologies/mesh"]; + conduit::Node& n_matset = deviceMesh["matsets/mat"]; auto connView = utils::make_array_view(n_topo["elements/connectivity"]); // Make matset view. (There's often 1 more material so add 1) @@ -86,7 +86,7 @@ int runMIR_tri(const conduit::Node &hostMesh, const conduit::Node &options, cond * \param hostResult A conduit node that will contain the MIR results. */ template -int runMIR_quad(const conduit::Node &hostMesh, const conduit::Node &options, conduit::Node &hostResult) +int runMIR_quad(const conduit::Node& hostMesh, const conduit::Node& options, conduit::Node& hostResult) { AXOM_ANNOTATE_SCOPE("runMIR_quad"); namespace utils = axom::bump::utilities; @@ -100,9 +100,9 @@ int runMIR_quad(const conduit::Node &hostMesh, const conduit::Node &options, con utils::copy(deviceMesh, hostMesh); } - conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - conduit::Node &n_topo = deviceMesh["topologies/mesh"]; - conduit::Node &n_matset = deviceMesh["matsets/mat"]; + conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + conduit::Node& n_topo = deviceMesh["topologies/mesh"]; + conduit::Node& n_matset = deviceMesh["matsets/mat"]; auto connView = utils::make_array_view(n_topo["elements/connectivity"]); // Make matset view. (There's often 1 more material so add 1) @@ -145,7 +145,7 @@ int runMIR_quad(const conduit::Node &hostMesh, const conduit::Node &options, con * \param hostResult A conduit node that will contain the MIR results. */ template -int runMIR_hex(const conduit::Node &hostMesh, const conduit::Node &options, conduit::Node &hostResult) +int runMIR_hex(const conduit::Node& hostMesh, const conduit::Node& options, conduit::Node& hostResult) { AXOM_ANNOTATE_SCOPE("runMIR_hex"); namespace utils = axom::bump::utilities; @@ -159,9 +159,9 @@ int runMIR_hex(const conduit::Node &hostMesh, const conduit::Node &options, cond utils::copy(deviceMesh, hostMesh); } - conduit::Node &n_coordset = deviceMesh["coordsets/coords"]; - conduit::Node &n_topo = deviceMesh["topologies/mesh"]; - conduit::Node &n_matset = deviceMesh["matsets/mat"]; + conduit::Node& n_coordset = deviceMesh["coordsets/coords"]; + conduit::Node& n_topo = deviceMesh["topologies/mesh"]; + conduit::Node& n_matset = deviceMesh["matsets/mat"]; auto connView = utils::make_array_view(n_topo["elements/connectivity"]); // Make matset view. (There's often 1 more material so add 1) @@ -195,7 +195,7 @@ int runMIR_hex(const conduit::Node &hostMesh, const conduit::Node &options, cond } // Prototypes. -int runMIR_seq(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_omp(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_cuda(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_hip(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); +int runMIR_seq(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_omp(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_cuda(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_hip(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_cuda.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_cuda.cpp index f249ef7290..7ad33fb1a7 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_cuda.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_cuda.cpp @@ -7,11 +7,11 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) // Prototypes -int runMIR_cuda_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_cuda_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_cuda_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); +int runMIR_cuda_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_cuda_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_cuda_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); -int runMIR_cuda(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_cuda(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { std::string shape = mesh["topologies/mesh/elements/shape"].as_string(); int retval = 0; @@ -24,9 +24,9 @@ int runMIR_cuda(const conduit::Node &mesh, const conduit::Node &options, conduit return retval; } #else -int runMIR_cuda(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_cuda(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_hex.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_hex.cpp index ec35ebbee0..0476ebb776 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_hex.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_hex.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) -int runMIR_cuda_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_cuda_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int CUDA_BLOCK_SIZE = 256; using cuda_exec = axom::CUDA_EXEC; return runMIR_hex(mesh, options, result); } #else -int runMIR_cuda_hex(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_cuda_hex(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_quad.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_quad.cpp index cf1c75c916..ea6c9f7780 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_quad.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_quad.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) -int runMIR_cuda_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_cuda_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int CUDA_BLOCK_SIZE = 256; using cuda_exec = axom::CUDA_EXEC; return runMIR_quad(mesh, options, result); } #else -int runMIR_cuda_quad(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_cuda_quad(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_tri.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_tri.cpp index 9dd304b6c6..5cb4eebb43 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_cuda_tri.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_cuda_tri.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_CUDA) -int runMIR_cuda_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_cuda_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int CUDA_BLOCK_SIZE = 256; using cuda_exec = axom::CUDA_EXEC; return runMIR_tri(mesh, options, result); } #else -int runMIR_cuda_tri(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_cuda_tri(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_hip.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_hip.cpp index 44f38f91f4..f28d30eae1 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_hip.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_hip.cpp @@ -7,11 +7,11 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) // Prototypes -int runMIR_hip_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_hip_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_hip_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); +int runMIR_hip_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_hip_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_hip_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); -int runMIR_hip(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_hip(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { std::string shape = mesh["topologies/mesh/elements/shape"].as_string(); int retval = 0; @@ -24,9 +24,9 @@ int runMIR_hip(const conduit::Node &mesh, const conduit::Node &options, conduit: return retval; } #else -int runMIR_hip(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_hip(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_hip_hex.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_hip_hex.cpp index 5603541ce9..95a8ba72c4 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_hip_hex.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_hip_hex.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) -int runMIR_hip_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_hip_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int HIP_BLOCK_SIZE = 64; using hip_exec = axom::HIP_EXEC; return runMIR_hex(mesh, options, result); } #else -int runMIR_hip_hex(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_hip_hex(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_hip_quad.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_hip_quad.cpp index 33839c59c9..b88682ce54 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_hip_quad.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_hip_quad.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) -int runMIR_hip_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_hip_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int HIP_BLOCK_SIZE = 64; using hip_exec = axom::HIP_EXEC; return runMIR_quad(mesh, options, result); } #else -int runMIR_hip_quad(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_hip_quad(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_hip_tri.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_hip_tri.cpp index c8c0b77e33..12332b9e0d 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_hip_tri.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_hip_tri.cpp @@ -6,16 +6,16 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_HIP) -int runMIR_hip_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_hip_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { constexpr int HIP_BLOCK_SIZE = 64; using hip_exec = axom::HIP_EXEC; return runMIR_tri(mesh, options, result); } #else -int runMIR_hip_tri(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_hip_tri(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_omp.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_omp.cpp index 4696e7c051..2f5fa85c79 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_omp.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_omp.cpp @@ -8,11 +8,11 @@ #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) // Prototypes -int runMIR_omp_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_omp_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_omp_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); +int runMIR_omp_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_omp_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_omp_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); -int runMIR_omp(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_omp(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { std::string shape = mesh["topologies/mesh/elements/shape"].as_string(); int retval = 0; @@ -25,9 +25,9 @@ int runMIR_omp(const conduit::Node &mesh, const conduit::Node &options, conduit: return retval; } #else -int runMIR_omp(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_omp(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_omp_hex.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_omp_hex.cpp index 766b324877..ee87f76565 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_omp_hex.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_omp_hex.cpp @@ -6,14 +6,14 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) -int runMIR_omp_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_omp_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_hex(mesh, options, result); } #else -int runMIR_omp_hex(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_omp_hex(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_omp_quad.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_omp_quad.cpp index ad71bbb76c..1b733386ef 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_omp_quad.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_omp_quad.cpp @@ -6,14 +6,14 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) -int runMIR_omp_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_omp_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_quad(mesh, options, result); } #else -int runMIR_omp_quad(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_omp_quad(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_omp_tri.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_omp_tri.cpp index 0d43536a57..74fa3784eb 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_omp_tri.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_omp_tri.cpp @@ -6,14 +6,14 @@ #include "runMIR.hpp" #if defined(AXOM_USE_RAJA) && defined(AXOM_USE_UMPIRE) && defined(AXOM_USE_OPENMP) -int runMIR_omp_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_omp_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_tri(mesh, options, result); } #else -int runMIR_omp_tri(const conduit::Node &AXOM_UNUSED_PARAM(mesh), - const conduit::Node &AXOM_UNUSED_PARAM(options), - conduit::Node &AXOM_UNUSED_PARAM(result)) +int runMIR_omp_tri(const conduit::Node& AXOM_UNUSED_PARAM(mesh), + const conduit::Node& AXOM_UNUSED_PARAM(options), + conduit::Node& AXOM_UNUSED_PARAM(result)) { return 0; } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_seq.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_seq.cpp index d78afad4c6..8a2e4a3a3c 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_seq.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_seq.cpp @@ -6,11 +6,11 @@ #include "runMIR.hpp" // Prototypes -int runMIR_seq_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_seq_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); -int runMIR_seq_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result); +int runMIR_seq_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_seq_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); +int runMIR_seq_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result); -int runMIR_seq(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_seq(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { std::string shape = mesh["topologies/mesh/elements/shape"].as_string(); int retval = 0; diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_seq_hex.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_seq_hex.cpp index d6d1c9fa6e..771ff8ddc2 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_seq_hex.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_seq_hex.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: (BSD-3-Clause) #include "runMIR.hpp" -int runMIR_seq_hex(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_seq_hex(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_hex(mesh, options, result); } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_seq_quad.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_seq_quad.cpp index fdf6d07995..551fa3966b 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_seq_quad.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_seq_quad.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: (BSD-3-Clause) #include "runMIR.hpp" -int runMIR_seq_quad(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_seq_quad(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_quad(mesh, options, result); } diff --git a/src/axom/mir/examples/tutorial_simple/runMIR_seq_tri.cpp b/src/axom/mir/examples/tutorial_simple/runMIR_seq_tri.cpp index 3af13f6774..63563c76a7 100644 --- a/src/axom/mir/examples/tutorial_simple/runMIR_seq_tri.cpp +++ b/src/axom/mir/examples/tutorial_simple/runMIR_seq_tri.cpp @@ -5,7 +5,7 @@ // SPDX-License-Identifier: (BSD-3-Clause) #include "runMIR.hpp" -int runMIR_seq_tri(const conduit::Node &mesh, const conduit::Node &options, conduit::Node &result) +int runMIR_seq_tri(const conduit::Node& mesh, const conduit::Node& options, conduit::Node& result) { return runMIR_tri(mesh, options, result); } diff --git a/src/axom/mir/future/ClipFieldFilter.cpp b/src/axom/mir/future/ClipFieldFilter.cpp index 18eeb9e97d..018a8ffb80 100644 --- a/src/axom/mir/future/ClipFieldFilter.cpp +++ b/src/axom/mir/future/ClipFieldFilter.cpp @@ -32,19 +32,19 @@ namespace mir { namespace clipping { -void ClipFieldFilter::execute(const conduit::Node &n_input, - const conduit::Node &n_options, - conduit::Node &n_output) +void ClipFieldFilter::execute(const conduit::Node& n_input, + const conduit::Node& n_options, + conduit::Node& n_output) { ClipOptions opts(n_options); const std::string clipFieldName = opts.clipField(); - const conduit::Node &n_fields = n_input.fetch_existing("fields"); - const conduit::Node &n_clipField = n_fields.fetch_existing(clipFieldName); - const std::string &topoName = n_clipField["topology"].as_string(); - const conduit::Node &n_topo = n_input.fetch_existing("topologies/" + topoName); - const std::string &coordsetName = n_topo["coordset"].as_string(); - const conduit::Node &n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); + const conduit::Node& n_fields = n_input.fetch_existing("fields"); + const conduit::Node& n_clipField = n_fields.fetch_existing(clipFieldName); + const std::string& topoName = n_clipField["topology"].as_string(); + const conduit::Node& n_topo = n_input.fetch_existing("topologies/" + topoName); + const std::string& coordsetName = n_topo["coordset"].as_string(); + const conduit::Node& n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); execute(n_topo, n_coordset, @@ -55,13 +55,13 @@ void ClipFieldFilter::execute(const conduit::Node &n_input, n_output["fields"]); } -void ClipFieldFilter::execute(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields) +void ClipFieldFilter::execute(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields) { // Instantiate the algorithm for the right device and invoke it. if(m_runtime == axom::runtime_policy::Policy::seq) diff --git a/src/axom/mir/future/ClipFieldFilter.hpp b/src/axom/mir/future/ClipFieldFilter.hpp index c26f37a1a9..d9f39a7900 100644 --- a/src/axom/mir/future/ClipFieldFilter.hpp +++ b/src/axom/mir/future/ClipFieldFilter.hpp @@ -46,7 +46,7 @@ class ClipFieldFilter * * \note The clipField field must currently be vertex-associated. */ - void execute(const conduit::Node &n_input, const conduit::Node &n_options, conduit::Node &n_output); + void execute(const conduit::Node& n_input, const conduit::Node& n_options, conduit::Node& n_output); /** * \brief Execute the clipping operation using the specified options. @@ -61,13 +61,13 @@ class ClipFieldFilter * * \note The clipField field must currently be vertex-associated. Also, the output topology will be an unstructured topology with mixed shape types. */ - void execute(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields); + void execute(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields); private: axom::runtime_policy::Policy m_runtime; diff --git a/src/axom/mir/future/ClipFieldFilterDevice.hpp b/src/axom/mir/future/ClipFieldFilterDevice.hpp index 79a00d0f56..a5d1151cae 100644 --- a/src/axom/mir/future/ClipFieldFilterDevice.hpp +++ b/src/axom/mir/future/ClipFieldFilterDevice.hpp @@ -39,17 +39,17 @@ class ClipFieldFilterDevice * * \note The clipField field must currently be vertex-associated. */ - void execute(const conduit::Node &n_input, const conduit::Node &n_options, conduit::Node &n_output) + void execute(const conduit::Node& n_input, const conduit::Node& n_options, conduit::Node& n_output) { ClipOptions opts(n_options); const std::string clipFieldName = opts.clipField(); - const conduit::Node &n_fields = n_input.fetch_existing("fields"); - const conduit::Node &n_clipField = n_fields.fetch_existing(clipFieldName); - const std::string &topoName = n_clipField["topology"].as_string(); - const conduit::Node &n_topo = n_input.fetch_existing("topologies/" + topoName); - const std::string &coordsetName = n_topo["coordset"].as_string(); - const conduit::Node &n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); + const conduit::Node& n_fields = n_input.fetch_existing("fields"); + const conduit::Node& n_clipField = n_fields.fetch_existing(clipFieldName); + const std::string& topoName = n_clipField["topology"].as_string(); + const conduit::Node& n_topo = n_input.fetch_existing("topologies/" + topoName); + const std::string& coordsetName = n_topo["coordset"].as_string(); + const conduit::Node& n_coordset = n_input.fetch_existing("coordsets/" + coordsetName); execute(n_topo, n_coordset, @@ -89,13 +89,13 @@ class ClipFieldFilterDevice * * \note The clipField field must currently be vertex-associated. Also, the output topology will be an unstructured topology with mixed shape types. */ - void execute(const conduit::Node &n_topo, - const conduit::Node &n_coordset, - const conduit::Node &n_fields, - const conduit::Node &n_options, - conduit::Node &n_newTopo, - conduit::Node &n_newCoordset, - conduit::Node &n_newFields) + void execute(const conduit::Node& n_topo, + const conduit::Node& n_coordset, + const conduit::Node& n_fields, + const conduit::Node& n_options, + conduit::Node& n_newTopo, + conduit::Node& n_newCoordset, + conduit::Node& n_newFields) { #if 0 // NOTE - there are 2 dispatches here so we can get coordset and topology views. diff --git a/src/axom/mir/tests/mir_coupled.cpp b/src/axom/mir/tests/mir_coupled.cpp index e23e69c546..71cb72a845 100644 --- a/src/axom/mir/tests/mir_coupled.cpp +++ b/src/axom/mir/tests/mir_coupled.cpp @@ -119,7 +119,7 @@ fine - refines coarse with equal sized quads. */ // NOTE: Coordinates were switched to explicit to play better with VisIt and strided-structured. -const char *yaml = R"( +const char* yaml = R"( coordsets: coarse_coords: type: explicit @@ -158,7 +158,7 @@ const char *yaml = R"( )"; // This matset is defined on all zones in the mesh. -const char *coarse_matset_yaml = R"( +const char* coarse_matset_yaml = R"( coarse_matset: topology: coarse material_map: @@ -174,7 +174,7 @@ const char *coarse_matset_yaml = R"( )"; // This matset is restricted to the valid zones in a strided structured mesh. -const char *coarse_matset_ss_yaml = R"( +const char* coarse_matset_ss_yaml = R"( coarse_strided_matset: topology: coarse_strided material_map: @@ -199,7 +199,7 @@ template class test_coupling { public: - static void test2D(const std::string &name, bool selectedZones = false, bool stridedStructured = false) + static void test2D(const std::string& name, bool selectedZones = false, bool stridedStructured = false) { // Make the 2D input mesh. conduit::Node n_mesh; @@ -233,7 +233,7 @@ class test_coupling } private: - static void initialize(bool stridedStructured, conduit::Node &n_mesh) + static void initialize(bool stridedStructured, conduit::Node& n_mesh) { // Make the 2D input mesh. n_mesh.parse(yaml); @@ -255,15 +255,15 @@ class test_coupling } } - static void mir2D(const std::string &input_prefix, - conduit::Node &n_input, - const std::string &output_prefix, - conduit::Node &n_output, + static void mir2D(const std::string& input_prefix, + conduit::Node& n_input, + const std::string& output_prefix, + conduit::Node& n_output, bool selectedZones, bool stridedStructured) { // Wrap the coarse mesh in views. - const conduit::Node &n_topology = n_input[axom::fmt::format("topologies/{}", input_prefix)]; + const conduit::Node& n_topology = n_input[axom::fmt::format("topologies/{}", input_prefix)]; if(stridedStructured) { @@ -279,18 +279,18 @@ class test_coupling template static void mir2D(TopologyView topologyView, - const std::string &input_prefix, - conduit::Node &n_input, - const std::string &output_prefix, - conduit::Node &n_output, + const std::string& input_prefix, + conduit::Node& n_input, + const std::string& output_prefix, + conduit::Node& n_output, bool selectedZones, bool stridedStructured) { SLIC_INFO(axom::fmt::format("mir2D {} to {}", input_prefix, output_prefix)); // Wrap the input mesh in views. - const conduit::Node &n_coordset = n_input[axom::fmt::format("coordsets/{}_coords", input_prefix)]; - const conduit::Node &n_matset = n_input[axom::fmt::format("matsets/{}_matset", input_prefix)]; + const conduit::Node& n_coordset = n_input[axom::fmt::format("coordsets/{}_coords", input_prefix)]; + const conduit::Node& n_matset = n_input[axom::fmt::format("matsets/{}_matset", input_prefix)]; auto coordsetView = views::make_explicit_coordset::view(n_coordset); using CoordsetView = decltype(coordsetView); @@ -320,7 +320,7 @@ class test_coupling } /// Add a list of selected zones to the options going into 2D mir. - static void selectCoarseZones2D(bool stridedStructured, conduit::Node &n_options) + static void selectCoarseZones2D(bool stridedStructured, conduit::Node& n_options) { if(stridedStructured) { @@ -333,10 +333,10 @@ class test_coupling } } - static void selectFineZones2D(bool stridedStructured, conduit::Node &n_options) + static void selectFineZones2D(bool stridedStructured, conduit::Node& n_options) { // These selected zones are on the fine mesh and are used for TopologyMapper. - conduit::Node &n_selectedZones = n_options["target/selectedZones"]; + conduit::Node& n_selectedZones = n_options["target/selectedZones"]; if(stridedStructured) { @@ -352,17 +352,17 @@ class test_coupling } } - static void mapping2D(conduit::Node &n_src, - conduit::Node &n_target, + static void mapping2D(conduit::Node& n_src, + conduit::Node& n_target, bool selectedZones, bool stridedStructured) { SLIC_INFO("mapping2D postmir to fine"); // Wrap the source mesh from (coarse MIR output). - const conduit::Node &n_src_coordset = n_src["coordsets/postmir_coords"]; - const conduit::Node &n_src_topology = n_src["topologies/postmir"]; - const conduit::Node &n_src_matset = n_src["matsets/postmir_matset"]; + const conduit::Node& n_src_coordset = n_src["coordsets/postmir_coords"]; + const conduit::Node& n_src_topology = n_src["topologies/postmir"]; + const conduit::Node& n_src_matset = n_src["matsets/postmir_matset"]; auto srcCoordsetView = views::make_explicit_coordset::view(n_src_coordset); using SrcCoordsetView = decltype(srcCoordsetView); @@ -377,8 +377,8 @@ class test_coupling using SrcMatsetView = decltype(srcMatsetView); // Wrap the target mesh (fine) - const conduit::Node &n_target_coordset = n_target["coordsets/fine_coords"]; - const conduit::Node &n_target_topology = n_target["topologies/fine"]; + const conduit::Node& n_target_coordset = n_target["coordsets/fine_coords"]; + const conduit::Node& n_target_topology = n_target["topologies/fine"]; auto targetCoordsetView = views::make_explicit_coordset::view(n_target_coordset); using TargetCoordsetView = decltype(targetCoordsetView); @@ -498,7 +498,7 @@ TEST(mir_coupled, coupling_2D_sz1_ss1_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/mir/tests/mir_coupled3d.cpp b/src/axom/mir/tests/mir_coupled3d.cpp index 12c7ea9c51..2e5ccb9873 100644 --- a/src/axom/mir/tests/mir_coupled3d.cpp +++ b/src/axom/mir/tests/mir_coupled3d.cpp @@ -42,21 +42,21 @@ constexpr int NRIGHT = 1; * \param extents The mesh coordinate extents {xmin, xmax, ymin, ymax, zmin, zmax}. * \param dims The total number of NODES in each dimension. */ -void make_explicit_coordset(conduit::Node &n_mesh, - const std::string &coordsetName, +void make_explicit_coordset(conduit::Node& n_mesh, + const std::string& coordsetName, double extents[6], int dims[3]) { SLIC_ASSERT(dims[0] > 0 && dims[1] > 0 && dims[2] > 0); const int nnodes = dims[0] * dims[1] * dims[2]; - conduit::Node &n_coordset = n_mesh["coordsets/" + coordsetName]; + conduit::Node& n_coordset = n_mesh["coordsets/" + coordsetName]; n_coordset["type"] = "explicit"; n_coordset["values/x"].set(conduit::DataType::float64(nnodes)); n_coordset["values/y"].set(conduit::DataType::float64(nnodes)); n_coordset["values/z"].set(conduit::DataType::float64(nnodes)); - double *x = n_coordset["values/x"].as_double_ptr(); - double *y = n_coordset["values/y"].as_double_ptr(); - double *z = n_coordset["values/z"].as_double_ptr(); + double* x = n_coordset["values/x"].as_double_ptr(); + double* y = n_coordset["values/y"].as_double_ptr(); + double* z = n_coordset["values/z"].as_double_ptr(); int index = 0; for(int k = 0; k < dims[2]; k++) { @@ -89,9 +89,9 @@ void make_explicit_coordset(conduit::Node &n_mesh, * * \note extents and dims include phonies. */ -void make_mesh(conduit::Node &n_mesh, - const std::string &topoName, - const std::string &coordsetName, +void make_mesh(conduit::Node& n_mesh, + const std::string& topoName, + const std::string& coordsetName, const int dims[3]) { SLIC_ASSERT(dims[0] > 0 && dims[1] > 0 && dims[2] > 0); @@ -106,7 +106,7 @@ void make_mesh(conduit::Node &n_mesh, strides[2] = dims[0] * dims[1]; // Make the strided-structured topology, - conduit::Node &n_topo = n_mesh["topologies/" + topoName]; + conduit::Node& n_topo = n_mesh["topologies/" + topoName]; n_topo["type"] = "structured"; n_topo["coordset"] = coordsetName; n_topo["elements/dims/i"] = real_zone_dims[0]; @@ -131,9 +131,9 @@ void make_mesh(conduit::Node &n_mesh, * \param ballRadius The radius of the ball. * \param wallX The X value above which zones are filled with CU. */ -void make_matset(conduit::Node &n_mesh, - const std::string &topologyName, - const std::string &matsetName, +void make_matset(conduit::Node& n_mesh, + const std::string& topologyName, + const std::string& matsetName, const double extents[6], const int dims[3], const double ballCenter[3], @@ -141,7 +141,7 @@ void make_matset(conduit::Node &n_mesh, const double wallX) { /// Sample a zone and determine vfCU and vfAIR, returning number of materials 1 or 2. - auto ballVF = [&](const double zExt[6], double &vfCU, double &vfAIR) -> int { + auto ballVF = [&](const double zExt[6], double& vfCU, double& vfAIR) -> int { const int nSamples = 10; const double br2 = ballRadius * ballRadius; const int nTotalSamples = nSamples * nSamples * nSamples; @@ -258,7 +258,7 @@ void make_matset(conduit::Node &n_mesh, } } - conduit::Node &n_matset = n_mesh["matsets/" + matsetName]; + conduit::Node& n_matset = n_mesh["matsets/" + matsetName]; n_matset["topology"] = topologyName; n_matset["material_map/AIR"] = AIR; n_matset["material_map/CU"] = CU; @@ -303,7 +303,7 @@ void adjust_sizes(int real_dims[3], double real_extents[6], int total_dims[3], d * \param real_extents The box that defines the extents for the real nodes. * \param real_dims The number of real nodes in each dimension. */ -void make_coarse(conduit::Node &n_mesh, double real_extents[6], int real_dims[3]) +void make_coarse(conduit::Node& n_mesh, double real_extents[6], int real_dims[3]) { SLIC_ASSERT(real_dims[0] > 0 && real_dims[1] > 0 && real_dims[2] > 0); @@ -332,7 +332,7 @@ void make_coarse(conduit::Node &n_mesh, double real_extents[6], int real_dims[3] * \param real_dims The number of real nodes in each dimension. * \param refinement The refinement ration in each dimension. */ -void make_fine(conduit::Node &n_mesh, double real_extents[6], int real_dims[3], int refinement[3]) +void make_fine(conduit::Node& n_mesh, double real_extents[6], int real_dims[3], int refinement[3]) { SLIC_ASSERT(real_dims[0] > 0 && real_dims[1] > 0 && real_dims[2] > 0); SLIC_ASSERT(refinement[0] > 0 && refinement[1] > 0 && refinement[2] > 0); @@ -360,7 +360,7 @@ template class test_coupling { public: - static void test(const std::string &name) + static void test(const std::string& name) { // Make the input mesh. conduit::Node n_mesh; @@ -399,7 +399,7 @@ class test_coupling private: /// Make the meshes - static void initialize(conduit::Node &n_mesh) + static void initialize(conduit::Node& n_mesh) { // Unit cube with different numbers of zones (and refinements) in each dimension. double extents[] = {0., 1., 0., 1., 0., 1.}; @@ -411,17 +411,17 @@ class test_coupling } /// Perform MIR on input mesh and make new output mesh. - static void mir(const std::string &input_prefix, - conduit::Node &n_input, - const std::string &output_prefix, - conduit::Node &n_output) + static void mir(const std::string& input_prefix, + conduit::Node& n_input, + const std::string& output_prefix, + conduit::Node& n_output) { SLIC_INFO(axom::fmt::format("mir {} to {}", input_prefix, output_prefix)); // Wrap the input mesh in views. - const conduit::Node &n_coordset = n_input[axom::fmt::format("coordsets/{}_coords", input_prefix)]; - const conduit::Node &n_topology = n_input[axom::fmt::format("topologies/{}", input_prefix)]; - const conduit::Node &n_matset = n_input[axom::fmt::format("matsets/{}_matset", input_prefix)]; + const conduit::Node& n_coordset = n_input[axom::fmt::format("coordsets/{}_coords", input_prefix)]; + const conduit::Node& n_topology = n_input[axom::fmt::format("topologies/{}", input_prefix)]; + const conduit::Node& n_matset = n_input[axom::fmt::format("matsets/{}_matset", input_prefix)]; auto coordsetView = views::make_explicit_coordset::view(n_coordset); using CoordsetView = decltype(coordsetView); @@ -450,14 +450,14 @@ class test_coupling } /// Map material from postmir mesh onto fine mesh to make fine matset. - static void mapping(conduit::Node &n_src, conduit::Node &n_target) + static void mapping(conduit::Node& n_src, conduit::Node& n_target) { SLIC_INFO("mapping postmir to fine"); // Wrap the source mesh from (coarse MIR output). - const conduit::Node &n_src_coordset = n_src["coordsets/postmir_coords"]; - const conduit::Node &n_src_topology = n_src["topologies/postmir"]; - const conduit::Node &n_src_matset = n_src["matsets/postmir_matset"]; + const conduit::Node& n_src_coordset = n_src["coordsets/postmir_coords"]; + const conduit::Node& n_src_topology = n_src["topologies/postmir"]; + const conduit::Node& n_src_matset = n_src["matsets/postmir_matset"]; auto srcCoordsetView = views::make_explicit_coordset::view(n_src_coordset); using SrcCoordsetView = decltype(srcCoordsetView); @@ -472,8 +472,8 @@ class test_coupling using SrcMatsetView = decltype(srcMatsetView); // Wrap the target mesh (fine) - const conduit::Node &n_target_coordset = n_target["coordsets/fine_coords"]; - const conduit::Node &n_target_topology = n_target["topologies/fine"]; + const conduit::Node& n_target_coordset = n_target["coordsets/fine_coords"]; + const conduit::Node& n_target_topology = n_target["topologies/fine"]; auto targetCoordsetView = views::make_explicit_coordset::view(n_target_coordset); using TargetCoordsetView = decltype(targetCoordsetView); @@ -529,7 +529,7 @@ TEST(mir_coupling, coupling_3d_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/mir/tests/mir_elvira2d.cpp b/src/axom/mir/tests/mir_elvira2d.cpp index d34e34cc33..5766700a7b 100644 --- a/src/axom/mir/tests/mir_elvira2d.cpp +++ b/src/axom/mir/tests/mir_elvira2d.cpp @@ -44,10 +44,10 @@ constexpr int maxAttempts() template struct braid2d_mat_test { - static void initialize(const std::string &type, - const std::string &mattype, + static void initialize(const std::string& type, + const std::string& mattype, bool cleanMats, - conduit::Node &n_mesh) + conduit::Node& n_mesh) { axom::StackArray dims {10, 10}; axom::StackArray zoneDims {dims[0] - 1, dims[1] - 1}; @@ -62,14 +62,14 @@ struct braid2d_mat_test } // Select a chunk of clean and mixed zones. - static void selectZones(conduit::Node &n_options) + static void selectZones(conduit::Node& n_options) { n_options["selectedZones"].set(std::vector {30, 31, 32, 39, 40, 41, 48, 49, 50}); } - static void test(const std::string &type, - const std::string &mattype, - const std::string &name, + static void test(const std::string& type, + const std::string& mattype, + const std::string& name, bool selectedZones = false, bool pointMesh = false, bool cleanMats = false, @@ -80,7 +80,7 @@ struct braid2d_mat_test for(int dom = 0; dom < nDomains; dom++) { const std::string domainName = axom::fmt::format("domain_{:07}", dom); - conduit::Node &hostDomain = (nDomains > 1) ? hostMesh[domainName] : hostMesh; + conduit::Node& hostDomain = (nDomains > 1) ? hostMesh[domainName] : hostMesh; initialize(type, mattype, cleanMats, hostDomain); TestApp.saveVisualization(name + "_orig", hostDomain); @@ -96,7 +96,7 @@ struct braid2d_mat_test for(int dom = 0; dom < nDomains; dom++) { const std::string domainName = axom::fmt::format("domain_{:07}", dom); - conduit::Node &deviceDomain = (nDomains > 1) ? deviceMesh[domainName] : deviceMesh; + conduit::Node& deviceDomain = (nDomains > 1) ? deviceMesh[domainName] : deviceMesh; // _elvira_mir_start namespace views = axom::bump::views; @@ -545,7 +545,7 @@ TEST(mir_elvira2d, elvira_uniform_unibuffer_sel_pm_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/mir/tests/mir_elvira3d.cpp b/src/axom/mir/tests/mir_elvira3d.cpp index 65933e933e..d0a318f05f 100644 --- a/src/axom/mir/tests/mir_elvira3d.cpp +++ b/src/axom/mir/tests/mir_elvira3d.cpp @@ -33,7 +33,7 @@ struct test_Elvira3D static const int gridSize = 10; static const int numSpheres = 2; - static void initialize(conduit::Node &n_mesh) + static void initialize(conduit::Node& n_mesh) { AXOM_ANNOTATE_SCOPE("initialize"); axom::bump::data::MeshTester M; @@ -42,7 +42,7 @@ struct test_Elvira3D } // Select a chunk of zones. - static int selectZones(conduit::Node &n_options) + static int selectZones(conduit::Node& n_options) { std::vector selected; for(int k = 0; k < gridSize; k++) @@ -65,7 +65,7 @@ struct test_Elvira3D return static_cast(selected.size()); } - static void test(const std::string &name, bool selectedZones = false, bool pointMesh = false) + static void test(const std::string& name, bool selectedZones = false, bool pointMesh = false) { const double expectedVolume = gridSize * gridSize * gridSize; double mirExpectedVolume = expectedVolume; @@ -81,9 +81,9 @@ struct test_Elvira3D TestApp.saveVisualization(name + "_orig", hostMesh); //-------------------------------------------------------------------------- - const conduit::Node &n_coordset = deviceMesh.fetch_existing("coordsets/coords"); - const conduit::Node &n_topology = deviceMesh.fetch_existing("topologies/mesh"); - const conduit::Node &n_matset = deviceMesh.fetch_existing("matsets/mat"); + const conduit::Node& n_coordset = deviceMesh.fetch_existing("coordsets/coords"); + const conduit::Node& n_topology = deviceMesh.fetch_existing("topologies/mesh"); + const conduit::Node& n_matset = deviceMesh.fetch_existing("matsets/mat"); // Make views. auto coordsetView = views::make_explicit_coordset::view(n_coordset); @@ -133,7 +133,7 @@ struct test_Elvira3D } } - static void comparePointMesh(const std::string &name, const conduit::Node &deviceMIRMesh) + static void comparePointMesh(const std::string& name, const conduit::Node& deviceMIRMesh) { // device->host conduit::Node hostMIRMesh; @@ -151,14 +151,14 @@ struct test_Elvira3D } template - static void compare(const std::string &name, + static void compare(const std::string& name, bool selectedZones, - conduit::Node &deviceMesh, - const TopologyView &topologyView, - const CoordsetView &coordsetView, - const conduit::Node &n_topology, - const conduit::Node &n_coordset, - conduit::Node &deviceMIRMesh, + conduit::Node& deviceMesh, + const TopologyView& topologyView, + const CoordsetView& coordsetView, + const conduit::Node& n_topology, + const conduit::Node& n_coordset, + conduit::Node& deviceMIRMesh, double expectedVolume, double mirExpectedVolume) { @@ -170,12 +170,12 @@ struct test_Elvira3D //-------------------------------------------------------------------------- // Compute volumes for MIR mesh as a field. - conduit::Node &n_mir_coordset = deviceMIRMesh["coordsets/coords"]; + conduit::Node& n_mir_coordset = deviceMIRMesh["coordsets/coords"]; auto mirCoordsetView = views::make_explicit_coordset::view(n_mir_coordset); using MirCoordsetView = decltype(mirCoordsetView); // Make polyhedral topology view. - const conduit::Node &n_mir_topology = deviceMIRMesh["topologies/mesh"]; + const conduit::Node& n_mir_topology = deviceMIRMesh["topologies/mesh"]; auto mirTopoView = views::make_unstructured_polyhedral_topology::view(n_mir_topology); using MirTopologyView = decltype(mirTopoView); @@ -205,10 +205,10 @@ struct test_Elvira3D constexpr double tolerance = 2.6e-06; EXPECT_TRUE(TestApp.test(name, hostMIRMesh, tolerance)); #endif - const conduit::Node &n_matset = deviceMesh["matsets/mat"]; + const conduit::Node& n_matset = deviceMesh["matsets/mat"]; auto matsetView = views::make_unibuffer_matset::view(n_matset); - const conduit::Node &n_mir_matset = deviceMIRMesh["matsets/mat"]; + const conduit::Node& n_mir_matset = deviceMIRMesh["matsets/mat"]; auto mirMatsetView = views::make_unibuffer_matset::view(n_mir_matset); //-------------------------------------------------------------------------- @@ -277,7 +277,7 @@ struct test_Elvira3D template static std::vector sumMaterialVolumes(MatsetView matsetView, axom::ArrayView zoneVolumes, - const views::MaterialInformation &matInfo) + const views::MaterialInformation& matInfo) { const int allocatorID = axom::execution_space::allocatorID(); AXOM_ANNOTATE_SCOPE("sumMaterialVolumes"); @@ -286,7 +286,7 @@ struct test_Elvira3D const int nmats = static_cast(matInfo.size()); axom::Array sortedIdsHost(matInfo.size()); int mi = 0; - for(const auto &mat : matInfo) + for(const auto& mat : matInfo) { sortedIdsHost[mi++] = mat.m_number; } @@ -460,7 +460,7 @@ TEST(mir_elvira3d, elvira3d_unibuffer_sel_pm_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/mir/tests/mir_equiz2d.cpp b/src/axom/mir/tests/mir_equiz2d.cpp index 42e610626d..73215c730c 100644 --- a/src/axom/mir/tests/mir_equiz2d.cpp +++ b/src/axom/mir/tests/mir_equiz2d.cpp @@ -26,7 +26,7 @@ axom::blueprint::testing::TestApplication TestApp; //------------------------------------------------------------------------------ TEST(mir_equiz, miralgorithm) { - axom::mir::MIRAlgorithm *m = nullptr; + axom::mir::MIRAlgorithm* m = nullptr; EXPECT_EQ(m, nullptr); } @@ -52,9 +52,9 @@ TEST(mir_equiz, materialinformation) //------------------------------------------------------------------------------ template -void braid2d_mat_test(const std::string &type, - const std::string &mattype, - const std::string &name, +void braid2d_mat_test(const std::string& type, + const std::string& mattype, + const std::string& name, int nDomains, bool selectedZones, bool cleanMats) @@ -67,7 +67,7 @@ void braid2d_mat_test(const std::string &type, for(int dom = 0; dom < nDomains; dom++) { const std::string domainName = axom::fmt::format("domain_{:07}", dom); - conduit::Node &hostDomain = (nDomains > 1) ? hostMesh[domainName] : hostMesh; + conduit::Node& hostDomain = (nDomains > 1) ? hostMesh[domainName] : hostMesh; axom::blueprint::testing::data::braid(type, dims, hostDomain); const bool makeMixedField = false; // for now axom::blueprint::testing::data::make_matset(mattype, @@ -85,7 +85,7 @@ void braid2d_mat_test(const std::string &type, for(int dom = 0; dom < nDomains; dom++) { const std::string domainName = axom::fmt::format("domain_{:07}", dom); - conduit::Node &deviceDomain = (nDomains > 1) ? deviceMesh[domainName] : deviceMesh; + conduit::Node& deviceDomain = (nDomains > 1) ? deviceMesh[domainName] : deviceMesh; // Make views. auto coordsetView = views::make_uniform_coordset<2>::view(deviceDomain["coordsets/coords"]); @@ -163,7 +163,7 @@ class test_Polygonal_MIR static constexpr conduit::index_t NLEVELS = 4; static constexpr int MAX_MATERIALS = NLEVELS + 1; - static void test(const std::string &name) + static void test(const std::string& name) { // Make the 2D input mesh. conduit::Node n_mesh; @@ -188,14 +188,14 @@ class test_Polygonal_MIR EXPECT_TRUE(TestApp.test(name, hostResult)); } - static void initialize(conduit::Node &n_mesh) + static void initialize(conduit::Node& n_mesh) { // Make polygonal geometry const conduit::index_t nz = 1; conduit::blueprint::mesh::examples::polytess(NLEVELS, nz, n_mesh); // Make a matset from the level field. - conduit::Node &n_matset = n_mesh["matsets/mat"]; + conduit::Node& n_matset = n_mesh["matsets/mat"]; n_matset["topology"] = "topo"; for(int mat = 1; mat <= NLEVELS; mat++) { @@ -226,13 +226,13 @@ class test_Polygonal_MIR make_target2(n_mesh); } - static void make_target2(conduit::Node &n_mesh) + static void make_target2(conduit::Node& n_mesh) { const auto x = n_mesh["coordsets/coords/values/x"].as_float64_accessor(); const auto y = n_mesh["coordsets/coords/values/y"].as_float64_accessor(); // Make a rotated copy of the input topo mesh. - conduit::Node &target2_coords = n_mesh["coordsets/target2_coords"]; + conduit::Node& target2_coords = n_mesh["coordsets/target2_coords"]; target2_coords["type"] = "explicit"; target2_coords["values/x"].set(conduit::DataType::float64(x.number_of_elements())); target2_coords["values/y"].set(conduit::DataType::float64(y.number_of_elements())); @@ -253,19 +253,19 @@ class test_Polygonal_MIR n_mesh["topologies/target2/coordset"] = "target2_coords"; } - static void mapping_target2(conduit::Node &n_dev) + static void mapping_target2(conduit::Node& n_dev) { // Wrap polygonal mesh in views. auto srcCoordset = views::make_explicit_coordset::view(n_dev["coordsets/coords"]); using SrcCoordsetView = decltype(srcCoordset); - const conduit::Node &n_srcTopo = n_dev["topologies/topo"]; + const conduit::Node& n_srcTopo = n_dev["topologies/topo"]; auto srcTopo = views::make_unstructured_single_shape_topology>::view( n_srcTopo); using SrcTopologyView = decltype(srcTopo); - const conduit::Node &n_srcMatset = n_dev["matsets/mat"]; + const conduit::Node& n_srcMatset = n_dev["matsets/mat"]; auto srcMatset = views::make_unibuffer_matset::view(n_srcMatset); using SrcMatsetView = decltype(srcMatset); @@ -274,7 +274,7 @@ class test_Polygonal_MIR views::make_explicit_coordset::view(n_dev["coordsets/target2_coords"]); using TargetCoordsetView = decltype(targetCoordset); - const conduit::Node &n_targetTopo = n_dev["topologies/target2"]; + const conduit::Node& n_targetTopo = n_dev["topologies/target2"]; auto targetTopo = views::make_unstructured_single_shape_topology>::view( n_targetTopo); @@ -297,20 +297,20 @@ class test_Polygonal_MIR mapper.execute(n_dev, n_opts, n_dev); } - static void mir_target2(conduit::Node &n_dev) + static void mir_target2(conduit::Node& n_dev) { // Wrap target2 mesh in views. auto coordsetView = views::make_explicit_coordset::view(n_dev["coordsets/target2_coords"]); using CoordsetView = decltype(coordsetView); - const conduit::Node &n_targetTopo = n_dev["topologies/target2"]; + const conduit::Node& n_targetTopo = n_dev["topologies/target2"]; auto topologyView = views::make_unstructured_single_shape_topology>::view( n_targetTopo); using TopologyView = decltype(topologyView); - const conduit::Node &n_targetMatset = n_dev["matsets/target2_matset"]; + const conduit::Node& n_targetMatset = n_dev["matsets/target2_matset"]; auto matsetView = views::make_unibuffer_matset::view(n_targetMatset); using MatsetView = decltype(matsetView); @@ -334,7 +334,7 @@ class test_Polygonal_MIR n_dev["fields/originalElements/topology"] = "mir"; } - static int countBadMaterialZones(const conduit::Node &matset, double eps = 1.e-4) + static int countBadMaterialZones(const conduit::Node& matset, double eps = 1.e-4) { const auto volume_fractions = utils::make_array_view(matset["volume_fractions"]); //const auto material_ids = utils::make_array_view(matset["material_ids"]); @@ -481,7 +481,7 @@ TEST(mir_equiz, equiz_polygonal_unibuffer_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/mir/tests/mir_equiz3d.cpp b/src/axom/mir/tests/mir_equiz3d.cpp index a2691784ef..154a6747da 100644 --- a/src/axom/mir/tests/mir_equiz3d.cpp +++ b/src/axom/mir/tests/mir_equiz3d.cpp @@ -24,7 +24,7 @@ axom::blueprint::testing::TestApplication TestApp; //------------------------------------------------------------------------------ template -void braid3d_mat_test(const std::string &type, const std::string &mattype, const std::string &name) +void braid3d_mat_test(const std::string& type, const std::string& mattype, const std::string& name) { axom::StackArray dims {11, 11, 11}; axom::StackArray zoneDims {dims[0] - 1, dims[1] - 1, dims[2] - 1}; @@ -117,7 +117,7 @@ TEST(mir_equiz, equiz_hex_unibuffer_hip) #endif //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); return TestApp.execute(argc, argv); diff --git a/src/axom/multimat/examples/basic.cpp b/src/axom/multimat/examples/basic.cpp index 9472f224e3..f9fe5f7ce4 100644 --- a/src/axom/multimat/examples/basic.cpp +++ b/src/axom/multimat/examples/basic.cpp @@ -19,7 +19,7 @@ #include #include -void addfields(axom::multimat::MultiMat &mm) +void addfields(axom::multimat::MultiMat& mm) { // clang-format off @@ -92,7 +92,7 @@ void addfields(axom::multimat::MultiMat &mm) // clang-format on } -void multicomponent(axom::multimat::MultiMat &mm) +void multicomponent(axom::multimat::MultiMat& mm) { // clang-format off @@ -120,7 +120,7 @@ void multicomponent(axom::multimat::MultiMat &mm) // clang-format on } -void introspection(axom::multimat::MultiMat &mm) +void introspection(axom::multimat::MultiMat& mm) { //_multimat_using_fields_introspection_begin @@ -143,7 +143,7 @@ void introspection(axom::multimat::MultiMat &mm) //_multimat_using_fields_introspection_end } -void using_fields_index_sets(axom::multimat::MultiMat &mm) +void using_fields_index_sets(axom::multimat::MultiMat& mm) { //_multimat_using_fields_index_sets_begin // CELL_DOM data (iterate over cells then materials) @@ -153,7 +153,7 @@ void using_fields_index_sets(axom::multimat::MultiMat &mm) for(int i = 0; i < mm.getNumberOfCells(); i++) { std::cout << "\tcell " << i << " values: "; - for(const auto &idx : mm.getIndexingSetOfCell(i, axom::multimat::SparsityLayout::SPARSE)) + for(const auto& idx : mm.getIndexingSetOfCell(i, axom::multimat::SparsityLayout::SPARSE)) { std::cout << f[idx] << ", "; } @@ -162,7 +162,7 @@ void using_fields_index_sets(axom::multimat::MultiMat &mm) //_multimat_using_fields_index_sets_end } -void using_fields_1d(axom::multimat::MultiMat &mm) +void using_fields_1d(axom::multimat::MultiMat& mm) { // _multimat_using_fields_1d_start // Sum all values in the field. @@ -177,7 +177,7 @@ void using_fields_1d(axom::multimat::MultiMat &mm) SLIC_INFO(axom::fmt::format("sum={}", sum)); } -void using_fields_multi_component(axom::multimat::MultiMat &mm) +void using_fields_multi_component(axom::multimat::MultiMat& mm) { // _multimat_using_fields_1dmc_start double sum = 0.; @@ -194,7 +194,7 @@ void using_fields_multi_component(axom::multimat::MultiMat &mm) SLIC_INFO(axom::fmt::format("sum={}", sum)); } -void dynamic_mode(axom::multimat::MultiMat &mm) +void dynamic_mode(axom::multimat::MultiMat& mm) { //_multimat_dynamic_mode_begin // mm is a MultiMat object. @@ -221,7 +221,7 @@ void dynamic_mode(axom::multimat::MultiMat &mm) * \param mm The MultiMat object that contains the materials and fields. * \param mesh The node that contains the Blueprint mesh. */ -void multimat_to_blueprint(axom::multimat::MultiMat &mm, conduit::Node &mesh) +void multimat_to_blueprint(axom::multimat::MultiMat& mm, conduit::Node& mesh) { // Multimat to matset. const auto VF = mm.get2dField("Volfrac"); @@ -268,14 +268,14 @@ void multimat_to_blueprint(axom::multimat::MultiMat &mm, conduit::Node &mesh) auto mapping = mm.getFieldMapping(i); SLIC_ASSERT(mm.getFieldDataType(i) == axom::multimat::DataTypeSupported::TypeDouble); - conduit::Node &n_f = mesh["fields/" + name]; + conduit::Node& n_f = mesh["fields/" + name]; n_f["association"] = "element"; n_f["topology"] = "main"; if(mapping == axom::multimat::FieldMapping::PER_CELL) { auto f = mm.get1dField(name); - double *dptr = &f[0]; + double* dptr = &f[0]; if(f.numComp() == 1) { @@ -325,9 +325,9 @@ void multimat_to_blueprint(axom::multimat::MultiMat &mm, conduit::Node &mesh) { const auto matsInCell = mm.getMatInCell(c); double avg = 0.; - for(auto &m : matsInCell) + for(auto& m : matsInCell) { - double *valptr = f.findValue(c, m); + double* valptr = f.findValue(c, m); if(valptr != nullptr) { matset_values.push_back(*valptr); @@ -348,11 +348,11 @@ void multimat_to_blueprint(axom::multimat::MultiMat &mm, conduit::Node &mesh) { const auto matsInCell = mm.getMatInCell(c); double avg[3] = {0., 0., 0.}; - for(auto &m : matsInCell) + for(auto& m : matsInCell) { for(int comp = 0; comp < f.numComp(); comp++) { - double *valptr = f.findValue(c, m, comp); + double* valptr = f.findValue(c, m, comp); if(valptr != nullptr) { matset_values[comp].push_back(*valptr); @@ -382,9 +382,9 @@ void multimat_to_blueprint(axom::multimat::MultiMat &mm, conduit::Node &mesh) * * \param mm The MultiMat object to save. It is compatible with the mesh in this routine. */ -void save_blueprint(axom::multimat::MultiMat &mm) +void save_blueprint(axom::multimat::MultiMat& mm) { - const char *yaml = R"( + const char* yaml = R"( coordsets: coords: type: explicit @@ -413,7 +413,7 @@ void save_blueprint(axom::multimat::MultiMat &mm) } #endif -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { axom::slic::SimpleLogger logger(axom::slic::message::Info); axom::CLI::App app; diff --git a/src/axom/primal/operators/compute_bounding_box.hpp b/src/axom/primal/operators/compute_bounding_box.hpp index dcf03c3847..09f5ba33a8 100644 --- a/src/axom/primal/operators/compute_bounding_box.hpp +++ b/src/axom/primal/operators/compute_bounding_box.hpp @@ -41,7 +41,7 @@ namespace primal * \note if n <= 0, invokes default constructor */ template -OrientedBoundingBox compute_oriented_bounding_box(const Point *pts, int n) +OrientedBoundingBox compute_oriented_bounding_box(const Point* pts, int n) { return OrientedBoundingBox(pts, n); } @@ -56,8 +56,8 @@ OrientedBoundingBox compute_oriented_bounding_box(const Point -OrientedBoundingBox merge_boxes(const OrientedBoundingBox &l, - const OrientedBoundingBox &r) +OrientedBoundingBox merge_boxes(const OrientedBoundingBox& l, + const OrientedBoundingBox& r) { // TODO: See if this initial check can be improved so it's not so costly in // cases where it doesn't end up helping @@ -95,7 +95,7 @@ OrientedBoundingBox merge_boxes(const OrientedBoundingBox &l */ template -BoundingBox merge_boxes(const BoundingBox &l, const BoundingBox &r) +BoundingBox merge_boxes(const BoundingBox& l, const BoundingBox& r) { BoundingBox res(l); res.addBox(r); @@ -108,7 +108,7 @@ BoundingBox merge_boxes(const BoundingBox &l, const Bounding * \param [in] tri The Triangle */ template -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Triangle &tri) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Triangle& tri) { return BoundingBox {tri[0], tri[1], tri[2]}; } @@ -119,7 +119,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Triangle -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Quadrilateral &quad) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Quadrilateral& quad) { return BoundingBox {quad[0], quad[1], quad[2], quad[3]}; } @@ -130,7 +130,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Quadrilateral< * \param [in] oct The Octahedron */ template -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Octahedron &oct) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Octahedron& oct) { return BoundingBox {oct[0], oct[1], oct[2], oct[3], oct[4], oct[5]}; } @@ -141,7 +141,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Octahedron -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Hexahedron &hex) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Hexahedron& hex) { return BoundingBox {hex[0], hex[1], hex[2], hex[3], hex[4], hex[5], hex[6], hex[7]}; } @@ -152,7 +152,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Hexahedron -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Polyhedron &poly) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Polyhedron& poly) { BoundingBox res; for(int i = 0; i < poly.numVertices(); i++) @@ -168,7 +168,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Polyhedron -AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Tetrahedron &tet) +AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Tetrahedron& tet) { return BoundingBox {tet[0], tet[1], tet[2], tet[3]}; } @@ -180,7 +180,7 @@ AXOM_HOST_DEVICE BoundingBox compute_bounding_box(const Tetrahedron AXOM_HOST_DEVICE BoundingBox compute_bounding_box( - const Polygon &poly) + const Polygon& poly) { BoundingBox res; for(int i = 0; i < poly.numVertices(); ++i) diff --git a/src/axom/primal/operators/detail/intersect_bezier_impl.hpp b/src/axom/primal/operators/detail/intersect_bezier_impl.hpp index 57fd1b8118..bcd61b7c04 100644 --- a/src/axom/primal/operators/detail/intersect_bezier_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_bezier_impl.hpp @@ -62,10 +62,10 @@ namespace detail * \sa intersect_bezier */ template -bool intersect_bezier_curves(const BezierCurve &c1, - const BezierCurve &c2, - axom::Array &sp, - axom::Array &tp, +bool intersect_bezier_curves(const BezierCurve& c1, + const BezierCurve& c2, + axom::Array& sp, + axom::Array& tp, double sq_tol, int order1, int order2, @@ -101,12 +101,12 @@ bool intersect_bezier_curves(const BezierCurve &c1, * \note This function does not properly handle collinear lines */ template -bool intersect_2d_linear(const Point &a, - const Point &b, - const Point &c, - const Point &d, - T &s, - T &t); +bool intersect_2d_linear(const Point& a, + const Point& b, + const Point& c, + const Point& d, + T& s, + T& t); /*! * \brief Recursive function to find intersections between a ray and a Bezier curve @@ -137,10 +137,10 @@ bool intersect_2d_linear(const Point &a, * \sa intersect_bezier */ template -bool intersect_ray_bezier(const Ray &r, - const BezierCurve &c, - axom::Array &rp, - axom::Array &cp, +bool intersect_ray_bezier(const Ray& r, + const BezierCurve& c, + axom::Array& rp, + axom::Array& cp, double sq_tol, double EPS, int order, @@ -177,10 +177,10 @@ bool intersect_ray_bezier(const Ray &r, * \sa intersect_bezier */ template -bool intersect_circle_bezier(const Sphere &circle, - const BezierCurve &curve, - axom::Array &circle_params, - axom::Array &curve_params, +bool intersect_circle_bezier(const Sphere& circle, + const BezierCurve& curve, + axom::Array& circle_params, + axom::Array& curve_params, double sq_tol, double EPS, int order, @@ -201,21 +201,21 @@ bool intersect_circle_bezier(const Sphere &circle, * of Bezier curves. */ template -bool intersect_2d_circle_line(const Sphere &circ, - const Point &a, - const Point &b, - T &c1, - T &c2, - T &t1, - T &t2, +bool intersect_2d_circle_line(const Sphere& circ, + const Point& a, + const Point& b, + T& c1, + T& c2, + T& t1, + T& t2, double EPS); //------------------------------ IMPLEMENTATIONS ------------------------------ template -bool intersect_bezier_curves(const BezierCurve &c1, - const BezierCurve &c2, - axom::Array &sp, - axom::Array &tp, +bool intersect_bezier_curves(const BezierCurve& c1, + const BezierCurve& c2, + axom::Array& sp, + axom::Array& tp, double sq_tol, int order1, int order2, @@ -280,12 +280,12 @@ bool intersect_bezier_curves(const BezierCurve &c1, } template -bool intersect_2d_linear(const Point &a, - const Point &b, - const Point &c, - const Point &d, - T &s, - T &t) +bool intersect_2d_linear(const Point& a, + const Point& b, + const Point& c, + const Point& d, + T& s, + T& t) { // Implementation inspired by Section 5.1.9.1 of // C. Ericson's Real-Time Collision Detection book @@ -322,10 +322,10 @@ bool intersect_2d_linear(const Point &a, } template -bool intersect_ray_bezier(const Ray &r, - const BezierCurve &c, - axom::Array &rp, - axom::Array &cp, +bool intersect_ray_bezier(const Ray& r, + const BezierCurve& c, + axom::Array& rp, + axom::Array& cp, double sq_tol, double EPS, int order, @@ -391,10 +391,10 @@ bool intersect_ray_bezier(const Ray &r, } template -bool intersect_circle_bezier(const Sphere &circle, - const BezierCurve &curve, - axom::Array &circle_p, - axom::Array &curve_p, +bool intersect_circle_bezier(const Sphere& circle, + const BezierCurve& curve, + axom::Array& circle_p, + axom::Array& curve_p, double sq_tol, double EPS, int order, @@ -457,13 +457,13 @@ bool intersect_circle_bezier(const Sphere &circle, } template -bool intersect_2d_circle_line(const Sphere &circ, - const Point &a, - const Point &b, - T &c1, - T &c2, - T &t1, - T &t2, +bool intersect_2d_circle_line(const Sphere& circ, + const Point& a, + const Point& b, + T& c1, + T& c2, + T& t1, + T& t2, double EPS) { T dx = b[0] - a[0]; @@ -541,10 +541,10 @@ bool intersect_2d_circle_line(const Sphere &circ, } template -bool intersect_nurbscurves(const NURBSCurve &n1, - const NURBSCurve &n2, - axom::Array &p1, - axom::Array &p2, +bool intersect_nurbscurves(const NURBSCurve& n1, + const NURBSCurve& n2, + axom::Array& p1, + axom::Array& p2, double tol) { // Decompose both NURBS curves into Bezier segments diff --git a/src/axom/primal/operators/detail/intersect_patch_impl.hpp b/src/axom/primal/operators/detail/intersect_patch_impl.hpp index 9c21a69bc2..a8634b4807 100644 --- a/src/axom/primal/operators/detail/intersect_patch_impl.hpp +++ b/src/axom/primal/operators/detail/intersect_patch_impl.hpp @@ -69,11 +69,11 @@ namespace detail * \return False if an early return was triggered (failure). True otherwise */ template -bool intersect_line_patch(const Line &line, - const BezierPatch &patch, - axom::Array &tp, - axom::Array &up, - axom::Array &vp, +bool intersect_line_patch(const Line& line, + const BezierPatch& patch, + axom::Array& tp, + axom::Array& up, + axom::Array& vp, int order_u, int order_v, double u_offset, @@ -83,16 +83,16 @@ bool intersect_line_patch(const Line &line, double sq_tol, double EPS, bool isRay, - bool &success); + bool& success); //------------------------------ IMPLEMENTATIONS ------------------------------ template -bool intersect_line_patch(const Line &line, - const BezierPatch &patch, - axom::Array &tp, - axom::Array &up, - axom::Array &vp, +bool intersect_line_patch(const Line& line, + const BezierPatch& patch, + axom::Array& tp, + axom::Array& up, + axom::Array& vp, int order_u, int order_v, double u_offset, @@ -102,7 +102,7 @@ bool intersect_line_patch(const Line &line, double sq_tol, double EPS, bool isRay, - bool &success) + bool& success) { using BPatch = BezierPatch; diff --git a/src/axom/primal/tests/primal_clip_perf.cpp b/src/axom/primal/tests/primal_clip_perf.cpp index a4b883452a..3897b0114b 100644 --- a/src/axom/primal/tests/primal_clip_perf.cpp +++ b/src/axom/primal/tests/primal_clip_perf.cpp @@ -48,10 +48,10 @@ constexpr bool tryFixOrientation = false; constexpr axom::IndexType repCount = 10000; // For reliable timings, try 1e6. template -void time_repeat_clips(const Primal3D::TetrahedronType &a, - const Primal3D::TetrahedronType &b, +void time_repeat_clips(const Primal3D::TetrahedronType& a, + const Primal3D::TetrahedronType& b, axom::IndexType count, - const std::string &caseName) + const std::string& caseName) { using namespace Primal3D; const std::string timerName = caseName + axom::execution_space::name(); @@ -87,10 +87,10 @@ void time_repeat_clips(const Primal3D::TetrahedronType &a, EXPECT_NEAR(avgVol, singleVol, EPS); } -void time_repeat_clips_all(const Primal3D::TetrahedronType &a, - const Primal3D::TetrahedronType &b, +void time_repeat_clips_all(const Primal3D::TetrahedronType& a, + const Primal3D::TetrahedronType& b, axom::IndexType count, - const std::string &caseName) + const std::string& caseName) { time_repeat_clips(a, b, count, caseName); @@ -284,7 +284,7 @@ TEST(primal_clip, eight_point5) } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/quest/LinearizeCurves.hpp b/src/axom/quest/LinearizeCurves.hpp index a69ac76850..39115b1d3a 100644 --- a/src/axom/quest/LinearizeCurves.hpp +++ b/src/axom/quest/LinearizeCurves.hpp @@ -43,7 +43,7 @@ class LinearizeCurves * \param[in] mesh The mesh object that will contain the linearized line segments. * \param[in] segmentsPerKnotSpan The number of segments to make per knot span. */ - void getLinearMeshUniform(CurveArrayView curves, SegmentMesh *mesh, int segmentsPerKnotSpan) const; + void getLinearMeshUniform(CurveArrayView curves, SegmentMesh* mesh, int segmentsPerKnotSpan) const; /*! * \brief Projects high-order NURBS contours onto a linear mesh using \a percentError @@ -53,7 +53,7 @@ class LinearizeCurves * \param[in] mesh The mesh object that will contain the linearized line segments. * \param[in] percentError A percent of error that is acceptable to stop refinement. */ - void getLinearMeshNonUniform(CurveArrayView curves, SegmentMesh *mesh, double percentError) const; + void getLinearMeshNonUniform(CurveArrayView curves, SegmentMesh* mesh, double percentError) const; /*! * \brief Compute the revolved volume of the curves using quadrature. @@ -70,7 +70,7 @@ class LinearizeCurves * * \return The revolved volume. */ - double getRevolvedVolume(CurveArrayView curves, const numerics::Matrix &transform) const; + double getRevolvedVolume(CurveArrayView curves, const numerics::Matrix& transform) const; protected: /*! @@ -82,7 +82,7 @@ class LinearizeCurves * * \return The revolved volume. */ - double revolvedVolume(const NURBSCurve &nurbs, const numerics::Matrix &transform) const; + double revolvedVolume(const NURBSCurve& nurbs, const numerics::Matrix& transform) const; protected: double m_vertexWeldThreshold {1E-9}; diff --git a/src/axom/quest/MarchingCubes.hpp b/src/axom/quest/MarchingCubes.hpp index 4b663a0cbe..e3c6bd6191 100644 --- a/src/axom/quest/MarchingCubes.hpp +++ b/src/axom/quest/MarchingCubes.hpp @@ -138,15 +138,15 @@ class MarchingCubes * Some metadata from \a bpMesh may be cached. Any change to it * after setMesh() leads to undefined behavior. */ - void setMesh(const conduit::Node &bpMesh, - const std::string &topologyName, - const std::string &maskField = {}); + void setMesh(const conduit::Node& bpMesh, + const std::string& topologyName, + const std::string& maskField = {}); /*! * @brief Set the field containing the nodal function. * @param [in] fcnField Name of node-based scalar function values. */ - void setFunctionField(const std::string &fcnField); + void setFunctionField(const std::string& fcnField); /*! * @brief Set the mask value. @@ -194,9 +194,9 @@ class MarchingCubes * data to host memory. To access the data without deep-copying, see * the other output methods in this name group. */ - void populateContourMesh(axom::mint::UnstructuredMesh &mesh, - const std::string &cellIdField = {}, - const std::string &domainIdField = {}) const; + void populateContourMesh(axom::mint::UnstructuredMesh& mesh, + const std::string& cellIdField = {}, + const std::string& domainIdField = {}) const; /*! * @brief Return view of facet corner node indices (connectivity) Array. @@ -258,10 +258,10 @@ class MarchingCubes * @pre computeIsocontour() must have been called. * @post outputs can no longer be accessed from object, as though clearOutput() has been called. */ - void relinquishContourData(axom::Array &facetNodeIds, - axom::Array &facetNodeCoords, - axom::Array &facetParentIds, - axom::Array &facetDomainIds) + void relinquishContourData(axom::Array& facetNodeIds, + axom::Array& facetNodeCoords, + axom::Array& facetParentIds, + axom::Array& facetDomainIds) { facetNodeIds.clear(); facetNodeCoords.clear(); diff --git a/src/axom/quest/detail/Discretize_detail.hpp b/src/axom/quest/detail/Discretize_detail.hpp index 5d0b158174..f1977bbf7a 100644 --- a/src/axom/quest/detail/Discretize_detail.hpp +++ b/src/axom/quest/detail/Discretize_detail.hpp @@ -32,7 +32,7 @@ using NAType = axom::NumericArray; * in a right-handed way (thumb points out the axis, fingers spin segment * toward wrist). */ -inline OctType from_segment(const Point2D &a, const Point2D &b) +inline OctType from_segment(const Point2D& a, const Point2D& b) { const double SQ_3_2 = sqrt(3.) / 2.; @@ -83,7 +83,7 @@ inline int count_segment_prisms(int levels) } AXOM_HOST_DEVICE -Point3D rescale_YZ(const Point3D &p, double new_dst) +Point3D rescale_YZ(const Point3D& p, double new_dst) { const double cur_dst = axom::utilities::clampLower(sqrt(p[1] * p[1] + p[2] * p[2]), axom::primal::PRIMAL_TINY); @@ -96,7 +96,7 @@ Point3D rescale_YZ(const Point3D &p, double new_dst) } AXOM_HOST_DEVICE -inline OctType new_inscribed_prism(OctType &old_oct, +inline OctType new_inscribed_prism(OctType& old_oct, int p_off, int s_off, int t_off, @@ -148,7 +148,7 @@ inline OctType new_inscribed_prism(OctType &old_oct, * quadrilateral side-wall. */ template -int discrSeg(const Point2D &a, const Point2D &b, int levels, axom::ArrayView &out, int idx) +int discrSeg(const Point2D& a, const Point2D& b, int levels, axom::ArrayView& out, int idx) { int hostAllocID = axom::execution_space::allocatorID(); @@ -171,7 +171,7 @@ int discrSeg(const Point2D &a, const Point2D &b, int levels, axom::ArrayView(1, hostAllocID); + OctType* oct_from_seg = axom::allocate(1, hostAllocID); oct_from_seg[0] = from_segment(a, b); axom::copy(out.data() + idx + 0, oct_from_seg, sizeof(OctType)); @@ -259,11 +259,11 @@ namespace quest * This routine resizes and populates an Array pointed to by \a out. */ template -bool discretize(const axom::ArrayView &polyline, +bool discretize(const axom::ArrayView& polyline, int pointcount, int levels, - axom::Array &out, - int &octcount) + axom::Array& out, + int& octcount) { SLIC_ERROR_IF(!axom::execution_space::usesAllocId(out.getAllocatorID()), axom::fmt::format("Execution space {} cannot access allocator id {}", @@ -275,8 +275,8 @@ bool discretize(const axom::ArrayView &polyline, int segmentcount = pointcount - 1; for(int seg = 0; seg < segmentcount && stillValid; ++seg) { - const Point2D &a = polyline[seg]; - const Point2D &b = polyline[seg + 1]; + const Point2D& a = polyline[seg]; + const Point2D& b = polyline[seg + 1]; if(a[1] < 0 || b[1] < 0) { stillValid = false; diff --git a/src/axom/quest/detail/MarchingCubesSingleDomain.hpp b/src/axom/quest/detail/MarchingCubesSingleDomain.hpp index 7ecb9d4b32..9e822a20f0 100644 --- a/src/axom/quest/detail/MarchingCubesSingleDomain.hpp +++ b/src/axom/quest/detail/MarchingCubesSingleDomain.hpp @@ -56,7 +56,7 @@ class MarchingCubesSingleDomain /*! \brief Constructor for applying algorithm in a single domain. */ - MarchingCubesSingleDomain(MarchingCubes &mc); + MarchingCubesSingleDomain(MarchingCubes& mc); ~MarchingCubesSingleDomain() { } @@ -80,9 +80,9 @@ class MarchingCubesSingleDomain requirement may be relaxed, possibly at the cost of a transformation and storage of the temporary contiguous layout. */ - void setDomain(const conduit::Node &dom, - const std::string &topologyName, - const std::string &maskfield); + void setDomain(const conduit::Node& dom, + const std::string& topologyName, + const std::string& maskfield); int spatialDimension() const { return m_ndim; } @@ -91,7 +91,7 @@ class MarchingCubesSingleDomain in the input mesh. \param [in] fcnField Name of node-based scalar function values. */ - void setFunctionField(const std::string &fcnField) + void setFunctionField(const std::string& fcnField) { m_fcnFieldName = fcnField; m_fcnPath = "fields/" + fcnField; @@ -154,11 +154,11 @@ class MarchingCubesSingleDomain * Put in here codes that can't be in MarchingCubesSingleDomain * due to template use (DIM and ExecSpace). */ - virtual void setDomain(const conduit::Node &dom, - const std::string &topologyName, - const std::string &maskPath = {}) = 0; + virtual void setDomain(const conduit::Node& dom, + const std::string& topologyName, + const std::string& maskPath = {}) = 0; - virtual void setFunctionField(const std::string &fcnFieldName) = 0; + virtual void setFunctionField(const std::string& fcnFieldName) = 0; virtual void setContourValue(double contourVal) = 0; virtual void setMaskValue(int maskVal) = 0; @@ -187,9 +187,9 @@ class MarchingCubesSingleDomain virtual axom::IndexType getContourCellCount() const = 0; ///@} - void setOutputBuffers(axom::ArrayView &facetNodeIds, - axom::ArrayView &facetNodeCoords, - axom::ArrayView &facetParentIds, + void setOutputBuffers(axom::ArrayView& facetNodeIds, + axom::ArrayView& facetNodeCoords, + axom::ArrayView& facetParentIds, axom::IndexType facetIndexOffset) { m_facetNodeIds = facetNodeIds; @@ -212,11 +212,11 @@ class MarchingCubesSingleDomain axom::IndexType m_facetIndexOffset = -1; }; - ImplBase &getImpl() { return *m_impl; } + ImplBase& getImpl() { return *m_impl; } private: //! @brief Multi-domain implementation this object is under. - MarchingCubes &m_mc; + MarchingCubes& m_mc; RuntimePolicy m_runtimePolicy; int m_allocatorID = axom::INVALID_ALLOCATOR_ID; @@ -225,7 +225,7 @@ class MarchingCubesSingleDomain MarchingCubesDataParallelism m_dataParallelism = MarchingCubesDataParallelism::byPolicy; //! \brief Computational mesh as a conduit::Node. - const conduit::Node *m_dom; + const conduit::Node* m_dom; int m_ndim; //! @brief Name of Blueprint topology in m_dom. @@ -249,7 +249,7 @@ class MarchingCubesSingleDomain * * Some data from \a dom may be cached. */ - void setDomain(const conduit::Node &dom); + void setDomain(const conduit::Node& dom); /// @brief Allocate MarchingCubesImpl object std::unique_ptr newMarchingCubesImpl(); diff --git a/src/axom/quest/interface/c_fortran/typesQUEST.h b/src/axom/quest/interface/c_fortran/typesQUEST.h index 9aae0b530a..c8f2ec98d6 100644 --- a/src/axom/quest/interface/c_fortran/typesQUEST.h +++ b/src/axom/quest/interface/c_fortran/typesQUEST.h @@ -37,13 +37,13 @@ extern "C" { // helper capsule_data struct s_QUEST_SHROUD_capsule_data { - void *addr; /* address of C++ memory */ + void* addr; /* address of C++ memory */ int idtor; /* index of destructor */ int cmemflags; /* memory flags */ }; typedef struct s_QUEST_SHROUD_capsule_data QUEST_SHROUD_capsule_data; -void QUEST_SHROUD_memory_destructor(QUEST_SHROUD_capsule_data *cap); +void QUEST_SHROUD_memory_destructor(QUEST_SHROUD_capsule_data* cap); #ifdef __cplusplus } diff --git a/src/axom/quest/interface/c_fortran/utilQUEST.cpp b/src/axom/quest/interface/c_fortran/utilQUEST.cpp index 1413436394..8768f37e91 100644 --- a/src/axom/quest/interface/c_fortran/utilQUEST.cpp +++ b/src/axom/quest/interface/c_fortran/utilQUEST.cpp @@ -14,7 +14,7 @@ extern "C" { #endif // Release library allocated memory. -void QUEST_SHROUD_memory_destructor(QUEST_SHROUD_capsule_data *cap) +void QUEST_SHROUD_memory_destructor(QUEST_SHROUD_capsule_data* cap) { cap->addr = nullptr; cap->idtor = 0; // avoid deleting again diff --git a/src/axom/quest/interface/c_fortran/wrapQUEST.cpp b/src/axom/quest/interface/c_fortran/wrapQUEST.cpp index 6cb18f9092..f1ab310214 100644 --- a/src/axom/quest/interface/c_fortran/wrapQUEST.cpp +++ b/src/axom/quest/interface/c_fortran/wrapQUEST.cpp @@ -20,7 +20,7 @@ extern "C" { // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -39,7 +39,7 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer end C_definitions #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi(const char *fileName, MPI_Fint comm) +int QUEST_inout_init_mpi(const char* fileName, MPI_Fint comm) { // splicer begin function.inout_init_mpi const std::string SHC_fileName_cxx(fileName); @@ -51,7 +51,7 @@ int QUEST_inout_init_mpi(const char *fileName, MPI_Fint comm) #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi_bufferify(char *fileName, int SHT_fileName_len, MPI_Fint comm) +int QUEST_inout_init_mpi_bufferify(char* fileName, int SHT_fileName_len, MPI_Fint comm) { // splicer begin function.inout_init_mpi_bufferify int SHC_fileName_trim = ShroudCharLenTrim(fileName, SHT_fileName_len); @@ -64,7 +64,7 @@ int QUEST_inout_init_mpi_bufferify(char *fileName, int SHT_fileName_len, MPI_Fin #endif // ifdef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial(const char *fileName) +int QUEST_inout_init_serial(const char* fileName) { // splicer begin function.inout_init_serial const std::string SHC_fileName_cxx(fileName); @@ -75,7 +75,7 @@ int QUEST_inout_init_serial(const char *fileName) #endif // ifndef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial_bufferify(char *fileName, int SHT_fileName_len) +int QUEST_inout_init_serial_bufferify(char* fileName, int SHT_fileName_len) { // splicer begin function.inout_init_serial_bufferify int SHC_fileName_trim = ShroudCharLenTrim(fileName, SHT_fileName_len); @@ -142,7 +142,7 @@ bool QUEST_inout_evaluate_1(double x, double y, double z) // splicer end function.inout_evaluate_1 } -int QUEST_inout_mesh_min_bounds(double *coords) +int QUEST_inout_mesh_min_bounds(double* coords) { // splicer begin function.inout_mesh_min_bounds int SHC_rv = axom::quest::inout_mesh_min_bounds(coords); @@ -150,7 +150,7 @@ int QUEST_inout_mesh_min_bounds(double *coords) // splicer end function.inout_mesh_min_bounds } -int QUEST_inout_mesh_max_bounds(double *coords) +int QUEST_inout_mesh_max_bounds(double* coords) { // splicer begin function.inout_mesh_max_bounds int SHC_rv = axom::quest::inout_mesh_max_bounds(coords); @@ -158,7 +158,7 @@ int QUEST_inout_mesh_max_bounds(double *coords) // splicer end function.inout_mesh_max_bounds } -int QUEST_inout_mesh_center_of_mass(double *coords) +int QUEST_inout_mesh_center_of_mass(double* coords) { // splicer begin function.inout_mesh_center_of_mass int SHC_rv = axom::quest::inout_mesh_center_of_mass(coords); @@ -183,7 +183,7 @@ int QUEST_inout_finalize(void) } #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi(const char *file, MPI_Fint comm) +int QUEST_signed_distance_init_mpi(const char* file, MPI_Fint comm) { // splicer begin function.signed_distance_init_mpi const std::string SHC_file_cxx(file); @@ -195,7 +195,7 @@ int QUEST_signed_distance_init_mpi(const char *file, MPI_Fint comm) #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi_bufferify(char *file, int SHT_file_len, MPI_Fint comm) +int QUEST_signed_distance_init_mpi_bufferify(char* file, int SHT_file_len, MPI_Fint comm) { // splicer begin function.signed_distance_init_mpi_bufferify int SHC_file_trim = ShroudCharLenTrim(file, SHT_file_len); @@ -208,7 +208,7 @@ int QUEST_signed_distance_init_mpi_bufferify(char *file, int SHT_file_len, MPI_F #endif // ifdef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial(const char *file) +int QUEST_signed_distance_init_serial(const char* file) { // splicer begin function.signed_distance_init_serial const std::string SHC_file_cxx(file); @@ -219,7 +219,7 @@ int QUEST_signed_distance_init_serial(const char *file) #endif // ifndef AXOM_USE_MPI #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial_bufferify(char *file, int SHT_file_len) +int QUEST_signed_distance_init_serial_bufferify(char* file, int SHT_file_len) { // splicer begin function.signed_distance_init_serial_bufferify int SHC_file_trim = ShroudCharLenTrim(file, SHT_file_len); @@ -238,7 +238,7 @@ bool QUEST_signed_distance_initialized(void) // splicer end function.signed_distance_initialized } -void QUEST_signed_distance_get_mesh_bounds(double *lo, double *hi) +void QUEST_signed_distance_get_mesh_bounds(double* lo, double* hi) { // splicer begin function.signed_distance_get_mesh_bounds axom::quest::signed_distance_get_mesh_bounds(lo, hi); @@ -321,12 +321,12 @@ double QUEST_signed_distance_evaluate_0(double x, double y, double z) double QUEST_signed_distance_evaluate_1(double x, double y, double z, - double *cp_x, - double *cp_y, - double *cp_z, - double *n_x, - double *n_y, - double *n_z) + double* cp_x, + double* cp_y, + double* cp_z, + double* n_x, + double* n_y, + double* n_z) { // splicer begin function.signed_distance_evaluate_1 double SHC_rv = diff --git a/src/axom/quest/interface/c_fortran/wrapQUEST.h b/src/axom/quest/interface/c_fortran/wrapQUEST.h index ce744d04fb..99f27c8a1b 100644 --- a/src/axom/quest/interface/c_fortran/wrapQUEST.h +++ b/src/axom/quest/interface/c_fortran/wrapQUEST.h @@ -49,19 +49,19 @@ enum QUEST_SignedDistExec }; #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi(const char *fileName, MPI_Fint comm); +int QUEST_inout_init_mpi(const char* fileName, MPI_Fint comm); #endif #ifdef AXOM_USE_MPI -int QUEST_inout_init_mpi_bufferify(char *fileName, int SHT_fileName_len, MPI_Fint comm); +int QUEST_inout_init_mpi_bufferify(char* fileName, int SHT_fileName_len, MPI_Fint comm); #endif #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial(const char *fileName); +int QUEST_inout_init_serial(const char* fileName); #endif #ifndef AXOM_USE_MPI -int QUEST_inout_init_serial_bufferify(char *fileName, int SHT_fileName_len); +int QUEST_inout_init_serial_bufferify(char* fileName, int SHT_fileName_len); #endif bool QUEST_inout_initialized(void); @@ -78,35 +78,35 @@ bool QUEST_inout_evaluate_0(double x, double y); bool QUEST_inout_evaluate_1(double x, double y, double z); -int QUEST_inout_mesh_min_bounds(double *coords); +int QUEST_inout_mesh_min_bounds(double* coords); -int QUEST_inout_mesh_max_bounds(double *coords); +int QUEST_inout_mesh_max_bounds(double* coords); -int QUEST_inout_mesh_center_of_mass(double *coords); +int QUEST_inout_mesh_center_of_mass(double* coords); int QUEST_inout_get_dimension(void); int QUEST_inout_finalize(void); #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi(const char *file, MPI_Fint comm); +int QUEST_signed_distance_init_mpi(const char* file, MPI_Fint comm); #endif #ifdef AXOM_USE_MPI -int QUEST_signed_distance_init_mpi_bufferify(char *file, int SHT_file_len, MPI_Fint comm); +int QUEST_signed_distance_init_mpi_bufferify(char* file, int SHT_file_len, MPI_Fint comm); #endif #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial(const char *file); +int QUEST_signed_distance_init_serial(const char* file); #endif #ifndef AXOM_USE_MPI -int QUEST_signed_distance_init_serial_bufferify(char *file, int SHT_file_len); +int QUEST_signed_distance_init_serial_bufferify(char* file, int SHT_file_len); #endif bool QUEST_signed_distance_initialized(void); -void QUEST_signed_distance_get_mesh_bounds(double *lo, double *hi); +void QUEST_signed_distance_get_mesh_bounds(double* lo, double* hi); void QUEST_signed_distance_set_dimension(int dim); @@ -131,12 +131,12 @@ double QUEST_signed_distance_evaluate_0(double x, double y, double z); double QUEST_signed_distance_evaluate_1(double x, double y, double z, - double *cp_x, - double *cp_y, - double *cp_z, - double *n_x, - double *n_y, - double *n_z); + double* cp_x, + double* cp_y, + double* cp_z, + double* n_x, + double* n_y, + double* n_z); void QUEST_signed_distance_finalize(void); diff --git a/src/axom/quest/interface/python/pyQUESTmodule.cpp b/src/axom/quest/interface/python/pyQUESTmodule.cpp index f7812b4c4c..7fa7185502 100644 --- a/src/axom/quest/interface/python/pyQUESTmodule.cpp +++ b/src/axom/quest/interface/python/pyQUESTmodule.cpp @@ -27,24 +27,24 @@ // splicer begin C_definition // splicer end C_definition -PyObject *PY_error_obj; +PyObject* PY_error_obj; // splicer begin additional_functions // splicer end additional_functions #ifdef AXOM_USE_MPI -static PyObject *PY_inout_init_mpi(PyObject *SHROUD_UNUSED(self), PyObject *args, PyObject *kwds) +static PyObject* PY_inout_init_mpi(PyObject* SHROUD_UNUSED(self), PyObject* args, PyObject* kwds) { // splicer begin function.inout_init_mpi - char *fileName; + char* fileName; MPI_Fint comm; - const char *SHT_kwlist[] = {"fileName", "comm", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"fileName", "comm", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "sO:inout_init", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &fileName, &comm)) return nullptr; @@ -52,42 +52,42 @@ static PyObject *PY_inout_init_mpi(PyObject *SHROUD_UNUSED(self), PyObject *args MPI_Comm SH_comm = MPI_Comm_f2c(comm); int SHCXX_rv = axom::quest::inout_init(SH_fileName, SH_comm); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_init_mpi } #endif // ifdef AXOM_USE_MPI #ifndef AXOM_USE_MPI -static PyObject *PY_inout_init_serial(PyObject *SHROUD_UNUSED(self), PyObject *args, PyObject *kwds) +static PyObject* PY_inout_init_serial(PyObject* SHROUD_UNUSED(self), PyObject* args, PyObject* kwds) { // splicer begin function.inout_init_serial - char *fileName; - const char *SHT_kwlist[] = {"fileName", nullptr}; - PyObject *SHTPy_rv = nullptr; + char* fileName; + const char* SHT_kwlist[] = {"fileName", nullptr}; + PyObject* SHTPy_rv = nullptr; - if(!PyArg_ParseTupleAndKeywords(args, kwds, "s:inout_init", const_cast(SHT_kwlist), &fileName)) + if(!PyArg_ParseTupleAndKeywords(args, kwds, "s:inout_init", const_cast(SHT_kwlist), &fileName)) return nullptr; const std::string SH_fileName(fileName); int SHCXX_rv = axom::quest::inout_init(SH_fileName); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_init_serial } #endif // ifndef AXOM_USE_MPI static char PY_inout_initialized__doc__[] = "documentation"; -static PyObject *PY_inout_initialized(PyObject *SHROUD_UNUSED(self), - PyObject *SHROUD_UNUSED(args), - PyObject *SHROUD_UNUSED(kwds)) +static PyObject* PY_inout_initialized(PyObject* SHROUD_UNUSED(self), + PyObject* SHROUD_UNUSED(args), + PyObject* SHROUD_UNUSED(kwds)) { // splicer begin function.inout_initialized - PyObject *SHTPy_rv = nullptr; + PyObject* SHTPy_rv = nullptr; bool SHCXX_rv = axom::quest::inout_initialized(); SHTPy_rv = PyBool_FromLong(SHCXX_rv); if(SHTPy_rv == nullptr) goto fail; - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; fail: Py_XDECREF(SHTPy_rv); @@ -97,114 +97,114 @@ static PyObject *PY_inout_initialized(PyObject *SHROUD_UNUSED(self), static char PY_inout_set_dimension__doc__[] = "documentation"; -static PyObject *PY_inout_set_dimension(PyObject *SHROUD_UNUSED(self), PyObject *args, PyObject *kwds) +static PyObject* PY_inout_set_dimension(PyObject* SHROUD_UNUSED(self), PyObject* args, PyObject* kwds) { // splicer begin function.inout_set_dimension int dim; - const char *SHT_kwlist[] = {"dim", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"dim", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i:inout_set_dimension", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &dim)) return nullptr; int SHCXX_rv = axom::quest::inout_set_dimension(dim); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_set_dimension } static char PY_inout_set_verbose__doc__[] = "documentation"; -static PyObject *PY_inout_set_verbose(PyObject *SHROUD_UNUSED(self), PyObject *args, PyObject *kwds) +static PyObject* PY_inout_set_verbose(PyObject* SHROUD_UNUSED(self), PyObject* args, PyObject* kwds) { // splicer begin function.inout_set_verbose bool verbosity; - PyObject *SHPy_verbosity; - const char *SHT_kwlist[] = {"verbosity", nullptr}; - PyObject *SHTPy_rv = nullptr; + PyObject* SHPy_verbosity; + const char* SHT_kwlist[] = {"verbosity", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!:inout_set_verbose", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &PyBool_Type, &SHPy_verbosity)) return nullptr; verbosity = PyObject_IsTrue(SHPy_verbosity); int SHCXX_rv = axom::quest::inout_set_verbose(verbosity); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_set_verbose } static char PY_inout_set_vertex_weld_threshold__doc__[] = "documentation"; -static PyObject *PY_inout_set_vertex_weld_threshold(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_inout_set_vertex_weld_threshold(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.inout_set_vertex_weld_threshold double thresh; - const char *SHT_kwlist[] = {"thresh", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"thresh", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "d:inout_set_vertex_weld_threshold", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &thresh)) return nullptr; int SHCXX_rv = axom::quest::inout_set_vertex_weld_threshold(thresh); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_set_vertex_weld_threshold } static char PY_inout_set_segments_per_knot_span__doc__[] = "documentation"; -static PyObject *PY_inout_set_segments_per_knot_span(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_inout_set_segments_per_knot_span(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.inout_set_segments_per_knot_span int segmentsPerKnotSpan; - const char *SHT_kwlist[] = {"segmentsPerKnotSpan", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"segmentsPerKnotSpan", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i:inout_set_segments_per_knot_span", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &segmentsPerKnotSpan)) return nullptr; int SHCXX_rv = axom::quest::inout_set_segments_per_knot_span(segmentsPerKnotSpan); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_set_segments_per_knot_span } static char PY_inout_evaluate_1__doc__[] = "documentation"; -static PyObject *PY_inout_evaluate_1(PyObject *SHROUD_UNUSED(self), PyObject *args, PyObject *kwds) +static PyObject* PY_inout_evaluate_1(PyObject* SHROUD_UNUSED(self), PyObject* args, PyObject* kwds) { // splicer begin function.inout_evaluate Py_ssize_t SH_nargs = 0; double x; double y; double z; - const char *SHT_kwlist[] = {"x", "y", "z", nullptr}; + const char* SHT_kwlist[] = {"x", "y", "z", nullptr}; bool SHCXX_rv; - PyObject *SHTPy_rv = nullptr; + PyObject* SHTPy_rv = nullptr; if(args != nullptr) SH_nargs += PyTuple_Size(args); if(kwds != nullptr) SH_nargs += PyDict_Size(args); if(!PyArg_ParseTupleAndKeywords(args, kwds, "dd|d:inout_evaluate", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &x, &y, &z)) @@ -223,7 +223,7 @@ static PyObject *PY_inout_evaluate_1(PyObject *SHROUD_UNUSED(self), PyObject *ar } SHTPy_rv = PyBool_FromLong(SHCXX_rv); if(SHTPy_rv == nullptr) goto fail; - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; fail: Py_XDECREF(SHTPy_rv); @@ -233,49 +233,49 @@ static PyObject *PY_inout_evaluate_1(PyObject *SHROUD_UNUSED(self), PyObject *ar static char PY_inout_get_dimension__doc__[] = "documentation"; -static PyObject *PY_inout_get_dimension(PyObject *SHROUD_UNUSED(self), - PyObject *SHROUD_UNUSED(args), - PyObject *SHROUD_UNUSED(kwds)) +static PyObject* PY_inout_get_dimension(PyObject* SHROUD_UNUSED(self), + PyObject* SHROUD_UNUSED(args), + PyObject* SHROUD_UNUSED(kwds)) { // splicer begin function.inout_get_dimension - PyObject *SHTPy_rv = nullptr; + PyObject* SHTPy_rv = nullptr; int SHCXX_rv = axom::quest::inout_get_dimension(); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_get_dimension } static char PY_inout_finalize__doc__[] = "documentation"; -static PyObject *PY_inout_finalize(PyObject *SHROUD_UNUSED(self), - PyObject *SHROUD_UNUSED(args), - PyObject *SHROUD_UNUSED(kwds)) +static PyObject* PY_inout_finalize(PyObject* SHROUD_UNUSED(self), + PyObject* SHROUD_UNUSED(args), + PyObject* SHROUD_UNUSED(kwds)) { // splicer begin function.inout_finalize - PyObject *SHTPy_rv = nullptr; + PyObject* SHTPy_rv = nullptr; int SHCXX_rv = axom::quest::inout_finalize(); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.inout_finalize } #ifdef AXOM_USE_MPI -static PyObject *PY_signed_distance_init_mpi(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_init_mpi(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_init_mpi - char *file; + char* file; MPI_Fint comm; - const char *SHT_kwlist[] = {"file", "comm", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"file", "comm", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "sO:signed_distance_init", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &file, &comm)) return nullptr; @@ -283,48 +283,48 @@ static PyObject *PY_signed_distance_init_mpi(PyObject *SHROUD_UNUSED(self), MPI_Comm SH_comm = MPI_Comm_f2c(comm); int SHCXX_rv = axom::quest::signed_distance_init(SH_file, SH_comm); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.signed_distance_init_mpi } #endif // ifdef AXOM_USE_MPI #ifndef AXOM_USE_MPI -static PyObject *PY_signed_distance_init_serial(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_init_serial(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_init_serial - char *file; - const char *SHT_kwlist[] = {"file", nullptr}; - PyObject *SHTPy_rv = nullptr; + char* file; + const char* SHT_kwlist[] = {"file", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "s:signed_distance_init", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &file)) return nullptr; const std::string SH_file(file); int SHCXX_rv = axom::quest::signed_distance_init(SH_file); SHTPy_rv = PyInt_FromLong(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.signed_distance_init_serial } #endif // ifndef AXOM_USE_MPI static char PY_signed_distance_initialized__doc__[] = "documentation"; -static PyObject *PY_signed_distance_initialized(PyObject *SHROUD_UNUSED(self), - PyObject *SHROUD_UNUSED(args), - PyObject *SHROUD_UNUSED(kwds)) +static PyObject* PY_signed_distance_initialized(PyObject* SHROUD_UNUSED(self), + PyObject* SHROUD_UNUSED(args), + PyObject* SHROUD_UNUSED(kwds)) { // splicer begin function.signed_distance_initialized - PyObject *SHTPy_rv = nullptr; + PyObject* SHTPy_rv = nullptr; bool SHCXX_rv = axom::quest::signed_distance_initialized(); SHTPy_rv = PyBool_FromLong(SHCXX_rv); if(SHTPy_rv == nullptr) goto fail; - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; fail: Py_XDECREF(SHTPy_rv); @@ -334,18 +334,18 @@ static PyObject *PY_signed_distance_initialized(PyObject *SHROUD_UNUSED(self), static char PY_signed_distance_set_dimension__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_dimension(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_dimension(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_dimension int dim; - const char *SHT_kwlist[] = {"dim", nullptr}; + const char* SHT_kwlist[] = {"dim", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i:signed_distance_set_dimension", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &dim)) return nullptr; axom::quest::signed_distance_set_dimension(dim); @@ -355,19 +355,19 @@ static PyObject *PY_signed_distance_set_dimension(PyObject *SHROUD_UNUSED(self), static char PY_signed_distance_set_closed_surface__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_closed_surface(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_closed_surface(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_closed_surface bool status; - PyObject *SHPy_status; - const char *SHT_kwlist[] = {"status", nullptr}; + PyObject* SHPy_status; + const char* SHT_kwlist[] = {"status", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!:signed_distance_set_closed_surface", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &PyBool_Type, &SHPy_status)) return nullptr; @@ -379,19 +379,19 @@ static PyObject *PY_signed_distance_set_closed_surface(PyObject *SHROUD_UNUSED(s static char PY_signed_distance_set_compute_signs__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_compute_signs(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_compute_signs(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_compute_signs bool computeSign; - PyObject *SHPy_computeSign; - const char *SHT_kwlist[] = {"computeSign", nullptr}; + PyObject* SHPy_computeSign; + const char* SHT_kwlist[] = {"computeSign", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!:signed_distance_set_compute_signs", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &PyBool_Type, &SHPy_computeSign)) return nullptr; @@ -403,18 +403,18 @@ static PyObject *PY_signed_distance_set_compute_signs(PyObject *SHROUD_UNUSED(se static char PY_signed_distance_set_allocator__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_allocator(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_allocator(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_allocator int allocatorID; - const char *SHT_kwlist[] = {"allocatorID", nullptr}; + const char* SHT_kwlist[] = {"allocatorID", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i:signed_distance_set_allocator", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &allocatorID)) return nullptr; axom::quest::signed_distance_set_allocator(allocatorID); @@ -424,19 +424,19 @@ static PyObject *PY_signed_distance_set_allocator(PyObject *SHROUD_UNUSED(self), static char PY_signed_distance_set_verbose__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_verbose(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_verbose(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_verbose bool status; - PyObject *SHPy_status; - const char *SHT_kwlist[] = {"status", nullptr}; + PyObject* SHPy_status; + const char* SHT_kwlist[] = {"status", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!:signed_distance_set_verbose", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &PyBool_Type, &SHPy_status)) return nullptr; @@ -448,19 +448,19 @@ static PyObject *PY_signed_distance_set_verbose(PyObject *SHROUD_UNUSED(self), static char PY_signed_distance_use_shared_memory__doc__[] = "documentation"; -static PyObject *PY_signed_distance_use_shared_memory(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_use_shared_memory(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_use_shared_memory bool status; - PyObject *SHPy_status; - const char *SHT_kwlist[] = {"status", nullptr}; + PyObject* SHPy_status; + const char* SHT_kwlist[] = {"status", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!:signed_distance_use_shared_memory", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &PyBool_Type, &SHPy_status)) return nullptr; @@ -472,18 +472,18 @@ static PyObject *PY_signed_distance_use_shared_memory(PyObject *SHROUD_UNUSED(se static char PY_signed_distance_set_shared_memory_size__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_shared_memory_size(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_shared_memory_size(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_shared_memory_size size_t minSegmentSize; - const char *SHT_kwlist[] = {"minSegmentSize", nullptr}; + const char* SHT_kwlist[] = {"minSegmentSize", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "n:signed_distance_set_shared_memory_size", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &minSegmentSize)) return nullptr; axom::quest::signed_distance_set_shared_memory_size(minSegmentSize); @@ -493,18 +493,18 @@ static PyObject *PY_signed_distance_set_shared_memory_size(PyObject *SHROUD_UNUS static char PY_signed_distance_set_execution_space__doc__[] = "documentation"; -static PyObject *PY_signed_distance_set_execution_space(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_set_execution_space(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_set_execution_space int execSpace; - const char *SHT_kwlist[] = {"execSpace", nullptr}; + const char* SHT_kwlist[] = {"execSpace", nullptr}; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i:signed_distance_set_execution_space", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &execSpace)) return nullptr; axom::quest::SignedDistExec SH_execSpace = static_cast(execSpace); @@ -513,34 +513,34 @@ static PyObject *PY_signed_distance_set_execution_space(PyObject *SHROUD_UNUSED( // splicer end function.signed_distance_set_execution_space } -static PyObject *PY_signed_distance_evaluate_0(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_evaluate_0(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_evaluate_0 double x; double y; double z; - const char *SHT_kwlist[] = {"x", "y", "z", nullptr}; - PyObject *SHTPy_rv = nullptr; + const char* SHT_kwlist[] = {"x", "y", "z", nullptr}; + PyObject* SHTPy_rv = nullptr; if(!PyArg_ParseTupleAndKeywords(args, kwds, "ddd:signed_distance_evaluate", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &x, &y, &z)) return nullptr; double SHCXX_rv = axom::quest::signed_distance_evaluate(x, y, z); SHTPy_rv = PyFloat_FromDouble(SHCXX_rv); - return (PyObject *)SHTPy_rv; + return (PyObject*)SHTPy_rv; // splicer end function.signed_distance_evaluate_0 } -static PyObject *PY_signed_distance_evaluate_1(PyObject *SHROUD_UNUSED(self), - PyObject *args, - PyObject *kwds) +static PyObject* PY_signed_distance_evaluate_1(PyObject* SHROUD_UNUSED(self), + PyObject* args, + PyObject* kwds) { // splicer begin function.signed_distance_evaluate_1 double x; @@ -552,13 +552,13 @@ static PyObject *PY_signed_distance_evaluate_1(PyObject *SHROUD_UNUSED(self), double n_x; double n_y; double n_z; - const char *SHT_kwlist[] = {"x", "y", "z", "cp_x", "cp_y", "cp_z", "n_x", "n_y", "n_z", nullptr}; - PyObject *SHTPy_rv = nullptr; // return value object + const char* SHT_kwlist[] = {"x", "y", "z", "cp_x", "cp_y", "cp_z", "n_x", "n_y", "n_z", nullptr}; + PyObject* SHTPy_rv = nullptr; // return value object if(!PyArg_ParseTupleAndKeywords(args, kwds, "ddddddddd:signed_distance_evaluate", - const_cast(SHT_kwlist), + const_cast(SHT_kwlist), &x, &y, &z, @@ -577,9 +577,9 @@ static PyObject *PY_signed_distance_evaluate_1(PyObject *SHROUD_UNUSED(self), static char PY_signed_distance_finalize__doc__[] = "documentation"; -static PyObject *PY_signed_distance_finalize(PyObject *SHROUD_UNUSED(self), - PyObject *SHROUD_UNUSED(args), - PyObject *SHROUD_UNUSED(kwds)) +static PyObject* PY_signed_distance_finalize(PyObject* SHROUD_UNUSED(self), + PyObject* SHROUD_UNUSED(args), + PyObject* SHROUD_UNUSED(kwds)) { // splicer begin function.signed_distance_finalize axom::quest::signed_distance_finalize(); @@ -589,13 +589,13 @@ static PyObject *PY_signed_distance_finalize(PyObject *SHROUD_UNUSED(self), static char PY_inout_init__doc__[] = "documentation"; -static PyObject *PY_inout_init(PyObject *self, PyObject *args, PyObject *kwds) +static PyObject* PY_inout_init(PyObject* self, PyObject* args, PyObject* kwds) { // splicer begin function.inout_init Py_ssize_t SHT_nargs = 0; if(args != nullptr) SHT_nargs += PyTuple_Size(args); if(kwds != nullptr) SHT_nargs += PyDict_Size(args); - PyObject *rvobj; + PyObject* rvobj; #ifdef AXOM_USE_MPI if(SHT_nargs == 2) { @@ -633,13 +633,13 @@ static PyObject *PY_inout_init(PyObject *self, PyObject *args, PyObject *kwds) static char PY_signed_distance_init__doc__[] = "documentation"; -static PyObject *PY_signed_distance_init(PyObject *self, PyObject *args, PyObject *kwds) +static PyObject* PY_signed_distance_init(PyObject* self, PyObject* args, PyObject* kwds) { // splicer begin function.signed_distance_init Py_ssize_t SHT_nargs = 0; if(args != nullptr) SHT_nargs += PyTuple_Size(args); if(kwds != nullptr) SHT_nargs += PyDict_Size(args); - PyObject *rvobj; + PyObject* rvobj; #ifdef AXOM_USE_MPI if(SHT_nargs == 2) { @@ -677,13 +677,13 @@ static PyObject *PY_signed_distance_init(PyObject *self, PyObject *args, PyObjec static char PY_signed_distance_evaluate__doc__[] = "documentation"; -static PyObject *PY_signed_distance_evaluate(PyObject *self, PyObject *args, PyObject *kwds) +static PyObject* PY_signed_distance_evaluate(PyObject* self, PyObject* args, PyObject* kwds) { // splicer begin function.signed_distance_evaluate Py_ssize_t SHT_nargs = 0; if(args != nullptr) SHT_nargs += PyTuple_Size(args); if(kwds != nullptr) SHT_nargs += PyDict_Size(args); - PyObject *rvobj; + PyObject* rvobj; if(SHT_nargs == 3) { rvobj = PY_signed_distance_evaluate_0(self, args, kwds); @@ -798,24 +798,24 @@ static char PY__doc__[] = "library documentation"; struct module_state { - PyObject *error; + PyObject* error; }; #if PY_MAJOR_VERSION >= 3 - #define GETSTATE(m) ((struct module_state *)PyModule_GetState(m)) + #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) #else #define GETSTATE(m) (&_state) static struct module_state _state; #endif #if PY_MAJOR_VERSION >= 3 -static int quest_traverse(PyObject *m, visitproc visit, void *arg) +static int quest_traverse(PyObject* m, visitproc visit, void* arg) { Py_VISIT(GETSTATE(m)->error); return 0; } -static int quest_clear(PyObject *m) +static int quest_clear(PyObject* m) { Py_CLEAR(GETSTATE(m)->error); return 0; @@ -847,8 +847,8 @@ PyInit_quest(void) initquest(void) #endif { - PyObject *m = nullptr; - const char *error_name = "quest.Error"; + PyObject* m = nullptr; + const char* error_name = "quest.Error"; // splicer begin C_init_locals // splicer end C_init_locals @@ -857,17 +857,17 @@ initquest(void) #if PY_MAJOR_VERSION >= 3 m = PyModule_Create(&moduledef); #else - m = Py_InitModule4("quest", PY_methods, PY__doc__, (PyObject *)nullptr, PYTHON_API_VERSION); + m = Py_InitModule4("quest", PY_methods, PY__doc__, (PyObject*)nullptr, PYTHON_API_VERSION); #endif if(m == nullptr) return RETVAL; - struct module_state *st = GETSTATE(m); + struct module_state* st = GETSTATE(m); // enum axom::quest::SignedDistExec PyModule_AddIntConstant(m, "CPU", static_cast(axom::quest::SignedDistExec::CPU)); PyModule_AddIntConstant(m, "OpenMP", static_cast(axom::quest::SignedDistExec::OpenMP)); PyModule_AddIntConstant(m, "GPU", static_cast(axom::quest::SignedDistExec::GPU)); - PY_error_obj = PyErr_NewException((char *)error_name, nullptr, nullptr); + PY_error_obj = PyErr_NewException((char*)error_name, nullptr, nullptr); if(PY_error_obj == nullptr) return RETVAL; st->error = PY_error_obj; PyModule_AddObject(m, "Error", st->error); diff --git a/src/axom/quest/interface/python/pyQUESTmodule.hpp b/src/axom/quest/interface/python/pyQUESTmodule.hpp index 483cc09564..6fddf13f32 100644 --- a/src/axom/quest/interface/python/pyQUESTmodule.hpp +++ b/src/axom/quest/interface/python/pyQUESTmodule.hpp @@ -21,7 +21,7 @@ // splicer begin header.C_declaration // splicer end header.C_declaration -extern PyObject *PY_error_obj; +extern PyObject* PY_error_obj; #if PY_MAJOR_VERSION >= 3 extern "C" PyMODINIT_FUNC PyInit_quest(void); diff --git a/src/axom/quest/io/C2CReader.cpp b/src/axom/quest/io/C2CReader.cpp index 82e0e0d180..f4aec2df2c 100644 --- a/src/axom/quest/io/C2CReader.cpp +++ b/src/axom/quest/io/C2CReader.cpp @@ -74,7 +74,7 @@ void C2CReader::setLengthUnit(utilities::LengthUnit lengthUnit) m_lengthUnit = lengthUnit; } -bool C2CReader::hasValidExtension(const std::string &filename) +bool C2CReader::hasValidExtension(const std::string& filename) { return utilities::string::endsWith(filename, ".contour") || utilities::string::endsWith(filename, ".assembly"); @@ -98,7 +98,7 @@ int C2CReader::read() return ret; } -C2CReader::ResultType C2CReader::readInternal(const std::string &filename, CurveArray &inputCurves) +C2CReader::ResultType C2CReader::readInternal(const std::string& filename, CurveArray& inputCurves) { try { @@ -117,7 +117,7 @@ C2CReader::ResultType C2CReader::readInternal(const std::string &filename, Curve return readAssembly(filename, inputCurves); } } - catch(const std::exception &e) + catch(const std::exception& e) { SLIC_WARNING(axom::fmt::format("Failed to read c2c file '{}': {}", filename, e.what())); } @@ -129,7 +129,7 @@ C2CReader::ResultType C2CReader::readInternal(const std::string &filename, Curve return ResultType::Failure; } -C2CReader::ResultType C2CReader::readAssembly(const std::string &filename, CurveArray &inputCurves) +C2CReader::ResultType C2CReader::readAssembly(const std::string& filename, CurveArray& inputCurves) { const c2c::Assembly assembly = c2c::parseAssembly(filename); std::string assemblyDir; @@ -156,7 +156,7 @@ C2CReader::ResultType C2CReader::readAssembly(const std::string &filename, Curve { // Move the curves out to inputCurves. inputCurves.reserve(inputCurves.size() + assemblyCurves.size()); - for(auto &curve : assemblyCurves) + for(auto& curve : assemblyCurves) { inputCurves.emplace_back(std::move(curve)); } @@ -165,7 +165,7 @@ C2CReader::ResultType C2CReader::readAssembly(const std::string &filename, Curve return ret; } -C2CReader::ResultType C2CReader::readContour(const std::string &filename, CurveArray &inputCurves) +C2CReader::ResultType C2CReader::readContour(const std::string& filename, CurveArray& inputCurves) { using PointType = primal::Point; @@ -177,14 +177,14 @@ C2CReader::ResultType C2CReader::readContour(const std::string &filename, CurveA inputCurves.reserve(inputCurves.size() + contour.getPieces().size()); int piece_index = 0; - for(auto *piece : contour.getPieces()) + for(auto* piece : contour.getPieces()) { const auto nurbsData = c2c::toNurbs(*piece, c2cLengthUnit); // Load control points axom::Array controlPoints; controlPoints.reserve(nurbsData.controlPoints.size()); - for(const auto &pt : nurbsData.controlPoints) + for(const auto& pt : nurbsData.controlPoints) { controlPoints.emplace_back(PointType {pt.getZ().getValue(), pt.getR().getValue()}); } @@ -255,7 +255,7 @@ C2CReader::ResultType C2CReader::readContour(const std::string &filename, CurveA // Check if weights are non-trivial (present and not all equal to 1) bool has_non_trivial_weights = false; - for(const double &wt : nurbsData.weights) + for(const double& wt : nurbsData.weights) { if(wt != 1.0) { @@ -268,7 +268,7 @@ C2CReader::ResultType C2CReader::readContour(const std::string &filename, CurveA if(has_non_trivial_weights) { weights.reserve(nurbsData.weights.size()); - for(const double &wt : nurbsData.weights) + for(const double& wt : nurbsData.weights) { weights.push_back(wt); } @@ -298,7 +298,7 @@ void C2CReader::log() sstr << fmt::format("The contour has {} pieces\n", m_nurbsData.size()); int index = 0; - for(const auto &curve : m_nurbsData) + for(const auto& curve : m_nurbsData) { sstr << fmt::format("\tCurve {}: {}\n", index, curve); ++index; diff --git a/src/axom/quest/io/C2CReader.hpp b/src/axom/quest/io/C2CReader.hpp index 0322686ae9..4d164a6c7e 100644 --- a/src/axom/quest/io/C2CReader.hpp +++ b/src/axom/quest/io/C2CReader.hpp @@ -51,7 +51,7 @@ class C2CReader virtual ~C2CReader() = default; /// Sets the name of the contour file to load. Must be called before \a read() - void setFileName(const std::string &fileName) { m_fileName = fileName; } + void setFileName(const std::string& fileName) { m_fileName = fileName; } /// Sets the length unit. All lengths will be converted to this unit when reading the mesh void setLengthUnit(utilities::LengthUnit lengthUnit); @@ -60,7 +60,7 @@ class C2CReader void clear(); /// Returns true if the file has a recognized c2c extension. - static bool hasValidExtension(const std::string &filename); + static bool hasValidExtension(const std::string& filename); /*! * \brief Read the contour file provided by \a setFileName() @@ -88,7 +88,7 @@ class C2CReader * * \return Success on success, Failure otherwise. */ - ResultType readInternal(const std::string &filename, CurveArray &inputCurves); + ResultType readInternal(const std::string& filename, CurveArray& inputCurves); /*! * \brief Internal helper for reading a contour file. @@ -98,7 +98,7 @@ class C2CReader * * \return Success on success, Failure otherwise. */ - ResultType readContour(const std::string &filename, CurveArray &inputCurves); + ResultType readContour(const std::string& filename, CurveArray& inputCurves); /*! * \brief Internal helper for reading an assembly file. @@ -108,7 +108,7 @@ class C2CReader * * \return Success on success, Failure otherwise. */ - ResultType readAssembly(const std::string &filename, CurveArray &inputCurves); + ResultType readAssembly(const std::string& filename, CurveArray& inputCurves); protected: std::string m_fileName; diff --git a/src/axom/quest/io/MFEMReader.cpp b/src/axom/quest/io/MFEMReader.cpp index d392a8f93d..4587f794cb 100644 --- a/src/axom/quest/io/MFEMReader.cpp +++ b/src/axom/quest/io/MFEMReader.cpp @@ -42,8 +42,8 @@ namespace internal * * \return 0 on success; non-zero on failure. */ -int read_mfem(const std::string &fileName, - std::map>> &curvemap) +int read_mfem(const std::string& fileName, + std::map>>& curvemap) { if(!axom::utilities::filesystem::pathExists(fileName)) { @@ -67,9 +67,9 @@ int read_mfem(const std::string &fileName, return MFEMReader::READ_FAILED; } - const auto *nodes = mesh->GetNodes(); - const auto *fes = nodes != nullptr ? nodes->FESpace() : nullptr; - const auto *fec = fes != nullptr ? fes->FEColl() : nullptr; + const auto* nodes = mesh->GetNodes(); + const auto* fes = nodes != nullptr ? nodes->FESpace() : nullptr; + const auto* fec = fes != nullptr ? fes->FEColl() : nullptr; if(nodes == nullptr || fes == nullptr || fec == nullptr) { SLIC_WARNING("Mesh does not have a valid nodes grid function"); @@ -161,14 +161,14 @@ int read_mfem(const std::string &fileName, }; auto get_element_degree = [fes, &mesh](int elemId) -> int { - const mfem::Array &orders = mesh->NURBSext->GetOrders(); + const mfem::Array& orders = mesh->NURBSext->GetOrders(); // MFEM calls this "order"; in Axom terminology this is the polynomial degree. return (elemId < orders.Size()) ? orders[elemId] : fes->GetOrder(elemId); }; #endif // lambda to check if the weights correspond to a rational curve. If they are all equal it is not rational - auto is_rational = [](const axom::Array &weights) -> bool { + auto is_rational = [](const axom::Array& weights) -> bool { const int sz = weights.size(); if(sz == 0) { @@ -189,7 +189,7 @@ int read_mfem(const std::string &fileName, // Examine the mesh attributes and group all of the related curves w/ same attribute // Assumption is that they're part of the same contour - const bool isNURBS = dynamic_cast(fec) != nullptr; + const bool isNURBS = dynamic_cast(fec) != nullptr; if(isNURBS) { #if MFEM_VERSION >= AXOM_MFEM_MIN_VERSION_PATCH_BASED_1D_NURBS @@ -201,7 +201,7 @@ int read_mfem(const std::string &fileName, { const int attribute = mesh->GetPatchAttribute(patchId); - mfem::Array kvs; + mfem::Array kvs; mesh->NURBSext->GetPatchKnotVectors(patchId, kvs); if(kvs.Size() < 1 || kvs[0] == nullptr) { @@ -210,7 +210,7 @@ int read_mfem(const std::string &fileName, patchId)); return MFEMReader::READ_FAILED; } - const mfem::KnotVector &kv0 = *kvs[0]; + const mfem::KnotVector& kv0 = *kvs[0]; if(kv0.Size() <= 0) { SLIC_WARNING( @@ -259,7 +259,7 @@ int read_mfem(const std::string &fileName, } else { - const bool is_bernstein = dynamic_cast(fec) != nullptr; + const bool is_bernstein = dynamic_cast(fec) != nullptr; if(!is_bernstein) { SLIC_WARNING(axom::fmt::format( @@ -300,13 +300,13 @@ int read_mfem(const std::string &fileName, } // end namespace internal -int MFEMReader::read(CurveArray &curves) +int MFEMReader::read(CurveArray& curves) { axom::Array attributes; return read(curves, attributes); } -int MFEMReader::read(CurveArray &curves, axom::Array &attributes) +int MFEMReader::read(CurveArray& curves, axom::Array& attributes) { SLIC_WARNING_IF(m_fileName.empty(), "Missing a filename in MFEMReader::read()"); @@ -316,9 +316,9 @@ int MFEMReader::read(CurveArray &curves, axom::Array &attributes) const int ret = internal::read_mfem(m_fileName, curvemap); if(ret == READ_SUCCESS) { - for(auto &[attribute, nurbs] : curvemap) + for(auto& [attribute, nurbs] : curvemap) { - for(const auto &curve : nurbs) + for(const auto& curve : nurbs) { curves.push_back(curve); attributes.push_back(attribute); @@ -329,13 +329,13 @@ int MFEMReader::read(CurveArray &curves, axom::Array &attributes) return ret; } -int MFEMReader::read(CurvedPolygonArray &curvedPolygons) +int MFEMReader::read(CurvedPolygonArray& curvedPolygons) { axom::Array attributes; return read(curvedPolygons, attributes); } -int MFEMReader::read(CurvedPolygonArray &curvedPolygons, axom::Array &attributes) +int MFEMReader::read(CurvedPolygonArray& curvedPolygons, axom::Array& attributes) { SLIC_WARNING_IF(m_fileName.empty(), "Missing a filename in MFEMReader::read()"); @@ -349,11 +349,11 @@ int MFEMReader::read(CurvedPolygonArray &curvedPolygons, axom::Array &attri attributes.resize(curvemap.size()); int polygon_index = 0; - for(auto &[attribute, nurbs] : curvemap) + for(auto& [attribute, nurbs] : curvemap) { attributes[polygon_index] = attribute; - auto &poly = curvedPolygons[polygon_index]; - for(auto &cur : nurbs) + auto& poly = curvedPolygons[polygon_index]; + for(auto& cur : nurbs) { poly.addEdge(cur); } diff --git a/src/axom/quest/io/MFEMReader.hpp b/src/axom/quest/io/MFEMReader.hpp index 2b981bcd5a..5bedf3aada 100644 --- a/src/axom/quest/io/MFEMReader.hpp +++ b/src/axom/quest/io/MFEMReader.hpp @@ -43,7 +43,7 @@ class MFEMReader public: /// Sets the name of the contour file to load. Must be called before \a read() - void setFileName(const std::string &fileName) { m_fileName = fileName; } + void setFileName(const std::string& fileName) { m_fileName = fileName; } /*! * \brief Read the contour file provided by \a setFileName() @@ -52,7 +52,7 @@ class MFEMReader * * \return READ_SUCCESS for a successful read; READ_FAILED (non-zero) otherwise */ - int read(CurveArray &curves); + int read(CurveArray& curves); /*! * \brief Read the contour file provided by \a setFileName() @@ -64,7 +64,7 @@ class MFEMReader * * \return READ_SUCCESS for a successful read; READ_FAILED (non-zero) otherwise */ - int read(CurveArray &curves, axom::Array &attributes); + int read(CurveArray& curves, axom::Array& attributes); /*! * \brief Read the contour file provided by \a setFileName() @@ -76,7 +76,7 @@ class MFEMReader * * \return READ_SUCCESS for a successful read; READ_FAILED (non-zero) otherwise */ - int read(CurvedPolygonArray &curvedPolygons); + int read(CurvedPolygonArray& curvedPolygons); /*! * \brief Read the contour file provided by \a setFileName() @@ -90,7 +90,7 @@ class MFEMReader * * \return READ_SUCCESS for a successful read; READ_FAILED (non-zero) otherwise */ - int read(CurvedPolygonArray &curvedPolygons, axom::Array &attributes); + int read(CurvedPolygonArray& curvedPolygons, axom::Array& attributes); protected: std::string m_fileName; diff --git a/src/axom/quest/io/STLWriter.cpp b/src/axom/quest/io/STLWriter.cpp index d63dce34ba..f236581b7c 100644 --- a/src/axom/quest/io/STLWriter.cpp +++ b/src/axom/quest/io/STLWriter.cpp @@ -30,7 +30,7 @@ namespace internal * \param N The triangle normal. */ template -void writeTriangle(std::ofstream &out, bool binary, double coords[3][3], const NormalType &N) +void writeTriangle(std::ofstream& out, bool binary, double coords[3][3], const NormalType& N) { if(binary) { @@ -46,11 +46,11 @@ void writeTriangle(std::ofstream &out, bool binary, double coords[3][3], const N // The attribute is sometimes used as colors. Set bits to white. // See https://en.wikipedia.org/wiki/STL_(file_format). const std::uint16_t attr = 0x7fff; - out.write(reinterpret_cast(n32), 3 * sizeof(float32)); - out.write(reinterpret_cast(coords32[0]), 3 * sizeof(float32)); - out.write(reinterpret_cast(coords32[1]), 3 * sizeof(float32)); - out.write(reinterpret_cast(coords32[2]), 3 * sizeof(float32)); - out.write(reinterpret_cast(&attr), sizeof(std::uint16_t)); + out.write(reinterpret_cast(n32), 3 * sizeof(float32)); + out.write(reinterpret_cast(coords32[0]), 3 * sizeof(float32)); + out.write(reinterpret_cast(coords32[1]), 3 * sizeof(float32)); + out.write(reinterpret_cast(coords32[2]), 3 * sizeof(float32)); + out.write(reinterpret_cast(&attr), sizeof(std::uint16_t)); } else { @@ -66,7 +66,7 @@ void writeTriangle(std::ofstream &out, bool binary, double coords[3][3], const N } // end namespace internal -STLWriter::STLWriter(const std::string &filename, bool binary) +STLWriter::STLWriter(const std::string& filename, bool binary) : m_mesh(nullptr) , m_fileName(filename) , m_binary(binary) @@ -116,7 +116,7 @@ IndexType STLWriter::getNumberOfTriangles() const return ntri; } -int STLWriter::write(const mint::Mesh *mesh) +int STLWriter::write(const mint::Mesh* mesh) { using VectorType = axom::primal::Vector; @@ -143,13 +143,13 @@ int STLWriter::write(const mint::Mesh *mesh) // Fill with spaces memset(header, ' ', sizeof(std::uint8_t) * STL_HEADER_SIZE); // Copy in string (without terminator) - const char *msg = "STL Binary File Written By Axom"; + const char* msg = "STL Binary File Written By Axom"; memcpy(header, msg, strlen(msg)); - out.write(reinterpret_cast(header), STL_HEADER_SIZE); + out.write(reinterpret_cast(header), STL_HEADER_SIZE); // Write number of triangles std::uint32_t ntri = static_cast(getNumberOfTriangles()); - out.write(reinterpret_cast(&ntri), sizeof(std::uint32_t)); + out.write(reinterpret_cast(&ntri), sizeof(std::uint32_t)); } else { @@ -227,7 +227,7 @@ int STLWriter::write(const mint::Mesh *mesh) return 0; } -int write_stl(const mint::Mesh *mesh, const std::string &filename, bool binary) +int write_stl(const mint::Mesh* mesh, const std::string& filename, bool binary) { STLWriter w(filename, binary); return w.write(mesh); diff --git a/src/axom/quest/tests/quest_gwn_methods.cpp b/src/axom/quest/tests/quest_gwn_methods.cpp index 939cd9fe7d..24d16026ca 100644 --- a/src/axom/quest/tests/quest_gwn_methods.cpp +++ b/src/axom/quest/tests/quest_gwn_methods.cpp @@ -28,18 +28,18 @@ #endif //------------------------------------------------------------------------------ -std::string pjoin(const std::string &str) { return str; } +std::string pjoin(const std::string& str) { return str; } -std::string pjoin(const char *str) { return std::string(str); } +std::string pjoin(const char* str) { return std::string(str); } template -std::string pjoin(const std::string &str, Args... args) +std::string pjoin(const std::string& str, Args... args) { return axom::utilities::filesystem::joinPath(str, pjoin(args...)); } template -std::string pjoin(const char *str, Args... args) +std::string pjoin(const char* str, Args... args) { return axom::utilities::filesystem::joinPath(std::string(str), pjoin(args...)); } @@ -179,7 +179,7 @@ void check_mfem_mesh_evaluation() // Get bounding box of the shape // Extract the curves and compute their bounding boxes along the way axom::primal::BoundingBox shape_bbox; - for(const auto &cur : curves) + for(const auto& cur : curves) { shape_bbox.addBox(cur.boundingBox()); } @@ -239,13 +239,13 @@ void check_mfem_mesh_evaluation() gwn_polyline_fast.query(dc[5], tol); // Compare the in-out values between all fields - const auto *query_mesh = dc[0].GetMesh(); + const auto* query_mesh = dc[0].GetMesh(); const auto num_query_points = query_mesh->GetNodalFESpace()->GetNDofs(); - auto &inout_direct = *dc[0].GetField("inout"); + auto& inout_direct = *dc[0].GetField("inout"); for(int N = 1; N < num_queries; ++N) { - auto &inout_other = *dc[N].GetField("inout"); + auto& inout_other = *dc[N].GetField("inout"); for(int i = 0; i < num_query_points; ++i) { @@ -339,13 +339,13 @@ void check_step_file_evaluation() gwn_triangles_fast.query(dc[3], tol); // Compare the in-out values between all fields - const auto *query_mesh = dc[0].GetMesh(); + const auto* query_mesh = dc[0].GetMesh(); const auto num_query_points = query_mesh->GetNodalFESpace()->GetNDofs(); - auto &inout_direct = *dc[0].GetField("inout"); + auto& inout_direct = *dc[0].GetField("inout"); for(int N = 1; N < num_queries; ++N) { - auto &inout_other = *dc[N].GetField("inout"); + auto& inout_other = *dc[N].GetField("inout"); for(int i = 0; i < num_query_points; ++i) { @@ -371,7 +371,7 @@ TEST(quest_gwn_methods, step_file_evaluation_omp) { check_step_file_evaluationDimension(); - mfem::L2_FECollection *coll = new mfem::L2_FECollection(vfOrder, dim, mfem::BasisType::Positive); - mfem::FiniteElementSpace *fes = new mfem::FiniteElementSpace(mesh, coll); - mfem::GridFunction *gf = new mfem::GridFunction(fes); + mfem::L2_FECollection* coll = new mfem::L2_FECollection(vfOrder, dim, mfem::BasisType::Positive); + mfem::FiniteElementSpace* fes = new mfem::FiniteElementSpace(mesh, coll); + mfem::GridFunction* gf = new mfem::GridFunction(fes); gf->MakeOwner(coll); // Initialize the values to 0. *gf = 0; return gf; } -void makeTestMesh(sidre::MFEMSidreDataCollection &dc, bool initialMats) +void makeTestMesh(sidre::MFEMSidreDataCollection& dc, bool initialMats) { const int polynomialOrder = 1; const auto celldims = axom::NumericArray {20, 20, 1}; @@ -109,8 +109,8 @@ void makeTestMesh(sidre::MFEMSidreDataCollection &dc, bool initialMats) // This mode will make 2 clean materials in the mesh. if(initialMats) { - mfem::GridFunction *mata = newGridFunction(mesh); - mfem::GridFunction *matb = newGridFunction(mesh); + mfem::GridFunction* mata = newGridFunction(mesh); + mfem::GridFunction* matb = newGridFunction(mesh); for(int k = 0; k < celldims[2]; k++) { for(int j = 0; j < celldims[1]; j++) @@ -130,7 +130,7 @@ void makeTestMesh(sidre::MFEMSidreDataCollection &dc, bool initialMats) } // Save Sidre as VisIt -void saveVisIt(const std::string &path, const std::string &filename, sidre::MFEMSidreDataCollection &dc) +void saveVisIt(const std::string& path, const std::string& filename, sidre::MFEMSidreDataCollection& dc) { // Wrap mesh and grid functions in a VisItDataCollection and save it. mfem::VisItDataCollection vdc(filename, dc.GetMesh()); @@ -152,7 +152,7 @@ void saveVisIt(const std::string &path, const std::string &filename, sidre::MFEM } // Load VisIt as Sidre -void loadVisIt(mfem::VisItDataCollection &vdc, sidre::MFEMSidreDataCollection &dc) +void loadVisIt(mfem::VisItDataCollection& vdc, sidre::MFEMSidreDataCollection& dc) { // Wrap mesh and grid functions in a VisItDataCollection and save it. vdc.SetFormat(mfem::DataCollection::SERIAL_FORMAT); @@ -170,7 +170,7 @@ void loadVisIt(mfem::VisItDataCollection &vdc, sidre::MFEMSidreDataCollection &d } // Turn a MFEMSidreDataCollection's fields into a simple Conduit node so I/O is not so problematic. -void dcToConduit(sidre::MFEMSidreDataCollection &dc, conduit::Node &n) +void dcToConduit(sidre::MFEMSidreDataCollection& dc, conduit::Node& n) { for(auto it : dc.GetFieldMap()) { @@ -183,10 +183,10 @@ void dcToConduit(sidre::MFEMSidreDataCollection &dc, conduit::Node &n) } } -bool compareConduit(const conduit::Node &n1, - const conduit::Node &n2, +bool compareConduit(const conduit::Node& n1, + const conduit::Node& n2, double tolerance, - conduit::Node &info) + conduit::Node& info) { bool same = true; if(n1.dtype().id() == n2.dtype().id() && n1.dtype().is_floating_point()) @@ -210,8 +210,8 @@ bool compareConduit(const conduit::Node &n1, { for(int i = 0; i < n1.number_of_children() && same; i++) { - const auto &n1c = n1.child(i); - const auto &n2c = n2.fetch_existing(n1c.name()); + const auto& n1c = n1.child(i); + const auto& n2c = n2.fetch_existing(n1c.name()); same &= compareConduit(n1c, n2c, tolerance, info); } } @@ -221,14 +221,14 @@ bool compareConduit(const conduit::Node &n1, // NOTE: The baselines are read/written using Conduit directly because the // various data collections in Sidre, MFEM, VisIt all exhibited problems // either saving or loading the data. -void saveBaseline(const std::string &filename, const conduit::Node &n) +void saveBaseline(const std::string& filename, const conduit::Node& n) { std::string file_with_ext(filename + ".yaml"); SLIC_INFO(axom::fmt::format("Save baseline ", file_with_ext)); conduit::relay::io::save(n, file_with_ext, "yaml"); } -bool loadBaseline(const std::string &filename, conduit::Node &n) +bool loadBaseline(const std::string& filename, conduit::Node& n) { bool loaded = false; std::string file_with_ext(filename + ".yaml"); @@ -242,8 +242,8 @@ bool loadBaseline(const std::string &filename, conduit::Node &n) return loaded; } -void replacementRuleTest(const std::string &shapeFile, - const std::string &policyName, +void replacementRuleTest(const std::string& shapeFile, + const std::string& policyName, RuntimePolicy policy, double tolerance, bool initialMats = false) @@ -284,7 +284,7 @@ void replacementRuleTest(const std::string &shapeFile, // Borrowed from shaping_driver. const klee::Dimensions shapeDim = shapeSet.getDimensions(); - for(const auto &shape : shapeSet.getShapes()) + for(const auto& shape : shapeSet.getShapes()) { SLIC_INFO(axom::fmt::format("\tshape {} -> material {}", shape.getName(), shape.getMaterial())); @@ -317,7 +317,7 @@ void replacementRuleTest(const std::string &shapeFile, saveVisIt("", baselineName, dc); #endif #ifdef GENERATE_BASELINES - for(const auto &path : baselinePaths) + for(const auto& path : baselinePaths) { SLIC_INFO(axom::fmt::format("Saving baseline to {}", path)); axom::utilities::filesystem::makeDirsForPath(path); @@ -330,7 +330,7 @@ void replacementRuleTest(const std::string &shapeFile, // Need to get the MFEM mesh out and compare to expected results bool success = false; - for(const auto &path : baselinePaths) + for(const auto& path : baselinePaths) { try { @@ -354,25 +354,25 @@ void replacementRuleTest(const std::string &shapeFile, EXPECT_EQ(success, true); } -void replacementRuleTestSet(const std::vector &cases, - const std::string &policyName, +void replacementRuleTestSet(const std::vector& cases, + const std::string& policyName, RuntimePolicy policy, double tolerance, bool initialMats = false) { - for(const auto &c : cases) + for(const auto& c : cases) { replacementRuleTest(testData(c), policyName, policy, tolerance, initialMats); } } -void IntersectionWithErrorTolerances(const std::string &filebase, - const std::string &contour, - const std::string &shapeYAML, +void IntersectionWithErrorTolerances(const std::string& filebase, + const std::string& contour, + const std::string& shapeYAML, double expectedRevolvedVolume, int refinementLevel, double targetPercentError, - const std::string &policyName, + const std::string& policyName, RuntimePolicy policy, double revolvedVolumeEPS = 1.e-4) { @@ -417,7 +417,7 @@ void IntersectionWithErrorTolerances(const std::string &filebase, // Borrowed from shaping_driver (there should just be one shape) const klee::Dimensions shapeDim = shapeSet.getDimensions(); - for(const auto &shape : shapeSet.getShapes()) + for(const auto& shape : shapeSet.getShapes()) { SLIC_INFO(axom::fmt::format("\tshape {} -> material {}", shape.getName(), shape.getMaterial())); @@ -449,7 +449,7 @@ void IntersectionWithErrorTolerances(const std::string &filebase, } // Clean up files. - for(const auto &filename : filenames) + for(const auto& filename : filenames) { EXPECT_EQ(axom::utilities::filesystem::removeFile(filename), 0); } @@ -470,7 +470,7 @@ class ShapingTestApplication ~ShapingTestApplication() { } /// \brief Parse the command line and run the tests - int execute(int argc, char *argv[]) + int execute(int argc, char* argv[]) { int result = 0; @@ -499,12 +499,12 @@ class ShapingTestApplication // Run all the tests. result = RUN_ALL_TESTS(); } - catch(axom::CLI::CallForHelp &e) + catch(axom::CLI::CallForHelp& e) { std::cout << m_app.help() << std::endl; result = 0; } - catch(axom::CLI::ParseError &e) + catch(axom::CLI::ParseError& e) { // Handle other parsing errors std::cerr << e.what() << std::endl; @@ -513,7 +513,7 @@ class ShapingTestApplication return result; } - bool selected(const std::string &policy, int caseNumber) + bool selected(const std::string& policy, int caseNumber) { bool sel = false; if(m_policy.empty()) diff --git a/src/axom/quest/tests/quest_linearize_curves.cpp b/src/axom/quest/tests/quest_linearize_curves.cpp index fa0e5ad5a0..abbae2ae27 100644 --- a/src/axom/quest/tests/quest_linearize_curves.cpp +++ b/src/axom/quest/tests/quest_linearize_curves.cpp @@ -26,14 +26,14 @@ using SegmentMesh = axom::mint::UnstructuredMesh; * \return The total length of segments in the mesh. */ template -double totalSegmentLength(const SegmentMesh *mesh) +double totalSegmentLength(const SegmentMesh* mesh) { axom::ReduceSum totalSegmentLength(0.); axom::mint::for_all_cells( mesh, AXOM_LAMBDA(axom::IndexType AXOM_UNUSED_PARAM(cellID), - const axom::numerics::Matrix &coordsMatrix, - const axom::IndexType *AXOM_UNUSED_PARAM(nodes)) { + const axom::numerics::Matrix& coordsMatrix, + const axom::IndexType* AXOM_UNUSED_PARAM(nodes)) { constexpr int xdim = 0; constexpr int ydim = 1; const double dx = coordsMatrix(xdim, 1) - coordsMatrix(xdim, 0); @@ -50,7 +50,7 @@ double totalSegmentLength(const SegmentMesh *mesh) * \param[out] curves The array that will contain the curves. */ template -void makeCurves(axom::Array &curves, bool circle = true) +void makeCurves(axom::Array& curves, bool circle = true) { const double center[] = {0., 0.}; const double radius = 1.; @@ -89,7 +89,7 @@ TEST(quest_linearize_curves, linearize_uniform) const double expectedLength = 2. * M_PI; const int segmentsPerKnotSpan = 30; axom::quest::LinearizeCurves lin; - SegmentMesh *mesh = new SegmentMesh(DIM, axom::mint::SEGMENT); + SegmentMesh* mesh = new SegmentMesh(DIM, axom::mint::SEGMENT); lin.getLinearMeshUniform(curves.view(), mesh, segmentsPerKnotSpan); const double actualLength = totalSegmentLength(mesh); EXPECT_NEAR(actualLength, expectedLength, 1.e-3); @@ -110,7 +110,7 @@ TEST(quest_linearize_curves, linearize_nonuniform) const double expectedLength = M_PI * 3. / 4.; const double percentError = 0.01; axom::quest::LinearizeCurves lin; - SegmentMesh *mesh = new SegmentMesh(DIM, axom::mint::SEGMENT); + SegmentMesh* mesh = new SegmentMesh(DIM, axom::mint::SEGMENT); lin.getLinearMeshNonUniform(curves.view(), mesh, percentError); const double actualLength = totalSegmentLength(mesh); EXPECT_NEAR(((expectedLength - actualLength) / expectedLength), percentError, percentError); @@ -136,7 +136,7 @@ TEST(quest_linearize_curves, revolved_volume) } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { int result = 0; diff --git a/src/axom/quest/tests/quest_mfem_reader.cpp b/src/axom/quest/tests/quest_mfem_reader.cpp index 9a621b4b8a..80ec31fd5e 100644 --- a/src/axom/quest/tests/quest_mfem_reader.cpp +++ b/src/axom/quest/tests/quest_mfem_reader.cpp @@ -32,18 +32,18 @@ namespace quest = axom::quest; namespace fs = axom::utilities::filesystem; //------------------------------------------------------------------------------ -std::string pjoin(const std::string &str) { return str; } +std::string pjoin(const std::string& str) { return str; } -std::string pjoin(const char *str) { return std::string(str); } +std::string pjoin(const char* str) { return std::string(str); } template -std::string pjoin(const std::string &str, Args... args) +std::string pjoin(const std::string& str, Args... args) { return axom::utilities::filesystem::joinPath(str, pjoin(args...)); } template -std::string pjoin(const char *str, Args... args) +std::string pjoin(const char* str, Args... args) { return axom::utilities::filesystem::joinPath(std::string(str), pjoin(args...)); } @@ -54,10 +54,10 @@ namespace using BezierCurve2D = primal::BezierCurve; using Point2D = primal::Point; -void write_mesh_from_bezier_curves(const std::string &mesh_path, - const axom::Array &bezier_curves, - const axom::Array &attributes, - mfem::FiniteElementCollection &fec) +void write_mesh_from_bezier_curves(const std::string& mesh_path, + const axom::Array& bezier_curves, + const axom::Array& attributes, + mfem::FiniteElementCollection& fec) { ASSERT_EQ(bezier_curves.size(), attributes.size()); const int num_curves = bezier_curves.size(); @@ -73,11 +73,11 @@ void write_mesh_from_bezier_curves(const std::string &mesh_path, for(int i = 0; i < num_curves; ++i) { - const auto &curve = bezier_curves[i]; + const auto& curve = bezier_curves[i]; ASSERT_EQ(curve.getOrder(), fec.GetOrder()); - const auto &p0 = curve.getInitPoint(); - const auto &p1 = curve.getEndPoint(); + const auto& p0 = curve.getInitPoint(); + const auto& p1 = curve.getEndPoint(); const double v0[] = {p0[0], p0[1]}; const double v1[] = {p1[0], p1[1]}; @@ -115,7 +115,7 @@ void write_mesh_from_bezier_curves(const std::string &mesh_path, for(int i = 0; i <= order; ++i) { - const auto &cp = bezier_curves[e][mfemLocalToBezier(i)]; + const auto& cp = bezier_curves[e][mfemLocalToBezier(i)]; nodes(fes.DofToVDof(dofs[i], 0)) = cp[0]; nodes(fes.DofToVDof(dofs[i], 1)) = cp[1]; } @@ -193,7 +193,7 @@ TEST(quest_mfem_reader, preserves_rational_weights) ASSERT_GT(curves.size(), 0); bool any_rational = false; - for(const auto &curve : curves) + for(const auto& curve : curves) { if(curve.isRational()) { @@ -211,9 +211,9 @@ TEST(quest_mfem_reader, preserves_rational_weights) ASSERT_GT(polys.size(), 0); bool any_rational = false; - for(const auto &poly : polys) + for(const auto& poly : polys) { - for(const auto &cur : poly.getEdges()) + for(const auto& cur : poly.getEdges()) { if(cur.isRational()) { @@ -268,7 +268,7 @@ TEST(quest_mfem_reader, read_bernstein_basis_roundtrip_bezier_order3) const int attr = attributes[i]; const auto expected_it = expected.find(attr); ASSERT_TRUE(expected_it != expected.end()); - const auto &expected_curve = expected_it->second; + const auto& expected_curve = expected_it->second; EXPECT_EQ(curves[i].getDegree(), expected_curve.getOrder()); EXPECT_EQ(curves[i].getNumControlPoints(), expected_curve.getOrder() + 1); @@ -348,7 +348,7 @@ TEST(quest_mfem_reader, read_curved_polygon_noncontiguous_attributes) // the y-coordinates of the edges start and end vertex should equal the attribute for(int i : {0, 1}) { - const auto &curve = polys[i][0]; + const auto& curve = polys[i][0]; switch(attributes[i]) { case attr10: @@ -376,7 +376,7 @@ TEST(quest_mfem_reader, read_curved_polygon_noncontiguous_attributes) for(int i : {0, 1}) { - const auto &curve = curves[i]; + const auto& curve = curves[i]; switch(attributes[i]) { case attr10: @@ -483,7 +483,7 @@ controlpoints // Validate basic properties of the extracted curves. for(int i = 0; i < curves.size(); ++i) { - const auto &c = curves[i]; + const auto& c = curves[i]; const int a = attributes[i]; ASSERT_TRUE(c.isValidNURBS()); @@ -514,7 +514,7 @@ TEST(quest_mfem_reader, read_patches_format_1d_nurbs) } #endif -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/quest/tests/quest_stl_writer.cpp b/src/axom/quest/tests/quest_stl_writer.cpp index 2da0042888..8f73fe7e76 100644 --- a/src/axom/quest/tests/quest_stl_writer.cpp +++ b/src/axom/quest/tests/quest_stl_writer.cpp @@ -34,13 +34,13 @@ namespace quest = axom::quest; namespace testing { -void writeArray(const axom::Array &vec, const std::string &var_name = "v") +void writeArray(const axom::Array& vec, const std::string& var_name = "v") { axom::fmt::print("axom::Array {} = {{{}}};\n", var_name, axom::fmt::join(vec, ", ")); } /// Convert mesh coordinates into arrays that can be easily compared. -void getCoordinates(const mint::Mesh &mesh, axom::Array &xc, axom::Array &yc) +void getCoordinates(const mint::Mesh& mesh, axom::Array& xc, axom::Array& yc) { for(axom::IndexType cellId = 0; cellId < mesh.getNumberOfCells(); cellId++) { @@ -57,10 +57,10 @@ void getCoordinates(const mint::Mesh &mesh, axom::Array &xc, axom::Array } /// Convert mesh coordinates into arrays that can be easily compared. -void getCoordinates(const mint::Mesh &mesh, - axom::Array &xc, - axom::Array &yc, - axom::Array &zc) +void getCoordinates(const mint::Mesh& mesh, + axom::Array& xc, + axom::Array& yc, + axom::Array& zc) { for(axom::IndexType cellId = 0; cellId < mesh.getNumberOfCells(); cellId++) { @@ -77,7 +77,7 @@ void getCoordinates(const mint::Mesh &mesh, } } -bool compareArrays(const axom::Array &A, const axom::Array &B, double tolerance = 1.e-8) +bool compareArrays(const axom::Array& A, const axom::Array& B, double tolerance = 1.e-8) { bool eq = A.size() == B.size(); if(eq) @@ -112,7 +112,7 @@ struct Test2D 1.5, 1.5, 2, 1.5, 2, 2, 1.5, 1.5, 2, 1.5, 2, 2}}; } - void test(const mint::Mesh &mesh, const std::string &filename, bool binary) + void test(const mint::Mesh& mesh, const std::string& filename, bool binary) { // Write STL file. int result = axom::quest::write_stl(&mesh, filename, binary); @@ -187,7 +187,7 @@ struct Test3D 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3}}; } - void test(const mint::Mesh &mesh, const std::string &filename, bool binary) + void test(const mint::Mesh& mesh, const std::string& filename, bool binary) { // Write STL file. int result = axom::quest::write_stl(&mesh, filename, binary); @@ -291,7 +291,7 @@ TEST(quest_stl_writer, rectilinear2d) const double y[] = {1., 1.5, 2.}; constexpr axom::IndexType NI = 3; constexpr axom::IndexType NJ = 3; - mint::RectilinearMesh mesh(NI, const_cast(x), NJ, const_cast(y)); + mint::RectilinearMesh mesh(NI, const_cast(x), NJ, const_cast(y)); testing::Test2D tester; tester.test(mesh, "rectilinear2d.stl", false); @@ -305,7 +305,7 @@ TEST(quest_stl_writer, curvilinear2d) const double y[] = {1., 1., 1., 1.5, 1.5, 1.5, 2., 2., 2.}; constexpr axom::IndexType NI = 3; constexpr axom::IndexType NJ = 3; - mint::CurvilinearMesh mesh(NI, const_cast(x), NJ, const_cast(y)); + mint::CurvilinearMesh mesh(NI, const_cast(x), NJ, const_cast(y)); testing::Test2D tester; tester.test(mesh, "curvilinear2d.stl", false); @@ -324,11 +324,11 @@ TEST(quest_stl_writer, unstructured2d) mint::UnstructuredMesh mesh(mint::CellType::TRIANGLE, numTriangles, // ncells numTriangles, // cell_capacity - const_cast(conn), + const_cast(conn), nnodes, // nnodes nnodes, // node_capacity - const_cast(x), - const_cast(y)); + const_cast(x), + const_cast(y)); testing::Test2D tester; tester.test(mesh, "unstructured2d.stl", false); @@ -360,11 +360,11 @@ TEST(quest_stl_writer, rectilinear3d) constexpr axom::IndexType NJ = 3; constexpr axom::IndexType NK = 2; mint::RectilinearMesh mesh(NI, - const_cast(x), + const_cast(x), NJ, - const_cast(y), + const_cast(y), NK, - const_cast(z)); + const_cast(z)); testing::Test3D tester; tester.test(mesh, "rectilinear3d.stl", false); @@ -381,11 +381,11 @@ TEST(quest_stl_writer, curvilinear3d) constexpr axom::IndexType NJ = 3; constexpr axom::IndexType NK = 2; mint::CurvilinearMesh mesh(NI, - const_cast(x), + const_cast(x), NJ, - const_cast(y), + const_cast(y), NK, - const_cast(z)); + const_cast(z)); testing::Test3D tester; tester.test(mesh, "curvilinear3d.stl", false); @@ -412,12 +412,12 @@ TEST(quest_stl_writer, unstructured3d) mint::UnstructuredMesh mesh(mint::CellType::HEX, ncells, // ncells ncells, // cell_capacity - const_cast(conn), + const_cast(conn), nnodes, // nnodes nnodes, // node_capacity - const_cast(x), - const_cast(y), - const_cast(z)); + const_cast(x), + const_cast(y), + const_cast(z)); mesh.initializeFaceConnectivity(); testing::Test3DUns tester; @@ -426,7 +426,7 @@ TEST(quest_stl_writer, unstructured3d) } //------------------------------------------------------------------------------ -int main(int argc, char *argv[]) +int main(int argc, char* argv[]) { ::testing::InitGoogleTest(&argc, argv); axom::slic::SimpleLogger logger; diff --git a/src/axom/sidre/core/SidreTypes.hpp b/src/axom/sidre/core/SidreTypes.hpp index 79d5d235f4..5f10be281f 100644 --- a/src/axom/sidre/core/SidreTypes.hpp +++ b/src/axom/sidre/core/SidreTypes.hpp @@ -69,7 +69,7 @@ inline bool indexIsValid(IndexType idx) { return idx != InvalidIndex; } /*! * \brief Returns true if name is valid, else false. */ -inline bool nameIsValid(const std::string &name) +inline bool nameIsValid(const std::string& name) { return name != axom::utilities::string::InvalidName; } @@ -213,10 +213,10 @@ template <> struct formatter { // no format specifiers in this example - constexpr auto parse(format_parse_context &ctx) { return ctx.begin(); } + constexpr auto parse(format_parse_context& ctx) { return ctx.begin(); } template - auto format(axom::sidre::DataTypeId dt, FormatContext &ctx) const + auto format(axom::sidre::DataTypeId dt, FormatContext& ctx) const { // map enum to its name std::string name; diff --git a/src/axom/sidre/interface/c_fortran/typesSidre.h b/src/axom/sidre/interface/c_fortran/typesSidre.h index aa2f2fe77e..084d7f8e5c 100644 --- a/src/axom/sidre/interface/c_fortran/typesSidre.h +++ b/src/axom/sidre/interface/c_fortran/typesSidre.h @@ -38,7 +38,7 @@ extern "C" { // helper capsule_data struct s_SIDRE_SHROUD_capsule_data { - void *addr; /* address of C++ memory */ + void* addr; /* address of C++ memory */ int idtor; /* index of destructor */ int cmemflags; /* memory flags */ }; @@ -81,7 +81,7 @@ typedef struct s_SIDRE_DataStore SIDRE_DataStore; // C capsule SIDRE_Buffer struct s_SIDRE_Buffer { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; @@ -90,7 +90,7 @@ typedef struct s_SIDRE_Buffer SIDRE_Buffer; // C capsule SIDRE_Group struct s_SIDRE_Group { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; @@ -99,7 +99,7 @@ typedef struct s_SIDRE_Group SIDRE_Group; // C capsule SIDRE_View struct s_SIDRE_View { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; @@ -108,13 +108,13 @@ typedef struct s_SIDRE_View SIDRE_View; // C capsule SIDRE_DataStore struct s_SIDRE_DataStore { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; typedef struct s_SIDRE_DataStore SIDRE_DataStore; -void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data *cap); +void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data* cap); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/utilSidre.cpp b/src/axom/sidre/interface/c_fortran/utilSidre.cpp index 365caedf97..91c7c48316 100644 --- a/src/axom/sidre/interface/c_fortran/utilSidre.cpp +++ b/src/axom/sidre/interface/c_fortran/utilSidre.cpp @@ -16,9 +16,9 @@ extern "C" { #endif // Release library allocated memory. -void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data *cap) +void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data* cap) { - void *ptr = cap->addr; + void* ptr = cap->addr; switch(cap->idtor) { case 0: // --none-- @@ -28,13 +28,13 @@ void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data *cap) } case 1: // std::string { - std::string *cxx_ptr = reinterpret_cast(ptr); + std::string* cxx_ptr = reinterpret_cast(ptr); delete cxx_ptr; break; } case 2: // axom::sidre::DataStore { - axom::sidre::DataStore *cxx_ptr = reinterpret_cast(ptr); + axom::sidre::DataStore* cxx_ptr = reinterpret_cast(ptr); delete cxx_ptr; break; } @@ -50,7 +50,7 @@ void SIDRE_SHROUD_memory_destructor(SIDRE_SHROUD_capsule_data *cap) } // axom::sidre::Buffer = axom::sidre::Buffer -void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer *lhs_capsule, SIDRE_Buffer *rhs_capsule) +void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer* lhs_capsule, SIDRE_Buffer* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -75,7 +75,7 @@ void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer *lhs_capsule, SIDRE_Buffer *rhs_cap // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -91,7 +91,7 @@ void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer *lhs_capsule, SIDRE_Buffer *rhs_cap // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -102,7 +102,7 @@ void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer *lhs_capsule, SIDRE_Buffer *rhs_cap // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -111,7 +111,7 @@ void SIDRE_Buffer_assign_Buffer(SIDRE_Buffer *lhs_capsule, SIDRE_Buffer *rhs_cap } // axom::sidre::Group = axom::sidre::Group -void SIDRE_Group_assign_Group(SIDRE_Group *lhs_capsule, SIDRE_Group *rhs_capsule) +void SIDRE_Group_assign_Group(SIDRE_Group* lhs_capsule, SIDRE_Group* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -136,7 +136,7 @@ void SIDRE_Group_assign_Group(SIDRE_Group *lhs_capsule, SIDRE_Group *rhs_capsule // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -152,7 +152,7 @@ void SIDRE_Group_assign_Group(SIDRE_Group *lhs_capsule, SIDRE_Group *rhs_capsule // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -163,7 +163,7 @@ void SIDRE_Group_assign_Group(SIDRE_Group *lhs_capsule, SIDRE_Group *rhs_capsule // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -172,7 +172,7 @@ void SIDRE_Group_assign_Group(SIDRE_Group *lhs_capsule, SIDRE_Group *rhs_capsule } // axom::sidre::View = axom::sidre::View -void SIDRE_View_assign_View(SIDRE_View *lhs_capsule, SIDRE_View *rhs_capsule) +void SIDRE_View_assign_View(SIDRE_View* lhs_capsule, SIDRE_View* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -197,7 +197,7 @@ void SIDRE_View_assign_View(SIDRE_View *lhs_capsule, SIDRE_View *rhs_capsule) // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -213,7 +213,7 @@ void SIDRE_View_assign_View(SIDRE_View *lhs_capsule, SIDRE_View *rhs_capsule) // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -224,7 +224,7 @@ void SIDRE_View_assign_View(SIDRE_View *lhs_capsule, SIDRE_View *rhs_capsule) // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -233,7 +233,7 @@ void SIDRE_View_assign_View(SIDRE_View *lhs_capsule, SIDRE_View *rhs_capsule) } // axom::sidre::DataStore = axom::sidre::DataStore -void SIDRE_DataStore_assign_DataStore(SIDRE_DataStore *lhs_capsule, SIDRE_DataStore *rhs_capsule) +void SIDRE_DataStore_assign_DataStore(SIDRE_DataStore* lhs_capsule, SIDRE_DataStore* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -258,7 +258,7 @@ void SIDRE_DataStore_assign_DataStore(SIDRE_DataStore *lhs_capsule, SIDRE_DataSt // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -274,7 +274,7 @@ void SIDRE_DataStore_assign_DataStore(SIDRE_DataStore *lhs_capsule, SIDRE_DataSt // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -285,7 +285,7 @@ void SIDRE_DataStore_assign_DataStore(SIDRE_DataStore *lhs_capsule, SIDRE_DataSt // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data *)lhs_capsule); + SIDRE_SHROUD_memory_destructor((SIDRE_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; diff --git a/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp b/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp index cfecd9c637..b7e2957c5d 100644 --- a/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapBuffer.cpp @@ -18,106 +18,106 @@ extern "C" { // splicer begin class.Buffer.C_definitions // splicer end class.Buffer.C_definitions -SIDRE_IndexType SIDRE_Buffer_get_index(const SIDRE_Buffer *self) +SIDRE_IndexType SIDRE_Buffer_get_index(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; // splicer end class.Buffer.method.getIndex } -size_t SIDRE_Buffer_get_num_views(const SIDRE_Buffer *self) +size_t SIDRE_Buffer_get_num_views(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getNumViews size_t SHC_rv = SH_this->getNumViews(); return SHC_rv; // splicer end class.Buffer.method.getNumViews } -void *SIDRE_Buffer_get_void_ptr(SIDRE_Buffer *self) +void* SIDRE_Buffer_get_void_ptr(SIDRE_Buffer* self) { - axom::sidre::Buffer *SH_this = static_cast(self->addr); + axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getVoidPtr - void *SHC_rv = SH_this->getVoidPtr(); + void* SHC_rv = SH_this->getVoidPtr(); return SHC_rv; // splicer end class.Buffer.method.getVoidPtr } -SIDRE_TypeIDint SIDRE_Buffer_get_type_id(const SIDRE_Buffer *self) +SIDRE_TypeIDint SIDRE_Buffer_get_type_id(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getTypeID axom::sidre::TypeID SHC_rv = SH_this->getTypeID(); return SHC_rv; // splicer end class.Buffer.method.getTypeID } -size_t SIDRE_Buffer_get_num_elements(const SIDRE_Buffer *self) +size_t SIDRE_Buffer_get_num_elements(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getNumElements size_t SHC_rv = SH_this->getNumElements(); return SHC_rv; // splicer end class.Buffer.method.getNumElements } -size_t SIDRE_Buffer_get_total_bytes(const SIDRE_Buffer *self) +size_t SIDRE_Buffer_get_total_bytes(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getTotalBytes size_t SHC_rv = SH_this->getTotalBytes(); return SHC_rv; // splicer end class.Buffer.method.getTotalBytes } -size_t SIDRE_Buffer_get_bytes_per_element(const SIDRE_Buffer *self) +size_t SIDRE_Buffer_get_bytes_per_element(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.getBytesPerElement size_t SHC_rv = SH_this->getBytesPerElement(); return SHC_rv; // splicer end class.Buffer.method.getBytesPerElement } -void SIDRE_Buffer_describe(SIDRE_Buffer *self, SIDRE_TypeID type, SIDRE_IndexType num_elems) +void SIDRE_Buffer_describe(SIDRE_Buffer* self, SIDRE_TypeID type, SIDRE_IndexType num_elems) { - axom::sidre::Buffer *SH_this = static_cast(self->addr); + axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.describe axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->describe(SHCXX_type, num_elems); // splicer end class.Buffer.method.describe } -void SIDRE_Buffer_allocate_existing(SIDRE_Buffer *self) +void SIDRE_Buffer_allocate_existing(SIDRE_Buffer* self) { - axom::sidre::Buffer *SH_this = static_cast(self->addr); + axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.allocate_existing SH_this->allocate(); // splicer end class.Buffer.method.allocate_existing } -void SIDRE_Buffer_allocate_from_type(SIDRE_Buffer *self, SIDRE_TypeID type, SIDRE_IndexType num_elems) +void SIDRE_Buffer_allocate_from_type(SIDRE_Buffer* self, SIDRE_TypeID type, SIDRE_IndexType num_elems) { - axom::sidre::Buffer *SH_this = static_cast(self->addr); + axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.allocate_from_type axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->allocate(SHCXX_type, num_elems); // splicer end class.Buffer.method.allocate_from_type } -void SIDRE_Buffer_reallocate(SIDRE_Buffer *self, SIDRE_IndexType num_elems) +void SIDRE_Buffer_reallocate(SIDRE_Buffer* self, SIDRE_IndexType num_elems) { - axom::sidre::Buffer *SH_this = static_cast(self->addr); + axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.reallocate SH_this->reallocate(num_elems); // splicer end class.Buffer.method.reallocate } -void SIDRE_Buffer_print(const SIDRE_Buffer *self) +void SIDRE_Buffer_print(const SIDRE_Buffer* self) { - const axom::sidre::Buffer *SH_this = static_cast(self->addr); + const axom::sidre::Buffer* SH_this = static_cast(self->addr); // splicer begin class.Buffer.method.print SH_this->print(); // splicer end class.Buffer.method.print diff --git a/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp b/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp index 2f136546cc..d3abcb53fb 100644 --- a/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapDataStore.cpp @@ -20,7 +20,7 @@ extern "C" { // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -38,30 +38,30 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer begin class.DataStore.C_definitions // splicer end class.DataStore.C_definitions -SIDRE_DataStore *SIDRE_DataStore_new(SIDRE_DataStore *SHC_rv) +SIDRE_DataStore* SIDRE_DataStore_new(SIDRE_DataStore* SHC_rv) { // splicer begin class.DataStore.method.new - axom::sidre::DataStore *SHCXX_rv = new axom::sidre::DataStore(); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::DataStore* SHCXX_rv = new axom::sidre::DataStore(); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 2; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; return SHC_rv; // splicer end class.DataStore.method.new } -void SIDRE_DataStore_new_bufferify(SIDRE_DataStore *SHC_rv) +void SIDRE_DataStore_new_bufferify(SIDRE_DataStore* SHC_rv) { // splicer begin class.DataStore.method.new_bufferify - axom::sidre::DataStore *SHCXX_rv = new axom::sidre::DataStore(); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::DataStore* SHCXX_rv = new axom::sidre::DataStore(); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 2; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; // splicer end class.DataStore.method.new_bufferify } -void SIDRE_DataStore_delete(SIDRE_DataStore *self) +void SIDRE_DataStore_delete(SIDRE_DataStore* self) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.delete if(self->cmemflags & SWIG_MEM_OWN) { @@ -73,11 +73,11 @@ void SIDRE_DataStore_delete(SIDRE_DataStore *self) // splicer end class.DataStore.method.delete } -SIDRE_Group *SIDRE_DataStore_get_root(SIDRE_DataStore *self, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_DataStore_get_root(SIDRE_DataStore* self, SIDRE_Group* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.getRoot - axom::sidre::Group *SHC_rv_cxx = SH_this->getRoot(); + axom::sidre::Group* SHC_rv_cxx = SH_this->getRoot(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -85,33 +85,33 @@ SIDRE_Group *SIDRE_DataStore_get_root(SIDRE_DataStore *self, SIDRE_Group *SHC_rv // splicer end class.DataStore.method.getRoot } -void SIDRE_DataStore_get_root_bufferify(SIDRE_DataStore *self, SIDRE_Group *SHC_rv) +void SIDRE_DataStore_get_root_bufferify(SIDRE_DataStore* self, SIDRE_Group* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.getRoot_bufferify - axom::sidre::Group *SHC_rv_cxx = SH_this->getRoot(); + axom::sidre::Group* SHC_rv_cxx = SH_this->getRoot(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.DataStore.method.getRoot_bufferify } -size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore *self) +size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore* self) { - const axom::sidre::DataStore *SH_this = static_cast(self->addr); + const axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.getNumBuffers size_t SHC_rv = SH_this->getNumBuffers(); return SHC_rv; // splicer end class.DataStore.method.getNumBuffers } -SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, +SIDRE_Buffer* SIDRE_DataStore_get_buffer(SIDRE_DataStore* self, SIDRE_IndexType idx, - SIDRE_Buffer *SHC_rv) + SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.getBuffer - axom::sidre::Buffer *SHC_rv_cxx = SH_this->getBuffer(idx); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->getBuffer(idx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -128,24 +128,24 @@ SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, // splicer end class.DataStore.method.getBuffer } -void SIDRE_DataStore_get_buffer_bufferify(SIDRE_DataStore *self, +void SIDRE_DataStore_get_buffer_bufferify(SIDRE_DataStore* self, SIDRE_IndexType idx, - SIDRE_Buffer *SHC_rv) + SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.getBuffer_bufferify - axom::sidre::Buffer *SHC_rv_cxx = SH_this->getBuffer(idx); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->getBuffer(idx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.DataStore.method.getBuffer_bufferify } -SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, SIDRE_Buffer *SHC_rv) +SIDRE_Buffer* SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore* self, SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.createBuffer_empty - axom::sidre::Buffer *SHC_rv_cxx = SH_this->createBuffer(); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->createBuffer(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -153,26 +153,26 @@ SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, SIDRE_B // splicer end class.DataStore.method.createBuffer_empty } -void SIDRE_DataStore_create_buffer_empty_bufferify(SIDRE_DataStore *self, SIDRE_Buffer *SHC_rv) +void SIDRE_DataStore_create_buffer_empty_bufferify(SIDRE_DataStore* self, SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.createBuffer_empty_bufferify - axom::sidre::Buffer *SHC_rv_cxx = SH_this->createBuffer(); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->createBuffer(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.DataStore.method.createBuffer_empty_bufferify } -SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, +SIDRE_Buffer* SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *SHC_rv) + SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.createBuffer_from_type axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_rv_cxx = SH_this->createBuffer(SHCXX_type, num_elems); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->createBuffer(SHCXX_type, num_elems); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -189,36 +189,36 @@ SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, // splicer end class.DataStore.method.createBuffer_from_type } -void SIDRE_DataStore_create_buffer_from_type_bufferify(SIDRE_DataStore *self, +void SIDRE_DataStore_create_buffer_from_type_bufferify(SIDRE_DataStore* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *SHC_rv) + SIDRE_Buffer* SHC_rv) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.createBuffer_from_type_bufferify axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_rv_cxx = SH_this->createBuffer(SHCXX_type, num_elems); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->createBuffer(SHCXX_type, num_elems); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.DataStore.method.createBuffer_from_type_bufferify } -void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore *self, SIDRE_IndexType id) +void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore* self, SIDRE_IndexType id) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.destroyBuffer SH_this->destroyBuffer(id); // splicer end class.DataStore.method.destroyBuffer } -bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, - const char *domain_path, - const char *mesh_name, - const char *index_path, +bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore* self, + const char* domain_path, + const char* mesh_name, + const char* index_path, int num_domains) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.generateBlueprintIndex_0 const std::string SHC_domain_path_cxx(domain_path); const std::string SHC_mesh_name_cxx(mesh_name); @@ -231,16 +231,16 @@ bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, // splicer end class.DataStore.method.generateBlueprintIndex_0 } -bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore *self, - char *domain_path, +bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore* self, + char* domain_path, int SHT_domain_path_len, - char *mesh_name, + char* mesh_name, int SHT_mesh_name_len, - char *index_path, + char* index_path, int SHT_index_path_len, int num_domains) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.generateBlueprintIndex_0_bufferify int SHC_domain_path_trim = ShroudCharLenTrim(domain_path, SHT_domain_path_len); const std::string SHC_domain_path_cxx(domain_path, SHC_domain_path_trim); @@ -257,13 +257,13 @@ bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore *self, } #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, +bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore* self, MPI_Fint comm, - const char *domain_path, - const char *mesh_name, - const char *index_path) + const char* domain_path, + const char* mesh_name, + const char* index_path) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.generateBlueprintIndex_1 MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); const std::string SHC_domain_path_cxx(domain_path); @@ -279,16 +279,16 @@ bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, #endif // ifdef AXOM_USE_MPI #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore *self, +bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore* self, MPI_Fint comm, - char *domain_path, + char* domain_path, int SHT_domain_path_len, - char *mesh_name, + char* mesh_name, int SHT_mesh_name_len, - char *index_path, + char* index_path, int SHT_index_path_len) { - axom::sidre::DataStore *SH_this = static_cast(self->addr); + axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.generateBlueprintIndex_1_bufferify MPI_Comm SHCXX_comm = MPI_Comm_f2c(comm); int SHC_domain_path_trim = ShroudCharLenTrim(domain_path, SHT_domain_path_len); @@ -306,9 +306,9 @@ bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore *self, } #endif // ifdef AXOM_USE_MPI -void SIDRE_DataStore_print(const SIDRE_DataStore *self) +void SIDRE_DataStore_print(const SIDRE_DataStore* self) { - const axom::sidre::DataStore *SH_this = static_cast(self->addr); + const axom::sidre::DataStore* SH_this = static_cast(self->addr); // splicer begin class.DataStore.method.print SH_this->print(); // splicer end class.DataStore.method.print diff --git a/src/axom/sidre/interface/c_fortran/wrapDataStore.h b/src/axom/sidre/interface/c_fortran/wrapDataStore.h index e7f342af38..f671dba0e8 100644 --- a/src/axom/sidre/interface/c_fortran/wrapDataStore.h +++ b/src/axom/sidre/interface/c_fortran/wrapDataStore.h @@ -40,77 +40,77 @@ extern "C" { // splicer begin class.DataStore.C_declarations // splicer end class.DataStore.C_declarations -SIDRE_DataStore *SIDRE_DataStore_new(SIDRE_DataStore *SHC_rv); +SIDRE_DataStore* SIDRE_DataStore_new(SIDRE_DataStore* SHC_rv); -void SIDRE_DataStore_new_bufferify(SIDRE_DataStore *SHC_rv); +void SIDRE_DataStore_new_bufferify(SIDRE_DataStore* SHC_rv); -void SIDRE_DataStore_delete(SIDRE_DataStore *self); +void SIDRE_DataStore_delete(SIDRE_DataStore* self); -SIDRE_Group *SIDRE_DataStore_get_root(SIDRE_DataStore *self, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_DataStore_get_root(SIDRE_DataStore* self, SIDRE_Group* SHC_rv); -void SIDRE_DataStore_get_root_bufferify(SIDRE_DataStore *self, SIDRE_Group *SHC_rv); +void SIDRE_DataStore_get_root_bufferify(SIDRE_DataStore* self, SIDRE_Group* SHC_rv); -size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore *self); +size_t SIDRE_DataStore_get_num_buffers(const SIDRE_DataStore* self); -SIDRE_Buffer *SIDRE_DataStore_get_buffer(SIDRE_DataStore *self, +SIDRE_Buffer* SIDRE_DataStore_get_buffer(SIDRE_DataStore* self, SIDRE_IndexType idx, - SIDRE_Buffer *SHC_rv); + SIDRE_Buffer* SHC_rv); -void SIDRE_DataStore_get_buffer_bufferify(SIDRE_DataStore *self, +void SIDRE_DataStore_get_buffer_bufferify(SIDRE_DataStore* self, SIDRE_IndexType idx, - SIDRE_Buffer *SHC_rv); + SIDRE_Buffer* SHC_rv); -SIDRE_Buffer *SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore *self, SIDRE_Buffer *SHC_rv); +SIDRE_Buffer* SIDRE_DataStore_create_buffer_empty(SIDRE_DataStore* self, SIDRE_Buffer* SHC_rv); -void SIDRE_DataStore_create_buffer_empty_bufferify(SIDRE_DataStore *self, SIDRE_Buffer *SHC_rv); +void SIDRE_DataStore_create_buffer_empty_bufferify(SIDRE_DataStore* self, SIDRE_Buffer* SHC_rv); -SIDRE_Buffer *SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore *self, +SIDRE_Buffer* SIDRE_DataStore_create_buffer_from_type(SIDRE_DataStore* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *SHC_rv); + SIDRE_Buffer* SHC_rv); -void SIDRE_DataStore_create_buffer_from_type_bufferify(SIDRE_DataStore *self, +void SIDRE_DataStore_create_buffer_from_type_bufferify(SIDRE_DataStore* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *SHC_rv); + SIDRE_Buffer* SHC_rv); -void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore *self, SIDRE_IndexType id); +void SIDRE_DataStore_destroy_buffer(SIDRE_DataStore* self, SIDRE_IndexType id); -bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore *self, - const char *domain_path, - const char *mesh_name, - const char *index_path, +bool SIDRE_DataStore_generate_blueprint_index_0(SIDRE_DataStore* self, + const char* domain_path, + const char* mesh_name, + const char* index_path, int num_domains); -bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore *self, - char *domain_path, +bool SIDRE_DataStore_generate_blueprint_index_0_bufferify(SIDRE_DataStore* self, + char* domain_path, int SHT_domain_path_len, - char *mesh_name, + char* mesh_name, int SHT_mesh_name_len, - char *index_path, + char* index_path, int SHT_index_path_len, int num_domains); #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore *self, +bool SIDRE_DataStore_generate_blueprint_index_1(SIDRE_DataStore* self, MPI_Fint comm, - const char *domain_path, - const char *mesh_name, - const char *index_path); + const char* domain_path, + const char* mesh_name, + const char* index_path); #endif #ifdef AXOM_USE_MPI -bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore *self, +bool SIDRE_DataStore_generate_blueprint_index_1_bufferify(SIDRE_DataStore* self, MPI_Fint comm, - char *domain_path, + char* domain_path, int SHT_domain_path_len, - char *mesh_name, + char* mesh_name, int SHT_mesh_name_len, - char *index_path, + char* index_path, int SHT_index_path_len); #endif -void SIDRE_DataStore_print(const SIDRE_DataStore *self); +void SIDRE_DataStore_print(const SIDRE_DataStore* self); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/wrapGroup.cpp b/src/axom/sidre/interface/c_fortran/wrapGroup.cpp index 7f2d111fda..46ea6b051f 100644 --- a/src/axom/sidre/interface/c_fortran/wrapGroup.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapGroup.cpp @@ -23,7 +23,7 @@ extern "C" { // Copy src into dest, blank fill to ndest characters // Truncate if dest is too short. // dest will not be NULL terminated. -static void ShroudCharCopy(char *dest, int ndest, const char *src, int nsrc) +static void ShroudCharCopy(char* dest, int ndest, const char* src, int nsrc) { if(src == NULL) { @@ -41,7 +41,7 @@ static void ShroudCharCopy(char *dest, int ndest, const char *src, int nsrc) // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -59,30 +59,30 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer begin class.Group.C_definitions // splicer end class.Group.C_definitions -SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group *self) +SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group* self) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; // splicer end class.Group.method.getIndex } -const char *SIDRE_Group_get_name(const SIDRE_Group *self) +const char* SIDRE_Group_get_name(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getName - const std::string &SHC_rv_cxx = SH_this->getName(); - const char *SHC_rv = SHC_rv_cxx.c_str(); + const std::string& SHC_rv_cxx = SH_this->getName(); + const char* SHC_rv = SHC_rv_cxx.c_str(); return SHC_rv; // splicer end class.Group.method.getName } -void SIDRE_Group_get_name_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_Group_get_name_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getName_bufferify - const std::string &SHC_rv_cxx = SH_this->getName(); + const std::string& SHC_rv_cxx = SH_this->getName(); if(SHC_rv_cxx.empty()) { ShroudCharCopy(SHC_rv, SHT_rv_len, nullptr, 0); @@ -94,13 +94,13 @@ void SIDRE_Group_get_name_bufferify(const SIDRE_Group *self, char *SHC_rv, int S // splicer end class.Group.method.getName_bufferify } -const char *SIDRE_Group_get_path(const SIDRE_Group *self, SIDRE_SHROUD_capsule_data *SHT_rv_capsule) +const char* SIDRE_Group_get_path(const SIDRE_Group* self, SIDRE_SHROUD_capsule_data* SHT_rv_capsule) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getPath - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = SH_this->getPath(); - const char *SHC_rv = NULL; + const char* SHC_rv = NULL; if(!SHC_rv_cxx->empty()) SHC_rv = SHC_rv_cxx->c_str(); SHT_rv_capsule->addr = SHC_rv_cxx; SHT_rv_capsule->idtor = 1; @@ -109,9 +109,9 @@ const char *SIDRE_Group_get_path(const SIDRE_Group *self, SIDRE_SHROUD_capsule_d // splicer end class.Group.method.getPath } -void SIDRE_Group_get_path_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_Group_get_path_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getPath_bufferify std::string SHC_rv_cxx = SH_this->getPath(); if(SHC_rv_cxx.empty()) @@ -125,14 +125,14 @@ void SIDRE_Group_get_path_bufferify(const SIDRE_Group *self, char *SHC_rv, int S // splicer end class.Group.method.getPath_bufferify } -const char *SIDRE_Group_get_path_name(const SIDRE_Group *self, - SIDRE_SHROUD_capsule_data *SHT_rv_capsule) +const char* SIDRE_Group_get_path_name(const SIDRE_Group* self, + SIDRE_SHROUD_capsule_data* SHT_rv_capsule) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getPathName - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = SH_this->getPathName(); - const char *SHC_rv = NULL; + const char* SHC_rv = NULL; if(!SHC_rv_cxx->empty()) SHC_rv = SHC_rv_cxx->c_str(); SHT_rv_capsule->addr = SHC_rv_cxx; SHT_rv_capsule->idtor = 1; @@ -141,9 +141,9 @@ const char *SIDRE_Group_get_path_name(const SIDRE_Group *self, // splicer end class.Group.method.getPathName } -void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getPathName_bufferify std::string SHC_rv_cxx = SH_this->getPathName(); if(SHC_rv_cxx.empty()) @@ -157,73 +157,73 @@ void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group *self, char *SHC_rv, // splicer end class.Group.method.getPathName_bufferify } -SIDRE_Group *SIDRE_Group_get_parent(const SIDRE_Group *self, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_Group_get_parent(const SIDRE_Group* self, SIDRE_Group* SHC_rv) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getParent - const axom::sidre::Group *SHC_rv_cxx = SH_this->getParent(); - SHC_rv->addr = const_cast(SHC_rv_cxx); + const axom::sidre::Group* SHC_rv_cxx = SH_this->getParent(); + SHC_rv->addr = const_cast(SHC_rv_cxx); SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; return SHC_rv; // splicer end class.Group.method.getParent } -void SIDRE_Group_get_parent_bufferify(const SIDRE_Group *self, SIDRE_Group *SHC_rv) +void SIDRE_Group_get_parent_bufferify(const SIDRE_Group* self, SIDRE_Group* SHC_rv) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getParent_bufferify - const axom::sidre::Group *SHC_rv_cxx = SH_this->getParent(); - SHC_rv->addr = const_cast(SHC_rv_cxx); + const axom::sidre::Group* SHC_rv_cxx = SH_this->getParent(); + SHC_rv->addr = const_cast(SHC_rv_cxx); SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getParent_bufferify } -size_t SIDRE_Group_get_num_groups(const SIDRE_Group *self) +size_t SIDRE_Group_get_num_groups(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getNumGroups size_t SHC_rv = SH_this->getNumGroups(); return SHC_rv; // splicer end class.Group.method.getNumGroups } -size_t SIDRE_Group_get_num_views(const SIDRE_Group *self) +size_t SIDRE_Group_get_num_views(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getNumViews size_t SHC_rv = SH_this->getNumViews(); return SHC_rv; // splicer end class.Group.method.getNumViews } -SIDRE_DataStore *SIDRE_Group_get_data_store(const SIDRE_Group *self, SIDRE_DataStore *SHC_rv) +SIDRE_DataStore* SIDRE_Group_get_data_store(const SIDRE_Group* self, SIDRE_DataStore* SHC_rv) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getDataStore - const axom::sidre::DataStore *SHC_rv_cxx = SH_this->getDataStore(); - SHC_rv->addr = const_cast(SHC_rv_cxx); + const axom::sidre::DataStore* SHC_rv_cxx = SH_this->getDataStore(); + SHC_rv->addr = const_cast(SHC_rv_cxx); SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; return SHC_rv; // splicer end class.Group.method.getDataStore } -void SIDRE_Group_get_data_store_bufferify(const SIDRE_Group *self, SIDRE_DataStore *SHC_rv) +void SIDRE_Group_get_data_store_bufferify(const SIDRE_Group* self, SIDRE_DataStore* SHC_rv) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getDataStore_bufferify - const axom::sidre::DataStore *SHC_rv_cxx = SH_this->getDataStore(); - SHC_rv->addr = const_cast(SHC_rv_cxx); + const axom::sidre::DataStore* SHC_rv_cxx = SH_this->getDataStore(); + SHC_rv->addr = const_cast(SHC_rv_cxx); SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getDataStore_bufferify } -bool SIDRE_Group_has_view(const SIDRE_Group *self, const char *path) +bool SIDRE_Group_has_view(const SIDRE_Group* self, const char* path) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasView const std::string SHC_path_cxx(path); bool SHC_rv = SH_this->hasView(SHC_path_cxx); @@ -231,9 +231,9 @@ bool SIDRE_Group_has_view(const SIDRE_Group *self, const char *path) // splicer end class.Group.method.hasView } -bool SIDRE_Group_has_view_bufferify(const SIDRE_Group *self, char *path, int SHT_path_len) +bool SIDRE_Group_has_view_bufferify(const SIDRE_Group* self, char* path, int SHT_path_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasView_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); @@ -242,9 +242,9 @@ bool SIDRE_Group_has_view_bufferify(const SIDRE_Group *self, char *path, int SHT // splicer end class.Group.method.hasView_bufferify } -bool SIDRE_Group_has_child_view(const SIDRE_Group *self, const char *name) +bool SIDRE_Group_has_child_view(const SIDRE_Group* self, const char* name) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasChildView const std::string SHC_name_cxx(name); bool SHC_rv = SH_this->hasChildView(SHC_name_cxx); @@ -252,9 +252,9 @@ bool SIDRE_Group_has_child_view(const SIDRE_Group *self, const char *name) // splicer end class.Group.method.hasChildView } -bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group *self, char *name, int SHT_name_len) +bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group* self, char* name, int SHT_name_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasChildView_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); const std::string SHC_name_cxx(name, SHC_name_trim); @@ -263,9 +263,9 @@ bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group *self, char *name, i // splicer end class.Group.method.hasChildView_bufferify } -SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, const char *name) +SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group* self, const char* name) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getViewIndex const std::string SHC_name_cxx(name); axom::sidre::IndexType SHC_rv = SH_this->getViewIndex(SHC_name_cxx); @@ -273,11 +273,11 @@ SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, const char * // splicer end class.Group.method.getViewIndex } -SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group *self, - char *name, +SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group* self, + char* name, int SHT_name_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getViewIndex_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); const std::string SHC_name_cxx(name, SHC_name_trim); @@ -286,30 +286,30 @@ SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group *self, // splicer end class.Group.method.getViewIndex_bufferify } -const char *SIDRE_Group_get_view_name(const SIDRE_Group *self, SIDRE_IndexType idx) +const char* SIDRE_Group_get_view_name(const SIDRE_Group* self, SIDRE_IndexType idx) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getViewName - const std::string &SHC_rv_cxx = SH_this->getViewName(idx); + const std::string& SHC_rv_cxx = SH_this->getViewName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHC_rv_cxx)) { return SIDRE_InvalidName; } - const char *SHC_rv = SHC_rv_cxx.c_str(); + const char* SHC_rv = SHC_rv_cxx.c_str(); return SHC_rv; // splicer end class.Group.method.getViewName } -void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group *self, +void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group* self, SIDRE_IndexType idx, - char *SHC_rv, + char* SHC_rv, int SHT_rv_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getViewName_bufferify - const std::string &SHC_rv_cxx = SH_this->getViewName(idx); + const std::string& SHC_rv_cxx = SH_this->getViewName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHC_rv_cxx)) { @@ -328,12 +328,12 @@ void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group *self, // splicer end class.Group.method.getViewName_bufferify } -SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, const char *path, SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_get_view_from_name(SIDRE_Group* self, const char* path, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getView_from_name const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->getView(SHC_path_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->getView(SHC_path_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -350,29 +350,29 @@ SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, const char *path, // splicer end class.Group.method.getView_from_name } -void SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getView_from_name_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->getView(SHC_path_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->getView(SHC_path_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getView_from_name_bufferify } -SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, +SIDRE_View* SIDRE_Group_get_view_from_index(SIDRE_Group* self, const SIDRE_IndexType idx, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getView_from_index - axom::sidre::View *SHC_rv_cxx = SH_this->getView(idx); + axom::sidre::View* SHC_rv_cxx = SH_this->getView(idx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -389,43 +389,43 @@ SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, // splicer end class.Group.method.getView_from_index } -void SIDRE_Group_get_view_from_index_bufferify(SIDRE_Group *self, +void SIDRE_Group_get_view_from_index_bufferify(SIDRE_Group* self, const SIDRE_IndexType idx, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getView_from_index_bufferify - axom::sidre::View *SHC_rv_cxx = SH_this->getView(idx); + axom::sidre::View* SHC_rv_cxx = SH_this->getView(idx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getView_from_index_bufferify } -SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group *self) +SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getFirstValidViewIndex axom::sidre::IndexType SHC_rv = SH_this->getFirstValidViewIndex(); return SHC_rv; // splicer end class.Group.method.getFirstValidViewIndex } -SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group *self, SIDRE_IndexType idx) +SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group* self, SIDRE_IndexType idx) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getNextValidViewIndex axom::sidre::IndexType SHC_rv = SH_this->getNextValidViewIndex(idx); return SHC_rv; // splicer end class.Group.method.getNextValidViewIndex } -SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, const char *path, SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_create_view_empty(SIDRE_Group* self, const char* path, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_empty const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -442,33 +442,33 @@ SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, const char *path, S // splicer end class.Group.method.createView_empty } -void SIDRE_Group_create_view_empty_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_empty_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_empty_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createView_empty_bufferify } -SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -485,37 +485,37 @@ SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, // splicer end class.Group.method.createView_from_type } -void SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createView_from_type_bufferify } -SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_base(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_base const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -533,20 +533,20 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_base } -void SIDRE_Group_create_view_with_shape_base_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_base_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_base_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -554,16 +554,16 @@ void SIDRE_Group_create_view_with_shape_base_bufferify(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_base_bufferify } -SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, - const char *path, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_create_view_into_buffer(SIDRE_Group* self, + const char* path, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_into_buffer const std::string SHC_path_cxx(path); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHC_buff_cxx); + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHC_buff_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -580,37 +580,37 @@ SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, // splicer end class.Group.method.createView_into_buffer } -void SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_into_buffer_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHC_buff_cxx); + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHC_buff_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createView_into_buffer_bufferify } -SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type_and_buffer const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems, SHC_buff_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -628,21 +628,21 @@ SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, // splicer end class.Group.method.createView_from_type_and_buffer } -void SIDRE_Group_create_view_from_type_and_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_and_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type_and_buffer_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems, SHC_buff_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -650,20 +650,20 @@ void SIDRE_Group_create_view_from_type_and_buffer_bufferify(SIDRE_Group *self, // splicer end class.Group.method.createView_from_type_and_buffer_bufferify } -SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_and_buffer const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape, SHC_buff_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -681,22 +681,22 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_and_buffer } -void SIDRE_Group_create_view_with_shape_and_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_and_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_and_buffer_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape, SHC_buff_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -704,15 +704,15 @@ void SIDRE_Group_create_view_with_shape_and_buffer_bufferify(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_and_buffer_bufferify } -SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, - const char *path, - void *external_ptr, - SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_create_view_external(SIDRE_Group* self, + const char* path, + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_external const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, external_ptr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, external_ptr); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -729,35 +729,35 @@ SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, // splicer end class.Group.method.createView_external } -void SIDRE_Group_create_view_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - void *external_ptr, - SIDRE_View *SHC_rv) + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_external_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createView(SHC_path_cxx, external_ptr); + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, external_ptr); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createView_external_bufferify } -SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type_external(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr, - SIDRE_View *SHC_rv) + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type_external const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems, external_ptr); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -775,20 +775,20 @@ SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, // splicer end class.Group.method.createView_from_type_external } -void SIDRE_Group_create_view_from_type_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr, - SIDRE_View *SHC_rv) + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createView_from_type_external_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createView(SHC_path_cxx, SHCXX_type, num_elems, external_ptr); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -796,19 +796,19 @@ void SIDRE_Group_create_view_from_type_external_bufferify(SIDRE_Group *self, // splicer end class.Group.method.createView_from_type_external_bufferify } -SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_external(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_external const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape, external_ptr); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -826,21 +826,21 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_external } -void SIDRE_Group_create_view_with_shape_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + void* external_ptr, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShape_external_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShape(SHC_path_cxx, SHCXX_type, ndims, shape, external_ptr); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -848,17 +848,17 @@ void SIDRE_Group_create_view_with_shape_external_bufferify(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShape_external_bufferify } -SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewAndAllocate_nelems const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewAndAllocate(SHC_path_cxx, SHCXX_type, num_elems); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewAndAllocate(SHC_path_cxx, SHCXX_type, num_elems); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -875,37 +875,37 @@ SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, // splicer end class.Group.method.createViewAndAllocate_nelems } -void SIDRE_Group_create_view_and_allocate_nelems_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_and_allocate_nelems_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewAndAllocate_nelems_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewAndAllocate(SHC_path_cxx, SHCXX_type, num_elems); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewAndAllocate(SHC_path_cxx, SHCXX_type, num_elems); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewAndAllocate_nelems_bufferify } -SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_and_allocate(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShapeAndAllocate const std::string SHC_path_cxx(path); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShapeAndAllocate(SHC_path_cxx, SHCXX_type, ndims, shape); // C_error_pattern if(SHC_rv_cxx == nullptr) @@ -923,20 +923,20 @@ SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate(SIDRE_Group *self, // splicer end class.Group.method.createViewWithShapeAndAllocate } -void SIDRE_Group_create_view_with_shape_and_allocate_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_and_allocate_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv) + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewWithShapeAndAllocate_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::View *SHC_rv_cxx = + axom::sidre::View* SHC_rv_cxx = SH_this->createViewWithShapeAndAllocate(SHC_path_cxx, SHCXX_type, ndims, shape); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; @@ -944,15 +944,15 @@ void SIDRE_Group_create_view_with_shape_and_allocate_bufferify(SIDRE_Group *self // splicer end class.Group.method.createViewWithShapeAndAllocate_bufferify } -SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_int(SIDRE_Group* self, + const char* path, int value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_int const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -969,32 +969,32 @@ SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, // splicer end class.Group.method.createViewScalar_int } -void SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group* self, + char* path, int SHT_path_len, int value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_bufferify_int int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_bufferify_int } -SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_long(SIDRE_Group* self, + const char* path, long value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_long const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1011,32 +1011,32 @@ SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, // splicer end class.Group.method.createViewScalar_long } -void SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group* self, + char* path, int SHT_path_len, long value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_bufferify_long int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_bufferify_long } -SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_float(SIDRE_Group* self, + const char* path, float value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_float const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1053,32 +1053,32 @@ SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, // splicer end class.Group.method.createViewScalar_float } -void SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group* self, + char* path, int SHT_path_len, float value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_bufferify_float int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_bufferify_float } -SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_double(SIDRE_Group* self, + const char* path, double value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_double const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1095,33 +1095,33 @@ SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, // splicer end class.Group.method.createViewScalar_double } -void SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group* self, + char* path, int SHT_path_len, double value, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_bufferify_double int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_bufferify_double } -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_int(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_int(SIDRE_Group* self, + const char* path, int value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_int const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1138,34 +1138,34 @@ SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_int(SIDRE_Group *s // splicer end class.Group.method.createViewScalar_path_value_allocID_int } -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_int(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_int(SIDRE_Group* self, + char* path, int SHT_path_len, int value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_bufferify_int int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_path_value_allocID_bufferify_int } -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_long(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_long(SIDRE_Group* self, + const char* path, long value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_long const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1182,34 +1182,34 @@ SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_long(SIDRE_Group * // splicer end class.Group.method.createViewScalar_path_value_allocID_long } -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_long(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_long(SIDRE_Group* self, + char* path, int SHT_path_len, long value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_bufferify_long int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_path_value_allocID_bufferify_long } -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_float(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_float(SIDRE_Group* self, + const char* path, float value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_float const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1226,34 +1226,34 @@ SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_float(SIDRE_Group // splicer end class.Group.method.createViewScalar_path_value_allocID_float } -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_float(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_float(SIDRE_Group* self, + char* path, int SHT_path_len, float value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_bufferify_float int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_path_value_allocID_bufferify_float } -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_double(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_double(SIDRE_Group* self, + const char* path, double value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_double const std::string SHC_path_cxx(path); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1270,34 +1270,34 @@ SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_double(SIDRE_Group // splicer end class.Group.method.createViewScalar_path_value_allocID_double } -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_double(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_double(SIDRE_Group* self, + char* path, int SHT_path_len, double value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewScalar_path_value_allocID_bufferify_double int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewScalar(SHC_path_cxx, value, allocID); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewScalar_path_value_allocID_bufferify_double } -SIDRE_View *SIDRE_Group_create_view_string_path_value(SIDRE_Group *self, - const char *path, - const char *value, - SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_create_view_string_path_value(SIDRE_Group* self, + const char* path, + const char* value, + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewString_path_value const std::string SHC_path_cxx(path); const std::string SHC_value_cxx(value); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1314,37 +1314,37 @@ SIDRE_View *SIDRE_Group_create_view_string_path_value(SIDRE_Group *self, // splicer end class.Group.method.createViewString_path_value } -void SIDRE_Group_create_view_string_path_value_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_string_path_value_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - char *value, + char* value, int SHT_value_len, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewString_path_value_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); int SHC_value_trim = ShroudCharLenTrim(value, SHT_value_len); const std::string SHC_value_cxx(value, SHC_value_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewString_path_value_bufferify } -SIDRE_View *SIDRE_Group_create_view_string_path_value_allocID(SIDRE_Group *self, - const char *path, - const char *value, +SIDRE_View* SIDRE_Group_create_view_string_path_value_allocID(SIDRE_Group* self, + const char* path, + const char* value, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewString_path_value_allocID const std::string SHC_path_cxx(path); const std::string SHC_value_cxx(value); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx, allocID); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1361,39 +1361,39 @@ SIDRE_View *SIDRE_Group_create_view_string_path_value_allocID(SIDRE_Group *self, // splicer end class.Group.method.createViewString_path_value_allocID } -void SIDRE_Group_create_view_string_path_value_allocID_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_string_path_value_allocID_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - char *value, + char* value, int SHT_value_len, int allocID, - SIDRE_View *SHC_rv) + SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createViewString_path_value_allocID_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); int SHC_value_trim = ShroudCharLenTrim(value, SHT_value_len); const std::string SHC_value_cxx(value, SHC_value_trim); - axom::sidre::View *SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx, allocID); + axom::sidre::View* SHC_rv_cxx = SH_this->createViewString(SHC_path_cxx, SHC_value_cxx, allocID); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createViewString_path_value_allocID_bufferify } -void SIDRE_Group_destroy_view(SIDRE_Group *self, const char *path) +void SIDRE_Group_destroy_view(SIDRE_Group* self, const char* path) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyView const std::string SHC_path_cxx(path); SH_this->destroyView(SHC_path_cxx); // splicer end class.Group.method.destroyView } -void SIDRE_Group_destroy_view_bufferify(SIDRE_Group *self, char *path, int SHT_path_len) +void SIDRE_Group_destroy_view_bufferify(SIDRE_Group* self, char* path, int SHT_path_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyView_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); @@ -1401,18 +1401,18 @@ void SIDRE_Group_destroy_view_bufferify(SIDRE_Group *self, char *path, int SHT_p // splicer end class.Group.method.destroyView_bufferify } -void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group *self, const char *path) +void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group* self, const char* path) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyViewAndData_name const std::string SHC_path_cxx(path); SH_this->destroyViewAndData(SHC_path_cxx); // splicer end class.Group.method.destroyViewAndData_name } -void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group *self, char *path, int SHT_path_len) +void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group* self, char* path, int SHT_path_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyViewAndData_name_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); @@ -1420,20 +1420,20 @@ void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group *self, char *p // splicer end class.Group.method.destroyViewAndData_name_bufferify } -void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group *self, SIDRE_IndexType idx) +void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group* self, SIDRE_IndexType idx) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyViewAndData_index SH_this->destroyViewAndData(idx); // splicer end class.Group.method.destroyViewAndData_index } -SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_move_view(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.moveView - axom::sidre::View *SHC_view_cxx = static_cast(view->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->moveView(SHC_view_cxx); + axom::sidre::View* SHC_view_cxx = static_cast(view->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->moveView(SHC_view_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -1441,24 +1441,24 @@ SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_Vie // splicer end class.Group.method.moveView } -void SIDRE_Group_move_view_bufferify(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv) +void SIDRE_Group_move_view_bufferify(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.moveView_bufferify - axom::sidre::View *SHC_view_cxx = static_cast(view->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->moveView(SHC_view_cxx); + axom::sidre::View* SHC_view_cxx = static_cast(view->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->moveView(SHC_view_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.moveView_bufferify } -SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv) +SIDRE_View* SIDRE_Group_copy_view(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.copyView - axom::sidre::View *SHC_view_cxx = static_cast(view->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->copyView(SHC_view_cxx); + axom::sidre::View* SHC_view_cxx = static_cast(view->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->copyView(SHC_view_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -1466,21 +1466,21 @@ SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_Vie // splicer end class.Group.method.copyView } -void SIDRE_Group_copy_view_bufferify(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv) +void SIDRE_Group_copy_view_bufferify(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.copyView_bufferify - axom::sidre::View *SHC_view_cxx = static_cast(view->addr); - axom::sidre::View *SHC_rv_cxx = SH_this->copyView(SHC_view_cxx); + axom::sidre::View* SHC_view_cxx = static_cast(view->addr); + axom::sidre::View* SHC_rv_cxx = SH_this->copyView(SHC_view_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.copyView_bufferify } -bool SIDRE_Group_has_group(SIDRE_Group *self, const char *path) +bool SIDRE_Group_has_group(SIDRE_Group* self, const char* path) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasGroup const std::string SHC_path_cxx(path); bool SHC_rv = SH_this->hasGroup(SHC_path_cxx); @@ -1488,9 +1488,9 @@ bool SIDRE_Group_has_group(SIDRE_Group *self, const char *path) // splicer end class.Group.method.hasGroup } -bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, char *path, int SHT_path_len) +bool SIDRE_Group_has_group_bufferify(SIDRE_Group* self, char* path, int SHT_path_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasGroup_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); @@ -1499,9 +1499,9 @@ bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, char *path, int SHT_path // splicer end class.Group.method.hasGroup_bufferify } -bool SIDRE_Group_has_child_group(SIDRE_Group *self, const char *name) +bool SIDRE_Group_has_child_group(SIDRE_Group* self, const char* name) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasChildGroup const std::string SHC_name_cxx(name); bool SHC_rv = SH_this->hasChildGroup(SHC_name_cxx); @@ -1509,9 +1509,9 @@ bool SIDRE_Group_has_child_group(SIDRE_Group *self, const char *name) // splicer end class.Group.method.hasChildGroup } -bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group *self, char *name, int SHT_name_len) +bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group* self, char* name, int SHT_name_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.hasChildGroup_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); const std::string SHC_name_cxx(name, SHC_name_trim); @@ -1520,9 +1520,9 @@ bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group *self, char *name, int SH // splicer end class.Group.method.hasChildGroup_bufferify } -SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, const char *name) +SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group* self, const char* name) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroupIndex const std::string SHC_name_cxx(name); axom::sidre::IndexType SHC_rv = SH_this->getGroupIndex(SHC_name_cxx); @@ -1530,11 +1530,11 @@ SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, const char // splicer end class.Group.method.getGroupIndex } -SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group *self, - char *name, +SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group* self, + char* name, int SHT_name_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroupIndex_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); const std::string SHC_name_cxx(name, SHC_name_trim); @@ -1543,30 +1543,30 @@ SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group *self, // splicer end class.Group.method.getGroupIndex_bufferify } -const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, SIDRE_IndexType idx) +const char* SIDRE_Group_get_group_name(const SIDRE_Group* self, SIDRE_IndexType idx) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroupName - const std::string &SHC_rv_cxx = SH_this->getGroupName(idx); + const std::string& SHC_rv_cxx = SH_this->getGroupName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHC_rv_cxx)) { return SIDRE_InvalidName; } - const char *SHC_rv = SHC_rv_cxx.c_str(); + const char* SHC_rv = SHC_rv_cxx.c_str(); return SHC_rv; // splicer end class.Group.method.getGroupName } -void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group *self, +void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group* self, SIDRE_IndexType idx, - char *SHC_rv, + char* SHC_rv, int SHT_rv_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroupName_bufferify - const std::string &SHC_rv_cxx = SH_this->getGroupName(idx); + const std::string& SHC_rv_cxx = SH_this->getGroupName(idx); // C_error_pattern if(!axom::sidre::nameIsValid(SHC_rv_cxx)) { @@ -1585,12 +1585,12 @@ void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group *self, // splicer end class.Group.method.getGroupName_bufferify } -SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, const char *path, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_Group_get_group_from_name(SIDRE_Group* self, const char* path, SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroup_from_name const std::string SHC_path_cxx(path); - axom::sidre::Group *SHC_rv_cxx = SH_this->getGroup(SHC_path_cxx); + axom::sidre::Group* SHC_rv_cxx = SH_this->getGroup(SHC_path_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1607,29 +1607,29 @@ SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, const char *path // splicer end class.Group.method.getGroup_from_name } -void SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Group *SHC_rv) + SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroup_from_name_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::Group *SHC_rv_cxx = SH_this->getGroup(SHC_path_cxx); + axom::sidre::Group* SHC_rv_cxx = SH_this->getGroup(SHC_path_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getGroup_from_name_bufferify } -SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, +SIDRE_Group* SIDRE_Group_get_group_from_index(SIDRE_Group* self, SIDRE_IndexType idx, - SIDRE_Group *SHC_rv) + SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroup_from_index - axom::sidre::Group *SHC_rv_cxx = SH_this->getGroup(idx); + axom::sidre::Group* SHC_rv_cxx = SH_this->getGroup(idx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1646,43 +1646,43 @@ SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, // splicer end class.Group.method.getGroup_from_index } -void SIDRE_Group_get_group_from_index_bufferify(SIDRE_Group *self, +void SIDRE_Group_get_group_from_index_bufferify(SIDRE_Group* self, SIDRE_IndexType idx, - SIDRE_Group *SHC_rv) + SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getGroup_from_index_bufferify - axom::sidre::Group *SHC_rv_cxx = SH_this->getGroup(idx); + axom::sidre::Group* SHC_rv_cxx = SH_this->getGroup(idx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.getGroup_from_index_bufferify } -SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group *self) +SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getFirstValidGroupIndex axom::sidre::IndexType SHC_rv = SH_this->getFirstValidGroupIndex(); return SHC_rv; // splicer end class.Group.method.getFirstValidGroupIndex } -SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group *self, SIDRE_IndexType idx) +SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group* self, SIDRE_IndexType idx) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.getNextValidGroupIndex axom::sidre::IndexType SHC_rv = SH_this->getNextValidGroupIndex(idx); return SHC_rv; // splicer end class.Group.method.getNextValidGroupIndex } -SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, const char *path, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_Group_create_group(SIDRE_Group* self, const char* path, SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createGroup const std::string SHC_path_cxx(path); - axom::sidre::Group *SHC_rv_cxx = SH_this->createGroup(SHC_path_cxx); + axom::sidre::Group* SHC_rv_cxx = SH_this->createGroup(SHC_path_cxx); // C_error_pattern if(SHC_rv_cxx == nullptr) { @@ -1699,34 +1699,34 @@ SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, const char *path, SIDRE // splicer end class.Group.method.createGroup } -void SIDRE_Group_create_group_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_group_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Group *SHC_rv) + SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.createGroup_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); - axom::sidre::Group *SHC_rv_cxx = SH_this->createGroup(SHC_path_cxx); + axom::sidre::Group* SHC_rv_cxx = SH_this->createGroup(SHC_path_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.createGroup_bufferify } -void SIDRE_Group_destroy_group_name(SIDRE_Group *self, const char *path) +void SIDRE_Group_destroy_group_name(SIDRE_Group* self, const char* path) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyGroup_name const std::string SHC_path_cxx(path); SH_this->destroyGroup(SHC_path_cxx); // splicer end class.Group.method.destroyGroup_name } -void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group *self, char *path, int SHT_path_len) +void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group* self, char* path, int SHT_path_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyGroup_name_bufferify int SHC_path_trim = ShroudCharLenTrim(path, SHT_path_len); const std::string SHC_path_cxx(path, SHC_path_trim); @@ -1734,20 +1734,20 @@ void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group *self, char *path, int // splicer end class.Group.method.destroyGroup_name_bufferify } -void SIDRE_Group_destroy_group_index(SIDRE_Group *self, SIDRE_IndexType idx) +void SIDRE_Group_destroy_group_index(SIDRE_Group* self, SIDRE_IndexType idx) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.destroyGroup_index SH_this->destroyGroup(idx); // splicer end class.Group.method.destroyGroup_index } -SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, SIDRE_Group *grp, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_Group_move_group(SIDRE_Group* self, SIDRE_Group* grp, SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.moveGroup - axom::sidre::Group *SHC_grp_cxx = static_cast(grp->addr); - axom::sidre::Group *SHC_rv_cxx = SH_this->moveGroup(SHC_grp_cxx); + axom::sidre::Group* SHC_grp_cxx = static_cast(grp->addr); + axom::sidre::Group* SHC_rv_cxx = SH_this->moveGroup(SHC_grp_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -1755,39 +1755,39 @@ SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, SIDRE_Group *grp, SIDRE_G // splicer end class.Group.method.moveGroup } -void SIDRE_Group_move_group_bufferify(SIDRE_Group *self, SIDRE_Group *grp, SIDRE_Group *SHC_rv) +void SIDRE_Group_move_group_bufferify(SIDRE_Group* self, SIDRE_Group* grp, SIDRE_Group* SHC_rv) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.moveGroup_bufferify - axom::sidre::Group *SHC_grp_cxx = static_cast(grp->addr); - axom::sidre::Group *SHC_rv_cxx = SH_this->moveGroup(SHC_grp_cxx); + axom::sidre::Group* SHC_grp_cxx = static_cast(grp->addr); + axom::sidre::Group* SHC_rv_cxx = SH_this->moveGroup(SHC_grp_cxx); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.Group.method.moveGroup_bufferify } -void SIDRE_Group_print(const SIDRE_Group *self) +void SIDRE_Group_print(const SIDRE_Group* self) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.print SH_this->print(); // splicer end class.Group.method.print } -bool SIDRE_Group_is_equivalent_to(const SIDRE_Group *self, SIDRE_Group *other) +bool SIDRE_Group_is_equivalent_to(const SIDRE_Group* self, SIDRE_Group* other) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.isEquivalentTo - const axom::sidre::Group *SHC_other_cxx = static_cast(other->addr); + const axom::sidre::Group* SHC_other_cxx = static_cast(other->addr); bool SHC_rv = SH_this->isEquivalentTo(SHC_other_cxx); return SHC_rv; // splicer end class.Group.method.isEquivalentTo } -void SIDRE_Group_save(const SIDRE_Group *self, const char *file_path, const char *protocol) +void SIDRE_Group_save(const SIDRE_Group* self, const char* file_path, const char* protocol) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.save const std::string SHC_file_path_cxx(file_path); const std::string SHC_protocol_cxx(protocol); @@ -1795,13 +1795,13 @@ void SIDRE_Group_save(const SIDRE_Group *self, const char *file_path, const char // splicer end class.Group.method.save } -void SIDRE_Group_save_bufferify(const SIDRE_Group *self, - char *file_path, +void SIDRE_Group_save_bufferify(const SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len) { - const axom::sidre::Group *SH_this = static_cast(self->addr); + const axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.save_bufferify int SHC_file_path_trim = ShroudCharLenTrim(file_path, SHT_file_path_len); const std::string SHC_file_path_cxx(file_path, SHC_file_path_trim); @@ -1811,9 +1811,9 @@ void SIDRE_Group_save_bufferify(const SIDRE_Group *self, // splicer end class.Group.method.save_bufferify } -void SIDRE_Group_load_0(SIDRE_Group *self, const char *file_path, const char *protocol) +void SIDRE_Group_load_0(SIDRE_Group* self, const char* file_path, const char* protocol) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_0 const std::string SHC_file_path_cxx(file_path); const std::string SHC_protocol_cxx(protocol); @@ -1821,13 +1821,13 @@ void SIDRE_Group_load_0(SIDRE_Group *self, const char *file_path, const char *pr // splicer end class.Group.method.load_0 } -void SIDRE_Group_load_0_bufferify(SIDRE_Group *self, - char *file_path, +void SIDRE_Group_load_0_bufferify(SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_0_bufferify int SHC_file_path_trim = ShroudCharLenTrim(file_path, SHT_file_path_len); const std::string SHC_file_path_cxx(file_path, SHC_file_path_trim); @@ -1837,12 +1837,12 @@ void SIDRE_Group_load_0_bufferify(SIDRE_Group *self, // splicer end class.Group.method.load_0_bufferify } -void SIDRE_Group_load_1(SIDRE_Group *self, - const char *file_path, - const char *protocol, +void SIDRE_Group_load_1(SIDRE_Group* self, + const char* file_path, + const char* protocol, bool preserve_contents) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_1 const std::string SHC_file_path_cxx(file_path); const std::string SHC_protocol_cxx(protocol); @@ -1850,14 +1850,14 @@ void SIDRE_Group_load_1(SIDRE_Group *self, // splicer end class.Group.method.load_1 } -void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, - char *file_path, +void SIDRE_Group_load_1_bufferify(SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len, bool preserve_contents) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.load_1_bufferify int SHC_file_path_trim = ShroudCharLenTrim(file_path, SHT_file_path_len); const std::string SHC_file_path_cxx(file_path, SHC_file_path_trim); @@ -1867,18 +1867,18 @@ void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, // splicer end class.Group.method.load_1_bufferify } -void SIDRE_Group_load_external_data(SIDRE_Group *self, const char *file_path) +void SIDRE_Group_load_external_data(SIDRE_Group* self, const char* file_path) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.loadExternalData const std::string SHC_file_path_cxx(file_path); SH_this->loadExternalData(SHC_file_path_cxx); // splicer end class.Group.method.loadExternalData } -void SIDRE_Group_load_external_data_bufferify(SIDRE_Group *self, char *file_path, int SHT_file_path_len) +void SIDRE_Group_load_external_data_bufferify(SIDRE_Group* self, char* file_path, int SHT_file_path_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.loadExternalData_bufferify int SHC_file_path_trim = ShroudCharLenTrim(file_path, SHT_file_path_len); const std::string SHC_file_path_cxx(file_path, SHC_file_path_trim); @@ -1886,9 +1886,9 @@ void SIDRE_Group_load_external_data_bufferify(SIDRE_Group *self, char *file_path // splicer end class.Group.method.loadExternalData_bufferify } -bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name) +bool SIDRE_Group_rename(SIDRE_Group* self, const char* new_name) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.rename const std::string SHC_new_name_cxx(new_name); bool SHC_rv = SH_this->rename(SHC_new_name_cxx); @@ -1896,9 +1896,9 @@ bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name) // splicer end class.Group.method.rename } -bool SIDRE_Group_rename_bufferify(SIDRE_Group *self, char *new_name, int SHT_new_name_len) +bool SIDRE_Group_rename_bufferify(SIDRE_Group* self, char* new_name, int SHT_new_name_len) { - axom::sidre::Group *SH_this = static_cast(self->addr); + axom::sidre::Group* SH_this = static_cast(self->addr); // splicer begin class.Group.method.rename_bufferify int SHC_new_name_trim = ShroudCharLenTrim(new_name, SHT_new_name_len); const std::string SHC_new_name_cxx(new_name, SHC_new_name_trim); diff --git a/src/axom/sidre/interface/c_fortran/wrapGroup.h b/src/axom/sidre/interface/c_fortran/wrapGroup.h index b92c176405..55d66b8e7d 100644 --- a/src/axom/sidre/interface/c_fortran/wrapGroup.h +++ b/src/axom/sidre/interface/c_fortran/wrapGroup.h @@ -37,460 +37,460 @@ extern "C" { // splicer begin class.Group.C_declarations // splicer end class.Group.C_declarations -SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group *self); +SIDRE_IndexType SIDRE_Group_get_index(SIDRE_Group* self); -const char *SIDRE_Group_get_name(const SIDRE_Group *self); +const char* SIDRE_Group_get_name(const SIDRE_Group* self); -void SIDRE_Group_get_name_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_Group_get_name_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len); -const char *SIDRE_Group_get_path(const SIDRE_Group *self, SIDRE_SHROUD_capsule_data *SHT_rv_capsule); +const char* SIDRE_Group_get_path(const SIDRE_Group* self, SIDRE_SHROUD_capsule_data* SHT_rv_capsule); -void SIDRE_Group_get_path_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_Group_get_path_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len); -const char *SIDRE_Group_get_path_name(const SIDRE_Group *self, - SIDRE_SHROUD_capsule_data *SHT_rv_capsule); +const char* SIDRE_Group_get_path_name(const SIDRE_Group* self, + SIDRE_SHROUD_capsule_data* SHT_rv_capsule); -void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_Group_get_path_name_bufferify(const SIDRE_Group* self, char* SHC_rv, int SHT_rv_len); -SIDRE_Group *SIDRE_Group_get_parent(const SIDRE_Group *self, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_Group_get_parent(const SIDRE_Group* self, SIDRE_Group* SHC_rv); -void SIDRE_Group_get_parent_bufferify(const SIDRE_Group *self, SIDRE_Group *SHC_rv); +void SIDRE_Group_get_parent_bufferify(const SIDRE_Group* self, SIDRE_Group* SHC_rv); -size_t SIDRE_Group_get_num_groups(const SIDRE_Group *self); +size_t SIDRE_Group_get_num_groups(const SIDRE_Group* self); -size_t SIDRE_Group_get_num_views(const SIDRE_Group *self); +size_t SIDRE_Group_get_num_views(const SIDRE_Group* self); -SIDRE_DataStore *SIDRE_Group_get_data_store(const SIDRE_Group *self, SIDRE_DataStore *SHC_rv); +SIDRE_DataStore* SIDRE_Group_get_data_store(const SIDRE_Group* self, SIDRE_DataStore* SHC_rv); -void SIDRE_Group_get_data_store_bufferify(const SIDRE_Group *self, SIDRE_DataStore *SHC_rv); +void SIDRE_Group_get_data_store_bufferify(const SIDRE_Group* self, SIDRE_DataStore* SHC_rv); -bool SIDRE_Group_has_view(const SIDRE_Group *self, const char *path); +bool SIDRE_Group_has_view(const SIDRE_Group* self, const char* path); -bool SIDRE_Group_has_view_bufferify(const SIDRE_Group *self, char *path, int SHT_path_len); +bool SIDRE_Group_has_view_bufferify(const SIDRE_Group* self, char* path, int SHT_path_len); -bool SIDRE_Group_has_child_view(const SIDRE_Group *self, const char *name); +bool SIDRE_Group_has_child_view(const SIDRE_Group* self, const char* name); -bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group *self, char *name, int SHT_name_len); +bool SIDRE_Group_has_child_view_bufferify(const SIDRE_Group* self, char* name, int SHT_name_len); -SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group *self, const char *name); +SIDRE_IndexType SIDRE_Group_get_view_index(const SIDRE_Group* self, const char* name); -SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group *self, - char *name, +SIDRE_IndexType SIDRE_Group_get_view_index_bufferify(const SIDRE_Group* self, + char* name, int SHT_name_len); -const char *SIDRE_Group_get_view_name(const SIDRE_Group *self, SIDRE_IndexType idx); +const char* SIDRE_Group_get_view_name(const SIDRE_Group* self, SIDRE_IndexType idx); -void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group *self, +void SIDRE_Group_get_view_name_bufferify(const SIDRE_Group* self, SIDRE_IndexType idx, - char *SHC_rv, + char* SHC_rv, int SHT_rv_len); -SIDRE_View *SIDRE_Group_get_view_from_name(SIDRE_Group *self, const char *path, SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_get_view_from_name(SIDRE_Group* self, const char* path, SIDRE_View* SHC_rv); -void SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_get_view_from_name_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_get_view_from_index(SIDRE_Group *self, +SIDRE_View* SIDRE_Group_get_view_from_index(SIDRE_Group* self, const SIDRE_IndexType idx, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_get_view_from_index_bufferify(SIDRE_Group *self, +void SIDRE_Group_get_view_from_index_bufferify(SIDRE_Group* self, const SIDRE_IndexType idx, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group *self); +SIDRE_IndexType SIDRE_Group_get_first_valid_view_index(const SIDRE_Group* self); -SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group *self, SIDRE_IndexType idx); +SIDRE_IndexType SIDRE_Group_get_next_valid_view_index(const SIDRE_Group* self, SIDRE_IndexType idx); -SIDRE_View *SIDRE_Group_create_view_empty(SIDRE_Group *self, const char *path, SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_create_view_empty(SIDRE_Group* self, const char* path, SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_empty_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_empty_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_from_type(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_with_shape_base(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_base(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_with_shape_base_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_base_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_into_buffer(SIDRE_Group *self, - const char *path, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_create_view_into_buffer(SIDRE_Group* self, + const char* path, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_into_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type_and_buffer(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_from_type_and_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_and_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_and_buffer(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_with_shape_and_buffer_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_and_buffer_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_external(SIDRE_Group *self, - const char *path, - void *external_ptr, - SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_create_view_external(SIDRE_Group* self, + const char* path, + void* external_ptr, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - void *external_ptr, - SIDRE_View *SHC_rv); + void* external_ptr, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_from_type_external(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_from_type_external(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr, - SIDRE_View *SHC_rv); + void* external_ptr, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_from_type_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_from_type_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr, - SIDRE_View *SHC_rv); + void* external_ptr, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_with_shape_external(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_external(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + void* external_ptr, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_with_shape_external_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_external_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + void* external_ptr, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_and_allocate_nelems(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_and_allocate_nelems_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_and_allocate_nelems_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_with_shape_and_allocate(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_with_shape_and_allocate(SIDRE_Group* self, + const char* path, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_with_shape_and_allocate_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_with_shape_and_allocate_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_View *SHC_rv); + const SIDRE_IndexType* shape, + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_int(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_int(SIDRE_Group* self, + const char* path, int value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_int(SIDRE_Group* self, + char* path, int SHT_path_len, int value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_long(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_long(SIDRE_Group* self, + const char* path, long value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_long(SIDRE_Group* self, + char* path, int SHT_path_len, long value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_float(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_float(SIDRE_Group* self, + const char* path, float value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_float(SIDRE_Group* self, + char* path, int SHT_path_len, float value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_double(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_double(SIDRE_Group* self, + const char* path, double value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_bufferify_double(SIDRE_Group* self, + char* path, int SHT_path_len, double value, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_int(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_int(SIDRE_Group* self, + const char* path, int value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_int(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_int(SIDRE_Group* self, + char* path, int SHT_path_len, int value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_long(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_long(SIDRE_Group* self, + const char* path, long value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_long(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_long(SIDRE_Group* self, + char* path, int SHT_path_len, long value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_float(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_float(SIDRE_Group* self, + const char* path, float value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_float(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_float(SIDRE_Group* self, + char* path, int SHT_path_len, float value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_scalar_path_value_allocID_double(SIDRE_Group *self, - const char *path, +SIDRE_View* SIDRE_Group_create_view_scalar_path_value_allocID_double(SIDRE_Group* self, + const char* path, double value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_double(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_scalar_path_value_allocID_bufferify_double(SIDRE_Group* self, + char* path, int SHT_path_len, double value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_string_path_value(SIDRE_Group *self, - const char *path, - const char *value, - SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_create_view_string_path_value(SIDRE_Group* self, + const char* path, + const char* value, + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_string_path_value_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_string_path_value_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - char *value, + char* value, int SHT_value_len, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_create_view_string_path_value_allocID(SIDRE_Group *self, - const char *path, - const char *value, +SIDRE_View* SIDRE_Group_create_view_string_path_value_allocID(SIDRE_Group* self, + const char* path, + const char* value, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_create_view_string_path_value_allocID_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_view_string_path_value_allocID_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - char *value, + char* value, int SHT_value_len, int allocID, - SIDRE_View *SHC_rv); + SIDRE_View* SHC_rv); -void SIDRE_Group_destroy_view(SIDRE_Group *self, const char *path); +void SIDRE_Group_destroy_view(SIDRE_Group* self, const char* path); -void SIDRE_Group_destroy_view_bufferify(SIDRE_Group *self, char *path, int SHT_path_len); +void SIDRE_Group_destroy_view_bufferify(SIDRE_Group* self, char* path, int SHT_path_len); -void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group *self, const char *path); +void SIDRE_Group_destroy_view_and_data_name(SIDRE_Group* self, const char* path); -void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group *self, char *path, int SHT_path_len); +void SIDRE_Group_destroy_view_and_data_name_bufferify(SIDRE_Group* self, char* path, int SHT_path_len); -void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group *self, SIDRE_IndexType idx); +void SIDRE_Group_destroy_view_and_data_index(SIDRE_Group* self, SIDRE_IndexType idx); -SIDRE_View *SIDRE_Group_move_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_move_view(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv); -void SIDRE_Group_move_view_bufferify(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv); +void SIDRE_Group_move_view_bufferify(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv); -SIDRE_View *SIDRE_Group_copy_view(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv); +SIDRE_View* SIDRE_Group_copy_view(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv); -void SIDRE_Group_copy_view_bufferify(SIDRE_Group *self, SIDRE_View *view, SIDRE_View *SHC_rv); +void SIDRE_Group_copy_view_bufferify(SIDRE_Group* self, SIDRE_View* view, SIDRE_View* SHC_rv); -bool SIDRE_Group_has_group(SIDRE_Group *self, const char *path); +bool SIDRE_Group_has_group(SIDRE_Group* self, const char* path); -bool SIDRE_Group_has_group_bufferify(SIDRE_Group *self, char *path, int SHT_path_len); +bool SIDRE_Group_has_group_bufferify(SIDRE_Group* self, char* path, int SHT_path_len); -bool SIDRE_Group_has_child_group(SIDRE_Group *self, const char *name); +bool SIDRE_Group_has_child_group(SIDRE_Group* self, const char* name); -bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group *self, char *name, int SHT_name_len); +bool SIDRE_Group_has_child_group_bufferify(SIDRE_Group* self, char* name, int SHT_name_len); -SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group *self, const char *name); +SIDRE_IndexType SIDRE_Group_get_group_index(const SIDRE_Group* self, const char* name); -SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group *self, - char *name, +SIDRE_IndexType SIDRE_Group_get_group_index_bufferify(const SIDRE_Group* self, + char* name, int SHT_name_len); -const char *SIDRE_Group_get_group_name(const SIDRE_Group *self, SIDRE_IndexType idx); +const char* SIDRE_Group_get_group_name(const SIDRE_Group* self, SIDRE_IndexType idx); -void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group *self, +void SIDRE_Group_get_group_name_bufferify(const SIDRE_Group* self, SIDRE_IndexType idx, - char *SHC_rv, + char* SHC_rv, int SHT_rv_len); -SIDRE_Group *SIDRE_Group_get_group_from_name(SIDRE_Group *self, const char *path, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_Group_get_group_from_name(SIDRE_Group* self, const char* path, SIDRE_Group* SHC_rv); -void SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_get_group_from_name_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Group *SHC_rv); + SIDRE_Group* SHC_rv); -SIDRE_Group *SIDRE_Group_get_group_from_index(SIDRE_Group *self, +SIDRE_Group* SIDRE_Group_get_group_from_index(SIDRE_Group* self, SIDRE_IndexType idx, - SIDRE_Group *SHC_rv); + SIDRE_Group* SHC_rv); -void SIDRE_Group_get_group_from_index_bufferify(SIDRE_Group *self, +void SIDRE_Group_get_group_from_index_bufferify(SIDRE_Group* self, SIDRE_IndexType idx, - SIDRE_Group *SHC_rv); + SIDRE_Group* SHC_rv); -SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group *self); +SIDRE_IndexType SIDRE_Group_get_first_valid_group_index(const SIDRE_Group* self); -SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group *self, SIDRE_IndexType idx); +SIDRE_IndexType SIDRE_Group_get_next_valid_group_index(const SIDRE_Group* self, SIDRE_IndexType idx); -SIDRE_Group *SIDRE_Group_create_group(SIDRE_Group *self, const char *path, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_Group_create_group(SIDRE_Group* self, const char* path, SIDRE_Group* SHC_rv); -void SIDRE_Group_create_group_bufferify(SIDRE_Group *self, - char *path, +void SIDRE_Group_create_group_bufferify(SIDRE_Group* self, + char* path, int SHT_path_len, - SIDRE_Group *SHC_rv); + SIDRE_Group* SHC_rv); -void SIDRE_Group_destroy_group_name(SIDRE_Group *self, const char *path); +void SIDRE_Group_destroy_group_name(SIDRE_Group* self, const char* path); -void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group *self, char *path, int SHT_path_len); +void SIDRE_Group_destroy_group_name_bufferify(SIDRE_Group* self, char* path, int SHT_path_len); -void SIDRE_Group_destroy_group_index(SIDRE_Group *self, SIDRE_IndexType idx); +void SIDRE_Group_destroy_group_index(SIDRE_Group* self, SIDRE_IndexType idx); -SIDRE_Group *SIDRE_Group_move_group(SIDRE_Group *self, SIDRE_Group *grp, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_Group_move_group(SIDRE_Group* self, SIDRE_Group* grp, SIDRE_Group* SHC_rv); -void SIDRE_Group_move_group_bufferify(SIDRE_Group *self, SIDRE_Group *grp, SIDRE_Group *SHC_rv); +void SIDRE_Group_move_group_bufferify(SIDRE_Group* self, SIDRE_Group* grp, SIDRE_Group* SHC_rv); -void SIDRE_Group_print(const SIDRE_Group *self); +void SIDRE_Group_print(const SIDRE_Group* self); -bool SIDRE_Group_is_equivalent_to(const SIDRE_Group *self, SIDRE_Group *other); +bool SIDRE_Group_is_equivalent_to(const SIDRE_Group* self, SIDRE_Group* other); -void SIDRE_Group_save(const SIDRE_Group *self, const char *file_path, const char *protocol); +void SIDRE_Group_save(const SIDRE_Group* self, const char* file_path, const char* protocol); -void SIDRE_Group_save_bufferify(const SIDRE_Group *self, - char *file_path, +void SIDRE_Group_save_bufferify(const SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len); -void SIDRE_Group_load_0(SIDRE_Group *self, const char *file_path, const char *protocol); +void SIDRE_Group_load_0(SIDRE_Group* self, const char* file_path, const char* protocol); -void SIDRE_Group_load_0_bufferify(SIDRE_Group *self, - char *file_path, +void SIDRE_Group_load_0_bufferify(SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len); -void SIDRE_Group_load_1(SIDRE_Group *self, - const char *file_path, - const char *protocol, +void SIDRE_Group_load_1(SIDRE_Group* self, + const char* file_path, + const char* protocol, bool preserve_contents); -void SIDRE_Group_load_1_bufferify(SIDRE_Group *self, - char *file_path, +void SIDRE_Group_load_1_bufferify(SIDRE_Group* self, + char* file_path, int SHT_file_path_len, - char *protocol, + char* protocol, int SHT_protocol_len, bool preserve_contents); -void SIDRE_Group_load_external_data(SIDRE_Group *self, const char *file_path); +void SIDRE_Group_load_external_data(SIDRE_Group* self, const char* file_path); -void SIDRE_Group_load_external_data_bufferify(SIDRE_Group *self, - char *file_path, +void SIDRE_Group_load_external_data_bufferify(SIDRE_Group* self, + char* file_path, int SHT_file_path_len); -bool SIDRE_Group_rename(SIDRE_Group *self, const char *new_name); +bool SIDRE_Group_rename(SIDRE_Group* self, const char* new_name); -bool SIDRE_Group_rename_bufferify(SIDRE_Group *self, char *new_name, int SHT_new_name_len); +bool SIDRE_Group_rename_bufferify(SIDRE_Group* self, char* new_name, int SHT_new_name_len); #ifdef __cplusplus } diff --git a/src/axom/sidre/interface/c_fortran/wrapSidre.h b/src/axom/sidre/interface/c_fortran/wrapSidre.h index 48d97a9b8b..6d6027431a 100644 --- a/src/axom/sidre/interface/c_fortran/wrapSidre.h +++ b/src/axom/sidre/interface/c_fortran/wrapSidre.h @@ -55,9 +55,9 @@ typedef short SIDRE_TypeID; typedef int SIDRE_TypeIDint; // splicer end typedef.TypeIDint -bool SIDRE_name_is_valid(const char *name); +bool SIDRE_name_is_valid(const char* name); -bool SIDRE_name_is_valid_bufferify(char *name, int SHT_name_len); +bool SIDRE_name_is_valid_bufferify(char* name, int SHT_name_len); int SIDRE_get_invalid_allocator_id(void); diff --git a/src/axom/sidre/interface/c_fortran/wrapView.cpp b/src/axom/sidre/interface/c_fortran/wrapView.cpp index 5213676836..87eb6cf8b2 100644 --- a/src/axom/sidre/interface/c_fortran/wrapView.cpp +++ b/src/axom/sidre/interface/c_fortran/wrapView.cpp @@ -22,7 +22,7 @@ extern "C" { // Copy src into dest, blank fill to ndest characters // Truncate if dest is too short. // dest will not be NULL terminated. -static void ShroudCharCopy(char *dest, int ndest, const char *src, int nsrc) +static void ShroudCharCopy(char* dest, int ndest, const char* src, int nsrc) { if(src == NULL) { @@ -40,7 +40,7 @@ static void ShroudCharCopy(char *dest, int ndest, const char *src, int nsrc) // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -58,30 +58,30 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer begin class.View.C_definitions // splicer end class.View.C_definitions -SIDRE_IndexType SIDRE_View_get_index(SIDRE_View *self) +SIDRE_IndexType SIDRE_View_get_index(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getIndex axom::sidre::IndexType SHC_rv = SH_this->getIndex(); return SHC_rv; // splicer end class.View.method.getIndex } -const char *SIDRE_View_get_name(const SIDRE_View *self) +const char* SIDRE_View_get_name(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getName - const std::string &SHC_rv_cxx = SH_this->getName(); - const char *SHC_rv = SHC_rv_cxx.c_str(); + const std::string& SHC_rv_cxx = SH_this->getName(); + const char* SHC_rv = SHC_rv_cxx.c_str(); return SHC_rv; // splicer end class.View.method.getName } -void SIDRE_View_get_name_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_View_get_name_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getName_bufferify - const std::string &SHC_rv_cxx = SH_this->getName(); + const std::string& SHC_rv_cxx = SH_this->getName(); if(SHC_rv_cxx.empty()) { ShroudCharCopy(SHC_rv, SHT_rv_len, nullptr, 0); @@ -93,13 +93,13 @@ void SIDRE_View_get_name_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT // splicer end class.View.method.getName_bufferify } -const char *SIDRE_View_get_path(const SIDRE_View *self, SIDRE_SHROUD_capsule_data *SHT_rv_capsule) +const char* SIDRE_View_get_path(const SIDRE_View* self, SIDRE_SHROUD_capsule_data* SHT_rv_capsule) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getPath - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = SH_this->getPath(); - const char *SHC_rv = NULL; + const char* SHC_rv = NULL; if(!SHC_rv_cxx->empty()) SHC_rv = SHC_rv_cxx->c_str(); SHT_rv_capsule->addr = SHC_rv_cxx; SHT_rv_capsule->idtor = 1; @@ -108,9 +108,9 @@ const char *SIDRE_View_get_path(const SIDRE_View *self, SIDRE_SHROUD_capsule_dat // splicer end class.View.method.getPath } -void SIDRE_View_get_path_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_View_get_path_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getPath_bufferify std::string SHC_rv_cxx = SH_this->getPath(); if(SHC_rv_cxx.empty()) @@ -124,13 +124,13 @@ void SIDRE_View_get_path_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT // splicer end class.View.method.getPath_bufferify } -const char *SIDRE_View_get_path_name(const SIDRE_View *self, SIDRE_SHROUD_capsule_data *SHT_rv_capsule) +const char* SIDRE_View_get_path_name(const SIDRE_View* self, SIDRE_SHROUD_capsule_data* SHT_rv_capsule) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getPathName - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = SH_this->getPathName(); - const char *SHC_rv = NULL; + const char* SHC_rv = NULL; if(!SHC_rv_cxx->empty()) SHC_rv = SHC_rv_cxx->c_str(); SHT_rv_capsule->addr = SHC_rv_cxx; SHT_rv_capsule->idtor = 1; @@ -139,9 +139,9 @@ const char *SIDRE_View_get_path_name(const SIDRE_View *self, SIDRE_SHROUD_capsul // splicer end class.View.method.getPathName } -void SIDRE_View_get_path_name_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len) +void SIDRE_View_get_path_name_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getPathName_bufferify std::string SHC_rv_cxx = SH_this->getPathName(); if(SHC_rv_cxx.empty()) @@ -155,11 +155,11 @@ void SIDRE_View_get_path_name_bufferify(const SIDRE_View *self, char *SHC_rv, in // splicer end class.View.method.getPathName_bufferify } -SIDRE_Group *SIDRE_View_get_owning_group(SIDRE_View *self, SIDRE_Group *SHC_rv) +SIDRE_Group* SIDRE_View_get_owning_group(SIDRE_View* self, SIDRE_Group* SHC_rv) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getOwningGroup - axom::sidre::Group *SHC_rv_cxx = SH_this->getOwningGroup(); + axom::sidre::Group* SHC_rv_cxx = SH_this->getOwningGroup(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -167,31 +167,31 @@ SIDRE_Group *SIDRE_View_get_owning_group(SIDRE_View *self, SIDRE_Group *SHC_rv) // splicer end class.View.method.getOwningGroup } -void SIDRE_View_get_owning_group_bufferify(SIDRE_View *self, SIDRE_Group *SHC_rv) +void SIDRE_View_get_owning_group_bufferify(SIDRE_View* self, SIDRE_Group* SHC_rv) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getOwningGroup_bufferify - axom::sidre::Group *SHC_rv_cxx = SH_this->getOwningGroup(); + axom::sidre::Group* SHC_rv_cxx = SH_this->getOwningGroup(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.View.method.getOwningGroup_bufferify } -bool SIDRE_View_has_buffer(const SIDRE_View *self) +bool SIDRE_View_has_buffer(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.hasBuffer bool SHC_rv = SH_this->hasBuffer(); return SHC_rv; // splicer end class.View.method.hasBuffer } -SIDRE_Buffer *SIDRE_View_get_buffer(SIDRE_View *self, SIDRE_Buffer *SHC_rv) +SIDRE_Buffer* SIDRE_View_get_buffer(SIDRE_View* self, SIDRE_Buffer* SHC_rv) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getBuffer - axom::sidre::Buffer *SHC_rv_cxx = SH_this->getBuffer(); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->getBuffer(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; @@ -199,355 +199,355 @@ SIDRE_Buffer *SIDRE_View_get_buffer(SIDRE_View *self, SIDRE_Buffer *SHC_rv) // splicer end class.View.method.getBuffer } -void SIDRE_View_get_buffer_bufferify(SIDRE_View *self, SIDRE_Buffer *SHC_rv) +void SIDRE_View_get_buffer_bufferify(SIDRE_View* self, SIDRE_Buffer* SHC_rv) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getBuffer_bufferify - axom::sidre::Buffer *SHC_rv_cxx = SH_this->getBuffer(); + axom::sidre::Buffer* SHC_rv_cxx = SH_this->getBuffer(); SHC_rv->addr = SHC_rv_cxx; SHC_rv->idtor = 0; SHC_rv->cmemflags = SWIG_MEM_RVALUE; // splicer end class.View.method.getBuffer_bufferify } -bool SIDRE_View_is_external(const SIDRE_View *self) +bool SIDRE_View_is_external(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isExternal bool SHC_rv = SH_this->isExternal(); return SHC_rv; // splicer end class.View.method.isExternal } -bool SIDRE_View_is_allocated(const SIDRE_View *self) +bool SIDRE_View_is_allocated(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isAllocated bool SHC_rv = SH_this->isAllocated(); return SHC_rv; // splicer end class.View.method.isAllocated } -bool SIDRE_View_is_applied(const SIDRE_View *self) +bool SIDRE_View_is_applied(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isApplied bool SHC_rv = SH_this->isApplied(); return SHC_rv; // splicer end class.View.method.isApplied } -bool SIDRE_View_is_described(const SIDRE_View *self) +bool SIDRE_View_is_described(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isDescribed bool SHC_rv = SH_this->isDescribed(); return SHC_rv; // splicer end class.View.method.isDescribed } -bool SIDRE_View_is_empty(const SIDRE_View *self) +bool SIDRE_View_is_empty(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isEmpty bool SHC_rv = SH_this->isEmpty(); return SHC_rv; // splicer end class.View.method.isEmpty } -bool SIDRE_View_is_opaque(const SIDRE_View *self) +bool SIDRE_View_is_opaque(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isOpaque bool SHC_rv = SH_this->isOpaque(); return SHC_rv; // splicer end class.View.method.isOpaque } -bool SIDRE_View_is_scalar(const SIDRE_View *self) +bool SIDRE_View_is_scalar(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isScalar bool SHC_rv = SH_this->isScalar(); return SHC_rv; // splicer end class.View.method.isScalar } -bool SIDRE_View_is_string(const SIDRE_View *self) +bool SIDRE_View_is_string(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.isString bool SHC_rv = SH_this->isString(); return SHC_rv; // splicer end class.View.method.isString } -SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View *self) +SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getTypeID axom::sidre::TypeID SHC_rv = SH_this->getTypeID(); return SHC_rv; // splicer end class.View.method.getTypeID } -size_t SIDRE_View_get_total_bytes(const SIDRE_View *self) +size_t SIDRE_View_get_total_bytes(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getTotalBytes size_t SHC_rv = SH_this->getTotalBytes(); return SHC_rv; // splicer end class.View.method.getTotalBytes } -size_t SIDRE_View_get_num_elements(const SIDRE_View *self) +size_t SIDRE_View_get_num_elements(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getNumElements size_t SHC_rv = SH_this->getNumElements(); return SHC_rv; // splicer end class.View.method.getNumElements } -size_t SIDRE_View_get_bytes_per_element(const SIDRE_View *self) +size_t SIDRE_View_get_bytes_per_element(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getBytesPerElement size_t SHC_rv = SH_this->getBytesPerElement(); return SHC_rv; // splicer end class.View.method.getBytesPerElement } -size_t SIDRE_View_get_offset(const SIDRE_View *self) +size_t SIDRE_View_get_offset(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getOffset size_t SHC_rv = SH_this->getOffset(); return SHC_rv; // splicer end class.View.method.getOffset } -size_t SIDRE_View_get_stride(const SIDRE_View *self) +size_t SIDRE_View_get_stride(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getStride size_t SHC_rv = SH_this->getStride(); return SHC_rv; // splicer end class.View.method.getStride } -int SIDRE_View_get_num_dimensions(const SIDRE_View *self) +int SIDRE_View_get_num_dimensions(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getNumDimensions int SHC_rv = SH_this->getNumDimensions(); return SHC_rv; // splicer end class.View.method.getNumDimensions } -int SIDRE_View_get_shape(const SIDRE_View *self, int ndims, SIDRE_IndexType *shape) +int SIDRE_View_get_shape(const SIDRE_View* self, int ndims, SIDRE_IndexType* shape) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getShape int SHC_rv = SH_this->getShape(ndims, shape); return SHC_rv; // splicer end class.View.method.getShape } -void SIDRE_View_allocate_simple(SIDRE_View *self) +void SIDRE_View_allocate_simple(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.allocate_simple SH_this->allocate(); // splicer end class.View.method.allocate_simple } -void SIDRE_View_allocate_from_type(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems) +void SIDRE_View_allocate_from_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.allocate_from_type axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->allocate(SHCXX_type, num_elems); // splicer end class.View.method.allocate_from_type } -void SIDRE_View_reallocate(SIDRE_View *self, SIDRE_IndexType num_elems) +void SIDRE_View_reallocate(SIDRE_View* self, SIDRE_IndexType num_elems) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.reallocate SH_this->reallocate(num_elems); // splicer end class.View.method.reallocate } -void SIDRE_View_attach_buffer_only(SIDRE_View *self, SIDRE_Buffer *buff) +void SIDRE_View_attach_buffer_only(SIDRE_View* self, SIDRE_Buffer* buff) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.attachBuffer_only - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); SH_this->attachBuffer(SHC_buff_cxx); // splicer end class.View.method.attachBuffer_only } -void SIDRE_View_attach_buffer_type(SIDRE_View *self, +void SIDRE_View_attach_buffer_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff) + SIDRE_Buffer* buff) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.attachBuffer_type axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); SH_this->attachBuffer(SHCXX_type, num_elems, SHC_buff_cxx); // splicer end class.View.method.attachBuffer_type } -void SIDRE_View_attach_buffer_shape(SIDRE_View *self, +void SIDRE_View_attach_buffer_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff) + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.attachBuffer_shape axom::sidre::TypeID SHCXX_type = static_cast(type); - axom::sidre::Buffer *SHC_buff_cxx = static_cast(buff->addr); + axom::sidre::Buffer* SHC_buff_cxx = static_cast(buff->addr); SH_this->attachBuffer(SHCXX_type, ndims, shape, SHC_buff_cxx); // splicer end class.View.method.attachBuffer_shape } -void SIDRE_View_clear(SIDRE_View *self) +void SIDRE_View_clear(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.clear SH_this->clear(); // splicer end class.View.method.clear } -void SIDRE_View_apply_0(SIDRE_View *self) +void SIDRE_View_apply_0(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_0 SH_this->apply(); // splicer end class.View.method.apply_0 } -void SIDRE_View_apply_nelems(SIDRE_View *self, SIDRE_IndexType num_elems) +void SIDRE_View_apply_nelems(SIDRE_View* self, SIDRE_IndexType num_elems) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_nelems SH_this->apply(num_elems); // splicer end class.View.method.apply_nelems } -void SIDRE_View_apply_nelems_offset(SIDRE_View *self, SIDRE_IndexType num_elems, SIDRE_IndexType offset) +void SIDRE_View_apply_nelems_offset(SIDRE_View* self, SIDRE_IndexType num_elems, SIDRE_IndexType offset) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_nelems_offset SH_this->apply(num_elems, offset); // splicer end class.View.method.apply_nelems_offset } -void SIDRE_View_apply_nelems_offset_stride(SIDRE_View *self, +void SIDRE_View_apply_nelems_offset_stride(SIDRE_View* self, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_nelems_offset_stride SH_this->apply(num_elems, offset, stride); // splicer end class.View.method.apply_nelems_offset_stride } -void SIDRE_View_apply_type_nelems(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems) +void SIDRE_View_apply_type_nelems(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_type_nelems axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->apply(SHCXX_type, num_elems); // splicer end class.View.method.apply_type_nelems } -void SIDRE_View_apply_type_nelems_offset(SIDRE_View *self, +void SIDRE_View_apply_type_nelems_offset(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_type_nelems_offset axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->apply(SHCXX_type, num_elems, offset); // splicer end class.View.method.apply_type_nelems_offset } -void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View *self, +void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_type_nelems_offset_stride axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->apply(SHCXX_type, num_elems, offset, stride); // splicer end class.View.method.apply_type_nelems_offset_stride } -void SIDRE_View_apply_type_shape(SIDRE_View *self, +void SIDRE_View_apply_type_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape) + const SIDRE_IndexType* shape) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.apply_type_shape axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->apply(SHCXX_type, ndims, shape); // splicer end class.View.method.apply_type_shape } -void SIDRE_View_set_scalar_int(SIDRE_View *self, int value) +void SIDRE_View_set_scalar_int(SIDRE_View* self, int value) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setScalar_int SH_this->setScalar(value); // splicer end class.View.method.setScalar_int } -void SIDRE_View_set_scalar_long(SIDRE_View *self, long value) +void SIDRE_View_set_scalar_long(SIDRE_View* self, long value) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setScalar_long SH_this->setScalar(value); // splicer end class.View.method.setScalar_long } -void SIDRE_View_set_scalar_float(SIDRE_View *self, float value) +void SIDRE_View_set_scalar_float(SIDRE_View* self, float value) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setScalar_float SH_this->setScalar(value); // splicer end class.View.method.setScalar_float } -void SIDRE_View_set_scalar_double(SIDRE_View *self, double value) +void SIDRE_View_set_scalar_double(SIDRE_View* self, double value) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setScalar_double SH_this->setScalar(value); // splicer end class.View.method.setScalar_double } -void SIDRE_View_set_string(SIDRE_View *self, const char *value) +void SIDRE_View_set_string(SIDRE_View* self, const char* value) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setString const std::string SHC_value_cxx(value); SH_this->setString(SHC_value_cxx); // splicer end class.View.method.setString } -void SIDRE_View_set_string_bufferify(SIDRE_View *self, char *value, int SHT_value_len) +void SIDRE_View_set_string_bufferify(SIDRE_View* self, char* value, int SHT_value_len) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setString_bufferify int SHC_value_trim = ShroudCharLenTrim(value, SHT_value_len); const std::string SHC_value_cxx(value, SHC_value_trim); @@ -555,113 +555,113 @@ void SIDRE_View_set_string_bufferify(SIDRE_View *self, char *value, int SHT_valu // splicer end class.View.method.setString_bufferify } -void SIDRE_View_set_external_data_ptr_only(SIDRE_View *self, void *external_ptr) +void SIDRE_View_set_external_data_ptr_only(SIDRE_View* self, void* external_ptr) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setExternalDataPtr_only SH_this->setExternalDataPtr(external_ptr); // splicer end class.View.method.setExternalDataPtr_only } -void SIDRE_View_set_external_data_ptr_type(SIDRE_View *self, +void SIDRE_View_set_external_data_ptr_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr) + void* external_ptr) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setExternalDataPtr_type axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->setExternalDataPtr(SHCXX_type, num_elems, external_ptr); // splicer end class.View.method.setExternalDataPtr_type } -void SIDRE_View_set_external_data_ptr_shape(SIDRE_View *self, +void SIDRE_View_set_external_data_ptr_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr) + const SIDRE_IndexType* shape, + void* external_ptr) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.setExternalDataPtr_shape axom::sidre::TypeID SHCXX_type = static_cast(type); SH_this->setExternalDataPtr(SHCXX_type, ndims, shape, external_ptr); // splicer end class.View.method.setExternalDataPtr_shape } -const char *SIDRE_View_get_string(SIDRE_View *self) +const char* SIDRE_View_get_string(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getString - const char *SHC_rv = SH_this->getString(); + const char* SHC_rv = SH_this->getString(); return SHC_rv; // splicer end class.View.method.getString } -void SIDRE_View_get_string_bufferify(SIDRE_View *self, char *SHC_rv, int nSHC_rv) +void SIDRE_View_get_string_bufferify(SIDRE_View* self, char* SHC_rv, int nSHC_rv) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getString_bufferify - const char *SHC_rv_cxx = SH_this->getString(); + const char* SHC_rv_cxx = SH_this->getString(); ShroudCharCopy(SHC_rv, nSHC_rv, SHC_rv_cxx, -1); // splicer end class.View.method.getString_bufferify } -int SIDRE_View_get_data_int(SIDRE_View *self) +int SIDRE_View_get_data_int(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getData_int int SHC_rv = SH_this->getData(); return SHC_rv; // splicer end class.View.method.getData_int } -long SIDRE_View_get_data_long(SIDRE_View *self) +long SIDRE_View_get_data_long(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getData_long long SHC_rv = SH_this->getData(); return SHC_rv; // splicer end class.View.method.getData_long } -float SIDRE_View_get_data_float(SIDRE_View *self) +float SIDRE_View_get_data_float(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getData_float float SHC_rv = SH_this->getData(); return SHC_rv; // splicer end class.View.method.getData_float } -double SIDRE_View_get_data_double(SIDRE_View *self) +double SIDRE_View_get_data_double(SIDRE_View* self) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getData_double double SHC_rv = SH_this->getData(); return SHC_rv; // splicer end class.View.method.getData_double } -void *SIDRE_View_get_void_ptr(const SIDRE_View *self) +void* SIDRE_View_get_void_ptr(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.getVoidPtr - void *SHC_rv = SH_this->getVoidPtr(); + void* SHC_rv = SH_this->getVoidPtr(); return SHC_rv; // splicer end class.View.method.getVoidPtr } -void SIDRE_View_print(const SIDRE_View *self) +void SIDRE_View_print(const SIDRE_View* self) { - const axom::sidre::View *SH_this = static_cast(self->addr); + const axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.print SH_this->print(); // splicer end class.View.method.print } -bool SIDRE_View_rename(SIDRE_View *self, const char *new_name) +bool SIDRE_View_rename(SIDRE_View* self, const char* new_name) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.rename const std::string SHC_new_name_cxx(new_name); bool SHC_rv = SH_this->rename(SHC_new_name_cxx); @@ -669,9 +669,9 @@ bool SIDRE_View_rename(SIDRE_View *self, const char *new_name) // splicer end class.View.method.rename } -bool SIDRE_View_rename_bufferify(SIDRE_View *self, char *new_name, int SHT_new_name_len) +bool SIDRE_View_rename_bufferify(SIDRE_View* self, char* new_name, int SHT_new_name_len) { - axom::sidre::View *SH_this = static_cast(self->addr); + axom::sidre::View* SH_this = static_cast(self->addr); // splicer begin class.View.method.rename_bufferify int SHC_new_name_trim = ShroudCharLenTrim(new_name, SHT_new_name_len); const std::string SHC_new_name_cxx(new_name, SHC_new_name_trim); diff --git a/src/axom/sidre/interface/c_fortran/wrapView.h b/src/axom/sidre/interface/c_fortran/wrapView.h index 174285649a..954becb3fe 100644 --- a/src/axom/sidre/interface/c_fortran/wrapView.h +++ b/src/axom/sidre/interface/c_fortran/wrapView.h @@ -37,159 +37,159 @@ extern "C" { // splicer begin class.View.C_declarations // splicer end class.View.C_declarations -SIDRE_IndexType SIDRE_View_get_index(SIDRE_View *self); +SIDRE_IndexType SIDRE_View_get_index(SIDRE_View* self); -const char *SIDRE_View_get_name(const SIDRE_View *self); +const char* SIDRE_View_get_name(const SIDRE_View* self); -void SIDRE_View_get_name_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_View_get_name_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len); -const char *SIDRE_View_get_path(const SIDRE_View *self, SIDRE_SHROUD_capsule_data *SHT_rv_capsule); +const char* SIDRE_View_get_path(const SIDRE_View* self, SIDRE_SHROUD_capsule_data* SHT_rv_capsule); -void SIDRE_View_get_path_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_View_get_path_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len); -const char *SIDRE_View_get_path_name(const SIDRE_View *self, - SIDRE_SHROUD_capsule_data *SHT_rv_capsule); +const char* SIDRE_View_get_path_name(const SIDRE_View* self, + SIDRE_SHROUD_capsule_data* SHT_rv_capsule); -void SIDRE_View_get_path_name_bufferify(const SIDRE_View *self, char *SHC_rv, int SHT_rv_len); +void SIDRE_View_get_path_name_bufferify(const SIDRE_View* self, char* SHC_rv, int SHT_rv_len); -SIDRE_Group *SIDRE_View_get_owning_group(SIDRE_View *self, SIDRE_Group *SHC_rv); +SIDRE_Group* SIDRE_View_get_owning_group(SIDRE_View* self, SIDRE_Group* SHC_rv); -void SIDRE_View_get_owning_group_bufferify(SIDRE_View *self, SIDRE_Group *SHC_rv); +void SIDRE_View_get_owning_group_bufferify(SIDRE_View* self, SIDRE_Group* SHC_rv); -bool SIDRE_View_has_buffer(const SIDRE_View *self); +bool SIDRE_View_has_buffer(const SIDRE_View* self); -SIDRE_Buffer *SIDRE_View_get_buffer(SIDRE_View *self, SIDRE_Buffer *SHC_rv); +SIDRE_Buffer* SIDRE_View_get_buffer(SIDRE_View* self, SIDRE_Buffer* SHC_rv); -void SIDRE_View_get_buffer_bufferify(SIDRE_View *self, SIDRE_Buffer *SHC_rv); +void SIDRE_View_get_buffer_bufferify(SIDRE_View* self, SIDRE_Buffer* SHC_rv); -bool SIDRE_View_is_external(const SIDRE_View *self); +bool SIDRE_View_is_external(const SIDRE_View* self); -bool SIDRE_View_is_allocated(const SIDRE_View *self); +bool SIDRE_View_is_allocated(const SIDRE_View* self); -bool SIDRE_View_is_applied(const SIDRE_View *self); +bool SIDRE_View_is_applied(const SIDRE_View* self); -bool SIDRE_View_is_described(const SIDRE_View *self); +bool SIDRE_View_is_described(const SIDRE_View* self); -bool SIDRE_View_is_empty(const SIDRE_View *self); +bool SIDRE_View_is_empty(const SIDRE_View* self); -bool SIDRE_View_is_opaque(const SIDRE_View *self); +bool SIDRE_View_is_opaque(const SIDRE_View* self); -bool SIDRE_View_is_scalar(const SIDRE_View *self); +bool SIDRE_View_is_scalar(const SIDRE_View* self); -bool SIDRE_View_is_string(const SIDRE_View *self); +bool SIDRE_View_is_string(const SIDRE_View* self); -SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View *self); +SIDRE_TypeIDint SIDRE_View_get_type_id(const SIDRE_View* self); -size_t SIDRE_View_get_total_bytes(const SIDRE_View *self); +size_t SIDRE_View_get_total_bytes(const SIDRE_View* self); -size_t SIDRE_View_get_num_elements(const SIDRE_View *self); +size_t SIDRE_View_get_num_elements(const SIDRE_View* self); -size_t SIDRE_View_get_bytes_per_element(const SIDRE_View *self); +size_t SIDRE_View_get_bytes_per_element(const SIDRE_View* self); -size_t SIDRE_View_get_offset(const SIDRE_View *self); +size_t SIDRE_View_get_offset(const SIDRE_View* self); -size_t SIDRE_View_get_stride(const SIDRE_View *self); +size_t SIDRE_View_get_stride(const SIDRE_View* self); -int SIDRE_View_get_num_dimensions(const SIDRE_View *self); +int SIDRE_View_get_num_dimensions(const SIDRE_View* self); -int SIDRE_View_get_shape(const SIDRE_View *self, int ndims, SIDRE_IndexType *shape); +int SIDRE_View_get_shape(const SIDRE_View* self, int ndims, SIDRE_IndexType* shape); -void SIDRE_View_allocate_simple(SIDRE_View *self); +void SIDRE_View_allocate_simple(SIDRE_View* self); -void SIDRE_View_allocate_from_type(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems); +void SIDRE_View_allocate_from_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems); -void SIDRE_View_reallocate(SIDRE_View *self, SIDRE_IndexType num_elems); +void SIDRE_View_reallocate(SIDRE_View* self, SIDRE_IndexType num_elems); -void SIDRE_View_attach_buffer_only(SIDRE_View *self, SIDRE_Buffer *buff); +void SIDRE_View_attach_buffer_only(SIDRE_View* self, SIDRE_Buffer* buff); -void SIDRE_View_attach_buffer_type(SIDRE_View *self, +void SIDRE_View_attach_buffer_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - SIDRE_Buffer *buff); + SIDRE_Buffer* buff); -void SIDRE_View_attach_buffer_shape(SIDRE_View *self, +void SIDRE_View_attach_buffer_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - SIDRE_Buffer *buff); + const SIDRE_IndexType* shape, + SIDRE_Buffer* buff); -void SIDRE_View_clear(SIDRE_View *self); +void SIDRE_View_clear(SIDRE_View* self); -void SIDRE_View_apply_0(SIDRE_View *self); +void SIDRE_View_apply_0(SIDRE_View* self); -void SIDRE_View_apply_nelems(SIDRE_View *self, SIDRE_IndexType num_elems); +void SIDRE_View_apply_nelems(SIDRE_View* self, SIDRE_IndexType num_elems); -void SIDRE_View_apply_nelems_offset(SIDRE_View *self, +void SIDRE_View_apply_nelems_offset(SIDRE_View* self, SIDRE_IndexType num_elems, SIDRE_IndexType offset); -void SIDRE_View_apply_nelems_offset_stride(SIDRE_View *self, +void SIDRE_View_apply_nelems_offset_stride(SIDRE_View* self, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride); -void SIDRE_View_apply_type_nelems(SIDRE_View *self, SIDRE_TypeID type, SIDRE_IndexType num_elems); +void SIDRE_View_apply_type_nelems(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems); -void SIDRE_View_apply_type_nelems_offset(SIDRE_View *self, +void SIDRE_View_apply_type_nelems_offset(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset); -void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View *self, +void SIDRE_View_apply_type_nelems_offset_stride(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, SIDRE_IndexType offset, SIDRE_IndexType stride); -void SIDRE_View_apply_type_shape(SIDRE_View *self, +void SIDRE_View_apply_type_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape); + const SIDRE_IndexType* shape); -void SIDRE_View_set_scalar_int(SIDRE_View *self, int value); +void SIDRE_View_set_scalar_int(SIDRE_View* self, int value); -void SIDRE_View_set_scalar_long(SIDRE_View *self, long value); +void SIDRE_View_set_scalar_long(SIDRE_View* self, long value); -void SIDRE_View_set_scalar_float(SIDRE_View *self, float value); +void SIDRE_View_set_scalar_float(SIDRE_View* self, float value); -void SIDRE_View_set_scalar_double(SIDRE_View *self, double value); +void SIDRE_View_set_scalar_double(SIDRE_View* self, double value); -void SIDRE_View_set_string(SIDRE_View *self, const char *value); +void SIDRE_View_set_string(SIDRE_View* self, const char* value); -void SIDRE_View_set_string_bufferify(SIDRE_View *self, char *value, int SHT_value_len); +void SIDRE_View_set_string_bufferify(SIDRE_View* self, char* value, int SHT_value_len); -void SIDRE_View_set_external_data_ptr_only(SIDRE_View *self, void *external_ptr); +void SIDRE_View_set_external_data_ptr_only(SIDRE_View* self, void* external_ptr); -void SIDRE_View_set_external_data_ptr_type(SIDRE_View *self, +void SIDRE_View_set_external_data_ptr_type(SIDRE_View* self, SIDRE_TypeID type, SIDRE_IndexType num_elems, - void *external_ptr); + void* external_ptr); -void SIDRE_View_set_external_data_ptr_shape(SIDRE_View *self, +void SIDRE_View_set_external_data_ptr_shape(SIDRE_View* self, SIDRE_TypeID type, int ndims, - const SIDRE_IndexType *shape, - void *external_ptr); + const SIDRE_IndexType* shape, + void* external_ptr); -const char *SIDRE_View_get_string(SIDRE_View *self); +const char* SIDRE_View_get_string(SIDRE_View* self); -void SIDRE_View_get_string_bufferify(SIDRE_View *self, char *SHC_rv, int nSHC_rv); +void SIDRE_View_get_string_bufferify(SIDRE_View* self, char* SHC_rv, int nSHC_rv); -int SIDRE_View_get_data_int(SIDRE_View *self); +int SIDRE_View_get_data_int(SIDRE_View* self); -long SIDRE_View_get_data_long(SIDRE_View *self); +long SIDRE_View_get_data_long(SIDRE_View* self); -float SIDRE_View_get_data_float(SIDRE_View *self); +float SIDRE_View_get_data_float(SIDRE_View* self); -double SIDRE_View_get_data_double(SIDRE_View *self); +double SIDRE_View_get_data_double(SIDRE_View* self); -void *SIDRE_View_get_void_ptr(const SIDRE_View *self); +void* SIDRE_View_get_void_ptr(const SIDRE_View* self); -void SIDRE_View_print(const SIDRE_View *self); +void SIDRE_View_print(const SIDRE_View* self); -bool SIDRE_View_rename(SIDRE_View *self, const char *new_name); +bool SIDRE_View_rename(SIDRE_View* self, const char* new_name); -bool SIDRE_View_rename_bufferify(SIDRE_View *self, char *new_name, int SHT_new_name_len); +bool SIDRE_View_rename_bufferify(SIDRE_View* self, char* new_name, int SHT_new_name_len); #ifdef __cplusplus } diff --git a/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h b/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h index ec533ea694..2be9d8e0f0 100644 --- a/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h +++ b/src/axom/sidre/spio/interface/c_fortran/typesSPIO.h @@ -37,7 +37,7 @@ extern "C" { // helper capsule_data struct s_SPIO_SHROUD_capsule_data { - void *addr; /* address of C++ memory */ + void* addr; /* address of C++ memory */ int idtor; /* index of destructor */ int cmemflags; /* memory flags */ }; @@ -56,13 +56,13 @@ typedef struct s_SPIO_IOManager SPIO_IOManager; // C capsule SPIO_IOManager struct s_SPIO_IOManager { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; typedef struct s_SPIO_IOManager SPIO_IOManager; -void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data *cap); +void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data* cap); #ifdef __cplusplus } diff --git a/src/axom/sidre/spio/interface/c_fortran/utilSPIO.cpp b/src/axom/sidre/spio/interface/c_fortran/utilSPIO.cpp index 25082fe515..085c2088f8 100644 --- a/src/axom/sidre/spio/interface/c_fortran/utilSPIO.cpp +++ b/src/axom/sidre/spio/interface/c_fortran/utilSPIO.cpp @@ -15,9 +15,9 @@ extern "C" { #endif // Release library allocated memory. -void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data *cap) +void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data* cap) { - void *ptr = cap->addr; + void* ptr = cap->addr; switch(cap->idtor) { case 0: // --none-- @@ -27,7 +27,7 @@ void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data *cap) } case 1: // axom::sidre::IOManager { - axom::sidre::IOManager *cxx_ptr = reinterpret_cast(ptr); + axom::sidre::IOManager* cxx_ptr = reinterpret_cast(ptr); delete cxx_ptr; break; } @@ -43,7 +43,7 @@ void SPIO_SHROUD_memory_destructor(SPIO_SHROUD_capsule_data *cap) } // axom::sidre::IOManager = axom::sidre::IOManager -void SPIO_IOManager_assign_IOManager(SPIO_IOManager *lhs_capsule, SPIO_IOManager *rhs_capsule) +void SPIO_IOManager_assign_IOManager(SPIO_IOManager* lhs_capsule, SPIO_IOManager* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -68,7 +68,7 @@ void SPIO_IOManager_assign_IOManager(SPIO_IOManager *lhs_capsule, SPIO_IOManager // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data *)lhs_capsule); + SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -84,7 +84,7 @@ void SPIO_IOManager_assign_IOManager(SPIO_IOManager *lhs_capsule, SPIO_IOManager // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data *)lhs_capsule); + SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -95,7 +95,7 @@ void SPIO_IOManager_assign_IOManager(SPIO_IOManager *lhs_capsule, SPIO_IOManager // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data *)lhs_capsule); + SPIO_SHROUD_memory_destructor((SPIO_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp index 90e5416b74..0d42066ad1 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp +++ b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.cpp @@ -20,7 +20,7 @@ extern "C" { // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -38,55 +38,55 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer begin class.IOManager.C_definitions // splicer end class.IOManager.C_definitions -SPIO_IOManager *SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager *SHC_rv) +SPIO_IOManager* SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager* SHC_rv) { // splicer begin class.IOManager.method.ctor_default MPI_Comm SHCXX_com = MPI_Comm_f2c(com); - axom::sidre::IOManager *SHCXX_rv = new axom::sidre::IOManager(SHCXX_com); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::IOManager* SHCXX_rv = new axom::sidre::IOManager(SHCXX_com); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; return SHC_rv; // splicer end class.IOManager.method.ctor_default } -void SPIO_IOManager_ctor_default_bufferify(MPI_Fint com, SPIO_IOManager *SHC_rv) +void SPIO_IOManager_ctor_default_bufferify(MPI_Fint com, SPIO_IOManager* SHC_rv) { // splicer begin class.IOManager.method.ctor_default_bufferify MPI_Comm SHCXX_com = MPI_Comm_f2c(com); - axom::sidre::IOManager *SHCXX_rv = new axom::sidre::IOManager(SHCXX_com); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::IOManager* SHCXX_rv = new axom::sidre::IOManager(SHCXX_com); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; // splicer end class.IOManager.method.ctor_default_bufferify } -SPIO_IOManager *SPIO_IOManager_ctor_usescr(MPI_Fint com, bool use_scr, SPIO_IOManager *SHC_rv) +SPIO_IOManager* SPIO_IOManager_ctor_usescr(MPI_Fint com, bool use_scr, SPIO_IOManager* SHC_rv) { // splicer begin class.IOManager.method.ctor_usescr MPI_Comm SHCXX_com = MPI_Comm_f2c(com); - axom::sidre::IOManager *SHCXX_rv = new axom::sidre::IOManager(SHCXX_com, use_scr); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::IOManager* SHCXX_rv = new axom::sidre::IOManager(SHCXX_com, use_scr); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; return SHC_rv; // splicer end class.IOManager.method.ctor_usescr } -void SPIO_IOManager_ctor_usescr_bufferify(MPI_Fint com, bool use_scr, SPIO_IOManager *SHC_rv) +void SPIO_IOManager_ctor_usescr_bufferify(MPI_Fint com, bool use_scr, SPIO_IOManager* SHC_rv) { // splicer begin class.IOManager.method.ctor_usescr_bufferify MPI_Comm SHCXX_com = MPI_Comm_f2c(com); - axom::sidre::IOManager *SHCXX_rv = new axom::sidre::IOManager(SHCXX_com, use_scr); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::sidre::IOManager* SHCXX_rv = new axom::sidre::IOManager(SHCXX_com, use_scr); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; // splicer end class.IOManager.method.ctor_usescr_bufferify } -void SPIO_IOManager_delete(SPIO_IOManager *self) +void SPIO_IOManager_delete(SPIO_IOManager* self) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.delete if(self->cmemflags & SWIG_MEM_OWN) { @@ -98,32 +98,32 @@ void SPIO_IOManager_delete(SPIO_IOManager *self) // splicer end class.IOManager.method.delete } -void SPIO_IOManager_write_0(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_0(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - const char *file_string, - const char *protocol) + const char* file_string, + const char* protocol) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_0 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_file_string_cxx(file_string); const std::string SHC_protocol_cxx(protocol); SH_this->write(SHC_group_cxx, num_files, SHC_file_string_cxx, SHC_protocol_cxx); // splicer end class.IOManager.method.write_0 } -void SPIO_IOManager_write_0_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_0_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - char *file_string, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_0_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_file_string_trim = ShroudCharLenTrim(file_string, SHT_file_string_len); const std::string SHC_file_string_cxx(file_string, SHC_file_string_trim); int SHC_protocol_trim = ShroudCharLenTrim(protocol, SHT_protocol_len); @@ -132,16 +132,16 @@ void SPIO_IOManager_write_0_bufferify(SPIO_IOManager *self, // splicer end class.IOManager.method.write_0_bufferify } -void SPIO_IOManager_write_1(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_1(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - const char *file_string, - const char *protocol, - const char *tree_pattern) + const char* file_string, + const char* protocol, + const char* tree_pattern) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_1 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_file_string_cxx(file_string); const std::string SHC_protocol_cxx(protocol); const std::string SHC_tree_pattern_cxx(tree_pattern); @@ -149,19 +149,19 @@ void SPIO_IOManager_write_1(SPIO_IOManager *self, // splicer end class.IOManager.method.write_1 } -void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_1_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - char *file_string, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len, - char *tree_pattern, + char* tree_pattern, int SHT_tree_pattern_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.write_1_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_file_string_trim = ShroudCharLenTrim(file_string, SHT_file_string_len); const std::string SHC_file_string_cxx(file_string, SHC_file_string_trim); int SHC_protocol_trim = ShroudCharLenTrim(protocol, SHT_protocol_len); @@ -172,39 +172,39 @@ void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, // splicer end class.IOManager.method.write_1_bufferify } -void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager *self, SIDRE_Group *group, const char *file_name) +void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager* self, SIDRE_Group* group, const char* file_name) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.writeGroupToRootFile - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_file_name_cxx(file_name); SH_this->writeGroupToRootFile(SHC_group_cxx, SHC_file_name_cxx); // splicer end class.IOManager.method.writeGroupToRootFile } -void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_name, +void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_name, int SHT_file_name_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.writeGroupToRootFile_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_file_name_trim = ShroudCharLenTrim(file_name, SHT_file_name_len); const std::string SHC_file_name_cxx(file_name, SHC_file_name_trim); SH_this->writeGroupToRootFile(SHC_group_cxx, SHC_file_name_cxx); // splicer end class.IOManager.method.writeGroupToRootFile_bufferify } -void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager *self, - SIDRE_DataStore *datastore, - const char *domain_path, - const char *file_name, - const char *mesh_path) +void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager* self, + SIDRE_DataStore* datastore, + const char* domain_path, + const char* file_name, + const char* mesh_path) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.writeBlueprintIndexToRootFile - axom::sidre::DataStore *SHC_datastore_cxx = static_cast(datastore->addr); + axom::sidre::DataStore* SHC_datastore_cxx = static_cast(datastore->addr); const std::string SHC_domain_path_cxx(domain_path); const std::string SHC_file_name_cxx(file_name); const std::string SHC_mesh_path_cxx(mesh_path); @@ -215,18 +215,18 @@ void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager *self, // splicer end class.IOManager.method.writeBlueprintIndexToRootFile } -void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify(SPIO_IOManager *self, - SIDRE_DataStore *datastore, - char *domain_path, +void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify(SPIO_IOManager* self, + SIDRE_DataStore* datastore, + char* domain_path, int SHT_domain_path_len, - char *file_name, + char* file_name, int SHT_file_name_len, - char *mesh_path, + char* mesh_path, int SHT_mesh_path_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.writeBlueprintIndexToRootFile_bufferify - axom::sidre::DataStore *SHC_datastore_cxx = static_cast(datastore->addr); + axom::sidre::DataStore* SHC_datastore_cxx = static_cast(datastore->addr); int SHC_domain_path_trim = ShroudCharLenTrim(domain_path, SHT_domain_path_len); const std::string SHC_domain_path_cxx(domain_path, SHC_domain_path_trim); int SHC_file_name_trim = ShroudCharLenTrim(file_name, SHT_file_name_len); @@ -240,30 +240,30 @@ void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify(SPIO_IOManager *self // splicer end class.IOManager.method.writeBlueprintIndexToRootFile_bufferify } -void SPIO_IOManager_read_0(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_string, - const char *protocol) +void SPIO_IOManager_read_0(SPIO_IOManager* self, + SIDRE_Group* group, + const char* file_string, + const char* protocol) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_0 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_file_string_cxx(file_string); const std::string SHC_protocol_cxx(protocol); SH_this->read(SHC_group_cxx, SHC_file_string_cxx, SHC_protocol_cxx); // splicer end class.IOManager.method.read_0 } -void SPIO_IOManager_read_0_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_string, +void SPIO_IOManager_read_0_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_0_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_file_string_trim = ShroudCharLenTrim(file_string, SHT_file_string_len); const std::string SHC_file_string_cxx(file_string, SHC_file_string_trim); int SHC_protocol_trim = ShroudCharLenTrim(protocol, SHT_protocol_len); @@ -272,32 +272,32 @@ void SPIO_IOManager_read_0_bufferify(SPIO_IOManager *self, // splicer end class.IOManager.method.read_0_bufferify } -void SPIO_IOManager_read_1(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_string, - const char *protocol, +void SPIO_IOManager_read_1(SPIO_IOManager* self, + SIDRE_Group* group, + const char* file_string, + const char* protocol, bool preserve_contents) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_1 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_file_string_cxx(file_string); const std::string SHC_protocol_cxx(protocol); SH_this->read(SHC_group_cxx, SHC_file_string_cxx, SHC_protocol_cxx, preserve_contents); // splicer end class.IOManager.method.read_1 } -void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_string, +void SPIO_IOManager_read_1_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len, bool preserve_contents) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_1_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_file_string_trim = ShroudCharLenTrim(file_string, SHT_file_string_len); const std::string SHC_file_string_cxx(file_string, SHC_file_string_trim); int SHC_protocol_trim = ShroudCharLenTrim(protocol, SHT_protocol_len); @@ -306,76 +306,76 @@ void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, // splicer end class.IOManager.method.read_1_bufferify } -void SPIO_IOManager_read_2(SPIO_IOManager *self, SIDRE_Group *group, const char *root_file) +void SPIO_IOManager_read_2(SPIO_IOManager* self, SIDRE_Group* group, const char* root_file) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_2 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_root_file_cxx(root_file); SH_this->read(SHC_group_cxx, SHC_root_file_cxx); // splicer end class.IOManager.method.read_2 } -void SPIO_IOManager_read_2_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_read_2_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_2_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_root_file_trim = ShroudCharLenTrim(root_file, SHT_root_file_len); const std::string SHC_root_file_cxx(root_file, SHC_root_file_trim); SH_this->read(SHC_group_cxx, SHC_root_file_cxx); // splicer end class.IOManager.method.read_2_bufferify } -void SPIO_IOManager_read_3(SPIO_IOManager *self, - SIDRE_Group *group, - const char *root_file, +void SPIO_IOManager_read_3(SPIO_IOManager* self, + SIDRE_Group* group, + const char* root_file, bool preserve_contents) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_3 - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_root_file_cxx(root_file); SH_this->read(SHC_group_cxx, SHC_root_file_cxx, preserve_contents); // splicer end class.IOManager.method.read_3 } -void SPIO_IOManager_read_3_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_read_3_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len, bool preserve_contents) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.read_3_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_root_file_trim = ShroudCharLenTrim(root_file, SHT_root_file_len); const std::string SHC_root_file_cxx(root_file, SHC_root_file_trim); SH_this->read(SHC_group_cxx, SHC_root_file_cxx, preserve_contents); // splicer end class.IOManager.method.read_3_bufferify } -void SPIO_IOManager_loadExternalData(SPIO_IOManager *self, SIDRE_Group *group, const char *root_file) +void SPIO_IOManager_loadExternalData(SPIO_IOManager* self, SIDRE_Group* group, const char* root_file) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.loadExternalData - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); const std::string SHC_root_file_cxx(root_file); SH_this->loadExternalData(SHC_group_cxx, SHC_root_file_cxx); // splicer end class.IOManager.method.loadExternalData } -void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len) { - axom::sidre::IOManager *SH_this = static_cast(self->addr); + axom::sidre::IOManager* SH_this = static_cast(self->addr); // splicer begin class.IOManager.method.loadExternalData_bufferify - axom::sidre::Group *SHC_group_cxx = static_cast(group->addr); + axom::sidre::Group* SHC_group_cxx = static_cast(group->addr); int SHC_root_file_trim = ShroudCharLenTrim(root_file, SHT_root_file_len); const std::string SHC_root_file_cxx(root_file, SHC_root_file_trim); SH_this->loadExternalData(SHC_group_cxx, SHC_root_file_cxx); diff --git a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h index 9a94d1c93f..6490e5567d 100644 --- a/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h +++ b/src/axom/sidre/spio/interface/c_fortran/wrapIOManager.h @@ -34,120 +34,120 @@ extern "C" { // splicer begin class.IOManager.C_declarations // splicer end class.IOManager.C_declarations -SPIO_IOManager *SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager *SHC_rv); +SPIO_IOManager* SPIO_IOManager_ctor_default(MPI_Fint com, SPIO_IOManager* SHC_rv); -void SPIO_IOManager_ctor_default_bufferify(MPI_Fint com, SPIO_IOManager *SHC_rv); +void SPIO_IOManager_ctor_default_bufferify(MPI_Fint com, SPIO_IOManager* SHC_rv); -SPIO_IOManager *SPIO_IOManager_ctor_usescr(MPI_Fint com, bool use_scr, SPIO_IOManager *SHC_rv); +SPIO_IOManager* SPIO_IOManager_ctor_usescr(MPI_Fint com, bool use_scr, SPIO_IOManager* SHC_rv); -void SPIO_IOManager_ctor_usescr_bufferify(MPI_Fint com, bool use_scr, SPIO_IOManager *SHC_rv); +void SPIO_IOManager_ctor_usescr_bufferify(MPI_Fint com, bool use_scr, SPIO_IOManager* SHC_rv); -void SPIO_IOManager_delete(SPIO_IOManager *self); +void SPIO_IOManager_delete(SPIO_IOManager* self); -void SPIO_IOManager_write_0(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_0(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - const char *file_string, - const char *protocol); + const char* file_string, + const char* protocol); -void SPIO_IOManager_write_0_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_0_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - char *file_string, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len); -void SPIO_IOManager_write_1(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_1(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - const char *file_string, - const char *protocol, - const char *tree_pattern); + const char* file_string, + const char* protocol, + const char* tree_pattern); -void SPIO_IOManager_write_1_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, +void SPIO_IOManager_write_1_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, int num_files, - char *file_string, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len, - char *tree_pattern, + char* tree_pattern, int SHT_tree_pattern_len); -void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_name); +void SPIO_IOManager_writeGroupToRootFile(SPIO_IOManager* self, + SIDRE_Group* group, + const char* file_name); -void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_name, +void SPIO_IOManager_writeGroupToRootFile_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_name, int SHT_file_name_len); -void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager *self, - SIDRE_DataStore *datastore, - const char *domain_path, - const char *file_name, - const char *mesh_path); +void SPIO_IOManager_writeBlueprintIndexToRootFile(SPIO_IOManager* self, + SIDRE_DataStore* datastore, + const char* domain_path, + const char* file_name, + const char* mesh_path); -void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify(SPIO_IOManager *self, - SIDRE_DataStore *datastore, - char *domain_path, +void SPIO_IOManager_writeBlueprintIndexToRootFile_bufferify(SPIO_IOManager* self, + SIDRE_DataStore* datastore, + char* domain_path, int SHT_domain_path_len, - char *file_name, + char* file_name, int SHT_file_name_len, - char *mesh_path, + char* mesh_path, int SHT_mesh_path_len); -void SPIO_IOManager_read_0(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_string, - const char *protocol); +void SPIO_IOManager_read_0(SPIO_IOManager* self, + SIDRE_Group* group, + const char* file_string, + const char* protocol); -void SPIO_IOManager_read_0_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_string, +void SPIO_IOManager_read_0_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len); -void SPIO_IOManager_read_1(SPIO_IOManager *self, - SIDRE_Group *group, - const char *file_string, - const char *protocol, +void SPIO_IOManager_read_1(SPIO_IOManager* self, + SIDRE_Group* group, + const char* file_string, + const char* protocol, bool preserve_contents); -void SPIO_IOManager_read_1_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *file_string, +void SPIO_IOManager_read_1_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* file_string, int SHT_file_string_len, - char *protocol, + char* protocol, int SHT_protocol_len, bool preserve_contents); -void SPIO_IOManager_read_2(SPIO_IOManager *self, SIDRE_Group *group, const char *root_file); +void SPIO_IOManager_read_2(SPIO_IOManager* self, SIDRE_Group* group, const char* root_file); -void SPIO_IOManager_read_2_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_read_2_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len); -void SPIO_IOManager_read_3(SPIO_IOManager *self, - SIDRE_Group *group, - const char *root_file, +void SPIO_IOManager_read_3(SPIO_IOManager* self, + SIDRE_Group* group, + const char* root_file, bool preserve_contents); -void SPIO_IOManager_read_3_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_read_3_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len, bool preserve_contents); -void SPIO_IOManager_loadExternalData(SPIO_IOManager *self, SIDRE_Group *group, const char *root_file); +void SPIO_IOManager_loadExternalData(SPIO_IOManager* self, SIDRE_Group* group, const char* root_file); -void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager *self, - SIDRE_Group *group, - char *root_file, +void SPIO_IOManager_loadExternalData_bufferify(SPIO_IOManager* self, + SIDRE_Group* group, + char* root_file, int SHT_root_file_len); #ifdef __cplusplus diff --git a/src/axom/sina/core/AdiakWriter.cpp b/src/axom/sina/core/AdiakWriter.cpp index 4751766fca..ef39f76581 100644 --- a/src/axom/sina/core/AdiakWriter.cpp +++ b/src/axom/sina/core/AdiakWriter.cpp @@ -59,10 +59,10 @@ enum SinaType * harvests what it can and hands it off to the Record. **/ template -void addDatum(const std::string &name, +void addDatum(const std::string& name, T sina_safe_val, - const std::vector &tags, - axom::sina::Record *record) + const std::vector& tags, + axom::sina::Record* record) { axom::sina::Datum datum {sina_safe_val}; datum.setTags(std::move(tags)); @@ -73,7 +73,7 @@ void addDatum(const std::string &name, * Add a axom::sina::File object to our current Record. Adiak stores paths, * which are essentially the same as Sina's idea of storing files. **/ -void addFile(const std::string &name, const std::string &uri, axom::sina::Record *record) +void addFile(const std::string& name, const std::string& uri, axom::sina::Record* record) { // We don't care about type here, there's only one adiak type that acts as a file axom::sina::File file {uri}; @@ -84,7 +84,7 @@ void addFile(const std::string &name, const std::string &uri, axom::sina::Record /** * Given an Adiak type, return its corresponding Sina type. **/ -SinaType findSinaType(adiak_datatype_t *t) +SinaType findSinaType(adiak_datatype_t* t) { switch(t->dtype) { @@ -119,7 +119,7 @@ SinaType findSinaType(adiak_datatype_t *t) * Manage the conversions from various Adiak types to the final double * representation **/ -double toScalar(adiak_value_t *val, adiak_datatype_t *adiak_type) +double toScalar(adiak_value_t* val, adiak_datatype_t* adiak_type) { switch(adiak_type->dtype) { @@ -133,7 +133,7 @@ double toScalar(adiak_value_t *val, adiak_datatype_t *adiak_type) return val->v_double; case adiak_timeval: { - struct timeval *tval = static_cast(val->v_ptr); + struct timeval* tval = static_cast(val->v_ptr); return static_cast(tval->tv_sec) + (static_cast(tval->tv_usec) / 1000000.0); } // None of the rest of these should ever be reachable, so special error message @@ -149,7 +149,7 @@ double toScalar(adiak_value_t *val, adiak_datatype_t *adiak_type) case adiak_type_unset: { std::string msg("Logic error, contact maintainer: Adiak-to-Sina double converter given "); - char *s = adiak_type_to_string(adiak_type, 1); + char* s = adiak_type_to_string(adiak_type, 1); msg += s; free(s); throw std::runtime_error(msg); @@ -165,7 +165,7 @@ double toScalar(adiak_value_t *val, adiak_datatype_t *adiak_type) * Some Adiak types become what Sina views as a string. * Manage the conversions from various Adiak types to said string. **/ -std::string toString(adiak_value_t *val, adiak_datatype_t *adiak_type) +std::string toString(adiak_value_t* val, adiak_datatype_t* adiak_type) { switch(adiak_type->dtype) { @@ -173,7 +173,7 @@ std::string toString(adiak_value_t *val, adiak_datatype_t *adiak_type) { char datestr[512]; signed long seconds_since_epoch = static_cast(val->v_long); - struct tm *loc = localtime(&seconds_since_epoch); + struct tm* loc = localtime(&seconds_since_epoch); strftime(datestr, sizeof(datestr), "%a, %d %b %Y %T %z", loc); return static_cast(datestr); } @@ -181,7 +181,7 @@ std::string toString(adiak_value_t *val, adiak_datatype_t *adiak_type) case adiak_version: case adiak_string: case adiak_path: - return std::string(static_cast(val->v_ptr)); + return std::string(static_cast(val->v_ptr)); case adiak_long: case adiak_ulong: case adiak_int: @@ -195,7 +195,7 @@ std::string toString(adiak_value_t *val, adiak_datatype_t *adiak_type) case adiak_type_unset: { std::string msg("Logic error, contact maintainer: Adiak-to-Sina string converter given "); - char *s = adiak_type_to_string(adiak_type, 1); + char* s = adiak_type_to_string(adiak_type, 1); msg += s; free(s); throw std::runtime_error(msg); @@ -213,7 +213,7 @@ std::string toString(adiak_value_t *val, adiak_datatype_t *adiak_type) * or all strings. Manage conversions from various Adiak list types that * contain scalars to a simple list (vector) of scalars. **/ -std::vector toScalarList(adiak_value_t *subvals, adiak_datatype_t *t) +std::vector toScalarList(adiak_value_t* subvals, adiak_datatype_t* t) { std::vector sina_safe_list; for(int i = 0; i < t->num_elements; i++) @@ -227,7 +227,7 @@ std::vector toScalarList(adiak_value_t *subvals, adiak_datatype_t *t) * Partner method to toScalarList, invoked when the children of an adiak list * type are strings (according to Sina). **/ -std::vector toStringList(adiak_value_t *subvals, adiak_datatype_t *t) +std::vector toStringList(adiak_value_t* subvals, adiak_datatype_t* t) { std::vector sina_safe_list; for(int i = 0; i < t->num_elements; i++) @@ -239,15 +239,15 @@ std::vector toStringList(adiak_value_t *subvals, adiak_datatype_t * } // namespace -void adiakSinaCallback(const char *name, +void adiakSinaCallback(const char* name, adiak_category_t, - const char *subcategory, - adiak_value_t *val, - adiak_datatype_t *adiak_type, - void *void_record) + const char* subcategory, + adiak_value_t* val, + adiak_datatype_t* adiak_type, + void* void_record) { const SinaType sina_type = findSinaType(adiak_type); - axom::sina::Record *record = static_cast(void_record); + axom::sina::Record* record = static_cast(void_record); std::vector tags; if(subcategory && subcategory[0] != '\0') { @@ -260,7 +260,7 @@ void adiakSinaCallback(const char *name, throw std::runtime_error("Unknown Adiak type cannot be added to Sina record."); case sina_scalar: { - char *s = adiak_type_to_string(adiak_type, 1); + char* s = adiak_type_to_string(adiak_type, 1); tags.emplace_back(s); free(s); addDatum(name, toScalar(val, adiak_type), tags, record); @@ -268,7 +268,7 @@ void adiakSinaCallback(const char *name, } case sina_string: { - char *s = adiak_type_to_string(adiak_type, 1); + char* s = adiak_type_to_string(adiak_type, 1); tags.emplace_back(s); free(s); addDatum(name, toString(val, adiak_type), tags, record); @@ -283,9 +283,9 @@ void adiakSinaCallback(const char *name, // Further simplification: everything has to be the same type // Even further simplification: nothing nested. In the future, depth>1 lists // should be sent to user_defined - adiak_value_t *subvals = static_cast(val->v_ptr); + adiak_value_t* subvals = static_cast(val->v_ptr); SinaType list_type = findSinaType(adiak_type->subtype[0]); - char *s = adiak_type_to_string(adiak_type->subtype[0], 1); + char* s = adiak_type_to_string(adiak_type->subtype[0], 1); tags.emplace_back(s); free(s); switch(list_type) diff --git a/src/axom/sina/core/AdiakWriter.hpp b/src/axom/sina/core/AdiakWriter.hpp index 87d37c75d7..c78bbf760a 100644 --- a/src/axom/sina/core/AdiakWriter.hpp +++ b/src/axom/sina/core/AdiakWriter.hpp @@ -54,12 +54,12 @@ namespace sina * anything like a CurveSet. As a result, to do that, you must hold on to * the Record object passed here as the opaque value and manipulate it directly. **/ -void adiakSinaCallback(const char *name, +void adiakSinaCallback(const char* name, adiak_category_t category, - const char *subcategory, - adiak_value_t *value, - adiak_datatype_t *t, - void *opaque_value); + const char* subcategory, + adiak_value_t* value, + adiak_datatype_t* t, + void* opaque_value); } // namespace sina } // namespace axom diff --git a/src/axom/sina/core/ConduitUtil.cpp b/src/axom/sina/core/ConduitUtil.cpp index 776c767388..007ed56143 100644 --- a/src/axom/sina/core/ConduitUtil.cpp +++ b/src/axom/sina/core/ConduitUtil.cpp @@ -41,9 +41,9 @@ namespace * @return the avlue of the field * @throws std::invalid_argument if the field is not a string */ -std::string getExpectedString(conduit::Node const &field, - std::string const &fieldName, - std::string const &parentType) +std::string getExpectedString(conduit::Node const& field, + std::string const& fieldName, + std::string const& parentType) { if(!field.dtype().is_string()) { @@ -56,9 +56,9 @@ std::string getExpectedString(conduit::Node const &field, } } // namespace -conduit::Node const &getRequiredField(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType) +conduit::Node const& getRequiredField(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType) { if(!parent.has_child(fieldName)) { @@ -70,17 +70,17 @@ conduit::Node const &getRequiredField(std::string const &fieldName, return parent.child(fieldName); } -std::string getRequiredString(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType) +std::string getRequiredString(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType) { - conduit::Node const &field = getRequiredField(fieldName, parent, parentType); + conduit::Node const& field = getRequiredField(fieldName, parent, parentType); return getExpectedString(field, fieldName, parentType); } -std::string getOptionalString(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType) +std::string getOptionalString(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType) { if(!parent.has_child(fieldName) || parent.child(fieldName).dtype().is_empty()) { @@ -89,11 +89,11 @@ std::string getOptionalString(std::string const &fieldName, return getExpectedString(parent.child(fieldName), fieldName, parentType); } -double getRequiredDouble(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType) +double getRequiredDouble(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType) { - auto &ref = getRequiredField(fieldName, parent, parentType); + auto& ref = getRequiredField(fieldName, parent, parentType); if(!ref.dtype().is_number()) { std::ostringstream message; @@ -104,15 +104,15 @@ double getRequiredDouble(std::string const &fieldName, return ref.as_double(); } -void addStringsToNode(conduit::Node &parent, - std::string const &child_name, - std::vector const &string_values) +void addStringsToNode(conduit::Node& parent, + std::string const& child_name, + std::vector const& string_values) { // If the child already exists, add_child returns it - conduit::Node &child_node = parent.add_child(child_name); - for(auto &value : string_values) + conduit::Node& child_node = parent.add_child(child_name); + for(auto& value : string_values) { - auto &list_entry = child_node.append(); + auto& list_entry = child_node.append(); list_entry.set(value); } @@ -125,7 +125,7 @@ void addStringsToNode(conduit::Node &parent, } } -std::vector toDoubleVector(conduit::Node const &node, std::string const &name) +std::vector toDoubleVector(conduit::Node const& node, std::string const& name) { if(node.dtype().is_list() && node.dtype().number_of_elements() == 0) { @@ -136,19 +136,19 @@ std::vector toDoubleVector(conduit::Node const &node, std::string const { node.to_double_array(asDoubles); } - catch(conduit::Error const &err) + catch(conduit::Error const& err) { std::ostringstream errStream; errStream << "Error trying to convert node \"" << name << "\" into a list of doubles" << err.what(); throw std::invalid_argument(errStream.str()); } - double const *start = asDoubles.as_double_ptr(); + double const* start = asDoubles.as_double_ptr(); auto count = static_cast::size_type>(asDoubles.dtype().number_of_elements()); return std::vector {start, start + count}; } -std::vector toStringVector(conduit::Node const &node, std::string const &name) +std::vector toStringVector(conduit::Node const& node, std::string const& name) { std::vector converted; if(!node.dtype().is_list()) @@ -160,7 +160,7 @@ std::vector toStringVector(conduit::Node const &node, std::string c } for(auto iter = node.children(); iter.has_next();) { - auto &child = iter.next(); + auto& child = iter.next(); if(child.dtype().is_string()) { converted.emplace_back(child.as_string()); diff --git a/src/axom/sina/core/ConduitUtil.hpp b/src/axom/sina/core/ConduitUtil.hpp index 3878d6e024..a84cc66967 100644 --- a/src/axom/sina/core/ConduitUtil.hpp +++ b/src/axom/sina/core/ConduitUtil.hpp @@ -36,9 +36,9 @@ namespace sina * \return the requested field as a Node * \throws std::invalid_argument if the field does not exist */ -conduit::Node const &getRequiredField(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType); +conduit::Node const& getRequiredField(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType); /** * \brief Get the value of a required field from a conduit Node. The field value @@ -51,9 +51,9 @@ conduit::Node const &getRequiredField(std::string const &fieldName, * \return the value of the requested field * \throws std::invalid_argument if the field does not exist or is not a string */ -std::string getRequiredString(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType); +std::string getRequiredString(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType); /** * \brief Get the value of a required field from a conduit Node. The field value @@ -66,9 +66,9 @@ std::string getRequiredString(std::string const &fieldName, * \return the value of the requested field * \throws std::invalid_argument if the field does not exist or is not a double */ -double getRequiredDouble(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType); +double getRequiredDouble(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType); /** * \brief Get the value of an optional field from a conduit Node. The field value @@ -82,9 +82,9 @@ double getRequiredDouble(std::string const &fieldName, * does not exist * \throws std::invalid_argument if the field exists but is not a string */ -std::string getOptionalString(std::string const &fieldName, - conduit::Node const &parent, - std::string const &parentType); +std::string getOptionalString(std::string const& fieldName, + conduit::Node const& parent, + std::string const& parentType); /** * \brief Convert the given node to a vector of doubles. @@ -94,7 +94,7 @@ std::string getOptionalString(std::string const &fieldName, * \return the node as a list of doubles * \throws std::invalid_argument if the node is not a list of doubles */ -std::vector toDoubleVector(conduit::Node const &node, std::string const &name); +std::vector toDoubleVector(conduit::Node const& node, std::string const& name); /** * \brief Convert the given node to a vector of strings. @@ -104,7 +104,7 @@ std::vector toDoubleVector(conduit::Node const &node, std::string const * \return the node as a list of strings * \throws std::invalid_argument if the node is not a list of strings */ -std::vector toStringVector(conduit::Node const &node, std::string const &name); +std::vector toStringVector(conduit::Node const& node, std::string const& name); /** * \brief Add a vector of strings to a Node. This operation's not natively @@ -114,9 +114,9 @@ std::vector toStringVector(conduit::Node const &node, std::string c * \param child_name the name of the child (aka the name of the field) * \param string_values the data values for the field */ -void addStringsToNode(conduit::Node &parent, - const std::string &child_name, - std::vector const &string_values); +void addStringsToNode(conduit::Node& parent, + const std::string& child_name, + std::vector const& string_values); } // end namespace sina } // end namespace axom diff --git a/src/axom/sina/core/Curve.cpp b/src/axom/sina/core/Curve.cpp index 5e756eef02..aecbbc81b4 100644 --- a/src/axom/sina/core/Curve.cpp +++ b/src/axom/sina/core/Curve.cpp @@ -40,14 +40,14 @@ Curve::Curve(std::string name_, std::vector values_) , tags {} { } -Curve::Curve(std::string name_, double const *values_, std::size_t numValues) +Curve::Curve(std::string name_, double const* values_, std::size_t numValues) : name {std::move(name_)} , values {values_, values_ + numValues} , units {} , tags {} { } -Curve::Curve(std::string name_, conduit::Node const &curveAsNode) +Curve::Curve(std::string name_, conduit::Node const& curveAsNode) : name {std::move(name_)} , values {} , units {} @@ -55,7 +55,7 @@ Curve::Curve(std::string name_, conduit::Node const &curveAsNode) { std::string const curve_type_name {CURVE_TYPE_NAME}; std::string const values_key {VALUES_KEY}; - conduit::Node const &valuesAsNode = getRequiredField(values_key, curveAsNode, curve_type_name); + conduit::Node const& valuesAsNode = getRequiredField(values_key, curveAsNode, curve_type_name); values = toDoubleVector(valuesAsNode, values_key); units = getOptionalString(UNITS_KEY, curveAsNode, CURVE_TYPE_NAME); diff --git a/src/axom/sina/core/Curve.hpp b/src/axom/sina/core/Curve.hpp index 192aef92ad..2263738302 100644 --- a/src/axom/sina/core/Curve.hpp +++ b/src/axom/sina/core/Curve.hpp @@ -47,7 +47,7 @@ class Curve * \param values the curve's values * \param numValues the number of values. */ - Curve(std::string name, double const *values, std::size_t numValues); + Curve(std::string name, double const* values, std::size_t numValues); /** * \brief Create a Curve by deserializing a conduit node. @@ -55,21 +55,21 @@ class Curve * \param name the name of the curve * \param curveAsNode the serialized version of a curve */ - Curve(std::string name, conduit::Node const &curveAsNode); + Curve(std::string name, conduit::Node const& curveAsNode); /** * \brief Get the curve's name. * * \return the curve's name */ - std::string const &getName() const { return name; } + std::string const& getName() const { return name; } /** * \brief Get the values of the curve. * * \return the curve's values */ - std::vector const &getValues() const { return values; } + std::vector const& getValues() const { return values; } /** * \brief Set the units of the values. @@ -83,7 +83,7 @@ class Curve * * \return the value's units */ - std::string const &getUnits() const { return units; } + std::string const& getUnits() const { return units; } /** * \brief Set the tags for this curve. @@ -97,7 +97,7 @@ class Curve * * \return the curve's tags */ - std::vector const &getTags() const { return tags; } + std::vector const& getTags() const { return tags; } /** * \brief Convert this curve to a Conduit node. diff --git a/src/axom/sina/core/CurveSet.cpp b/src/axom/sina/core/CurveSet.cpp index 6a167202b2..397f4f5b7b 100644 --- a/src/axom/sina/core/CurveSet.cpp +++ b/src/axom/sina/core/CurveSet.cpp @@ -54,7 +54,7 @@ constexpr auto DEPENDENT_KEY = "dependent"; * @param nameList the vector of curve names to add the curve's name to. Used for tracking insertion order for codes. */ -void addCurve(Curve &&curve, CurveSet::CurveMap &curves, std::vector &nameList) +void addCurve(Curve&& curve, CurveSet::CurveMap& curves, std::vector& nameList) { std::string curveName = curve.getName(); // Make a COPY before moving auto existing = curves.find(curveName); @@ -74,8 +74,8 @@ void addCurve(Curve &&curve, CurveSet::CurveMap &curves, std::vector &newOrder, - std::vector &oldOrder) +bool applyCustomCurveOrder(const std::vector& newOrder, + std::vector& oldOrder) { if(newOrder.size() != oldOrder.size()) { @@ -98,7 +98,7 @@ bool applyCustomCurveOrder(const std::vector &newOrder, * @param childNodeName the name of the child node * @return a struct containing the curveMap and ordered curve names. */ -CurveSet::curveNodeInfo extractCurveMap(conduit::Node const &parent, std::string const &childNodeName) +CurveSet::curveNodeInfo extractCurveMap(conduit::Node const& parent, std::string const& childNodeName) { CurveSet::CurveMap curveMap; std::vector curveNames; @@ -108,10 +108,10 @@ CurveSet::curveNodeInfo extractCurveMap(conduit::Node const &parent, std::string return CurveSet::curveNodeInfo {curveMap, curveNames}; } - auto &mapAsNode = parent.child(childNodeName); + auto& mapAsNode = parent.child(childNodeName); for(auto iter = mapAsNode.children(); iter.has_next();) { - auto &curveAsNode = iter.next(); + auto& curveAsNode = iter.next(); std::string curveName = iter.name(); curveNames.emplace_back(curveName); Curve curve {curveName, curveAsNode}; @@ -129,8 +129,8 @@ CurveSet::curveNodeInfo extractCurveMap(conduit::Node const &parent, std::string * @param curveOrder how nameList should be sorted if not oldest-first, ex: alphabetical. * @return the map as a node */ -conduit::Node createCurveMapNode(CurveSet::CurveMap const &curveMap, - std::vector const &nameList, +conduit::Node createCurveMapNode(CurveSet::CurveMap const& curveMap, + std::vector const& nameList, CurveSet::CurveOrder const curveOrder) { conduit::Node mapNode; @@ -151,7 +151,7 @@ conduit::Node createCurveMapNode(CurveSet::CurveMap const &curveMap, std::sort(orderedNameList.begin(), orderedNameList.end(), std::greater()); break; } - for(auto &curveName : orderedNameList) + for(auto& curveName : orderedNameList) { auto expectedCurve = curveMap.find(curveName); // Warn if not found? Should this be allowed to happen? @@ -173,7 +173,7 @@ CurveSet::CurveSet(std::string name_) , orderedDependentCurveNames {} { } -CurveSet::CurveSet(std::string name_, conduit::Node const &node) +CurveSet::CurveSet(std::string name_, conduit::Node const& node) { name = std::move(name_); auto independentCurveInfo = extractCurveMap(node, INDEPENDENT_KEY); diff --git a/src/axom/sina/core/CurveSet.hpp b/src/axom/sina/core/CurveSet.hpp index aca95ea13d..6576afb72e 100644 --- a/src/axom/sina/core/CurveSet.hpp +++ b/src/axom/sina/core/CurveSet.hpp @@ -82,21 +82,21 @@ class CurveSet * \param name the name of the CurveSet * \param node the Conduit node representing the CurveSet */ - CurveSet(std::string name, conduit::Node const &node); + CurveSet(std::string name, conduit::Node const& node); /** * \brief Get the name of the this CurveSet. * * \return the curve set's name */ - std::string const &getName() const { return name; } + std::string const& getName() const { return name; } /** * Get the insertion order of this curveset's independents. * * @return a vector of curve names in the order of insertion. */ - std::vector const &getOrderedIndependentCurveNames() + std::vector const& getOrderedIndependentCurveNames() { return orderedIndependentCurveNames; } @@ -106,7 +106,7 @@ class CurveSet * * @return a vector of curve names in the order of insertion. */ - std::vector const &getOrderedDependentCurveNames() + std::vector const& getOrderedDependentCurveNames() { return orderedDependentCurveNames; } @@ -148,14 +148,14 @@ class CurveSet * * \return a map of all the independent curves */ - CurveMap const &getIndependentCurves() const { return independentCurves; } + CurveMap const& getIndependentCurves() const { return independentCurves; } /** * \brief Get a map of all the dependent curves. * * \return a map of all the dependent curves */ - CurveMap const &getDependentCurves() const { return dependentCurves; } + CurveMap const& getDependentCurves() const { return dependentCurves; } /** * \brief Convert this CurveSet to a Conduit node. diff --git a/src/axom/sina/core/DataHolder.cpp b/src/axom/sina/core/DataHolder.cpp index 6fc135c27b..1c6407b855 100644 --- a/src/axom/sina/core/DataHolder.cpp +++ b/src/axom/sina/core/DataHolder.cpp @@ -63,7 +63,7 @@ void DataHolder::add(CurveSet curveSet) } } -std::shared_ptr DataHolder::addLibraryData(std::string const &name) +std::shared_ptr DataHolder::addLibraryData(std::string const& name) { auto existing = libraryData.find(name); if(existing == libraryData.end()) @@ -77,7 +77,7 @@ std::shared_ptr DataHolder::addLibraryData(std::string const &name) return libraryData.at(name); } -std::shared_ptr DataHolder::addLibraryData(std::string const &name, +std::shared_ptr DataHolder::addLibraryData(std::string const& name, conduit::Node existingLibraryData) { auto existing = libraryData.find(name); @@ -105,7 +105,7 @@ conduit::Node DataHolder::toNode(CurveSet::CurveOrder curveOrder) const { //Loop through vector of data and append Json conduit::Node libRef; - for(auto &lib : libraryData) + for(auto& lib : libraryData) { libRef.add_child(lib.first) = lib.second->toNode(curveOrder); } @@ -114,7 +114,7 @@ conduit::Node DataHolder::toNode(CurveSet::CurveOrder curveOrder) const if(!curveSets.empty()) { conduit::Node curveSetsNode; - for(auto &entry : curveSets) + for(auto& entry : curveSets) { curveSetsNode.add_child(entry.first) = entry.second.toNode(curveOrder); } @@ -124,7 +124,7 @@ conduit::Node DataHolder::toNode(CurveSet::CurveOrder curveOrder) const { //Loop through vector of data and append Json conduit::Node datumRef; - for(auto &datum : data) + for(auto& datum : data) { datumRef.add_child(datum.first) = datum.second.toNode(); } @@ -137,7 +137,7 @@ conduit::Node DataHolder::toNode(CurveSet::CurveOrder curveOrder) const return asNode; } -DataHolder::DataHolder(conduit::Node const &asNode) +DataHolder::DataHolder(conduit::Node const& asNode) { if(asNode.has_child(DATA_FIELD)) { @@ -145,7 +145,7 @@ DataHolder::DataHolder(conduit::Node const &asNode) //Loop through DATA_FIELD objects and add them to data: while(dataIter.has_next()) { - auto &namedDatum = dataIter.next(); + auto& namedDatum = dataIter.next(); data.emplace(std::make_pair(dataIter.name(), Datum(namedDatum))); } } @@ -154,7 +154,7 @@ DataHolder::DataHolder(conduit::Node const &asNode) auto curveSetsIter = asNode[CURVE_SETS_FIELD].children(); while(curveSetsIter.has_next()) { - auto &curveSetNode = curveSetsIter.next(); + auto& curveSetNode = curveSetsIter.next(); std::string name = curveSetsIter.name(); CurveSet cs {name, curveSetNode}; curveSets.emplace(std::make_pair(std::move(name), std::move(cs))); @@ -165,7 +165,7 @@ DataHolder::DataHolder(conduit::Node const &asNode) auto libraryIter = asNode[LIBRARY_DATA_FIELD].children(); while(libraryIter.has_next()) { - auto &libraryDataNode = libraryIter.next(); + auto& libraryDataNode = libraryIter.next(); std::string name = libraryIter.name(); libraryData.emplace( std::make_pair(std::move(name), std::make_shared(libraryDataNode))); diff --git a/src/axom/sina/core/DataHolder.hpp b/src/axom/sina/core/DataHolder.hpp index 9bc5bfe287..b5f3a0dde1 100644 --- a/src/axom/sina/core/DataHolder.hpp +++ b/src/axom/sina/core/DataHolder.hpp @@ -71,26 +71,26 @@ class DataHolder /** * Copy constructor that disallows this constructor type. */ - DataHolder(DataHolder const &) = delete; + DataHolder(DataHolder const&) = delete; /** * Disable copy assignment. */ - DataHolder &operator=(DataHolder const &) = delete; + DataHolder& operator=(DataHolder const&) = delete; /** * \brief Construct a DataHolder from its conduit Node representation. * * \param asNode the DataHolder as a Node */ - explicit DataHolder(conduit::Node const &asNode); + explicit DataHolder(conduit::Node const& asNode); /** * \brief Get the DataHolder's data. * * \return the DataHolder's data */ - DatumMap const &getData() const noexcept { return data; } + DatumMap const& getData() const noexcept { return data; } /** * \brief Add a Datum to this DataHolder. @@ -112,7 +112,7 @@ class DataHolder * * \return the dataholder's curve sets */ - CurveSetMap const &getCurveSets() const noexcept { return curveSets; } + CurveSetMap const& getCurveSets() const noexcept { return curveSets; } /** * \brief Add a new library to this DataHolder. @@ -123,14 +123,14 @@ class DataHolder * \return a pointer to a new DataHolder for a library * of the given name. */ - std::shared_ptr addLibraryData(std::string const &name); + std::shared_ptr addLibraryData(std::string const& name); /** * \brief Add a new library to this DataHolder with existing library data. * * \return a pointer to a new DataHolder for a library of the given name. */ - std::shared_ptr addLibraryData(std::string const &name, + std::shared_ptr addLibraryData(std::string const& name, conduit::Node existingLibraryData); /** @@ -138,14 +138,14 @@ class DataHolder * * \return the dataholder's library data */ - LibraryDataMap const &getLibraryData() const noexcept { return libraryData; } + LibraryDataMap const& getLibraryData() const noexcept { return libraryData; } /** * \brief Get a specific library associated with this DataHolder. * * \return the dataholder's library data */ - std::shared_ptr getLibraryData(std::string const &libraryName) + std::shared_ptr getLibraryData(std::string const& libraryName) { return libraryData.at(libraryName); } @@ -155,7 +155,7 @@ class DataHolder * * \return the dataholder's library data */ - std::shared_ptr const getLibraryData(std::string const &libraryName) const + std::shared_ptr const getLibraryData(std::string const& libraryName) const { return libraryData.at(libraryName); } @@ -165,14 +165,14 @@ class DataHolder * * \return the user-defined content */ - conduit::Node const &getUserDefinedContent() const noexcept { return userDefined; } + conduit::Node const& getUserDefinedContent() const noexcept { return userDefined; } /** * \brief Get the user-defined content of the object. * * \return the user-defined content */ - conduit::Node &getUserDefinedContent() noexcept { return userDefined; } + conduit::Node& getUserDefinedContent() noexcept { return userDefined; } /** * \brief Set the user-defined content of the object. diff --git a/src/axom/sina/core/Datum.cpp b/src/axom/sina/core/Datum.cpp index 9d64de5732..4f5002ab2f 100644 --- a/src/axom/sina/core/Datum.cpp +++ b/src/axom/sina/core/Datum.cpp @@ -36,31 +36,31 @@ namespace axom namespace sina { -Datum::Datum(const std::string &value_) : stringValue {value_} +Datum::Datum(const std::string& value_) : stringValue {value_} { //Set type to String, as we know it uses strings type = ValueType::String; } -Datum::Datum(const double &value_) : scalarValue {value_} +Datum::Datum(const double& value_) : scalarValue {value_} { //Set type to Scalar, as we know it uses doubles type = ValueType::Scalar; } -Datum::Datum(const std::vector &value_) : stringArrayValue {value_} +Datum::Datum(const std::vector& value_) : stringArrayValue {value_} { //Set type to StringArray, as we know it uses an array of strings type = ValueType::StringArray; } -Datum::Datum(const std::vector &value_) : scalarArrayValue {value_} +Datum::Datum(const std::vector& value_) : scalarArrayValue {value_} { //Set type to ScalarArray, as we know it uses an array of doubles type = ValueType::ScalarArray; } -Datum::Datum(conduit::Node const &asNode) +Datum::Datum(conduit::Node const& asNode) { //Need to determine what type of Datum we have: Scalar (double), String, //or list of one of those two. @@ -115,7 +115,7 @@ Datum::Datum(conduit::Node const &asNode) auto itr = valueNode.children(); while(itr.has_next()) { - conduit::Node const &entry = itr.next(); + conduit::Node const& entry = itr.next(); if(entry.dtype().is_string() && type == ValueType::StringArray) { stringArrayValue.emplace_back(entry.as_string()); @@ -151,7 +151,7 @@ Datum::Datum(conduit::Node const &asNode) auto tagNodeIter = asNode[TAGS_FIELD].children(); while(tagNodeIter.has_next()) { - auto &tag = tagNodeIter.next(); + auto& tag = tagNodeIter.next(); if(tag.dtype().is_string()) { tags.emplace_back(std::string(tag.as_string())); @@ -167,9 +167,9 @@ Datum::Datum(conduit::Node const &asNode) } } -void Datum::setUnits(const std::string &units_) { units = units_; } +void Datum::setUnits(const std::string& units_) { units = units_; } -void Datum::setTags(const std::vector &tags_) { tags = tags_; } +void Datum::setTags(const std::vector& tags_) { tags = tags_; } conduit::Node Datum::toNode() const { diff --git a/src/axom/sina/core/Datum.hpp b/src/axom/sina/core/Datum.hpp index 25bf26349a..49427b0a02 100644 --- a/src/axom/sina/core/Datum.hpp +++ b/src/axom/sina/core/Datum.hpp @@ -84,91 +84,91 @@ class Datum * * \param value the string value of the datum */ - Datum(const std::string &value); + Datum(const std::string& value); /** * \brief Construct a new Datum. * * \param value the double value of the datum */ - Datum(const double &value); + Datum(const double& value); /** * \brief Construct a new Datum. * * \param value the string array value of the datum */ - Datum(const std::vector &value); + Datum(const std::vector& value); /** * \brief Construct a new Datum. * * \param value the scalar array value of the datum */ - Datum(const std::vector &value); + Datum(const std::vector& value); /** * \brief Construct a Datum from its Node representation. * * \param asNode the Datum as conduit Node */ - explicit Datum(conduit::Node const &asNode); + explicit Datum(conduit::Node const& asNode); /** * \brief Get the string value of the Datum. * * \return the string value */ - std::string const &getValue() const noexcept { return stringValue; } + std::string const& getValue() const noexcept { return stringValue; } /** * \brief Get the scalar value of the Datum. * * \return the scalar value */ - double const &getScalar() const noexcept { return scalarValue; } + double const& getScalar() const noexcept { return scalarValue; } /** * \brief Get the string array value of the Datum. * * \return the string vector value */ - std::vector const &getStringArray() const noexcept { return stringArrayValue; } + std::vector const& getStringArray() const noexcept { return stringArrayValue; } /** * \brief Get the scalar array value of the Datum. * * \return the scalar vector value */ - std::vector const &getScalarArray() const noexcept { return scalarArrayValue; } + std::vector const& getScalarArray() const noexcept { return scalarArrayValue; } /** * \brief Get the tags of the Datum * * \return the tags of the value */ - std::vector const &getTags() const noexcept { return tags; } + std::vector const& getTags() const noexcept { return tags; } /** * \brief Set the tags of the Datum * * \param tags the tags of the value */ - void setTags(const std::vector &tags); + void setTags(const std::vector& tags); /** * \brief Get the units of the Datum * * \return the units of the value */ - std::string const &getUnits() const noexcept { return units; } + std::string const& getUnits() const noexcept { return units; } /** * \brief Set the units of the Datum * * \param units the units of the value */ - void setUnits(const std::string &units); + void setUnits(const std::string& units); /** * \brief Get the type of the Datum diff --git a/src/axom/sina/core/Document.cpp b/src/axom/sina/core/Document.cpp index ca2bd388c5..916fe97c30 100644 --- a/src/axom/sina/core/Document.cpp +++ b/src/axom/sina/core/Document.cpp @@ -87,7 +87,7 @@ static const std::map appendFieldStrings { std::vector const CURVE_CATEGORIES = {"dependent", "independent"}; -void protocolWarn(std::string const protocol, std::string const &name) +void protocolWarn(std::string const protocol, std::string const& name) { std::unordered_map protocolMessages = { {".json", ".json extension not found, did you mean to save to this format?"}, @@ -124,27 +124,27 @@ conduit::Node Document::toNode() const conduit::Node document(conduit::DataType::object()); document[RECORDS_KEY] = conduit::Node(conduit::DataType::list()); document[RELATIONSHIPS_KEY] = conduit::Node(conduit::DataType::list()); - for(auto &record : records) + for(auto& record : records) { - auto &list_entry = document[RECORDS_KEY].append(); + auto& list_entry = document[RECORDS_KEY].append(); list_entry.set_node(record->toNode()); } - for(auto &relationship : relationships) + for(auto& relationship : relationships) { - auto &list_entry = document[RELATIONSHIPS_KEY].append(); + auto& list_entry = document[RELATIONSHIPS_KEY].append(); list_entry = relationship.toNode(); } return document; } -void Document::createFromNode(const conduit::Node &asNode, const RecordLoader &recordLoader) +void Document::createFromNode(const conduit::Node& asNode, const RecordLoader& recordLoader) { conduit::Node nodeCopy = asNode; - auto processChildNodes = [&](const char *key, std::function addFunc) { + auto processChildNodes = [&](const char* key, std::function addFunc) { if(nodeCopy.has_child(key)) { - conduit::Node &childNodes = nodeCopy[key]; + conduit::Node& childNodes = nodeCopy[key]; // -- 1. Check if this node is a primitive leaf (throw immediately if so) // Customize these checks to match exactly what you consider "primitive." @@ -180,18 +180,18 @@ void Document::createFromNode(const conduit::Node &asNode, const RecordLoader &r } } }; - processChildNodes(RECORDS_KEY, [&](conduit::Node &record) { add(recordLoader.load(record)); }); + processChildNodes(RECORDS_KEY, [&](conduit::Node& record) { add(recordLoader.load(record)); }); processChildNodes(RELATIONSHIPS_KEY, - [&](conduit::Node &relationship) { add(Relationship {relationship}); }); + [&](conduit::Node& relationship) { add(Relationship {relationship}); }); } -Document::Document(conduit::Node const &asNode, RecordLoader const &recordLoader) +Document::Document(conduit::Node const& asNode, RecordLoader const& recordLoader) { this->createFromNode(asNode, recordLoader); } -Document::Document(std::string const &asJson, RecordLoader const &recordLoader) +Document::Document(std::string const& asJson, RecordLoader const& recordLoader) { conduit::Node asNode; asNode.parse(asJson, "json"); @@ -199,7 +199,7 @@ Document::Document(std::string const &asJson, RecordLoader const &recordLoader) } #ifdef AXOM_USE_HDF5 -void removeSlashes(const conduit::Node &originalNode, conduit::Node &modifiedNode) +void removeSlashes(const conduit::Node& originalNode, conduit::Node& modifiedNode) { for(auto it = originalNode.children(); it.has_next();) { @@ -219,7 +219,7 @@ void removeSlashes(const conduit::Node &originalNode, conduit::Node &modifiedNod } #endif -void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNode) +void restoreSlashes(const conduit::Node& modifiedNode, conduit::Node& restoredNode) { // Check if List or Object, if its a list the else statement would turn it into an object // which breaks the Document @@ -231,7 +231,7 @@ void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNo for(auto it = modifiedNode.children(); it.has_next();) { it.next(); - conduit::Node &newChild = restoredNode.append(); + conduit::Node& newChild = restoredNode.append(); auto data_type = it.node().dtype(); // Leaves empty nodes empty, if null data is set the @@ -259,7 +259,7 @@ void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNo axom::utilities::string::replaceAllInstances(key, slashSubstitute, "/"); // Initialize a new node for the restored key - conduit::Node &newChild = restoredNode.add_child(restoredKey); + conduit::Node& newChild = restoredNode.add_child(restoredKey); auto data_type = it.node().dtype(); // Leaves empty keys empty but continues recursive call if its a list @@ -284,12 +284,12 @@ void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNo } #ifdef AXOM_USE_HDF5 -conduit::Node &Document::toHDF5Node(conduit::Node &writeTo) const +conduit::Node& Document::toHDF5Node(conduit::Node& writeTo) const { - conduit::Node &recordsNode = writeTo["records"]; - conduit::Node &relationshipsNode = writeTo["relationships"]; + conduit::Node& recordsNode = writeTo["records"]; + conduit::Node& relationshipsNode = writeTo["relationships"]; - for(const auto &record : getRecords()) + for(const auto& record : getRecords()) { conduit::Node recordNode = record->toNode(); @@ -297,7 +297,7 @@ conduit::Node &Document::toHDF5Node(conduit::Node &writeTo) const } // Process relationships - for(const auto &relationship : getRelationships()) + for(const auto& relationship : getRelationships()) { conduit::Node relationshipNode = relationship.toNode(); @@ -306,7 +306,7 @@ conduit::Node &Document::toHDF5Node(conduit::Node &writeTo) const return writeTo; } -void Document::toHDF5(const std::string &filename) const +void Document::toHDF5(const std::string& filename) const { conduit::Node outNode; conduit::relay::io::save(this->toHDF5Node(outNode), filename, "hdf5"); @@ -317,18 +317,18 @@ void Document::toHDF5(const std::string &filename) const std::string Document::toJson(conduit::index_t indent, conduit::index_t depth, - const std::string &pad, - const std::string &eoe) const + const std::string& pad, + const std::string& eoe) const { return this->toNode().to_json("json", indent, depth, pad, eoe); } -Document loadDocument(std::string const &path, Protocol protocol) +Document loadDocument(std::string const& path, Protocol protocol) { return loadDocument(path, createRecordLoaderWithAllKnownTypes(), protocol); } -Document loadDocument(std::string const &path, RecordLoader const &recordLoader, Protocol protocol) +Document loadDocument(std::string const& path, RecordLoader const& recordLoader, Protocol protocol) { conduit::Node node, modifiedNode; std::ostringstream file_contents; @@ -363,18 +363,18 @@ Document loadDocument(std::string const &path, RecordLoader const &recordLoader, // This section exits because the hdf5 uses a dictionary to store records, ex: records//{actual_record} // whereas the JSON uses a list. The pathlike relay interface doesn't have access for list entries, hence needing to take // something "relay-like" instead for the JSON case (a Node). This can go away cleanly if we swap over to dicts in JSON. -conduit::Node &relayLikeRead(conduit::Node &appendTo, - const std::string &endpoint, - conduit::Node &readInto, +conduit::Node& relayLikeRead(conduit::Node& appendTo, + const std::string& endpoint, + conduit::Node& readInto, int record_num) { AXOM_UNUSED_VAR(readInto); return appendTo["records"].child(record_num)[endpoint]; } -conduit::Node &relayLikeRead(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, - conduit::Node &readInto, +conduit::Node& relayLikeRead(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, + conduit::Node& readInto, int record_num) { AXOM_UNUSED_VAR(record_num); @@ -382,46 +382,46 @@ conduit::Node &relayLikeRead(conduit::relay::io::IOHandle &appendTo, return readInto; } -conduit::Node &relayLikeReadEtc(conduit::Node &appendTo, - const std::string &endpoint, - conduit::Node &readInto) +conduit::Node& relayLikeReadEtc(conduit::Node& appendTo, + const std::string& endpoint, + conduit::Node& readInto) { AXOM_UNUSED_VAR(readInto); return appendTo[endpoint]; } -conduit::Node &relayLikeReadEtc(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, - conduit::Node &readInto) +conduit::Node& relayLikeReadEtc(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, + conduit::Node& readInto) { appendTo.read(endpoint, readInto); return readInto; } -bool relayLikeHasPath(conduit::Node &appendTo, const std::string &endpoint, int record_num) +bool relayLikeHasPath(conduit::Node& appendTo, const std::string& endpoint, int record_num) { return appendTo["records"].child(record_num).has_path(endpoint); } -bool relayLikeHasPath(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, +bool relayLikeHasPath(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, int record_num) { AXOM_UNUSED_VAR(record_num); return appendTo.has_path(endpoint); } -bool nodeWorkaroundHasChildSlashes(conduit::Node &appendTo, - const std::string &endpoint, - const std::string &child_name, +bool nodeWorkaroundHasChildSlashes(conduit::Node& appendTo, + const std::string& endpoint, + const std::string& child_name, int record_num) { return appendTo["records"].child(record_num)[endpoint].has_child(child_name); } // HDF5 already escapes the slashes, so we don't have to worry. -bool nodeWorkaroundHasChildSlashes(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, - const std::string &child_name, +bool nodeWorkaroundHasChildSlashes(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, + const std::string& child_name, int record_num) { AXOM_UNUSED_VAR(record_num); @@ -429,15 +429,15 @@ bool nodeWorkaroundHasChildSlashes(conduit::relay::io::IOHandle &appendTo, return appendTo.has_path(endpoint); } -std::vector relayLikeListChildNames(conduit::Node &appendTo, - const std::string &endpoint, +std::vector relayLikeListChildNames(conduit::Node& appendTo, + const std::string& endpoint, int record_num) { return appendTo["records"].child(record_num)[endpoint].child_names(); } -std::vector relayLikeListChildNames(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, +std::vector relayLikeListChildNames(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, int record_num) { AXOM_UNUSED_VAR(record_num); @@ -446,13 +446,13 @@ std::vector relayLikeListChildNames(conduit::relay::io::IOHandle &a return nameHolder; } -int relayLikeNumChildren(conduit::Node &appendTo, const std::string &endpoint, int record_num) +int relayLikeNumChildren(conduit::Node& appendTo, const std::string& endpoint, int record_num) { return appendTo["records"].child(record_num)[endpoint].number_of_children(); } -int relayLikeNumChildren(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, +int relayLikeNumChildren(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, int record_num) { AXOM_UNUSED_VAR(record_num); @@ -461,9 +461,9 @@ int relayLikeNumChildren(conduit::relay::io::IOHandle &appendTo, return child_name_holder.size(); } -void relayLikeWrite(conduit::relay::io::IOHandle &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void relayLikeWrite(conduit::relay::io::IOHandle& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, int record_num) { AXOM_UNUSED_VAR(record_num); @@ -474,18 +474,18 @@ void relayLikeWrite(conduit::relay::io::IOHandle &appendTo, appendTo.write(appendFrom, endpoint); } -void relayLikeWrite(conduit::Node &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void relayLikeWrite(conduit::Node& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, int record_num) { appendTo["records"].child(record_num)[endpoint].update(appendFrom); } // We only have one write that ever exists outside of records at the moment (relationships) -void relayLikeWriteEtc(conduit::relay::io::IOHandle &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint) +void relayLikeWriteEtc(conduit::relay::io::IOHandle& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint) { if(appendTo.has_path(endpoint)) { @@ -494,51 +494,51 @@ void relayLikeWriteEtc(conduit::relay::io::IOHandle &appendTo, appendTo.write(appendFrom, endpoint); } -void relayLikeWipeRecords(conduit::relay::io::IOHandle &appendTo) +void relayLikeWipeRecords(conduit::relay::io::IOHandle& appendTo) { // HDF5 seems to be displeased by empty endpoints, there are a few removes like this to cover for that, as these // fields being empty is allowed in Sina. appendTo.remove("/records"); } -void relayLikeWipeRecords(conduit::Node &appendTo) +void relayLikeWipeRecords(conduit::Node& appendTo) { // Should never be called. AXOM_UNUSED_VAR(appendTo); } -void relayLikeWriteEtc(conduit::Node &appendTo, conduit::Node &appendFrom, const std::string &endpoint) +void relayLikeWriteEtc(conduit::Node& appendTo, conduit::Node& appendFrom, const std::string& endpoint) { appendTo[endpoint].update(appendFrom); } -void relayLikeAddNewRecord(conduit::relay::io::IOHandle &appendTo, - conduit::Node &new_record, +void relayLikeAddNewRecord(conduit::relay::io::IOHandle& appendTo, + conduit::Node& new_record, int new_record_num) { relayLikeWrite(appendTo, new_record, "records/" + std::to_string(new_record_num), new_record_num); } -void relayLikeAddNewRecord(conduit::Node &appendTo, conduit::Node &new_record, int new_record_num) +void relayLikeAddNewRecord(conduit::Node& appendTo, conduit::Node& new_record, int new_record_num) { AXOM_UNUSED_VAR(new_record_num); appendTo["records"].append() = new_record; } -uint64_t relayLikeArrayNumElements(conduit::Node &appendTo, - const std::string &endpoint, +uint64_t relayLikeArrayNumElements(conduit::Node& appendTo, + const std::string& endpoint, int record_num, - const std::string &original_file_path) + const std::string& original_file_path) { AXOM_UNUSED_VAR(original_file_path); return appendTo["records"].child(record_num)[endpoint].dtype().number_of_elements(); } #ifdef AXOM_USE_HDF5 -uint64_t relayLikeArrayNumElements(conduit::relay::io::IOHandle &appendTo, - const std::string &endpoint, +uint64_t relayLikeArrayNumElements(conduit::relay::io::IOHandle& appendTo, + const std::string& endpoint, int record_num, - const std::string &original_file_path) + const std::string& original_file_path) { // This is the only reason why original_file_path has to be passed all the way down from append() // If access to it's added to IOHandle, we can clean this up. @@ -549,11 +549,11 @@ uint64_t relayLikeArrayNumElements(conduit::relay::io::IOHandle &appendTo, return metadata_only["num_elements"].value(); } -void relayLikeAppendCurve(conduit::relay::io::IOHandle &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void relayLikeAppendCurve(conduit::relay::io::IOHandle& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, int record_num, - const std::string &original_file_path) + const std::string& original_file_path) { AXOM_UNUSED_VAR(record_num); conduit::Node OPTS_NODE; // Keep an eye out for static defaults that might be helpful to set as we learn more here @@ -562,14 +562,14 @@ void relayLikeAppendCurve(conduit::relay::io::IOHandle &appendTo, } #endif /* AXOM_USE_HDF5 */ -void relayLikeAppendCurve(conduit::Node &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void relayLikeAppendCurve(conduit::Node& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, int record_num, - const std::string &original_file_path) + const std::string& original_file_path) { AXOM_UNUSED_VAR(original_file_path); - conduit::Node &append_at = appendTo["records"].child(record_num)[endpoint]; + conduit::Node& append_at = appendTo["records"].child(record_num)[endpoint]; std::vector merged_values( append_at.as_double_ptr(), append_at.as_double_ptr() + append_at.dtype().number_of_elements()); @@ -579,7 +579,7 @@ void relayLikeAppendCurve(conduit::Node &appendTo, append_at.set(merged_values); } -std::unordered_map relayLikeRecordOrderMap(conduit::Node &appendTo) +std::unordered_map relayLikeRecordOrderMap(conduit::Node& appendTo) { std::unordered_map order_map; int num_children = appendTo["records"].number_of_children(); @@ -597,13 +597,13 @@ std::unordered_map relayLikeRecordOrderMap(conduit::Node &appe return order_map; } -std::unordered_map relayLikeRecordOrderMap(conduit::relay::io::IOHandle &appendTo) +std::unordered_map relayLikeRecordOrderMap(conduit::relay::io::IOHandle& appendTo) { std::unordered_map order_map; conduit::Node n; std::vector child_names; appendTo.list_child_names("records/", child_names); - for(const std::string &child_name : child_names) + for(const std::string& child_name : child_names) { if(appendTo.has_path("records/" + child_name + "/id")) { @@ -622,7 +622,7 @@ std::unordered_map relayLikeRecordOrderMap(conduit::relay::io: // Helper function for ex: adding new entries to the error-tracking message list in the append() functions // Both nodes must be Conduit lists -void concat_list_node(conduit::Node &concatTo, const conduit::Node &concatFrom) +void concat_list_node(conduit::Node& concatTo, const conduit::Node& concatFrom) { auto itr = concatFrom.children(); while(itr.has_next()) @@ -634,11 +634,11 @@ void concat_list_node(conduit::Node &concatTo, const conduit::Node &concatFrom) // Specifically validate ONE curve set for ONE DataHolder (record, library_data...) for appending, // appendTo is notionally const, but the has_path() etc. methods aren't const. template -conduit::Node validateCurveSets(ConduitRelayLike &appendTo, - const conduit::Node &appendFrom, - const std::string &endpoint, +conduit::Node validateCurveSets(ConduitRelayLike& appendTo, + const conduit::Node& appendFrom, + const std::string& endpoint, int rec_num, - const std::string &original_file_path) + const std::string& original_file_path) { int baseline = -1; // baseline is shared across dependent and independent conduit::Node msgNode = conduit::Node(conduit::DataType::list()); @@ -647,12 +647,12 @@ conduit::Node validateCurveSets(ConduitRelayLike &appendTo, unsigned int curves_written = 0; unsigned int existing_curves = 0; int unappended_baseline = -1; // Find length of anything we don't append to, for later. - for(const std::string &curve_cat : CURVE_CATEGORIES) + for(const std::string& curve_cat : CURVE_CATEGORIES) { std::string curves_endpoint = endpoint + "/" + curve_cat; std::vector curve_names = relayLikeListChildNames(appendTo, curves_endpoint, rec_num); - for(const std::string &cname : curve_names) + for(const std::string& cname : curve_names) { if(cname == "value" || cname == "tags" || cname == "units") { @@ -681,7 +681,7 @@ conduit::Node validateCurveSets(ConduitRelayLike &appendTo, ": did not append ALL or NO pre-existing curves (causing append element count mismatch)"; } - for(const std::string &curve_cat : CURVE_CATEGORIES) + for(const std::string& curve_cat : CURVE_CATEGORIES) { // Now loop through what we've actually got. Once we find something, use it to set the baseline. if(appendFrom.has_child(curve_cat)) @@ -689,7 +689,7 @@ conduit::Node validateCurveSets(ConduitRelayLike &appendTo, auto curvesIter = appendFrom[curve_cat].children(); while(curvesIter.has_next()) { - const conduit::Node &testCurve = curvesIter.next()["value"]; + const conduit::Node& testCurve = curvesIter.next()["value"]; int post_append_size = testCurve.dtype().number_of_elements(); std::string sub_endpoint = endpoint + "/" + curve_cat + "/" + curvesIter.name() + "/value"; if(relayLikeHasPath(appendTo, sub_endpoint, rec_num)) @@ -716,12 +716,12 @@ conduit::Node validateCurveSets(ConduitRelayLike &appendTo, // Top-level append validation function. Works recursively on library data (hence endpoint) template -conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, - const conduit::Node &appendFrom, - const std::string &endpoint, +conduit::Node validateAppendDocument(ConduitRelayLike& appendTo, + const conduit::Node& appendFrom, + const std::string& endpoint, const int mergeProtocol, const int record_num, - const std::string &original_file_path) + const std::string& original_file_path) { conduit::Node msgNode = conduit::Node(conduit::DataType::list()); // Case one: die if the types disagree. A pingpong_game shouldn't become a billiards_game @@ -741,7 +741,7 @@ conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, if(mergeProtocol == 3) { const std::vector prot3Fields = {"data", "user_defined", "files"}; - for(auto &field : prot3Fields) + for(auto& field : prot3Fields) { if(appendFrom.has_child(field) && relayLikeHasPath(appendTo, endpoint + "/" + field + "/", record_num)) @@ -770,7 +770,7 @@ conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, auto curveSetsIter = appendFrom["curve_sets"].children(); while(curveSetsIter.has_next()) { - const conduit::Node &n = curveSetsIter.next(); + const conduit::Node& n = curveSetsIter.next(); subEndpoint = endpoint + "/curve_sets/" + curveSetsIter.name(); // We only have to validate if the hdf5 already has a curve set with that name. if(relayLikeHasPath(appendTo, subEndpoint, record_num)) @@ -788,7 +788,7 @@ conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, std::string subEndpoint; while(libraryIter.has_next()) { - const conduit::Node &n = libraryIter.next(); + const conduit::Node& n = libraryIter.next(); subEndpoint = endpoint + "/library_data/" + libraryIter.name(); // We only have to validate if the target already has a library with that name. if(relayLikeHasPath(appendTo, subEndpoint, record_num)) @@ -802,7 +802,7 @@ conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, } // Avoiding a terrible if/else chunk in append_recordlike_fields and friends. -AppendFields field_lookup(const std::string &input) +AppendFields field_lookup(const std::string& input) { auto itr = appendFieldStrings.find(input); if(itr != appendFieldStrings.end()) @@ -813,20 +813,20 @@ AppendFields field_lookup(const std::string &input) } template -void append_curveset(ConduitRelayLike &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void append_curveset(ConduitRelayLike& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, int record_num, - const std::string &original_file_path, + const std::string& original_file_path, bool overwriteCurves) { - for(const std::string &curve_cat : CURVE_CATEGORIES) + for(const std::string& curve_cat : CURVE_CATEGORIES) { auto curveIter = appendFrom[curve_cat].children(); while(curveIter.has_next()) { { - conduit::Node &n = curveIter.next(); + conduit::Node& n = curveIter.next(); std::string curve_endpoint = endpoint + "/" + curve_cat + "/" + curveIter.name() + "/value"; if(relayLikeHasPath(appendTo, curve_endpoint, record_num) && !overwriteCurves) { @@ -842,19 +842,19 @@ void append_curveset(ConduitRelayLike &appendTo, } template -void append_recordlike_fields(ConduitRelayLike &appendTo, - conduit::Node &appendFrom, - const std::string &endpoint, +void append_recordlike_fields(ConduitRelayLike& appendTo, + conduit::Node& appendFrom, + const std::string& endpoint, const int mergeProtocol, int record_num, - const std::string &original_file_path, + const std::string& original_file_path, bool isHDF5, bool overwriteCurves) { auto fieldsIter = appendFrom.children(); while(fieldsIter.has_next()) { - conduit::Node &recField = fieldsIter.next(); + conduit::Node& recField = fieldsIter.next(); std::string appendAtEndpoint = endpoint + "/" + fieldsIter.name() + "/"; switch(field_lookup(fieldsIter.name())) { @@ -879,7 +879,7 @@ void append_recordlike_fields(ConduitRelayLike &appendTo, auto subFieldIter = appendFrom[fieldsIter.name()].children(); while(subFieldIter.has_next()) { - conduit::Node &subField = subFieldIter.next(); + conduit::Node& subField = subFieldIter.next(); relayLikeWrite(appendTo, subField, appendAtEndpoint + subFieldIter.name(), record_num); } } @@ -893,7 +893,7 @@ void append_recordlike_fields(ConduitRelayLike &appendTo, auto subFieldIter = appendFrom[fieldsIter.name()].children(); while(subFieldIter.has_next()) { - conduit::Node &subField = subFieldIter.next(); + conduit::Node& subField = subFieldIter.next(); if(!relayLikeHasPath(appendTo, appendAtEndpoint, record_num)) { relayLikeWrite(appendTo, subField, appendAtEndpoint + subFieldIter.name(), record_num); @@ -908,7 +908,7 @@ void append_recordlike_fields(ConduitRelayLike &appendTo, std::string appendAtEndpoint = endpoint + "/library_data/"; while(libraryIter.has_next()) { - conduit::Node &libraryField = libraryIter.next(); + conduit::Node& libraryField = libraryIter.next(); if(relayLikeHasPath(appendTo, appendAtEndpoint + libraryIter.name(), record_num)) { append_recordlike_fields(appendTo, @@ -932,7 +932,7 @@ void append_recordlike_fields(ConduitRelayLike &appendTo, auto curveSetIter = appendFrom[fieldsIter.name()].children(); while(curveSetIter.has_next()) { - conduit::Node &curveSetField = curveSetIter.next(); + conduit::Node& curveSetField = curveSetIter.next(); append_curveset(appendTo, curveSetField, appendAtEndpoint + curveSetIter.name(), @@ -951,7 +951,7 @@ void append_recordlike_fields(ConduitRelayLike &appendTo, } template -void append_relationships(ConduitRelayLike &appendTo, conduit::Node &appendFrom) +void append_relationships(ConduitRelayLike& appendTo, conduit::Node& appendFrom) { // No such thing as an append conflict for a relationship. We just make sure // not to add anything twice. Relationships are typically rare and few. @@ -963,12 +963,12 @@ void append_relationships(ConduitRelayLike &appendTo, conduit::Node &appendFrom) conduit::Node newlyAddedRelationships = conduit::Node(); while(relationshipIter.has_next()) { - conduit::Node ¤tRelationship = relationshipIter.next(); + conduit::Node& currentRelationship = relationshipIter.next(); auto hasRelationshipIter = existingRelationships.children(); bool already_exists = false; while(hasRelationshipIter.has_next()) { - conduit::Node &testRelationship = hasRelationshipIter.next(); + conduit::Node& testRelationship = hasRelationshipIter.next(); std::string subj = currentRelationship.has_path("subject") ? currentRelationship["subject"].as_string() : currentRelationship["local_subject"].as_string(); @@ -1001,12 +1001,12 @@ void append_relationships(ConduitRelayLike &appendTo, conduit::Node &appendFrom) } template -conduit::Node append(ConduitRelayLike &appendTo, - conduit::Node &appendFrom, +conduit::Node append(ConduitRelayLike& appendTo, + conduit::Node& appendFrom, const int mergeProtocol, bool isHDF5, bool skipValidation, - const std::string &original_file_path, + const std::string& original_file_path, bool overwriteCurves) { conduit::Node msgNode = conduit::Node(conduit::DataType::list()); @@ -1020,7 +1020,7 @@ conduit::Node append(ConduitRelayLike &appendTo, auto recordsIter = appendFrom["records"].children(); while(recordsIter.has_next()) { - conduit::Node &n = recordsIter.next(); + conduit::Node& n = recordsIter.next(); std::string target = n.has_child("id") ? "id" : "local_id"; auto rec_num = rec_order.find(n[target].to_string()); // We only validate records we're appending (not just adding). This does mean someone could insert a malformed record, @@ -1054,7 +1054,7 @@ conduit::Node append(ConduitRelayLike &appendTo, } while(recordsIter.has_next()) { - conduit::Node &rec = recordsIter.next(); + conduit::Node& rec = recordsIter.next(); std::string target = rec.has_child("id") ? "id" : "local_id"; // Easiest case, the record doesn't exist yet. Add it. auto rec_num = rec_order.find(rec[target].to_string()); @@ -1080,8 +1080,8 @@ conduit::Node append(ConduitRelayLike &appendTo, return msgNode; } -conduit::Node appendDocumentToJson(const std::string &jsonFilePath, - const Document &newData, +conduit::Node appendDocumentToJson(const std::string& jsonFilePath, + const Document& newData, const int mergeProtocol, const bool skipValidation, const bool overwriteCurves) @@ -1095,8 +1095,8 @@ conduit::Node appendDocumentToJson(const std::string &jsonFilePath, return msgNode; } -conduit::Node appendDocumentToHDF5(const std::string &hdf5FilePath, - const Document &newData, +conduit::Node appendDocumentToHDF5(const std::string& hdf5FilePath, + const Document& newData, const int mergeProtocol, const bool skipValidation, const bool overwriteCurves) @@ -1122,7 +1122,7 @@ conduit::Node appendDocumentToHDF5(const std::string &hdf5FilePath, namespace internal { -Protocol detectOutputProtocol(const std::string &filepath) +Protocol detectOutputProtocol(const std::string& filepath) { std::string ext = axom::utilities::filesystem::getFileExtension(filepath); if(ext.empty()) @@ -1160,7 +1160,7 @@ Protocol detectOutputProtocol(const std::string &filepath) // Enhanced save functions with auto-detection //----------------------------------------------------------------------------- -void saveDocument(const Document &document, const std::string &fileName, Protocol protocol) +void saveDocument(const Document& document, const std::string& fileName, Protocol protocol) { Protocol actualProtocol = protocol; std::string tmpFileName = fileName + SAVE_TMP_FILE_EXTENSION; @@ -1211,7 +1211,7 @@ void saveDocument(const Document &document, const std::string &fileName, Protoco } } -void saveDocument(const Document &document, const std::string &fileName, int protocolInt) +void saveDocument(const Document& document, const std::string& fileName, int protocolInt) { if(protocolInt < -1 || protocolInt > 1) { @@ -1226,8 +1226,8 @@ void saveDocument(const Document &document, const std::string &fileName, int pro // Generic append functions with auto-detection //----------------------------------------------------------------------------- -void appendDocument(const Document &document, - const std::string &filepath, +void appendDocument(const Document& document, + const std::string& filepath, int mergeProtocol, Protocol outputProtocol, const bool overwriteCurves) @@ -1267,8 +1267,8 @@ void appendDocument(const Document &document, } } -void appendDocument(const Document &document, - const std::string &filepath, +void appendDocument(const Document& document, + const std::string& filepath, int mergeProtocol, int outputProtocolInt) { diff --git a/src/axom/sina/core/Document.hpp b/src/axom/sina/core/Document.hpp index 84d57fb5c5..28d83b3292 100644 --- a/src/axom/sina/core/Document.hpp +++ b/src/axom/sina/core/Document.hpp @@ -146,22 +146,22 @@ class Document * Disable copying Document objects. We must do this since we hold * pointers to polymorphic objects. */ - Document(Document const &) = delete; + Document(Document const&) = delete; /** * Disabling copy assignment. */ - Document &operator=(Document const &) = delete; + Document& operator=(Document const&) = delete; /** * Move constructor which should be handled by the compiler. */ - Document(Document &&) = default; + Document(Document&&) = default; /** * Move assignment which should be handled by the compiler. */ - Document &operator=(Document &&) = default; + Document& operator=(Document&&) = default; /** * \brief Create a Document from its Conduit Node representation @@ -170,7 +170,7 @@ class Document * \param recordLoader an RecordLoader to use to load the different * types of records which may be in the document */ - Document(conduit::Node const &asNode, RecordLoader const &recordLoader); + Document(conduit::Node const& asNode, RecordLoader const& recordLoader); /** * \brief Create a Document from a JSON string representation @@ -179,7 +179,7 @@ class Document * \param recordLoader an RecordLoader to use to load the different * types of records which may be in the document */ - Document(std::string const &asJson, RecordLoader const &recordLoader); + Document(std::string const& asJson, RecordLoader const& recordLoader); /** * \brief Add the given record to this document. @@ -193,7 +193,7 @@ class Document * * \return the list of records */ - RecordList const &getRecords() const noexcept { return records; } + RecordList const& getRecords() const noexcept { return records; } /** * \brief Add a relationship to this document @@ -207,7 +207,7 @@ class Document * * \return the list of relationships */ - RelationshipList const &getRelationships() const noexcept { return relationships; } + RelationshipList const& getRelationships() const noexcept { return relationships; } /** * \brief Convert this document to a conduit Node. @@ -225,14 +225,14 @@ class Document * * \return This node with slashes escaped for HDF5. */ - conduit::Node &toHDF5Node(conduit::Node &writeTo) const; + conduit::Node& toHDF5Node(conduit::Node& writeTo) const; /** * \brief Dump this document as an HDF5 File * * \param filename the location of which to save the file */ - void toHDF5(const std::string &filename) const; + void toHDF5(const std::string& filename) const; #endif /** @@ -242,8 +242,8 @@ class Document */ std::string toJson(conduit::index_t indent = 0, conduit::index_t depth = 0, - const std::string &pad = "", - const std::string &eoe = "") const; + const std::string& pad = "", + const std::string& eoe = "") const; /** * \brief Get the list of file types currently supported by the implementation. @@ -256,7 +256,7 @@ class Document /** * Constructor helper method, extracts info from a conduit Node. */ - void createFromNode(conduit::Node const &asNode, RecordLoader const &recordLoader); + void createFromNode(conduit::Node const& asNode, RecordLoader const& recordLoader); RecordList records; RelationshipList relationships; }; @@ -271,8 +271,8 @@ class Document * \throws std::ios::failure if there are any IO errors * std::invalid_argument if the protocol given is an undefined, optional protocol */ -void saveDocument(Document const &document, - std::string const &fileName, +void saveDocument(Document const& document, + std::string const& fileName, Protocol protocol = Protocol::AUTO_DETECT); /** @@ -286,7 +286,7 @@ inline std::string getSinaFileFormatVersion() std::to_string(SINA_FILE_FORMAT_VERSION_MINOR); } -void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNode); +void restoreSlashes(const conduit::Node& modifiedNode, conduit::Node& restoredNode); /** * \brief Load a document from the given path. Only records which this library @@ -296,7 +296,7 @@ void restoreSlashes(const conduit::Node &modifiedNode, conduit::Node &restoredNo * \param protocol the type of file being loaded, default = JSON * \return the loaded Document */ -Document loadDocument(std::string const &path, Protocol protocol = Protocol::JSON); +Document loadDocument(std::string const& path, Protocol protocol = Protocol::JSON); /** * \brief Load a document from the given path. @@ -308,8 +308,8 @@ Document loadDocument(std::string const &path, Protocol protocol = Protocol::JSO * \throws std::invalid_argument if the protocol given is an undefined, optional protocol * \return the loaded Document */ -Document loadDocument(std::string const &path, - RecordLoader const &recordLoader, +Document loadDocument(std::string const& path, + RecordLoader const& recordLoader, Protocol protocol = Protocol::JSON); /** @@ -331,8 +331,8 @@ Document loadDocument(std::string const &path, * * \return a conduit Node containing a list of any errors encountered in appending. If empty, success. */ -conduit::Node appendDocumentToJson(const std::string &jsonFilePath, - const Document &newData, +conduit::Node appendDocumentToJson(const std::string& jsonFilePath, + const Document& newData, const int mergeProtocol = 1, const bool skipValidation = false, const bool overwriteCurves = false); @@ -368,8 +368,8 @@ conduit::Node appendDocumentToJson(const std::string &jsonFilePath, * * \return a conduit Node containing a list of any errors encountered in appending. If empty, success! */ -conduit::Node appendDocumentToHDF5(const std::string &hdf5FilePath, - Document const &newData, +conduit::Node appendDocumentToHDF5(const std::string& hdf5FilePath, + Document const& newData, const int mergeProtocol = 1, const bool skipValidation = false, const bool overwriteCurves = false); @@ -389,8 +389,8 @@ conduit::Node appendDocumentToHDF5(const std::string &hdf5FilePath, * can't change on overwrite, don't use ints for floats etc. * \throws std::runtime_error If the file cannot be opened or the format is unsupported */ -void appendDocument(const Document &document, - const std::string &filepath, +void appendDocument(const Document& document, + const std::string& filepath, int mergeProtocol = 1, Protocol Protocol = Protocol::AUTO_DETECT, const bool overwriteCurves = false); @@ -409,13 +409,13 @@ void appendDocument(const Document &document, * \return a conduit Node containing a list of any errors encountered in appending. If empty, success. */ template -conduit::Node validateAppendDocument(ConduitRelayLike &appendTo, - const conduit::Node &appendFrom, - const std::string &endpoint, +conduit::Node validateAppendDocument(ConduitRelayLike& appendTo, + const conduit::Node& appendFrom, + const std::string& endpoint, const int mergeProtocol, int record_num, // default'd because it might go away with a conduit update - const std::string &original_file_path = ""); + const std::string& original_file_path = ""); } // namespace sina } // namespace axom diff --git a/src/axom/sina/core/File.cpp b/src/axom/sina/core/File.cpp index 518cf03ab4..fa79724e32 100644 --- a/src/axom/sina/core/File.cpp +++ b/src/axom/sina/core/File.cpp @@ -37,7 +37,7 @@ char const TAGS_KEY[] = "tags"; File::File(std::string uri_) : uri {std::move(uri_)} { } -File::File(std::string uri_, conduit::Node const &asNode) +File::File(std::string uri_, conduit::Node const& asNode) : uri {std::move(uri_)} , mimeType {getOptionalString(MIMETYPE_KEY, asNode, FILE_TYPE_NAME)} { @@ -46,7 +46,7 @@ File::File(std::string uri_, conduit::Node const &asNode) auto tagsIter = asNode[TAGS_KEY].children(); while(tagsIter.has_next()) { - auto &tag = tagsIter.next(); + auto& tag = tagsIter.next(); if(tag.dtype().is_string()) tags.emplace_back(tag.as_string()); else diff --git a/src/axom/sina/core/File.hpp b/src/axom/sina/core/File.hpp index fd1c8f53fb..f6d5060716 100644 --- a/src/axom/sina/core/File.hpp +++ b/src/axom/sina/core/File.hpp @@ -58,28 +58,28 @@ class File * \param uri the uri for a file * \param asNode the Node representation of the file's additional info */ - File(std::string uri, conduit::Node const &asNode); + File(std::string uri, conduit::Node const& asNode); /** * \brief Get the File's URI. * * \return the URI */ - std::string const &getUri() const noexcept { return uri; } + std::string const& getUri() const noexcept { return uri; } /** * \brief Get the File's MIME type. * * \return the MIME type */ - std::string const &getMimeType() const noexcept { return mimeType; } + std::string const& getMimeType() const noexcept { return mimeType; } /** * \brief Get the File's tags. * * \return the tags */ - std::vector const &getTags() const noexcept { return tags; } + std::vector const& getTags() const noexcept { return tags; } /** * \brief Set the File's MIME type. diff --git a/src/axom/sina/core/ID.cpp b/src/axom/sina/core/ID.cpp index 9c7be8ca4e..6d862ea29d 100644 --- a/src/axom/sina/core/ID.cpp +++ b/src/axom/sina/core/ID.cpp @@ -39,9 +39,9 @@ namespace * @param globalName the global variant of the ID field * @return the ID from the object */ -ID extractIDFromObject(conduit::Node const &parentObject, - std::string const &localName, - std::string const &globalName) +ID extractIDFromObject(conduit::Node const& parentObject, + std::string const& localName, + std::string const& globalName) { if(parentObject.has_child(globalName)) { @@ -63,16 +63,16 @@ IDField::IDField(ID value_, std::string localName_, std::string globalName_) , globalName {std::move(globalName_)} { } -IDField::IDField(conduit::Node const &parentObject, std::string localName_, std::string globalName_) +IDField::IDField(conduit::Node const& parentObject, std::string localName_, std::string globalName_) : value(extractIDFromObject(parentObject, localName_, globalName_)) { std::swap(localName, localName_); std::swap(globalName, globalName_); } -void IDField::addTo(conduit::Node &object) const +void IDField::addTo(conduit::Node& object) const { - auto &key = value.getType() == IDType::Global ? globalName : localName; + auto& key = value.getType() == IDType::Global ? globalName : localName; object[key] = value.getId(); } diff --git a/src/axom/sina/core/ID.hpp b/src/axom/sina/core/ID.hpp index 20aa864b2a..342a0d00cc 100644 --- a/src/axom/sina/core/ID.hpp +++ b/src/axom/sina/core/ID.hpp @@ -61,7 +61,7 @@ class ID * * \return the actual ID */ - std::string const &getId() const noexcept { return id; } + std::string const& getId() const noexcept { return id; } /** * \brief Get the type of the ID. @@ -106,35 +106,35 @@ class IDField * \param localName the local name of the field * \param globalName the global name of the field */ - IDField(conduit::Node const &parentObject, std::string localName, std::string globalName); + IDField(conduit::Node const& parentObject, std::string localName, std::string globalName); /** * \brief Get the value of this field. * * \return the ID describing the field's value */ - ID const &getID() const noexcept { return value; } + ID const& getID() const noexcept { return value; } /** * \brief Get the name to use for this field when the ID is local. * * \return the name of the local ID field */ - std::string const &getLocalName() const noexcept { return localName; } + std::string const& getLocalName() const noexcept { return localName; } /** * \brief Get the name to use for this field when the ID is global. * * \return the name of the global ID field */ - std::string const &getGlobalName() const noexcept { return globalName; } + std::string const& getGlobalName() const noexcept { return globalName; } /** * \brief Add this field to the given Node. * * \param object the Node to which to add the field */ - void addTo(conduit::Node &object) const; + void addTo(conduit::Node& object) const; private: ID value; diff --git a/src/axom/sina/core/Record.cpp b/src/axom/sina/core/Record.cpp index 252b33872c..b0d8b7eb6b 100644 --- a/src/axom/sina/core/Record.cpp +++ b/src/axom/sina/core/Record.cpp @@ -75,9 +75,9 @@ conduit::Node Record::toNode(CurveSet::CurveOrder curveOrder) const if(!files.empty()) { conduit::Node fileRef; - for(auto &file : files) + for(auto& file : files) { - auto &n = fileRef.add_child(file.getUri()); + auto& n = fileRef.add_child(file.getUri()); n.set(file.toNode()); asNode[FILES_FIELD] = fileRef; } @@ -87,7 +87,7 @@ conduit::Node Record::toNode(CurveSet::CurveOrder curveOrder) const conduit::Node Record::toNode() const { return toNode(getDefaultCurveOrder()); } -Record::Record(conduit::Node const &asNode) +Record::Record(conduit::Node const& asNode) : DataHolder {asNode} , id {asNode, LOCAL_ID_FIELD, GLOBAL_ID_FIELD} , type {getRequiredString(TYPE_FIELD, asNode, "record")} @@ -97,13 +97,13 @@ Record::Record(conduit::Node const &asNode) auto filesIter = asNode[FILES_FIELD].children(); while(filesIter.has_next()) { - auto &namedFile = filesIter.next(); + auto& namedFile = filesIter.next(); files.insert(File(filesIter.name(), namedFile)); } } } -void Record::remove(File const &file) { files.erase(file); } +void Record::remove(File const& file) { files.erase(file); } void Record::add(File file) { @@ -111,11 +111,11 @@ void Record::add(File file) files.insert(std::move(file)); } -void Record::addRecordAsLibraryData(Record const &childRecord, std::string const &name) +void Record::addRecordAsLibraryData(Record const& childRecord, std::string const& name) { if(!childRecord.files.empty()) { - for(auto &file : childRecord.files) + for(auto& file : childRecord.files) { add(file); } @@ -129,12 +129,12 @@ void Record::addRecordAsLibraryData(Record const &childRecord, std::string const newLibData->add(LIBRARY_DATA_TYPE_DATUM, Datum {childRecord.type}); } -void RecordLoader::addTypeLoader(std::string const &type, TypeLoader loader) +void RecordLoader::addTypeLoader(std::string const& type, TypeLoader loader) { typeLoaders[type] = std::move(loader); } -std::unique_ptr RecordLoader::load(conduit::Node const &recordAsNode) const +std::unique_ptr RecordLoader::load(conduit::Node const& recordAsNode) const { auto loaderIter = typeLoaders.find(recordAsNode[TYPE_FIELD].as_string()); if(loaderIter != typeLoaders.end()) @@ -144,7 +144,7 @@ std::unique_ptr RecordLoader::load(conduit::Node const &recordAsNode) co return std::make_unique(recordAsNode); } -bool RecordLoader::canLoad(std::string const &type) const { return typeLoaders.count(type) > 0; } +bool RecordLoader::canLoad(std::string const& type) const { return typeLoaders.count(type) > 0; } RecordLoader createRecordLoaderWithAllKnownTypes() { diff --git a/src/axom/sina/core/Record.hpp b/src/axom/sina/core/Record.hpp index 1511eb7e1e..a907c66494 100644 --- a/src/axom/sina/core/Record.hpp +++ b/src/axom/sina/core/Record.hpp @@ -43,7 +43,7 @@ namespace sina */ struct FileEqualByURI { - bool operator()(const File &file1, const File &file2) const + bool operator()(const File& file1, const File& file2) const { return file1.getUri() == file2.getUri(); } @@ -55,7 +55,7 @@ struct FileEqualByURI */ struct FileHashByURI { - size_t operator()(const File &file) const { return std::hash()(file.getUri()); } + size_t operator()(const File& file) const { return std::hash()(file.getUri()); } }; /** @@ -126,38 +126,38 @@ class Record : public DataHolder * * \param asNode the Record as a Node */ - explicit Record(conduit::Node const &asNode); + explicit Record(conduit::Node const& asNode); /** * Disable the copy constructor. */ - Record(Record const &) = delete; + Record(Record const&) = delete; /** * Disable copy assignment. */ - Record &operator=(Record const &) = delete; + Record& operator=(Record const&) = delete; /** * \brief Get the Record's ID. * * \return the ID */ - ID const &getId() const noexcept { return id.getID(); } + ID const& getId() const noexcept { return id.getID(); } /** * \brief Get the Record's type. * * \return the Record's type */ - std::string const &getType() const noexcept { return type; } + std::string const& getType() const noexcept { return type; } /** * \brief Remove a File from this record. * * \param file the File to remove */ - void remove(File const &file); + void remove(File const& file); using DataHolder::add; /** @@ -172,7 +172,7 @@ class Record : public DataHolder * * \return the record's files */ - FileSet const &getFiles() const noexcept { return files; } + FileSet const& getFiles() const noexcept { return files; } /** * \brief Convert this record to its conduit Node representation. @@ -198,7 +198,7 @@ class Record : public DataHolder * * \param name The host code's name for the library */ - void addRecordAsLibraryData(Record const &childRecord, std::string const &name); + void addRecordAsLibraryData(Record const& childRecord, std::string const& name); private: internal::IDField id; @@ -227,7 +227,7 @@ class RecordLoader * A TypeLoader is a function which converts records of a specific type * to their corresponding sub classes. */ - using TypeLoader = std::function(conduit::Node const &)>; + using TypeLoader = std::function(conduit::Node const&)>; /** * \brief Add a function for loading records of the specified type. @@ -235,7 +235,7 @@ class RecordLoader * \param type the type of records this function can load * \param loader the function which can load the records */ - void addTypeLoader(std::string const &type, TypeLoader loader); + void addTypeLoader(std::string const& type, TypeLoader loader); /** * \brief Load a Record from its conduit Node representation. @@ -243,7 +243,7 @@ class RecordLoader * \param recordAsNode the Record as a Node * \return the Record */ - std::unique_ptr load(conduit::Node const &recordAsNode) const; + std::unique_ptr load(conduit::Node const& recordAsNode) const; /** * \brief Check whether this loader can load records of the given type. @@ -251,7 +251,7 @@ class RecordLoader * \param type the type of the records to check * \return whether records of the given type can be loaded */ - bool canLoad(std::string const &type) const; + bool canLoad(std::string const& type) const; private: std::unordered_map typeLoaders; diff --git a/src/axom/sina/core/Relationship.cpp b/src/axom/sina/core/Relationship.cpp index ae0ff91202..68ba6765b4 100644 --- a/src/axom/sina/core/Relationship.cpp +++ b/src/axom/sina/core/Relationship.cpp @@ -40,7 +40,7 @@ Relationship::Relationship(ID subject_, std::string predicate_, ID object_) , predicate {std::move(predicate_)} { } -Relationship::Relationship(conduit::Node const &asNode) +Relationship::Relationship(conduit::Node const& asNode) : subject {asNode, LOCAL_SUBJECT_KEY, GLOBAL_SUBJECT_KEY} , object {asNode, LOCAL_OBJECT_KEY, GLOBAL_OBJECT_KEY} , predicate {getRequiredString(PREDICATE_KEY, asNode, "Relationship")} diff --git a/src/axom/sina/core/Relationship.hpp b/src/axom/sina/core/Relationship.hpp index f8bc21558b..5b6da089ec 100644 --- a/src/axom/sina/core/Relationship.hpp +++ b/src/axom/sina/core/Relationship.hpp @@ -98,28 +98,28 @@ class Relationship * * \param asNode the relationship as a Node */ - explicit Relationship(conduit::Node const &asNode); + explicit Relationship(conduit::Node const& asNode); /** * \brief Get the subject. * * \return the subject */ - ID const &getSubject() const noexcept { return subject.getID(); } + ID const& getSubject() const noexcept { return subject.getID(); } /** * \brief Get the object. * * \return the object */ - ID const &getObject() const noexcept { return object.getID(); } + ID const& getObject() const noexcept { return object.getID(); } /** * \brief Get the predicate. * * \return the predicate */ - std::string const &getPredicate() const noexcept { return predicate; } + std::string const& getPredicate() const noexcept { return predicate; } /** * \brief Convert this Relationship to its Node representation. diff --git a/src/axom/sina/core/Run.cpp b/src/axom/sina/core/Run.cpp index 1bb4e8ad2e..423fba201a 100644 --- a/src/axom/sina/core/Run.cpp +++ b/src/axom/sina/core/Run.cpp @@ -42,7 +42,7 @@ Run::Run(sina::ID id, std::string application_, std::string version_, std::strin , user {std::move(user_)} { } -Run::Run(conduit::Node const &asNode) +Run::Run(conduit::Node const& asNode) : Record(asNode) , application {getRequiredString(APPLICATION_FIELD, asNode, RUN_TYPE)} , version {getOptionalString(VERSION_FIELD, asNode, RUN_TYPE)} @@ -60,10 +60,10 @@ conduit::Node Run::toNode(CurveSet::CurveOrder curveOrder) const conduit::Node Run::toNode() const { return toNode(getDefaultCurveOrder()); } -void addRunLoader(RecordLoader &loader) +void addRunLoader(RecordLoader& loader) { loader.addTypeLoader(RUN_TYPE, - [](conduit::Node const &value) { return std::make_unique(value); }); + [](conduit::Node const& value) { return std::make_unique(value); }); } } // namespace sina diff --git a/src/axom/sina/core/Run.hpp b/src/axom/sina/core/Run.hpp index a4a842f442..f755d9e4c1 100644 --- a/src/axom/sina/core/Run.hpp +++ b/src/axom/sina/core/Run.hpp @@ -61,28 +61,28 @@ class Run : public Record * * \param asNode the run as a Node */ - explicit Run(conduit::Node const &asNode); + explicit Run(conduit::Node const& asNode); /** * \brief Get the application that was run. * * \return the application's name */ - std::string const &getApplication() const { return application; } + std::string const& getApplication() const { return application; } /** * \brief Get the version of the application that was run. * * \return the application's version */ - std::string const &getVersion() const { return version; } + std::string const& getVersion() const { return version; } /** * \brief Get the name of the user who ran the application. * * \return the user's name */ - std::string const &getUser() const { return user; } + std::string const& getUser() const { return user; } conduit::Node toNode(CurveSet::CurveOrder curveOrder) const override; conduit::Node toNode() const; @@ -99,7 +99,7 @@ class Run : public Record * \param loader the RecordLoader to which to add the function for loading * Run instances. */ -void addRunLoader(RecordLoader &loader); +void addRunLoader(RecordLoader& loader); } // namespace sina } // namespace axom diff --git a/src/axom/sina/examples/sina_curve_set.cpp b/src/axom/sina/examples/sina_curve_set.cpp index f390e1a320..917b5f375d 100644 --- a/src/axom/sina/examples/sina_curve_set.cpp +++ b/src/axom/sina/examples/sina_curve_set.cpp @@ -65,7 +65,7 @@ BounceData generateBounceData(double initialY, return data; } -void addCurveSet(axom::sina::Record &record, BounceData bounceData, std::string curveName) +void addCurveSet(axom::sina::Record& record, BounceData bounceData, std::string curveName) { // Create the curve set object axom::sina::CurveSet bounceCurveSet {curveName}; diff --git a/src/axom/sina/examples/sina_query_records_relationships.cpp b/src/axom/sina/examples/sina_query_records_relationships.cpp index 330246a860..ce1e955027 100644 --- a/src/axom/sina/examples/sina_query_records_relationships.cpp +++ b/src/axom/sina/examples/sina_query_records_relationships.cpp @@ -36,8 +36,8 @@ int main(void) document.add(relationship); // Query for a list of records and relationships - auto &records = document.getRecords(); - auto &relationships = document.getRelationships(); + auto& records = document.getRecords(); + auto& relationships = document.getRelationships(); SLIC_ASSERT_MSG(records.size() == 2, "Unexpected number of records found."); std::cout << "Number of Records: " << records.size() << std::endl; diff --git a/src/axom/sina/examples/sina_tutorial.cpp b/src/axom/sina/examples/sina_tutorial.cpp index aa7d80698b..956b04a59b 100644 --- a/src/axom/sina/examples/sina_tutorial.cpp +++ b/src/axom/sina/examples/sina_tutorial.cpp @@ -38,7 +38,7 @@ void createRun() //! [end create run] //! [begin adding data] -void addData(axom::sina::Record &record) +void addData(axom::sina::Record& record) { // Add a scalar named "my_scalar" with the value 123.456 record.add("my_scalar", axom::sina::Datum {123.456}); @@ -57,7 +57,7 @@ void addData(axom::sina::Record &record) //! [end adding data] //! [begin curve sets] -void addCurveSets(axom::sina::Record &record) +void addCurveSets(axom::sina::Record& record) { axom::sina::CurveSet timePlots {"time_plots"}; @@ -76,7 +76,7 @@ void addCurveSets(axom::sina::Record &record) //! [end curve sets] //! [begin file add_and_remove] -void addAndRemoveFileToRecord(axom::sina::Record &run) +void addAndRemoveFileToRecord(axom::sina::Record& run) { axom::sina::File my_file {"some/path.txt"}; // Adds the file to the record's file list @@ -87,16 +87,16 @@ void addAndRemoveFileToRecord(axom::sina::Record &run) //! [end file add_and_remove] //! [begin relationships] -void associateRunToStudy(axom::sina::Document &doc, - axom::sina::Record const &uqStudy, - axom::sina::Record const &run) +void associateRunToStudy(axom::sina::Document& doc, + axom::sina::Record const& uqStudy, + axom::sina::Record const& run) { doc.add(axom::sina::Relationship {uqStudy.getId(), "contains", run.getId()}); } //! [end relationships] //! [begin library data foo] -void foo_collectData(axom::sina::DataHolder &fooData) +void foo_collectData(axom::sina::DataHolder& fooData) { fooData.add("temperature", axom::sina::Datum {500}); fooData.add("energy", axom::sina::Datum {1.2e10}); @@ -104,7 +104,7 @@ void foo_collectData(axom::sina::DataHolder &fooData) //! [end library data foo] //! [begin library data bar] -void bar_gatherData(axom::sina::DataHolder &barData) +void bar_gatherData(axom::sina::DataHolder& barData) { barData.add("temperature", axom::sina::Datum {400}); barData.add("mass", axom::sina::Datum {15}); @@ -112,7 +112,7 @@ void bar_gatherData(axom::sina::DataHolder &barData) //! [end library data bar] //! [begin library data host] -void gatherAllData(axom::sina::Record &record) +void gatherAllData(axom::sina::Record& record) { auto fooData = record.addLibraryData("foo"); auto barData = record.addLibraryData("bar"); @@ -125,7 +125,7 @@ void gatherAllData(axom::sina::Record &record) //! [end library data host] //! [begin io write] -void save(axom::sina::Document const &doc) +void save(axom::sina::Document const& doc) { axom::sina::saveDocument(doc, "my_output.json"); #ifdef AXOM_USE_HDF5 @@ -146,9 +146,9 @@ void load() //! [end io read] //! [begin user defined] -void addUserDefined(axom::sina::Record &record) +void addUserDefined(axom::sina::Record& record) { - conduit::Node &userDefined = record.getUserDefinedContent(); + conduit::Node& userDefined = record.getUserDefinedContent(); userDefined["var_1"] = "a"; userDefined["var_2"] = "b"; diff --git a/src/axom/sina/interface/sina_fortran_interface.cpp b/src/axom/sina/interface/sina_fortran_interface.cpp index 93c9695a21..ce6b221ff2 100644 --- a/src/axom/sina/interface/sina_fortran_interface.cpp +++ b/src/axom/sina/interface/sina_fortran_interface.cpp @@ -14,7 +14,7 @@ #include std::vector> sinaRecordsList; -axom::sina::Document *sina_document; +axom::sina::Document* sina_document; char default_record_type[25] = "fortran_code_output"; // Helper function to check if modifications are allowed @@ -29,7 +29,7 @@ inline bool can_modify_records() return true; } // Helper function to clean Fortran strings -inline std::string fortran_to_cpp_string(const char *str, int str_len) +inline std::string fortran_to_cpp_string(const char* str, int str_len) { if(!str || str_len <= 0) return ""; @@ -48,14 +48,14 @@ inline std::string fortran_to_cpp_string(const char *str, int str_len) return std::string(str, actual_len); } -extern "C" void sina_set_default_record_type_(char *record_type) +extern "C" void sina_set_default_record_type_(char* record_type) { strcpy(default_record_type, record_type); } -extern "C" char *Get_File_Extension(char *input_fn) +extern "C" char* Get_File_Extension(char* input_fn) { - char *ext = strrchr(input_fn, '.'); + char* ext = strrchr(input_fn, '.'); if(!ext) { return (new char[1] {'\0'}); @@ -63,7 +63,7 @@ extern "C" char *Get_File_Extension(char *input_fn) return (ext + 1); } -extern "C" void sina_create_record_(char *recID, char *recType, int recId_length, int recType_length) +extern "C" void sina_create_record_(char* recID, char* recType, int recId_length, int recType_length) { if(!can_modify_records()) return; @@ -84,19 +84,19 @@ extern "C" void sina_create_record_(char *recID, char *recType, int recId_length sinaRecordsList.emplace_back(std::make_unique(id, type_str)); } -extern "C" axom::sina::Record *Sina_Get_Record(char *recId = NULL) +extern "C" axom::sina::Record* Sina_Get_Record(char* recId = NULL) { if(recId == NULL || recId[0] == '\0') { - std::unique_ptr const &myRecord = sinaRecordsList.front(); + std::unique_ptr const& myRecord = sinaRecordsList.front(); return myRecord.get(); } else { axom::sina::ID id {recId, axom::sina::IDType::Global}; - for(const std::unique_ptr &myRecord : sinaRecordsList) + for(const std::unique_ptr& myRecord : sinaRecordsList) { - const char *current_id_str = myRecord->getId().getId().c_str(); + const char* current_id_str = myRecord->getId().getId().c_str(); // Compare the input C-string (recId) with the current record's C-string ID if(strcmp(recId, current_id_str) == 0) { @@ -111,11 +111,11 @@ extern "C" axom::sina::Record *Sina_Get_Record(char *recId = NULL) return nullptr; } -extern "C" void sina_add_logical_(char *key, - bool *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_logical_(char* key, + bool* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -124,7 +124,7 @@ extern "C" void sina_add_logical_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); @@ -146,11 +146,11 @@ extern "C" void sina_add_logical_(char *key, sina_record->add(key_name, datum); } -extern "C" void sina_add_long_(char *key, - long long int *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_long_(char* key, + long long int* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -159,7 +159,7 @@ extern "C" void sina_add_long_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); axom::sina::Datum datum {static_cast(*value)}; @@ -179,11 +179,11 @@ extern "C" void sina_add_long_(char *key, sina_record->add(key_name, datum); } -extern "C" void sina_add_int_(char *key, - int *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_int_(char* key, + int* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -192,7 +192,7 @@ extern "C" void sina_add_int_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); axom::sina::Datum datum {static_cast(*value)}; @@ -212,11 +212,11 @@ extern "C" void sina_add_int_(char *key, sina_record->add(key_name, datum); } -extern "C" void sina_add_double_(char *key, - double *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_double_(char* key, + double* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -225,7 +225,7 @@ extern "C" void sina_add_double_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); axom::sina::Datum datum {*value}; @@ -245,11 +245,11 @@ extern "C" void sina_add_double_(char *key, sina_record->add(key_name, datum); } -extern "C" void sina_add_float_(char *key, - float *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_float_(char* key, + float* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -258,7 +258,7 @@ extern "C" void sina_add_float_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); axom::sina::Datum datum {*value}; @@ -279,11 +279,11 @@ extern "C" void sina_add_float_(char *key, } // Fix for sina_add_string_ - remove value_len parameter since it's not in the header -extern "C" void sina_add_string_(char *key, - char *value, - char *units, - char *tags, - char *recId, +extern "C" void sina_add_string_(char* key, + char* value, + char* units, + char* tags, + char* recId, int key_len, int units_len, int tags_len, @@ -295,7 +295,7 @@ extern "C" void sina_add_string_(char *key, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string key_name = fortran_to_cpp_string(key, key_len); // Since we don't have value_len, we need to figure out the length @@ -321,9 +321,9 @@ extern "C" void sina_add_string_(char *key, } // Fix for sina_add_file_ - cast to non-const char* -extern "C" void sina_add_file_(char *filename, - char *mime_type, - char *recId, +extern "C" void sina_add_file_(char* filename, + char* mime_type, + char* recId, int file_len, int mime_len, int recId_len) @@ -331,7 +331,7 @@ extern "C" void sina_add_file_(char *filename, if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); std::string filename_str = fortran_to_cpp_string(filename, file_len); std::string mime_type_str = fortran_to_cpp_string(mime_type, mime_len); @@ -346,7 +346,7 @@ extern "C" void sina_add_file_(char *filename, } else { - std::string ext = Get_File_Extension(const_cast(filename_str.c_str())); + std::string ext = Get_File_Extension(const_cast(filename_str.c_str())); my_file.setMimeType(ext); } @@ -356,10 +356,10 @@ extern "C" void sina_add_file_(char *filename, } } -extern "C" void sina_write_document_all_args_(char *input_fn, - int *protocol, - int *preserve, - int *mergeProtocol) +extern "C" void sina_write_document_all_args_(char* input_fn, + int* protocol, + int* preserve, + int* mergeProtocol) { // Create the document if needed if(sina_document == nullptr) @@ -367,7 +367,7 @@ extern "C" void sina_write_document_all_args_(char *input_fn, sina_document = new axom::sina::Document(); // Move all records into the document - for(auto &uniquePtr : sinaRecordsList) + for(auto& uniquePtr : sinaRecordsList) { if(uniquePtr) { @@ -393,7 +393,7 @@ extern "C" void sina_write_document_all_args_(char *input_fn, } } -extern "C" void sina_write_document_noprotocol_nopreserve_nomerge_(char *input_fn) +extern "C" void sina_write_document_noprotocol_nopreserve_nomerge_(char* input_fn) { int default_protocol = static_cast(axom::sina::Protocol::AUTO_DETECT); int default_merge_protocol = 0; @@ -402,7 +402,7 @@ extern "C" void sina_write_document_noprotocol_nopreserve_nomerge_(char *input_f sina_write_document_all_args_(input_fn, &default_protocol, &default_preserve, &default_merge_protocol); } -extern "C" void sina_write_document_protocol_nopreserve_nomerge_(char *input_fn, int *protocol) +extern "C" void sina_write_document_protocol_nopreserve_nomerge_(char* input_fn, int* protocol) { int default_merge_protocol = 0; int default_preserve = 0; @@ -410,23 +410,23 @@ extern "C" void sina_write_document_protocol_nopreserve_nomerge_(char *input_fn, sina_write_document_all_args_(input_fn, protocol, &default_preserve, &default_merge_protocol); } -extern "C" void sina_write_document_protocol_preserve_nomerge_(char *input_fn, - int *protocol, - int *preserve) +extern "C" void sina_write_document_protocol_preserve_nomerge_(char* input_fn, + int* protocol, + int* preserve) { int default_merge_protocol = 0; sina_write_document_all_args_(input_fn, protocol, preserve, &default_merge_protocol); } -extern "C" void sina_add_curveset_(char *name, char *recId, int name_len, int recId_len) +extern "C" void sina_add_curveset_(char* name, char* recId, int name_len, int recId_len) { if(!can_modify_records()) return; std::string recId_str = fortran_to_cpp_string(recId, recId_len); std::string name_str = fortran_to_cpp_string(name, name_len); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); if(sina_record) { axom::sina::CurveSet cs {name_str}; @@ -434,24 +434,24 @@ extern "C" void sina_add_curveset_(char *name, char *recId, int name_len, int re } } -extern "C" void sina_add_curve_double_(char *curveset_name, - char *curve_name, - double *values, - int *n, - int *independent, - char *recId) +extern "C" void sina_add_curve_double_(char* curveset_name, + char* curve_name, + double* values, + int* n, + int* independent, + char* recId) { if(!can_modify_records()) return; std::string recId_str(recId); std::string curveset_str(curveset_name); std::string curvename_str(curve_name); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); if(sina_record) { axom::sina::Curve curve {curvename_str, values, static_cast(*n)}; - auto &curvesets = sina_record->getCurveSets(); + auto& curvesets = sina_record->getCurveSets(); if(curvesets.find(curveset_str) == curvesets.end()) { // Create curveset directly @@ -483,12 +483,12 @@ extern "C" void sina_add_curve_double_(char *curveset_name, } } -extern "C" void sina_add_curve_float_(char *curveset_name, - char *curve_name, - float *values, - int *n, - int *independent, - char *recId) +extern "C" void sina_add_curve_float_(char* curveset_name, + char* curve_name, + float* values, + int* n, + int* independent, + char* recId) { if(!can_modify_records()) return; @@ -496,7 +496,7 @@ extern "C" void sina_add_curve_float_(char *curveset_name, std::string curveset_str(curveset_name); std::string curvename_str(curve_name); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); if(sina_record) { std::vector y(*n); @@ -506,7 +506,7 @@ extern "C" void sina_add_curve_float_(char *curveset_name, } axom::sina::Curve curve {curvename_str, y}; - auto &curvesets = sina_record->getCurveSets(); + auto& curvesets = sina_record->getCurveSets(); if(curvesets.find(curveset_str) == curvesets.end()) { // Create curveset directly @@ -538,12 +538,12 @@ extern "C" void sina_add_curve_float_(char *curveset_name, } } -extern "C" void sina_add_curve_int_(char *curveset_name, - char *curve_name, - int *values, - int *n, - int *independent, - char *recId) +extern "C" void sina_add_curve_int_(char* curveset_name, + char* curve_name, + int* values, + int* n, + int* independent, + char* recId) { if(!can_modify_records()) return; @@ -551,7 +551,7 @@ extern "C" void sina_add_curve_int_(char *curveset_name, std::string curveset_str(curveset_name); std::string curvename_str(curve_name); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); if(sina_record) { std::vector y(*n); @@ -561,7 +561,7 @@ extern "C" void sina_add_curve_int_(char *curveset_name, } axom::sina::Curve curve {curvename_str, y}; - auto &curvesets = sina_record->getCurveSets(); + auto& curvesets = sina_record->getCurveSets(); if(curvesets.find(curveset_str) == curvesets.end()) { // Create curveset directly @@ -593,12 +593,12 @@ extern "C" void sina_add_curve_int_(char *curveset_name, } } -extern "C" void sina_add_curve_long_(char *curveset_name, - char *curve_name, - long long int *values, - int *n, - int *independent, - char *recId) +extern "C" void sina_add_curve_long_(char* curveset_name, + char* curve_name, + long long int* values, + int* n, + int* independent, + char* recId) { if(!can_modify_records()) return; @@ -606,7 +606,7 @@ extern "C" void sina_add_curve_long_(char *curveset_name, std::string curveset_str(curveset_name); std::string curvename_str(curve_name); - axom::sina::Record *sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); + axom::sina::Record* sina_record = Sina_Get_Record(const_cast(recId_str.c_str())); if(sina_record) { std::vector y(*n); @@ -616,7 +616,7 @@ extern "C" void sina_add_curve_long_(char *curveset_name, } axom::sina::Curve curve {curvename_str, y}; - auto &curvesets = sina_record->getCurveSets(); + auto& curvesets = sina_record->getCurveSets(); if(curvesets.find(curveset_str) == curvesets.end()) { // Create curveset directly @@ -652,7 +652,7 @@ extern "C" void sina_add_curve_long_(char *curveset_name, // Curve Ordering Functions //============================================================================= -extern "C" void sina_set_curves_order_(int *curve_order) +extern "C" void sina_set_curves_order_(int* curve_order) { axom::sina::CurveSet::CurveOrder order; switch(*curve_order) @@ -677,9 +677,9 @@ extern "C" void sina_set_curves_order_(int *curve_order) return; } -extern "C" void sina_set_record_curves_order_(char *recId, int *curve_order) +extern "C" void sina_set_record_curves_order_(char* recId, int* curve_order) { - axom::sina::Record *sina_record = Sina_Get_Record(recId); + axom::sina::Record* sina_record = Sina_Get_Record(recId); if(!sina_record) { return; diff --git a/src/axom/sina/interface/sina_fortran_interface.h b/src/axom/sina/interface/sina_fortran_interface.h index 6f748899bf..40721ab268 100644 --- a/src/axom/sina/interface/sina_fortran_interface.h +++ b/src/axom/sina/interface/sina_fortran_interface.h @@ -8,30 +8,30 @@ #include "axom/sina.hpp" -extern "C" void sina_set_default_record_type_(char *); -extern "C" void sina_create_record_(char *, char *, int, int); -extern "C" void sina_add_file_(char *, char *, char *, int, int, int); -extern "C" axom::sina::Record *Sina_Get_Record(char *); -extern "C" char *Get_File_Extension(char *); -extern "C" axom::sina::Record *Sina_Get_Run(); -extern "C" void sina_add_file_to_record_(char *, char *, int, int); -extern "C" void sina_add_file_with_mimetype_to_record_(char *, char *, char *, int, int, int); -extern "C" void sina_write_document_noprotocol_nopreserve_nomerge(char *); -extern "C" void sina_write_document_protocol_nopreserve_nomerge(char *, int *); -extern "C" void sina_write_document_protocol_preserve_nomerge(char *, int *, int *); -extern "C" void sina_write_document_all_args(char *, int *, int *, int *); +extern "C" void sina_set_default_record_type_(char*); +extern "C" void sina_create_record_(char*, char*, int, int); +extern "C" void sina_add_file_(char*, char*, char*, int, int, int); +extern "C" axom::sina::Record* Sina_Get_Record(char*); +extern "C" char* Get_File_Extension(char*); +extern "C" axom::sina::Record* Sina_Get_Run(); +extern "C" void sina_add_file_to_record_(char*, char*, int, int); +extern "C" void sina_add_file_with_mimetype_to_record_(char*, char*, char*, int, int, int); +extern "C" void sina_write_document_noprotocol_nopreserve_nomerge(char*); +extern "C" void sina_write_document_protocol_nopreserve_nomerge(char*, int*); +extern "C" void sina_write_document_protocol_preserve_nomerge(char*, int*, int*); +extern "C" void sina_write_document_all_args(char*, int*, int*, int*); // extern "C" void write_sina_document_noprotocol_(char *); -extern "C" void sina_add_long_(char *, long long int *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_int_(char *, int *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_float_(char *, float *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_double_(char *, double *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_logical_(char *, bool *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_string_(char *, char *, char *, char *, char *, int, int, int, int); -extern "C" void sina_add_curveset_(char *, char *, int, int); -extern "C" void sina_add_curve_double_(char *, char *, double *, int *, int *, char *); -extern "C" void sina_add_curve_float_(char *, char *, float *, int *, int *, char *); -extern "C" void sina_add_curve_int_(char *, char *, int *, int *, int *, char *); -extern "C" void sina_add_curve_long_(char *, char *, long long int *, int *, int *, char *); +extern "C" void sina_add_long_(char*, long long int*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_int_(char*, int*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_float_(char*, float*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_double_(char*, double*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_logical_(char*, bool*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_string_(char*, char*, char*, char*, char*, int, int, int, int); +extern "C" void sina_add_curveset_(char*, char*, int, int); +extern "C" void sina_add_curve_double_(char*, char*, double*, int*, int*, char*); +extern "C" void sina_add_curve_float_(char*, char*, float*, int*, int*, char*); +extern "C" void sina_add_curve_int_(char*, char*, int*, int*, int*, char*); +extern "C" void sina_add_curve_long_(char*, char*, long long int*, int*, int*, char*); // Curve Ordering Functions -extern "C" void sina_set_curves_order_(int *); -extern "C" void sina_set_record_curves_order_(char *, int *); +extern "C" void sina_set_curves_order_(int*); +extern "C" void sina_set_record_curves_order_(char*, int*); diff --git a/src/axom/sina/tests/TestRecord.cpp b/src/axom/sina/tests/TestRecord.cpp index aa1c749bce..0287d7d99c 100644 --- a/src/axom/sina/tests/TestRecord.cpp +++ b/src/axom/sina/tests/TestRecord.cpp @@ -14,13 +14,13 @@ namespace testing { template <> -TestRecord::TestRecord(conduit::Node const &asNode) +TestRecord::TestRecord(conduit::Node const& asNode) : Record {asNode} , value {getRequiredString(TEST_RECORD_VALUE_KEY, asNode, "TestRecord")} { } template <> -TestRecord::TestRecord(conduit::Node const &asNode) +TestRecord::TestRecord(conduit::Node const& asNode) : Record {asNode} , value {getRequiredField(TEST_RECORD_VALUE_KEY, asNode, "TestRecord").as_int()} { } diff --git a/src/axom/sina/tests/TestRecord.hpp b/src/axom/sina/tests/TestRecord.hpp index e186a9b85d..bddb6b6571 100644 --- a/src/axom/sina/tests/TestRecord.hpp +++ b/src/axom/sina/tests/TestRecord.hpp @@ -44,14 +44,14 @@ class TestRecord : public Record * * @param asValue the record in its Node representation */ - explicit TestRecord(conduit::Node const &asValue); + explicit TestRecord(conduit::Node const& asValue); /** * Get the record's value. * * @return the record's value */ - const T &getValue() const noexcept { return value; } + const T& getValue() const noexcept { return value; } conduit::Node toNode(CurveSet::CurveOrder curveOrder = defaultCurveOrder) const override; @@ -66,10 +66,10 @@ TestRecord::TestRecord(std::string id, std::string type, T value_) { } template <> -TestRecord::TestRecord(conduit::Node const &asNode); +TestRecord::TestRecord(conduit::Node const& asNode); template <> -TestRecord::TestRecord(conduit::Node const &asJson); +TestRecord::TestRecord(conduit::Node const& asJson); template conduit::Node TestRecord::toNode(CurveSet::CurveOrder curveOrder) const diff --git a/src/axom/sina/tests/sina_AdiakWriter.cpp b/src/axom/sina/tests/sina_AdiakWriter.cpp index c43fd32b7a..e6d624bdee 100644 --- a/src/axom/sina/tests/sina_AdiakWriter.cpp +++ b/src/axom/sina/tests/sina_AdiakWriter.cpp @@ -50,22 +50,22 @@ class AdiakWriterTest : public ::testing::Test void SetUp() override { current_test = this; } - static void callbackWrapper(const char *name, + static void callbackWrapper(const char* name, adiak_category_t category, - const char *subcategory, - adiak_value_t *val, - adiak_datatype_t *adiak_type, - void *adiakwriter) + const char* subcategory, + adiak_value_t* val, + adiak_datatype_t* adiak_type, + void* adiakwriter) { - auto test = static_cast(adiakwriter); + auto test = static_cast(adiakwriter); adiakSinaCallback(name, category, subcategory, val, adiak_type, &((*test)->record)); } axom::sina::Record record {axom::sina::ID {"test_run", axom::sina::IDType::Local}, "test_type"}; - static AdiakWriterTest *current_test; + static AdiakWriterTest* current_test; }; -AdiakWriterTest *AdiakWriterTest::current_test; +AdiakWriterTest* AdiakWriterTest::current_test; TEST_F(AdiakWriterTest, basic_assignment) { diff --git a/src/axom/sina/tests/sina_ConduitUtil.cpp b/src/axom/sina/tests/sina_ConduitUtil.cpp index 4901dd58ac..a9dfa09601 100644 --- a/src/axom/sina/tests/sina_ConduitUtil.cpp +++ b/src/axom/sina/tests/sina_ConduitUtil.cpp @@ -34,7 +34,7 @@ TEST(ConduitUtil, getRequiredField_present) parent["fieldName"] = "field value"; std::string const field_name {"fieldName"}; std::string const parent_name {"parent name"}; - conduit::Node const &field = getRequiredField(field_name, parent, parent_name); + conduit::Node const& field = getRequiredField(field_name, parent, parent_name); EXPECT_TRUE(field.dtype().is_string()); EXPECT_EQ("field value", field.as_string()); } @@ -46,10 +46,10 @@ TEST(ConduitUtil, getRequiredField_missing) { std::string const field_name {"fieldName"}; std::string const parent_name {"parent name"}; - conduit::Node const &field = getRequiredField(field_name, parent, parent_name); + conduit::Node const& field = getRequiredField(field_name, parent, parent_name); FAIL() << "Should not have found field, but got " << field.name(); } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -81,7 +81,7 @@ TEST(ConduitUtil, getRequiredString_missing) auto value = getRequiredString("fieldName", parent, "parent name"); FAIL() << "Should not have found string, but got " << value; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -97,7 +97,7 @@ TEST(ConduitUtil, getRequiredString_wrongType) auto value = getRequiredString("fieldName", parent, "parent name"); FAIL() << "Should not have found string, but got " << value; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -128,7 +128,7 @@ TEST(ConduitUtil, getRequiredDouble_missing) auto value = getRequiredDouble("fieldName", parent, "parent name"); FAIL() << "Should not have found double, but got " << value; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -144,7 +144,7 @@ TEST(ConduitUtil, getRequiredDouble_wrongType) auto value = getRequiredDouble("fieldName", parent, "parent name"); FAIL() << "Should not have found double, but got " << value; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -181,7 +181,7 @@ TEST(ConduitUtil, getOptionalString_wrongType) auto value = getOptionalString("fieldName", parent, "parent name"); FAIL() << "Should not have found string, but got " << value; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("fieldName")); EXPECT_THAT(expected.what(), HasSubstr("parent name")); @@ -216,7 +216,7 @@ TEST(ConduitUtil, toDoubleVector_NotList) toDoubleVector(notList, "someName"); FAIL() << "Should have thrown an exception"; } - catch(std::invalid_argument const &ex) + catch(std::invalid_argument const& ex) { EXPECT_THAT(ex.what(), HasSubstr("someName")); } @@ -242,7 +242,7 @@ TEST(ConduitUtil, toStringVector_NotList) toStringVector(notList, "someName"); FAIL() << "Should have thrown an exception."; } - catch(std::invalid_argument const &ex) + catch(std::invalid_argument const& ex) { EXPECT_THAT(ex.what(), HasSubstr("someName")); } @@ -256,7 +256,7 @@ TEST(ConduitUtil, toStringVector_NotListOfStrings) toStringVector(notList, "someName"); FAIL() << "Should have thrown an exception."; } - catch(std::invalid_argument const &ex) + catch(std::invalid_argument const& ex) { EXPECT_THAT(ex.what(), HasSubstr("someName")); } diff --git a/src/axom/sina/tests/sina_CurveSet.cpp b/src/axom/sina/tests/sina_CurveSet.cpp index 74c7efba91..d960bf8461 100644 --- a/src/axom/sina/tests/sina_CurveSet.cpp +++ b/src/axom/sina/tests/sina_CurveSet.cpp @@ -25,7 +25,7 @@ namespace sina // // NOTE: Since this isn't in an unnamed namespace, we need a forward // declaration to satisfy strict compiler warnings. -bool operator==(Curve const &lhs, Curve const &rhs); +bool operator==(Curve const& lhs, Curve const& rhs); /** * Compare two curves for equality. All fields must be equal, including the @@ -36,7 +36,7 @@ bool operator==(Curve const &lhs, Curve const &rhs); * @param rhs the right-hand-side operand * @return whether the curves are equal */ -bool operator==(Curve const &lhs, Curve const &rhs) +bool operator==(Curve const& lhs, Curve const& rhs) { bool r = lhs.getName() == rhs.getName() && lhs.getUnits() == rhs.getUnits() && lhs.getTags() == rhs.getTags() && lhs.getValues() == rhs.getValues(); diff --git a/src/axom/sina/tests/sina_DataHolder.cpp b/src/axom/sina/tests/sina_DataHolder.cpp index 9efbbcae77..c0df0c816e 100644 --- a/src/axom/sina/tests/sina_DataHolder.cpp +++ b/src/axom/sina/tests/sina_DataHolder.cpp @@ -55,7 +55,7 @@ TEST(DataHolder, add_curve_set_existing_key) cs1.addDependentCurve(Curve {"original", {1, 2, 3}}); dh.add(cs1); - auto &csAfterFirstInsert = dh.getCurveSets(); + auto& csAfterFirstInsert = dh.getCurveSets(); ASSERT_THAT(csAfterFirstInsert, Contains(Key("cs1"))); EXPECT_THAT(csAfterFirstInsert.at("cs1").getDependentCurves(), Contains(Key("original"))); @@ -63,7 +63,7 @@ TEST(DataHolder, add_curve_set_existing_key) cs2.addDependentCurve(Curve {"new", {1, 2, 3}}); dh.add(cs2); - auto &csAfterSecondInsert = dh.getCurveSets(); + auto& csAfterSecondInsert = dh.getCurveSets(); ASSERT_THAT(csAfterSecondInsert, Contains(Key("cs1"))); EXPECT_THAT(csAfterSecondInsert.at("cs1").getDependentCurves(), Not(Contains(Key("original")))); EXPECT_THAT(csAfterSecondInsert.at("cs1").getDependentCurves(), Contains(Key("new"))); @@ -78,7 +78,7 @@ TEST(DataHolder, create_fromNode_userDefined) originalNode[EXPECTED_USER_DEFINED_KEY]["k3"] = k3_vals; DataHolder holder {originalNode}; - auto const &userDefined = holder.getUserDefinedContent(); + auto const& userDefined = holder.getUserDefinedContent(); EXPECT_EQ("v1", userDefined["k1"].as_string()); EXPECT_EQ(123, userDefined["k2"].as_int()); auto int_array = userDefined["k3"].as_int_ptr(); @@ -97,14 +97,14 @@ TEST(DataHolder, create_fromNode_userDefined_not_object) TEST(DataHolder, getUserDefined_initialConst) { DataHolder const holder; - conduit::Node const &userDefined = holder.getUserDefinedContent(); + conduit::Node const& userDefined = holder.getUserDefinedContent(); EXPECT_TRUE(userDefined.dtype().is_empty()); } TEST(DataHolder, getUserDefined_initialNonConst) { DataHolder holder; - conduit::Node &initialUserDefined = holder.getUserDefinedContent(); + conduit::Node& initialUserDefined = holder.getUserDefinedContent(); EXPECT_TRUE(initialUserDefined.dtype().is_empty()); initialUserDefined["foo"] = 123; EXPECT_EQ(123, holder.getUserDefinedContent()["foo"].as_int()); @@ -114,14 +114,14 @@ TEST(DataHolder, add_new_library) { DataHolder dh {}; auto outer = dh.addLibraryData("outer"); - auto &libDataAfterFirstInsert = dh.getLibraryData(); + auto& libDataAfterFirstInsert = dh.getLibraryData(); ASSERT_THAT(libDataAfterFirstInsert, Contains(Key("outer"))); dh.addLibraryData("other_outer"); - auto &libDataAfterSecondInsert = dh.getLibraryData(); + auto& libDataAfterSecondInsert = dh.getLibraryData(); ASSERT_THAT(libDataAfterSecondInsert, Contains(Key("outer"))); ASSERT_THAT(libDataAfterSecondInsert, Contains(Key("other_outer"))); outer->addLibraryData("inner"); - auto &libDataAfterThirdInsert = dh.getLibraryData(); + auto& libDataAfterThirdInsert = dh.getLibraryData(); ASSERT_THAT(libDataAfterThirdInsert.at("outer")->getLibraryData(), Contains(Key("inner"))); ASSERT_THAT(libDataAfterThirdInsert.at("other_outer")->getLibraryData(), Not(Contains(Key("inner")))); @@ -156,7 +156,7 @@ TEST(DataHolder, create_fromNode_data) name2_node["value"] = 2.22; originalNode[EXPECTED_DATA_KEY].add_child(name2) = name2_node; DataHolder dh {originalNode}; - auto &data = dh.getData(); + auto& data = dh.getData(); ASSERT_EQ(2u, data.size()); EXPECT_EQ("value 1", data.at(name1).getValue()); EXPECT_THAT(2.22, DoubleEq(data.at(name2).getScalar())); @@ -180,7 +180,7 @@ TEST(DataHolder, create_fromNode_curveSets) } })"); DataHolder dh {dataHolderAsNode}; - auto &curveSets = dh.getCurveSets(); + auto& curveSets = dh.getCurveSets(); ASSERT_THAT(curveSets, Contains(Key("cs1"))); } @@ -196,11 +196,11 @@ TEST(DataHolder, create_fromNode_libraryData) } })"); DataHolder dh {dataHolderAsNode}; - auto &fullLibData = dh.getLibraryData(); + auto& fullLibData = dh.getLibraryData(); ASSERT_THAT(fullLibData, Contains(Key("outer_lib"))); auto outerLibData = fullLibData.at("outer_lib")->getLibraryData(); ASSERT_THAT(outerLibData, Contains(Key("inner_lib"))); - auto &innerData = outerLibData.at("inner_lib")->getData(); + auto& innerData = outerLibData.at("inner_lib")->getData(); EXPECT_EQ("good morning!", innerData.at("i2").getValue()); } diff --git a/src/axom/sina/tests/sina_Datum.cpp b/src/axom/sina/tests/sina_Datum.cpp index 30c8ff26d8..924b6174d8 100644 --- a/src/axom/sina/tests/sina_Datum.cpp +++ b/src/axom/sina/tests/sina_Datum.cpp @@ -125,7 +125,7 @@ TEST(Datum, createFromJson_missingKeys) Datum datum1 {object1}; FAIL() << "Should have gotten a value error"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("value")); } @@ -134,16 +134,16 @@ TEST(Datum, createFromJson_missingKeys) TEST(Datum, createFromJson_badListValue) { conduit::Node object1; - auto &mixed_scal = object1["value"].append(); + auto& mixed_scal = object1["value"].append(); mixed_scal.set(1.0); - auto &mixed_val = object1["value"].append(); + auto& mixed_val = object1["value"].append(); mixed_val.set("two"); try { Datum datum1 {object1}; FAIL() << "Should have gotten a value error"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { std::string warning = "it must consist of only strings or only numbers"; EXPECT_THAT(expected.what(), HasSubstr(warning)); diff --git a/src/axom/sina/tests/sina_Document.cpp b/src/axom/sina/tests/sina_Document.cpp index a5430196b4..7d69e82f59 100644 --- a/src/axom/sina/tests/sina_Document.cpp +++ b/src/axom/sina/tests/sina_Document.cpp @@ -291,13 +291,13 @@ std::string long_json = R"( )"; // Helper function to convert Conduit Node array to std::vector for HDF5 assertion -std::vector node_to_double_vector(const conduit::Node &node) +std::vector node_to_double_vector(const conduit::Node& node) { std::vector result; if(node.dtype().is_number()) { - const double *intArray = node.as_double_ptr(); + const double* intArray = node.as_double_ptr(); conduit::index_t numElements = node.dtype().number_of_elements(); for(conduit::index_t i = 0; i < numElements; ++i) { @@ -327,7 +327,7 @@ TEST(Document, create_fromNode_wrongRecordsType) Document document {recordsAsNodes, loader}; FAIL() << "Should not have been able to parse records. Have " << document.getRecords().size(); } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_RECORDS_KEY)); } @@ -347,14 +347,14 @@ TEST(Document, create_fromNode_withRecords) documentAsNode[EXPECTED_RECORDS_KEY] = recordsAsNodes; RecordLoader loader; - loader.addTypeLoader("IntTestRecord", [](conduit::Node const &asNode) { + loader.addTypeLoader("IntTestRecord", [](conduit::Node const& asNode) { return std::make_unique>(asNode); }); Document document {documentAsNode, loader}; - auto &records = document.getRecords(); + auto& records = document.getRecords(); ASSERT_EQ(1u, records.size()); - auto testRecord = dynamic_cast const *>(records[0].get()); + auto testRecord = dynamic_cast const*>(records[0].get()); ASSERT_NE(nullptr, testRecord); ASSERT_EQ(123, testRecord->getValue()); } @@ -373,7 +373,7 @@ TEST(Document, create_fromNode_withRelationships) documentAsNode[EXPECTED_RELATIONSHIPS_KEY] = relationshipsAsNodes; Document document {documentAsNode, RecordLoader {}}; - auto &relationships = document.getRelationships(); + auto& relationships = document.getRelationships(); ASSERT_EQ(1u, relationships.size()); EXPECT_EQ("the subject", relationships[0].getSubject().getId()); EXPECT_EQ(IDType::Global, relationships[0].getSubject().getType()); @@ -413,7 +413,7 @@ TEST(Document, toNode_records) ASSERT_EQ(numRecords, record_nodes.number_of_children()); for(auto i = 0; i < record_nodes.number_of_children(); ++i) { - auto &actualNode = record_nodes[i]; + auto& actualNode = record_nodes[i]; EXPECT_EQ(expectedIds[i], actualNode["id"].as_string()); EXPECT_EQ(TEST_RECORD_TYPE, actualNode["type"].as_string()); EXPECT_EQ(expectedValues[i], actualNode[TEST_RECORD_VALUE_KEY].as_string()); @@ -443,7 +443,7 @@ TEST(Document, toNode_relationships) ASSERT_EQ(numRecords, relationship_nodes.number_of_children()); for(auto i = 0; i < relationship_nodes.number_of_children(); ++i) { - auto &actualRelationship = relationship_nodes[i]; + auto& actualRelationship = relationship_nodes[i]; EXPECT_EQ(expectedSubjects[i], actualRelationship["subject"].as_string()); EXPECT_EQ(expectedObjects[i], actualRelationship["object"].as_string()); EXPECT_EQ(expectedPredicates[i], actualRelationship["predicate"].as_string()); @@ -467,7 +467,7 @@ TEST(Document, create_fromJson_full_json) { axom::sina::Document myDocument = Document(long_json, createRecordLoaderWithAllKnownTypes()); EXPECT_EQ(2, myDocument.getRelationships().size()); - auto &records1 = myDocument.getRecords(); + auto& records1 = myDocument.getRecords(); EXPECT_EQ(4, records1.size()); } @@ -475,10 +475,10 @@ TEST(Document, create_fromJson_value_check_json) { axom::sina::Document myDocument = Document(SIMPLE_DOCUMENT, createRecordLoaderWithAllKnownTypes()); EXPECT_EQ(2, myDocument.getRelationships().size()); - auto &records1 = myDocument.getRecords(); + auto& records1 = myDocument.getRecords(); EXPECT_EQ(1, records1.size()); EXPECT_EQ(records1[0]->getType(), "run"); - auto &data1 = records1[0]->getData(); + auto& data1 = records1[0]->getData(); EXPECT_EQ(data1.at("int").getScalar(), 500.0); std::vector expected_string_vals = {"z", "o", "o"}; EXPECT_EQ(data1.at("str/ings").getStringArray(), expected_string_vals); @@ -499,7 +499,7 @@ TEST(Document, saveDocument_json) ASSERT_TRUE(readContents[EXPECTED_RECORDS_KEY].dtype().is_list()); EXPECT_EQ(1, readContents[EXPECTED_RECORDS_KEY].number_of_children()); - auto &readRecord = readContents[EXPECTED_RECORDS_KEY][0]; + auto& readRecord = readContents[EXPECTED_RECORDS_KEY][0]; EXPECT_EQ("the id", readRecord["id"].as_string()); EXPECT_EQ("the type", readRecord["type"].as_string()); } @@ -515,7 +515,7 @@ TEST(Document, load_specifiedRecordLoader) tempfile.write(originalDocument.toNode().to_json()); RecordLoader loader; - loader.addTypeLoader("my type", [](conduit::Node const &asNode) { + loader.addTypeLoader("my type", [](conduit::Node const& asNode) { return std::make_unique( getRequiredString("id", asNode, "Test type"), getRequiredString("type", asNode, "Test type"), @@ -523,7 +523,7 @@ TEST(Document, load_specifiedRecordLoader) }); Document loadedDocument = loadDocument(tempfile.getPath(), loader); ASSERT_EQ(1u, loadedDocument.getRecords().size()); - auto loadedRecord = dynamic_cast(loadedDocument.getRecords()[0].get()); + auto loadedRecord = dynamic_cast(loadedDocument.getRecords()[0].get()); ASSERT_NE(nullptr, loadedRecord); EXPECT_EQ(123, loadedRecord->getValue()); } @@ -540,7 +540,7 @@ TEST(Document, load_defaultRecordLoaders) Document loadedDocument = loadDocument(tempfile.getPath()); ASSERT_EQ(1u, loadedDocument.getRecords().size()); - auto loadedRun = dynamic_cast(loadedDocument.getRecords()[0].get()); + auto loadedRun = dynamic_cast(loadedDocument.getRecords()[0].get()); EXPECT_NE(nullptr, loadedRun); } @@ -656,8 +656,8 @@ TEST(Document, test_validate_append_valid) } void doEveryErrorTest( - const std::string &protocol, - std::function appendDocumentFunc, + const std::string& protocol, + std::function appendDocumentFunc, bool skipValidation = false, bool overwriteCurves = false) { @@ -694,8 +694,8 @@ TEST(Document, test_appendErrorCodepathsHDF5) { doEveryErrorTest("hdf5", appendD // Appending into an empty document void doSimpleAppendTest( - const std::string &protocol, - std::function appendDocumentFunc) + const std::string& protocol, + std::function appendDocumentFunc) { std::string empty_file = "test." + protocol; axom::sina::Document empty_doc = @@ -727,8 +727,8 @@ TEST(Document, test_simpleAppendDocumentToHDF5) // One unchanged, one merged void doFullAppendTest( - const std::string &protocol, - std::function appendDocumentFunc) + const std::string& protocol, + std::function appendDocumentFunc) { std::string filePath = "test." + protocol; sina::Document testDoc = Document(MULTI_REC_DOCUMENT, createRecordLoaderWithAllKnownTypes()); @@ -747,7 +747,7 @@ void doFullAppendTest( // One record should be unchanged, but loading it into a document means we // don't guarantee data order except where important (curve set order). Spot check shared val. std::vector expected = {1.0, 2.0}; - const conduit::Node &rec1 = root["records"].child(1); + const conduit::Node& rec1 = root["records"].child(1); auto actual = node_to_double_vector(rec1["curve_sets"]["set_1"]["dependent"]["0"]["value"]); EXPECT_EQ(expected, actual); // The hard one, now a blend of the prior and new record @@ -775,7 +775,7 @@ void doFullAppendTest( EXPECT_EQ(expected, actual); EXPECT_EQ(expected, actual); // Relationships are easy, we just need the union (no duplicates) - const conduit::Node &rels = root["relationships"]; + const conduit::Node& rels = root["relationships"]; EXPECT_EQ(rels.number_of_children(), 3); EXPECT_EQ(rels.to_string(), "\n- \n predicate: \"knows\"\n local_subject: \"bar1\"\n object: \"something\"\n- " @@ -792,8 +792,8 @@ TEST(Document, test_appendDocumentToHDF5) { doFullAppendTest("hdf5", appendDocum // Making sure we respect curve order (Records are in charge of ordering their curves, not documents) void doAppendOrderedCurveTest( - const std::string &protocol, - std::function appendDocumentFunc) + const std::string& protocol, + std::function appendDocumentFunc) { std::string curvedump_file = "test_curve." + protocol; axom::sina::Document ordered_curves = @@ -835,8 +835,8 @@ TEST(Document, test_appendOrderedCurvesToHDF5) // Making sure that we overwrite instead of appending when receiving "full" curves void doAppendOverwriteCurveTest( - const std::string &protocol, - std::function appendDocumentFunc) + const std::string& protocol, + std::function appendDocumentFunc) { std::string overwrite_file = "test_overwrite." + protocol; axom::sina::Document overwritten_doc = @@ -896,7 +896,7 @@ TEST(Document, create_fromJson_full_hdf5) saveDocument(myDocument, "long_json.hdf5", Protocol::HDF5); Document loadedDocument = loadDocument("long_json.hdf5", Protocol::HDF5); EXPECT_EQ(2, loadedDocument.getRelationships().size()); - auto &records2 = loadedDocument.getRecords(); + auto& records2 = loadedDocument.getRecords(); EXPECT_EQ(4, records2.size()); } @@ -907,10 +907,10 @@ TEST(Document, create_fromJson_value_check_hdf5) saveDocument(myDocument, "data_json.hdf5", Protocol::HDF5); Document loadedDocument = loadDocument("data_json.hdf5", Protocol::HDF5); EXPECT_EQ(2, loadedDocument.getRelationships().size()); - auto &records2 = loadedDocument.getRecords(); + auto& records2 = loadedDocument.getRecords(); EXPECT_EQ(1, records2.size()); EXPECT_EQ(records2[0]->getType(), "run"); - auto &data2 = records2[0]->getData(); + auto& data2 = records2[0]->getData(); EXPECT_EQ(data2.at("int").getScalar(), 500.0); EXPECT_EQ(data2.at("str/ings").getStringArray(), expected_string_vals); EXPECT_EQ(records2[0]->getFiles().count(File {"test/test.png"}), 1); @@ -930,7 +930,7 @@ TEST(Document, saveDocument_hdf5) ASSERT_TRUE(readContents[EXPECTED_RECORDS_KEY].dtype().is_list()); EXPECT_EQ(1, readContents[EXPECTED_RECORDS_KEY].number_of_children()); - auto &readRecord = readContents[EXPECTED_RECORDS_KEY][0]; + auto& readRecord = readContents[EXPECTED_RECORDS_KEY][0]; EXPECT_EQ("the id", readRecord["id"].as_string()); EXPECT_EQ("the type", readRecord["type"].as_string()); } diff --git a/src/axom/sina/tests/sina_ID.cpp b/src/axom/sina/tests/sina_ID.cpp index 6aa6d70fa6..83f6d5a49a 100644 --- a/src/axom/sina/tests/sina_ID.cpp +++ b/src/axom/sina/tests/sina_ID.cpp @@ -75,7 +75,7 @@ TEST(IDField, createFromNode_missingKeys) internal::IDField field {object, "local id key", "global id key"}; FAIL() << "Should have gotten a value error"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr("local id key")); EXPECT_THAT(expected.what(), HasSubstr("global id key")); diff --git a/src/axom/sina/tests/sina_Record.cpp b/src/axom/sina/tests/sina_Record.cpp index 217f1baa8c..0a535d4ba9 100644 --- a/src/axom/sina/tests/sina_Record.cpp +++ b/src/axom/sina/tests/sina_Record.cpp @@ -60,7 +60,7 @@ TEST(Record, create_typeMissing) Record record {originalNode}; FAIL() << "Should have failed due to missing type"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_TYPE_KEY)); } @@ -83,7 +83,7 @@ TEST(Record, add_curve_set_existing_key) cs1.addDependentCurve(Curve {"original", {1, 2, 3}}); record.add(cs1); - auto &csAfterFirstInsert = record.getCurveSets(); + auto& csAfterFirstInsert = record.getCurveSets(); ASSERT_THAT(csAfterFirstInsert, Contains(Key("cs1"))); EXPECT_THAT(csAfterFirstInsert.at("cs1").getDependentCurves(), Contains(Key("original"))); @@ -91,7 +91,7 @@ TEST(Record, add_curve_set_existing_key) cs2.addDependentCurve(Curve {"new", {1, 2, 3}}); record.add(cs2); - auto &csAfterSecondInsert = record.getCurveSets(); + auto& csAfterSecondInsert = record.getCurveSets(); ASSERT_THAT(csAfterSecondInsert, Contains(Key("cs1"))); EXPECT_THAT(csAfterSecondInsert.at("cs1").getDependentCurves(), Not(Contains(Key("original")))); EXPECT_THAT(csAfterSecondInsert.at("cs1").getDependentCurves(), Contains(Key("new"))); @@ -135,9 +135,9 @@ TEST(Record, add_child_record_as_library_data) Record parentRecord {ID {"parent id", IDType::Local}, "test_record_parent"}; Record childRecord {ID {"child id", IDType::Local}, "test_record_child"}; parentRecord.addRecordAsLibraryData(childRecord, "child"); - auto &parentLibData = parentRecord.getLibraryData(); + auto& parentLibData = parentRecord.getLibraryData(); ASSERT_THAT(parentLibData, Contains(Key("child"))); - auto &childLibContents = parentLibData.at("child")->getData(); + auto& childLibContents = parentLibData.at("child")->getData(); ASSERT_THAT(childLibContents, Contains(Key(LIBRARY_DATA_ID_DATUM))); EXPECT_EQ("child id", childLibContents.at(LIBRARY_DATA_ID_DATUM).getValue()); ASSERT_THAT(childLibContents, Contains(Key(LIBRARY_DATA_TYPE_DATUM))); @@ -150,7 +150,7 @@ TEST(Record, add_child_record_as_library_data_with_data) Record childRecord {ID {"child id", IDType::Local}, "test_record_child"}; childRecord.add("key1", Datum {"val1"}); parentRecord.addRecordAsLibraryData(childRecord, "child"); - auto &childLibContents = parentRecord.getLibraryData().at("child")->getData(); + auto& childLibContents = parentRecord.getLibraryData().at("child")->getData(); ASSERT_THAT(childLibContents, Contains(Key("key1"))); EXPECT_EQ("val1", childLibContents.at("key1").getValue()); } @@ -274,7 +274,7 @@ TEST(Record, create_globalId_withContent) originalNode[EXPECTED_LIBRARY_DATA_KEY][libName] = libNode; Record record {originalNode}; - auto &data = record.getData(); + auto& data = record.getData(); ASSERT_EQ(2u, data.size()); EXPECT_EQ("value 1", data.at(name1).getValue()); EXPECT_THAT(2.22, DoubleEq(data.at(name2).getScalar())); @@ -282,7 +282,7 @@ TEST(Record, create_globalId_withContent) EXPECT_EQ("tag1", data.at(name2).getTags()[0]); EXPECT_EQ("tag2", data.at(name2).getTags()[1]); - auto &libdata = record.getLibraryData(); + auto& libdata = record.getLibraryData(); EXPECT_THAT(libdata, Contains(Key(libName))); EXPECT_EQ("value 3", libdata.at(libName)->getData().at(name3).getValue()); } @@ -301,7 +301,7 @@ TEST(Record, create_globalId_files) originalNode[EXPECTED_FILES_KEY].add_child(uri2); originalNode[EXPECTED_FILES_KEY].add_child(uri3); Record record {originalNode}; - auto &files = record.getFiles(); + auto& files = record.getFiles(); ASSERT_EQ(3u, files.size()); EXPECT_EQ(1, files.count(File {uri1})); EXPECT_EQ(1, files.count(File {uri2})); @@ -325,7 +325,7 @@ TEST(Record, create_fromNode_curveSets) } })"); Record record {recordAsNode}; - auto &curveSets = record.getCurveSets(); + auto& curveSets = record.getCurveSets(); ASSERT_THAT(curveSets, Contains(Key("cs1"))); } @@ -340,7 +340,7 @@ TEST(Record, create_fromNode_userDefined) originalNode[EXPECTED_USER_DEFINED_KEY]["k3"] = k3_vals; Record record {originalNode}; - auto const &userDefined = record.getUserDefinedContent(); + auto const& userDefined = record.getUserDefinedContent(); EXPECT_EQ("v1", userDefined["k1"].as_string()); EXPECT_EQ(123, userDefined["k2"].as_int()); auto int_array = userDefined["k3"].as_int_ptr(); @@ -353,7 +353,7 @@ TEST(Record, getUserDefined_initialConst) { ID id {"the id", IDType::Local}; Record const record {id, "my type"}; - conduit::Node const &userDefined = record.getUserDefinedContent(); + conduit::Node const& userDefined = record.getUserDefinedContent(); EXPECT_TRUE(userDefined.dtype().is_empty()); } @@ -361,7 +361,7 @@ TEST(Record, getUserDefined_initialNonConst) { ID id {"the id", IDType::Local}; Record record {id, "my type"}; - conduit::Node &initialUserDefined = record.getUserDefinedContent(); + conduit::Node& initialUserDefined = record.getUserDefinedContent(); EXPECT_TRUE(initialUserDefined.dtype().is_empty()); initialUserDefined["foo"] = 123; EXPECT_EQ(123, record.getUserDefinedContent()["foo"].as_int()); @@ -473,7 +473,7 @@ TEST(Record, toNode_files) record.add(File {uri2}); auto asNode = record.toNode(); ASSERT_EQ(2u, asNode[EXPECTED_FILES_KEY].number_of_children()); - auto &child_with_slashes = asNode[EXPECTED_FILES_KEY].child(uri1); + auto& child_with_slashes = asNode[EXPECTED_FILES_KEY].child(uri1); EXPECT_EQ("mt1", child_with_slashes["mimetype"].as_string()); EXPECT_TRUE(asNode[EXPECTED_FILES_KEY][uri2]["mimetype"].dtype().is_empty()); } @@ -656,7 +656,7 @@ TEST(RecordLoader, load_missingLoader) EXPECT_NE(loaded.get(), nullptr); if(loaded) { - auto &loadedRef = *loaded; + auto& loadedRef = *loaded; EXPECT_EQ(typeid(Record), typeid(loadedRef)) << "Type was " << typeid(loadedRef).name(); } } @@ -667,12 +667,12 @@ TEST(RecordLoader, load_loaderPresent) EXPECT_FALSE(loader.canLoad("TestInt")); EXPECT_FALSE(loader.canLoad("TestString")); - loader.addTypeLoader("TestInt", [](conduit::Node const &value) { + loader.addTypeLoader("TestInt", [](conduit::Node const& value) { return std::make_unique>(value); }); EXPECT_TRUE(loader.canLoad("TestInt")); - loader.addTypeLoader("TestString", [](conduit::Node const &value) { + loader.addTypeLoader("TestString", [](conduit::Node const& value) { return std::make_unique>(value); }); EXPECT_TRUE(loader.canLoad("TestString")); @@ -682,7 +682,7 @@ TEST(RecordLoader, load_loaderPresent) asNode[EXPECTED_TYPE_KEY] = "TestString"; asNode[TEST_RECORD_VALUE_KEY] = "The value"; auto loaded = loader.load(asNode); - auto testObjPointer = dynamic_cast *>(loaded.get()); + auto testObjPointer = dynamic_cast*>(loaded.get()); ASSERT_NE(nullptr, testObjPointer); EXPECT_EQ("The value", testObjPointer->getValue()); EXPECT_EQ("TestString", testObjPointer->getType()); diff --git a/src/axom/sina/tests/sina_Relationship.cpp b/src/axom/sina/tests/sina_Relationship.cpp index cb03273a32..ccc02ade3c 100644 --- a/src/axom/sina/tests/sina_Relationship.cpp +++ b/src/axom/sina/tests/sina_Relationship.cpp @@ -90,7 +90,7 @@ TEST(Relationship, create_fromNode_missingSubect) Relationship relationship {asNode}; FAIL() << "Should have gotten an exception about a missing subject"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_LOCAL_SUBJECT_ID_KEY)); EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_GLOBAL_SUBJECT_ID_KEY)); @@ -108,7 +108,7 @@ TEST(Relationship, create_fromNode_missingObject) Relationship relationship {asNode}; FAIL() << "Should have gotten an exception about a missing object"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_LOCAL_OBJECT_ID_KEY)); EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_GLOBAL_OBJECT_ID_KEY)); @@ -126,7 +126,7 @@ TEST(Relationship, create_fromNode_missingPredicate) Relationship relationship {asNode}; FAIL() << "Should have gotten an exception about a missing predicate"; } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_PREDICATE_KEY)); EXPECT_THAT(expected.what(), HasSubstr("Relationship")); diff --git a/src/axom/sina/tests/sina_Run.cpp b/src/axom/sina/tests/sina_Run.cpp index 5e38fab285..044f8ab68a 100644 --- a/src/axom/sina/tests/sina_Run.cpp +++ b/src/axom/sina/tests/sina_Run.cpp @@ -59,7 +59,7 @@ TEST(Run, create_fromNode_missingApplication) axom::sina::Run run {originNode}; FAIL() << "Application should be missing, but is " << run.getApplication(); } - catch(std::invalid_argument const &expected) + catch(std::invalid_argument const& expected) { EXPECT_THAT(expected.what(), HasSubstr(EXPECTED_APPLICATION_KEY)); } @@ -92,7 +92,7 @@ TEST(Run, addRunLoader) addRunLoader(loader); auto record = loader.load(originNode); - auto run = dynamic_cast(record.get()); + auto run = dynamic_cast(record.get()); ASSERT_NE(nullptr, run); EXPECT_EQ("run", run->getType()); EXPECT_EQ("the id", run->getId().getId()); diff --git a/src/axom/slic/interface/c_fortran/typesSLIC.h b/src/axom/slic/interface/c_fortran/typesSLIC.h index 666620d5bb..9865719c96 100644 --- a/src/axom/slic/interface/c_fortran/typesSLIC.h +++ b/src/axom/slic/interface/c_fortran/typesSLIC.h @@ -80,7 +80,7 @@ extern "C" { // helper array_context struct s_SLIC_SHROUD_array { - void *base_addr; + void* base_addr; int type; /* type of element */ size_t elem_len; /* bytes-per-item or character len in c++ */ size_t size; /* size of data in c++ */ @@ -92,7 +92,7 @@ typedef struct s_SLIC_SHROUD_array SLIC_SHROUD_array; // helper capsule_data struct s_SLIC_SHROUD_capsule_data { - void *addr; /* address of C++ memory */ + void* addr; /* address of C++ memory */ int idtor; /* index of destructor */ int cmemflags; /* memory flags */ }; @@ -111,13 +111,13 @@ typedef struct s_SLIC_GenericOutputStream SLIC_GenericOutputStream; // C capsule SLIC_GenericOutputStream struct s_SLIC_GenericOutputStream { - void *addr; // address of C++ memory + void* addr; // address of C++ memory int idtor; // index of destructor int cmemflags; // memory flags }; typedef struct s_SLIC_GenericOutputStream SLIC_GenericOutputStream; -void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data *cap); +void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data* cap); #ifdef __cplusplus } diff --git a/src/axom/slic/interface/c_fortran/utilSLIC.cpp b/src/axom/slic/interface/c_fortran/utilSLIC.cpp index 66e1f588c1..df68ed2e75 100644 --- a/src/axom/slic/interface/c_fortran/utilSLIC.cpp +++ b/src/axom/slic/interface/c_fortran/utilSLIC.cpp @@ -19,18 +19,18 @@ extern "C" { // helper copy_string // Copy the char* or std::string in context into c_var. // Called by Fortran to deal with allocatable character. -void SLIC_ShroudCopyString(SLIC_SHROUD_array *data, char *c_var, size_t c_var_len) +void SLIC_ShroudCopyString(SLIC_SHROUD_array* data, char* c_var, size_t c_var_len) { - const void *cxx_var = data->base_addr; + const void* cxx_var = data->base_addr; size_t n = c_var_len; if(data->elem_len < n) n = data->elem_len; std::memcpy(c_var, cxx_var, n); } // Release library allocated memory. -void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data *cap) +void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data* cap) { - void *ptr = cap->addr; + void* ptr = cap->addr; switch(cap->idtor) { case 0: // --none-- @@ -40,20 +40,20 @@ void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data *cap) } case 1: // axom::slic::GenericOutputStream { - axom::slic::GenericOutputStream *cxx_ptr = - reinterpret_cast(ptr); + axom::slic::GenericOutputStream* cxx_ptr = + reinterpret_cast(ptr); delete cxx_ptr; break; } case 2: // std::string { - std::string *cxx_ptr = reinterpret_cast(ptr); + std::string* cxx_ptr = reinterpret_cast(ptr); delete cxx_ptr; break; } case 3: // new_string { - std::string *cxx_ptr = reinterpret_cast(ptr); + std::string* cxx_ptr = reinterpret_cast(ptr); delete cxx_ptr; break; } @@ -69,8 +69,8 @@ void SLIC_SHROUD_memory_destructor(SLIC_SHROUD_capsule_data *cap) } // axom::slic::GenericOutputStream = axom::slic::GenericOutputStream -void SLIC_GenericOutputStream_assign_GenericOutputStream(SLIC_GenericOutputStream *lhs_capsule, - SLIC_GenericOutputStream *rhs_capsule) +void SLIC_GenericOutputStream_assign_GenericOutputStream(SLIC_GenericOutputStream* lhs_capsule, + SLIC_GenericOutputStream* rhs_capsule) { if(lhs_capsule->addr == nullptr) { @@ -95,7 +95,7 @@ void SLIC_GenericOutputStream_assign_GenericOutputStream(SLIC_GenericOutputStrea // Replace LHS with a null pointer. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data *)lhs_capsule); + SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = nullptr; lhs_capsule->idtor = 0; @@ -111,7 +111,7 @@ void SLIC_GenericOutputStream_assign_GenericOutputStream(SLIC_GenericOutputStrea // Move-assign and delete the transient data. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data *)lhs_capsule); + SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; @@ -122,7 +122,7 @@ void SLIC_GenericOutputStream_assign_GenericOutputStream(SLIC_GenericOutputStrea // RHS shouldn't be deleted, alias to LHS. if(lhs_capsule->cmemflags & SWIG_MEM_OWN) { - SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data *)lhs_capsule); + SLIC_SHROUD_memory_destructor((SLIC_SHROUD_capsule_data*)lhs_capsule); } lhs_capsule->addr = rhs_capsule->addr; lhs_capsule->idtor = rhs_capsule->idtor; diff --git a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp index 127cc7816d..7ec3ac7e34 100644 --- a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp +++ b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.cpp @@ -20,7 +20,7 @@ extern "C" { // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -38,72 +38,72 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // splicer begin class.GenericOutputStream.C_definitions // splicer end class.GenericOutputStream.C_definitions -SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default(const char *stream, - SLIC_GenericOutputStream *SHC_rv) +SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_default(const char* stream, + SLIC_GenericOutputStream* SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_default const std::string SHC_stream_cxx(stream); - axom::slic::GenericOutputStream *SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::slic::GenericOutputStream* SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; return SHC_rv; // splicer end class.GenericOutputStream.method.ctor_default } -void SLIC_GenericOutputStream_ctor_default_bufferify(char *stream, +void SLIC_GenericOutputStream_ctor_default_bufferify(char* stream, int SHT_stream_len, - SLIC_GenericOutputStream *SHC_rv) + SLIC_GenericOutputStream* SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_default_bufferify int SHC_stream_trim = ShroudCharLenTrim(stream, SHT_stream_len); const std::string SHC_stream_cxx(stream, SHC_stream_trim); - axom::slic::GenericOutputStream *SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx); - SHC_rv->addr = static_cast(SHCXX_rv); + axom::slic::GenericOutputStream* SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; // splicer end class.GenericOutputStream.method.ctor_default_bufferify } -SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format(const char *stream, - const char *format, - SLIC_GenericOutputStream *SHC_rv) +SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_format(const char* stream, + const char* format, + SLIC_GenericOutputStream* SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_format const std::string SHC_stream_cxx(stream); const std::string SHC_format_cxx(format); - axom::slic::GenericOutputStream *SHCXX_rv = + axom::slic::GenericOutputStream* SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx, SHC_format_cxx); - SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; return SHC_rv; // splicer end class.GenericOutputStream.method.ctor_format } -void SLIC_GenericOutputStream_ctor_format_bufferify(char *stream, +void SLIC_GenericOutputStream_ctor_format_bufferify(char* stream, int SHT_stream_len, - char *format, + char* format, int SHT_format_len, - SLIC_GenericOutputStream *SHC_rv) + SLIC_GenericOutputStream* SHC_rv) { // splicer begin class.GenericOutputStream.method.ctor_format_bufferify int SHC_stream_trim = ShroudCharLenTrim(stream, SHT_stream_len); const std::string SHC_stream_cxx(stream, SHC_stream_trim); int SHC_format_trim = ShroudCharLenTrim(format, SHT_format_len); const std::string SHC_format_cxx(format, SHC_format_trim); - axom::slic::GenericOutputStream *SHCXX_rv = + axom::slic::GenericOutputStream* SHCXX_rv = new axom::slic::GenericOutputStream(SHC_stream_cxx, SHC_format_cxx); - SHC_rv->addr = static_cast(SHCXX_rv); + SHC_rv->addr = static_cast(SHCXX_rv); SHC_rv->idtor = 1; SHC_rv->cmemflags = SWIG_MEM_RVALUE | SWIG_MEM_OWN; // splicer end class.GenericOutputStream.method.ctor_format_bufferify } -void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream *self) +void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream* self) { - axom::slic::GenericOutputStream *SH_this = - static_cast(self->addr); + axom::slic::GenericOutputStream* SH_this = + static_cast(self->addr); // splicer begin class.GenericOutputStream.method.delete if(self->cmemflags & SWIG_MEM_OWN) { diff --git a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h index 8958a919cb..3b931e826c 100644 --- a/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h +++ b/src/axom/slic/interface/c_fortran/wrapGenericOutputStream.h @@ -28,24 +28,24 @@ extern "C" { // splicer begin class.GenericOutputStream.C_declarations // splicer end class.GenericOutputStream.C_declarations -SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_default(const char *stream, - SLIC_GenericOutputStream *SHC_rv); +SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_default(const char* stream, + SLIC_GenericOutputStream* SHC_rv); -void SLIC_GenericOutputStream_ctor_default_bufferify(char *stream, +void SLIC_GenericOutputStream_ctor_default_bufferify(char* stream, int SHT_stream_len, - SLIC_GenericOutputStream *SHC_rv); + SLIC_GenericOutputStream* SHC_rv); -SLIC_GenericOutputStream *SLIC_GenericOutputStream_ctor_format(const char *stream, - const char *format, - SLIC_GenericOutputStream *SHC_rv); +SLIC_GenericOutputStream* SLIC_GenericOutputStream_ctor_format(const char* stream, + const char* format, + SLIC_GenericOutputStream* SHC_rv); -void SLIC_GenericOutputStream_ctor_format_bufferify(char *stream, +void SLIC_GenericOutputStream_ctor_format_bufferify(char* stream, int SHT_stream_len, - char *format, + char* format, int SHT_format_len, - SLIC_GenericOutputStream *SHC_rv); + SLIC_GenericOutputStream* SHC_rv); -void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream *self); +void SLIC_GenericOutputStream_delete(SLIC_GenericOutputStream* self); #ifdef __cplusplus } diff --git a/src/axom/slic/interface/c_fortran/wrapSLIC.cpp b/src/axom/slic/interface/c_fortran/wrapSLIC.cpp index f4944327dd..1e6d86d3fc 100644 --- a/src/axom/slic/interface/c_fortran/wrapSLIC.cpp +++ b/src/axom/slic/interface/c_fortran/wrapSLIC.cpp @@ -22,7 +22,7 @@ extern "C" { // helper char_len_trim // Returns the length of character string src with length nsrc, // ignoring any trailing blanks. -static int ShroudCharLenTrim(const char *src, int nsrc) +static int ShroudCharLenTrim(const char* src, int nsrc) { int i; @@ -40,7 +40,7 @@ static int ShroudCharLenTrim(const char *src, int nsrc) // helper string_to_cdesc // Save std::string metadata into array to allow Fortran to access values. // CHARACTER(len=elem_size) src -static void ShroudStringToCdesc(SLIC_SHROUD_array *cdesc, const std::string *src) +static void ShroudStringToCdesc(SLIC_SHROUD_array* cdesc, const std::string* src) { if(src->empty()) { @@ -49,7 +49,7 @@ static void ShroudStringToCdesc(SLIC_SHROUD_array *cdesc, const std::string *src } else { - cdesc->base_addr = const_cast(src->data()); + cdesc->base_addr = const_cast(src->data()); cdesc->elem_len = src->length(); } cdesc->size = 1; @@ -74,7 +74,7 @@ bool SLIC_isInitialized(void) // splicer end function.isInitialized } -void SLIC_createLogger(const char *name, char imask) +void SLIC_createLogger(const char* name, char imask) { // splicer begin function.createLogger const std::string SHC_name_cxx(name); @@ -82,7 +82,7 @@ void SLIC_createLogger(const char *name, char imask) // splicer end function.createLogger } -void SLIC_createLogger_bufferify(char *name, int SHT_name_len, char imask) +void SLIC_createLogger_bufferify(char* name, int SHT_name_len, char imask) { // splicer begin function.createLogger_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); @@ -91,7 +91,7 @@ void SLIC_createLogger_bufferify(char *name, int SHT_name_len, char imask) // splicer end function.createLogger_bufferify } -bool SLIC_activateLogger(const char *name) +bool SLIC_activateLogger(const char* name) { // splicer begin function.activateLogger const std::string SHC_name_cxx(name); @@ -100,7 +100,7 @@ bool SLIC_activateLogger(const char *name) // splicer end function.activateLogger } -bool SLIC_activateLogger_bufferify(char *name, int SHT_name_len) +bool SLIC_activateLogger_bufferify(char* name, int SHT_name_len) { // splicer begin function.activateLogger_bufferify int SHC_name_trim = ShroudCharLenTrim(name, SHT_name_len); @@ -110,12 +110,12 @@ bool SLIC_activateLogger_bufferify(char *name, int SHT_name_len) // splicer end function.activateLogger_bufferify } -const char *SLIC_getActiveLoggerName(SLIC_SHROUD_capsule_data *SHT_rv_capsule) +const char* SLIC_getActiveLoggerName(SLIC_SHROUD_capsule_data* SHT_rv_capsule) { // splicer begin function.getActiveLoggerName - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = axom::slic::getActiveLoggerName(); - const char *SHC_rv = NULL; + const char* SHC_rv = NULL; if(!SHC_rv_cxx->empty()) SHC_rv = SHC_rv_cxx->c_str(); SHT_rv_capsule->addr = SHC_rv_cxx; SHT_rv_capsule->idtor = 2; @@ -124,11 +124,11 @@ const char *SLIC_getActiveLoggerName(SLIC_SHROUD_capsule_data *SHT_rv_capsule) // splicer end function.getActiveLoggerName } -void SLIC_getActiveLoggerName_bufferify(SLIC_SHROUD_array *SHT_rv_cdesc, - SLIC_SHROUD_capsule_data *SHT_rv_capsule) +void SLIC_getActiveLoggerName_bufferify(SLIC_SHROUD_array* SHT_rv_cdesc, + SLIC_SHROUD_capsule_data* SHT_rv_capsule) { // splicer begin function.getActiveLoggerName_bufferify - std::string *SHC_rv_cxx = new std::string; + std::string* SHC_rv_cxx = new std::string; *SHC_rv_cxx = axom::slic::getActiveLoggerName(); ShroudStringToCdesc(SHT_rv_cdesc, SHC_rv_cxx); SHT_rv_capsule->addr = SHC_rv_cxx; @@ -171,31 +171,31 @@ void SLIC_setLoggingMsgLevel_bufferify(int level) // splicer end function.setLoggingMsgLevel_bufferify } -void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream *ls, enum SLIC_message_Level level) +void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream* ls, enum SLIC_message_Level level) { // splicer begin function.addStreamToMsgLevel - axom::slic::GenericOutputStream *SHC_ls_cxx = - static_cast(ls->addr); + axom::slic::GenericOutputStream* SHC_ls_cxx = + static_cast(ls->addr); axom::slic::message::Level SHCXX_level = static_cast(level); axom::slic::addStreamToMsgLevel(SHC_ls_cxx, SHCXX_level); // splicer end function.addStreamToMsgLevel } -void SLIC_addStreamToMsgLevel_bufferify(SLIC_GenericOutputStream *ls, int level) +void SLIC_addStreamToMsgLevel_bufferify(SLIC_GenericOutputStream* ls, int level) { // splicer begin function.addStreamToMsgLevel_bufferify - axom::slic::GenericOutputStream *SHC_ls_cxx = - static_cast(ls->addr); + axom::slic::GenericOutputStream* SHC_ls_cxx = + static_cast(ls->addr); axom::slic::message::Level SHCXX_level = static_cast(level); axom::slic::addStreamToMsgLevel(SHC_ls_cxx, SHCXX_level); // splicer end function.addStreamToMsgLevel_bufferify } -void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream *ls) +void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream* ls) { // splicer begin function.addStreamToAllMsgLevels - axom::slic::GenericOutputStream *SHC_ls_cxx = - static_cast(ls->addr); + axom::slic::GenericOutputStream* SHC_ls_cxx = + static_cast(ls->addr); axom::slic::addStreamToAllMsgLevels(SHC_ls_cxx); // splicer end function.addStreamToAllMsgLevels } @@ -259,8 +259,8 @@ bool SLIC_isAbortOnWarningsEnabled(void) } void SLIC_logMessage_file_line(enum SLIC_message_Level level, - const char *message, - const char *fileName, + const char* message, + const char* fileName, int line) { // splicer begin function.logMessage_file_line @@ -272,9 +272,9 @@ void SLIC_logMessage_file_line(enum SLIC_message_Level level, } void SLIC_logMessage_file_line_bufferify(int level, - char *message, + char* message, int SHT_message_len, - char *fileName, + char* fileName, int SHT_fileName_len, int line) { @@ -289,8 +289,8 @@ void SLIC_logMessage_file_line_bufferify(int level, } void SLIC_logMessage_file_line_filter(enum SLIC_message_Level level, - const char *message, - const char *fileName, + const char* message, + const char* fileName, int line, bool filter_duplicates) { @@ -303,9 +303,9 @@ void SLIC_logMessage_file_line_filter(enum SLIC_message_Level level, } void SLIC_logMessage_file_line_filter_bufferify(int level, - char *message, + char* message, int SHT_message_len, - char *fileName, + char* fileName, int SHT_fileName_len, int line, bool filter_duplicates) @@ -320,7 +320,7 @@ void SLIC_logMessage_file_line_filter_bufferify(int level, // splicer end function.logMessage_file_line_filter_bufferify } -void SLIC_logMessage(enum SLIC_message_Level level, const char *message) +void SLIC_logMessage(enum SLIC_message_Level level, const char* message) { // splicer begin function.logMessage axom::slic::message::Level SHCXX_level = static_cast(level); @@ -329,7 +329,7 @@ void SLIC_logMessage(enum SLIC_message_Level level, const char *message) // splicer end function.logMessage } -void SLIC_logMessage_bufferify(int level, char *message, int SHT_message_len) +void SLIC_logMessage_bufferify(int level, char* message, int SHT_message_len) { // splicer begin function.logMessage_bufferify axom::slic::message::Level SHCXX_level = static_cast(level); @@ -339,7 +339,7 @@ void SLIC_logMessage_bufferify(int level, char *message, int SHT_message_len) // splicer end function.logMessage_bufferify } -void SLIC_logMessage_filter(enum SLIC_message_Level level, const char *message, bool filter_duplicates) +void SLIC_logMessage_filter(enum SLIC_message_Level level, const char* message, bool filter_duplicates) { // splicer begin function.logMessage_filter axom::slic::message::Level SHCXX_level = static_cast(level); @@ -349,7 +349,7 @@ void SLIC_logMessage_filter(enum SLIC_message_Level level, const char *message, } void SLIC_logMessage_filter_bufferify(int level, - char *message, + char* message, int SHT_message_len, bool filter_duplicates) { diff --git a/src/axom/slic/interface/c_fortran/wrapSLIC.h b/src/axom/slic/interface/c_fortran/wrapSLIC.h index 48da44b1b0..947d489cf3 100644 --- a/src/axom/slic/interface/c_fortran/wrapSLIC.h +++ b/src/axom/slic/interface/c_fortran/wrapSLIC.h @@ -48,18 +48,18 @@ void SLIC_initialize(void); bool SLIC_isInitialized(void); -void SLIC_createLogger(const char *name, char imask); +void SLIC_createLogger(const char* name, char imask); -void SLIC_createLogger_bufferify(char *name, int SHT_name_len, char imask); +void SLIC_createLogger_bufferify(char* name, int SHT_name_len, char imask); -bool SLIC_activateLogger(const char *name); +bool SLIC_activateLogger(const char* name); -bool SLIC_activateLogger_bufferify(char *name, int SHT_name_len); +bool SLIC_activateLogger_bufferify(char* name, int SHT_name_len); -const char *SLIC_getActiveLoggerName(SLIC_SHROUD_capsule_data *SHT_rv_capsule); +const char* SLIC_getActiveLoggerName(SLIC_SHROUD_capsule_data* SHT_rv_capsule); -void SLIC_getActiveLoggerName_bufferify(SLIC_SHROUD_array *SHT_rv_cdesc, - SLIC_SHROUD_capsule_data *SHT_rv_capsule); +void SLIC_getActiveLoggerName_bufferify(SLIC_SHROUD_array* SHT_rv_cdesc, + SLIC_SHROUD_capsule_data* SHT_rv_capsule); enum SLIC_message_Level SLIC_getLoggingMsgLevel(void); @@ -69,11 +69,11 @@ void SLIC_setLoggingMsgLevel(enum SLIC_message_Level level); void SLIC_setLoggingMsgLevel_bufferify(int level); -void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream *ls, enum SLIC_message_Level level); +void SLIC_addStreamToMsgLevel(SLIC_GenericOutputStream* ls, enum SLIC_message_Level level); -void SLIC_addStreamToMsgLevel_bufferify(SLIC_GenericOutputStream *ls, int level); +void SLIC_addStreamToMsgLevel_bufferify(SLIC_GenericOutputStream* ls, int level); -void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream *ls); +void SLIC_addStreamToAllMsgLevels(SLIC_GenericOutputStream* ls); void SLIC_setAbortOnError(bool status); @@ -92,39 +92,39 @@ void SLIC_disableAbortOnWarning(void); bool SLIC_isAbortOnWarningsEnabled(void); void SLIC_logMessage_file_line(enum SLIC_message_Level level, - const char *message, - const char *fileName, + const char* message, + const char* fileName, int line); void SLIC_logMessage_file_line_bufferify(int level, - char *message, + char* message, int SHT_message_len, - char *fileName, + char* fileName, int SHT_fileName_len, int line); void SLIC_logMessage_file_line_filter(enum SLIC_message_Level level, - const char *message, - const char *fileName, + const char* message, + const char* fileName, int line, bool filter_duplicates); void SLIC_logMessage_file_line_filter_bufferify(int level, - char *message, + char* message, int SHT_message_len, - char *fileName, + char* fileName, int SHT_fileName_len, int line, bool filter_duplicates); -void SLIC_logMessage(enum SLIC_message_Level level, const char *message); +void SLIC_logMessage(enum SLIC_message_Level level, const char* message); -void SLIC_logMessage_bufferify(int level, char *message, int SHT_message_len); +void SLIC_logMessage_bufferify(int level, char* message, int SHT_message_len); -void SLIC_logMessage_filter(enum SLIC_message_Level level, const char *message, bool filter_duplicates); +void SLIC_logMessage_filter(enum SLIC_message_Level level, const char* message, bool filter_duplicates); void SLIC_logMessage_filter_bufferify(int level, - char *message, + char* message, int SHT_message_len, bool filter_duplicates); diff --git a/src/axom/slic/internal/stacktrace.cpp b/src/axom/slic/internal/stacktrace.cpp index c6b0d14d42..27f431d1fd 100644 --- a/src/axom/slic/internal/stacktrace.cpp +++ b/src/axom/slic/internal/stacktrace.cpp @@ -1,182 +1,182 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include // for free -#include // for std::ostringstream - -#ifdef WIN32 - #define NOMINMAX - #include - #include - #include -#else - #include // for backtrace() - #include - #if !defined(_LIBCPP_VERSION) - #include // for abi::__cxa_demangle - #endif -#endif - -constexpr int MAX_FRAMES = 25; - -namespace axom -{ -namespace slic -{ -namespace internal -{ -#ifdef WIN32 - -std::string stacktrace() -{ - void* stack[MAX_FRAMES]; - std::ostringstream oss; - - unsigned short frames; - SYMBOL_INFO* symbol; - HANDLE process; - - process = GetCurrentProcess(); - - SymInitialize(process, NULL, TRUE); - - frames = CaptureStackBackTrace(0, MAX_FRAMES, stack, NULL); - symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1); - symbol->MaxNameLen = 255; - symbol->SizeOfStruct = sizeof(SYMBOL_INFO); - - oss << "\n** StackTrace of " << frames << " frames **\n"; - for(int i = 0; i < frames; i++) - { - char outString[512]; - SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); - - sprintf_s(outString, "%i: %s - 0x%0X", frames - i - 1, symbol->Name, symbol->Address); - oss << outString << std::endl; - } - - free(symbol); - oss << "=====\n\n"; - - return (oss.str()); -} - -#else /* #ifdef WIN32 */ - -//------------------------------------------------------------------------------ -std::string demangle(char* backtraceString, int frame) -{ - char* mangledName = nullptr; - char* functionOffset = nullptr; - char* returnOffset = nullptr; - - #ifdef __APPLE__ +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include // for free +#include // for std::ostringstream + +#ifdef WIN32 + #define NOMINMAX + #include + #include + #include +#else + #include // for backtrace() + #include + #if !defined(_LIBCPP_VERSION) + #include // for abi::__cxa_demangle + #endif +#endif + +constexpr int MAX_FRAMES = 25; + +namespace axom +{ +namespace slic +{ +namespace internal +{ +#ifdef WIN32 + +std::string stacktrace() +{ + void* stack[MAX_FRAMES]; + std::ostringstream oss; + + unsigned short frames; + SYMBOL_INFO* symbol; + HANDLE process; + + process = GetCurrentProcess(); + + SymInitialize(process, NULL, TRUE); + + frames = CaptureStackBackTrace(0, MAX_FRAMES, stack, NULL); + symbol = (SYMBOL_INFO*)calloc(sizeof(SYMBOL_INFO) + 256 * sizeof(char), 1); + symbol->MaxNameLen = 255; + symbol->SizeOfStruct = sizeof(SYMBOL_INFO); + + oss << "\n** StackTrace of " << frames << " frames **\n"; + for(int i = 0; i < frames; i++) + { + char outString[512]; + SymFromAddr(process, (DWORD64)(stack[i]), 0, symbol); + + sprintf_s(outString, "%i: %s - 0x%0X", frames - i - 1, symbol->Name, symbol->Address); + oss << outString << std::endl; + } + + free(symbol); + oss << "=====\n\n"; + + return (oss.str()); +} + +#else /* #ifdef WIN32 */ + +//------------------------------------------------------------------------------ +std::string demangle(char* backtraceString, int frame) +{ + char* mangledName = nullptr; + char* functionOffset = nullptr; + char* returnOffset = nullptr; + + #ifdef __APPLE__ /* On apple machines the mangled function name always starts at the 58th - * character */ - constexpr int APPLE_OFFSET = 58; - mangledName = backtraceString + APPLE_OFFSET; - for(char* p = backtraceString; *p; ++p) - { - if(*p == '+') - { - functionOffset = p; - } - returnOffset = p; - } - #else - for(char* p = backtraceString; *p; ++p) - { - if(*p == '(') - { - mangledName = p; - } - else if(*p == '+') - { - functionOffset = p; - } - else if(*p == ')') - { - returnOffset = p; - break; - } - } - #endif - - std::ostringstream oss; - - // if the line could be processed, attempt to demangle the symbol - if(mangledName && functionOffset && returnOffset && mangledName < functionOffset) - { - *mangledName = 0; - mangledName++; - #ifdef __APPLE__ - *(functionOffset - 1) = 0; - #endif - *functionOffset = 0; - ++functionOffset; - *returnOffset = 0; - ++returnOffset; - - int status = false; - #if !defined(_LIBCPP_VERSION) - char* realName = abi::__cxa_demangle(mangledName, nullptr, nullptr, &status); - #else - char* realName = mangledName; - #endif - - // if demangling is successful, output the demangled function name - if(status == 0) - { - oss << "Frame " << frame << ": " << realName << std::endl; - } - // otherwise, output the mangled function name - else - { - oss << "Frame " << frame << ": " << mangledName << std::endl; - } - - #if !defined(_LIBCPP_VERSION) - free(realName); - #endif - } - // otherwise, print the whole line - else - { - oss << "Frame " << frame << ": " << backtraceString << std::endl; - } - - return (oss.str()); -} - -std::string stacktrace() -{ - void* array[MAX_FRAMES]; - - const int size = backtrace(array, MAX_FRAMES); - char** strings = backtrace_symbols(array, size); - - // skip first stack frame (points here) - std::ostringstream oss; - oss << "\n** StackTrace of " << size - 1 << " frames **\n"; - for(int i = 1; i < size && strings != nullptr; ++i) - { - oss << internal::demangle(strings[i], i); - } - - oss << "=====\n\n"; - - free(strings); - - return (oss.str()); -} - -#endif /* #ifdef WIN32 */ - -} /* namespace internal */ - -} /* namespace slic */ - -} /* namespace axom */ + * character */ + constexpr int APPLE_OFFSET = 58; + mangledName = backtraceString + APPLE_OFFSET; + for(char* p = backtraceString; *p; ++p) + { + if(*p == '+') + { + functionOffset = p; + } + returnOffset = p; + } + #else + for(char* p = backtraceString; *p; ++p) + { + if(*p == '(') + { + mangledName = p; + } + else if(*p == '+') + { + functionOffset = p; + } + else if(*p == ')') + { + returnOffset = p; + break; + } + } + #endif + + std::ostringstream oss; + + // if the line could be processed, attempt to demangle the symbol + if(mangledName && functionOffset && returnOffset && mangledName < functionOffset) + { + *mangledName = 0; + mangledName++; + #ifdef __APPLE__ + *(functionOffset - 1) = 0; + #endif + *functionOffset = 0; + ++functionOffset; + *returnOffset = 0; + ++returnOffset; + + int status = false; + #if !defined(_LIBCPP_VERSION) + char* realName = abi::__cxa_demangle(mangledName, nullptr, nullptr, &status); + #else + char* realName = mangledName; + #endif + + // if demangling is successful, output the demangled function name + if(status == 0) + { + oss << "Frame " << frame << ": " << realName << std::endl; + } + // otherwise, output the mangled function name + else + { + oss << "Frame " << frame << ": " << mangledName << std::endl; + } + + #if !defined(_LIBCPP_VERSION) + free(realName); + #endif + } + // otherwise, print the whole line + else + { + oss << "Frame " << frame << ": " << backtraceString << std::endl; + } + + return (oss.str()); +} + +std::string stacktrace() +{ + void* array[MAX_FRAMES]; + + const int size = backtrace(array, MAX_FRAMES); + char** strings = backtrace_symbols(array, size); + + // skip first stack frame (points here) + std::ostringstream oss; + oss << "\n** StackTrace of " << size - 1 << " frames **\n"; + for(int i = 1; i < size && strings != nullptr; ++i) + { + oss << internal::demangle(strings[i], i); + } + + oss << "=====\n\n"; + + free(strings); + + return (oss.str()); +} + +#endif /* #ifdef WIN32 */ + +} /* namespace internal */ + +} /* namespace slic */ + +} /* namespace axom */ diff --git a/src/axom/slic/internal/stacktrace.hpp b/src/axom/slic/internal/stacktrace.hpp index 94d2f72f1c..c29abe0604 100644 --- a/src/axom/slic/internal/stacktrace.hpp +++ b/src/axom/slic/internal/stacktrace.hpp @@ -1,23 +1,23 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#pragma once - -#include - -namespace axom -{ -namespace slic -{ -namespace internal -{ -std::string stacktrace(); - -} /* namespace internal */ - -} /* namespace slic */ - -} /* namespace axom */ +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#pragma once + +#include + +namespace axom +{ +namespace slic +{ +namespace internal +{ +std::string stacktrace(); + +} /* namespace internal */ + +} /* namespace slic */ + +} /* namespace axom */ diff --git a/src/thirdparty/tests/sol_smoke.cpp b/src/thirdparty/tests/sol_smoke.cpp index bb91d9b9e4..dfb80a8420 100644 --- a/src/thirdparty/tests/sol_smoke.cpp +++ b/src/thirdparty/tests/sol_smoke.cpp @@ -1,28 +1,28 @@ -// Copyright (c) Lawrence Livermore National Security, LLC and other -// Axom Project Contributors. See top-level LICENSE and COPYRIGHT -// files for dates and other details. -// -// SPDX-License-Identifier: (BSD-3-Clause) - -#include - -#include "axom/sol.hpp" -#include "gtest/gtest.h" - -TEST(sol_smoke, basic_use) -{ - axom::sol::state lua; - lua.script( - "table1={" - " table2={" - " some_bool = true," - " some_double = 3.0 " - " }" - "}"); - - bool some_bool = lua["table1"]["table2"]["some_bool"]; - EXPECT_TRUE(some_bool); - - double some_double = lua["table1"]["table2"]["some_double"]; - EXPECT_NEAR(some_double, 3.0, 0.1); -} +// Copyright (c) Lawrence Livermore National Security, LLC and other +// Axom Project Contributors. See top-level LICENSE and COPYRIGHT +// files for dates and other details. +// +// SPDX-License-Identifier: (BSD-3-Clause) + +#include + +#include "axom/sol.hpp" +#include "gtest/gtest.h" + +TEST(sol_smoke, basic_use) +{ + axom::sol::state lua; + lua.script( + "table1={" + " table2={" + " some_bool = true," + " some_double = 3.0 " + " }" + "}"); + + bool some_bool = lua["table1"]["table2"]["some_bool"]; + EXPECT_TRUE(some_bool); + + double some_double = lua["table1"]["table2"]["some_double"]; + EXPECT_NEAR(some_double, 3.0, 0.1); +}