diff --git a/Applications/ApplicationsLib/ProjectData.cpp b/Applications/ApplicationsLib/ProjectData.cpp index 38684db553638a24b2c999d16c813c494feecca5..5e45b588975f7d28c04f9fd285bea47a214110ff 100644 --- a/Applications/ApplicationsLib/ProjectData.cpp +++ b/Applications/ApplicationsLib/ProjectData.cpp @@ -221,7 +221,7 @@ boost::optional<ParameterLib::CoordinateSystem> parseLocalCoordinateSystem( *config, //! \ogs_file_param_special{prj__local_coordinate_system__basis_vector_0} "basis_vector_0", parameters, 0 /* any dimension */); - int const dimension = basis_vector_0.getNumberOfComponents(); + int const dimension = basis_vector_0.getNumberOfGlobalComponents(); // check dimension if (dimension != 2 && dimension != 3) diff --git a/Applications/Utils/MeshEdit/UnityPreprocessing.cpp b/Applications/Utils/MeshEdit/UnityPreprocessing.cpp index 9700ffeb354d8ab42936e34f12b40bc8860c5aa2..2e92f8e67f0404cccf8f7aa799575582fd479c43 100644 --- a/Applications/Utils/MeshEdit/UnityPreprocessing.cpp +++ b/Applications/Utils/MeshEdit/UnityPreprocessing.cpp @@ -58,7 +58,7 @@ void fillPropVec(MeshLib::PropertyVector<T> const& property, std::vector<std::vector<std::size_t>> const& node_map, std::size_t const total_nodes) { - assert(property.getNumberOfComponents() == 1); + assert(property.getNumberOfGlobalComponents() == 1); MeshLib::PropertyVector<T>* new_property = new_props.createNewPropertyVector<T>(property.getPropertyName(), MeshLib::MeshItemType::Node, 1); @@ -103,7 +103,7 @@ MeshLib::Properties constructProperties( Properties new_properties; for (auto [name, property] : properties) { - if (property->getNumberOfComponents() != 1) + if (property->getNumberOfGlobalComponents() != 1) { INFO("Ignoring array '{:s}' (more than one component).", name); continue; diff --git a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp index a0786362f278d562e3ab9384fff4836ee305af8f..fc9a80b8a62bd2033d8b7cabf7bcf09fa2f823e5 100644 --- a/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp +++ b/Applications/Utils/ModelPreparation/PartitionMesh/NodeWiseMeshPartitioner.cpp @@ -337,7 +337,7 @@ std::size_t copyNodePropertyVectorValues( { auto const& nodes = p.nodes; auto const nnodes = nodes.size(); - auto const n_components = pv.getNumberOfComponents(); + auto const n_components = pv.getNumberOfGlobalComponents(); for (std::size_t i = 0; i < nnodes; ++i) { const auto global_id = nodes[i]->getID(); @@ -358,7 +358,7 @@ std::size_t copyCellPropertyVectorValues( MeshLib::PropertyVector<T>& partitioned_pv) { std::size_t const n_regular(p.regular_elements.size()); - auto const n_components = pv.getNumberOfComponents(); + auto const n_components = pv.getNumberOfGlobalComponents(); for (std::size_t i = 0; i < n_regular; ++i) { const auto id = p.regular_elements[i]->getID(); @@ -398,9 +398,9 @@ bool copyPropertyVector( auto partitioned_pv = partitioned_properties.createNewPropertyVector<T>( pv->getPropertyName(), pv->getMeshItemType(), - pv->getNumberOfComponents()); + pv->getNumberOfGlobalComponents()); partitioned_pv->resize(total_number_of_tuples.at(item_type) * - pv->getNumberOfComponents()); + pv->getNumberOfGlobalComponents()); auto copy_property_vector_values = [&](Partition const& p, std::size_t offset) { @@ -729,7 +729,7 @@ bool writePropertyVectorBinary(MeshLib::PropertyVector<T> const* const pv, MeshLib::IO::PropertyVectorMetaData pvmd; pvmd.property_name = pv->getPropertyName(); pvmd.fillPropertyVectorMetaDataTypeInfo<T>(); - pvmd.number_of_components = pv->getNumberOfComponents(); + pvmd.number_of_components = pv->getNumberOfGlobalComponents(); pvmd.number_of_tuples = pv->getNumberOfTuples(); writePropertyVectorValuesBinary(out_val, *pv); MeshLib::IO::writePropertyVectorMetaDataBinary(out_meta, pvmd); diff --git a/MaterialLib/PorousMedium/Permeability/Permeability.h b/MaterialLib/PorousMedium/Permeability/Permeability.h index 612e89bcd0928162ab74eee14cd22e9da62e4613..62330bbd2a928c83ef7261a984359758fccc5b28 100644 --- a/MaterialLib/PorousMedium/Permeability/Permeability.h +++ b/MaterialLib/PorousMedium/Permeability/Permeability.h @@ -29,13 +29,14 @@ public: int const dimension) : _permeability_parameter(permeability_parameter), _dimension(dimension) { - if (permeability_parameter.getNumberOfComponents() != + if (permeability_parameter.getNumberOfGlobalComponents() != _dimension * _dimension) { OGS_FATAL( "The given parameter has {:d} components, but the permeability " "tensor is defined for a {:d} dimensional problem.", - permeability_parameter.getNumberOfComponents(), _dimension); + permeability_parameter.getNumberOfGlobalComponents(), + _dimension); } } diff --git a/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp b/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp index 88e116358651136c83e387ec2c06f0fb8fee598c..1c34f657285765ad1de21bee41d8a0ff069a46c5 100644 --- a/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp +++ b/MaterialLib/PorousMedium/Permeability/createPermeabilityModel.cpp @@ -43,14 +43,15 @@ std::unique_ptr<Permeability> createPermeabilityModel( "permeability_tensor_entries", parameters, 0); int dimension = static_cast<int>( - std::sqrt(permeability_parameter.getNumberOfComponents())); - if (permeability_parameter.getNumberOfComponents() != + std::sqrt(permeability_parameter.getNumberOfGlobalComponents())); + if (permeability_parameter.getNumberOfGlobalComponents() != dimension * dimension) { OGS_FATAL( "The given parameter has {:d} components, but the permeability " "tensor is defined for a {:d} dimensional problem.", - permeability_parameter.getNumberOfComponents(), dimension); + permeability_parameter.getNumberOfGlobalComponents(), + dimension); } return std::make_unique<Permeability>( @@ -66,14 +67,15 @@ std::unique_ptr<Permeability> createPermeabilityModel( "permeability_tensor_entries", parameters, 0); int dimension = static_cast<int>( - std::sqrt(permeability_parameter.getNumberOfComponents())); - if (permeability_parameter.getNumberOfComponents() != + std::sqrt(permeability_parameter.getNumberOfGlobalComponents())); + if (permeability_parameter.getNumberOfGlobalComponents() != dimension * dimension) { OGS_FATAL( "The given parameter has {:d} components, but the permeability " "tensor is defined for a {:d} dimensional problem.", - permeability_parameter.getNumberOfComponents(), dimension); + permeability_parameter.getNumberOfGlobalComponents(), + dimension); } return std::make_unique<DupuitPermeability>(permeability_parameter, diff --git a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp index 2637d29e313e9ed31e1ed7f71aa6d3ccbe5f1457..6df78cfd0f66376699e6c2c3c454e7a7fd5d3180 100644 --- a/MeshLib/MeshEditing/ConvertToLinearMesh.cpp +++ b/MeshLib/MeshEditing/ConvertToLinearMesh.cpp @@ -115,7 +115,7 @@ std::unique_ptr<MeshLib::Mesh> convertToLinearMesh( { continue; } - auto const n_src_comp = double_property->getNumberOfComponents(); + auto const n_src_comp = double_property->getNumberOfGlobalComponents(); auto new_prop = new_mesh->getProperties().createNewPropertyVector<double>( name, MeshLib::MeshItemType::Node, n_src_comp); diff --git a/MeshLib/MeshSurfaceExtraction.cpp b/MeshLib/MeshSurfaceExtraction.cpp index ea5797f5de57a9de0ff71e48eac5521fb9fb4db9..fea2a63c8d460c2d8c1a63b10bcbdf9a5c77df4d 100644 --- a/MeshLib/MeshSurfaceExtraction.cpp +++ b/MeshLib/MeshSurfaceExtraction.cpp @@ -34,7 +34,7 @@ void processPropertyVector(MeshLib::PropertyVector<T> const& property, std::vector<std::size_t> const& id_map, MeshLib::Mesh& sfc_mesh) { - auto const number_of_components = property.getNumberOfComponents(); + auto const number_of_components = property.getNumberOfGlobalComponents(); auto sfc_prop = getOrCreateMeshProperty<T>( sfc_mesh, property.getPropertyName(), property.getMeshItemType(), diff --git a/MeshLib/Properties-impl.h b/MeshLib/Properties-impl.h index c1ad9e8ac29410ef18892eb1db5a8fe238c5b535..df40fcbdf51625b14a8f544520726dc4abe423f9 100644 --- a/MeshLib/Properties-impl.h +++ b/MeshLib/Properties-impl.h @@ -108,7 +108,7 @@ bool Properties::existsPropertyVector(std::string const& name, { return false; } - if (property->getNumberOfComponents() != number_of_components) + if (property->getNumberOfGlobalComponents() != number_of_components) { return false; } @@ -183,12 +183,12 @@ PropertyVector<T> const* Properties::getPropertyVector( "requested.", name, toString(property->getMeshItemType()), toString(item_type)); } - if (property->getNumberOfComponents() != n_components) + if (property->getNumberOfGlobalComponents() != n_components) { OGS_FATAL( "PropertyVector '{:s}' has {:d} components, {:d} components are " "needed.", - name, property->getNumberOfComponents(), n_components); + name, property->getNumberOfGlobalComponents(), n_components); } return property; } @@ -221,12 +221,12 @@ PropertyVector<T>* Properties::getPropertyVector(std::string const& name, "requested.", name, toString(property->getMeshItemType()), toString(item_type)); } - if (property->getNumberOfComponents() != n_components) + if (property->getNumberOfGlobalComponents() != n_components) { OGS_FATAL( "PropertyVector '{:s}' has {:d} components, {:d} components are " "needed.", - name, property->getNumberOfComponents(), n_components); + name, property->getNumberOfGlobalComponents(), n_components); } return property; } diff --git a/MeshLib/PropertyVector.h b/MeshLib/PropertyVector.h index e7563d7d93b47ed2f7a51f8797057755f3f3236d..b0817d6efc1d1606895f8e4065061c23ccd581c1 100644 --- a/MeshLib/PropertyVector.h +++ b/MeshLib/PropertyVector.h @@ -30,7 +30,7 @@ public: MeshItemType getMeshItemType() const { return _mesh_item_type; } std::string const& getPropertyName() const { return _property_name; } - int getNumberOfComponents() const { return _n_components; } + int getNumberOfGlobalComponents() const { return _n_components; } protected: PropertyVectorBase(std::string property_name, @@ -68,7 +68,7 @@ public: { assert(component < _n_components); assert(tuple_index < getNumberOfTuples()); - return this->operator[](tuple_index* getNumberOfComponents() + + return this->operator[](tuple_index* getNumberOfGlobalComponents() + component); } @@ -78,7 +78,7 @@ public: { assert(component < _n_components); assert(tuple_index < getNumberOfTuples()); - return this->operator[](tuple_index* getNumberOfComponents() + + return this->operator[](tuple_index* getNumberOfGlobalComponents() + component); } diff --git a/MeshLib/Vtk/VtkMappedMeshSource.cpp b/MeshLib/Vtk/VtkMappedMeshSource.cpp index 29080324452e1bf95ba1d55d119651e02a66409c..9bbc45d8a842fcec8eebeb764ac683742eaa8fc2 100644 --- a/MeshLib/Vtk/VtkMappedMeshSource.cpp +++ b/MeshLib/Vtk/VtkMappedMeshSource.cpp @@ -219,7 +219,7 @@ void VtkMappedMeshSource::addProperty( dataArray->SetArray(const_cast<T*>(property.data()), static_cast<vtkIdType>(property.size()), static_cast<int>(!hasArrayOwnership)); - dataArray->SetNumberOfComponents(property.getNumberOfComponents()); + dataArray->SetNumberOfComponents(property.getNumberOfGlobalComponents()); dataArray->SetName(property.getPropertyName().c_str()); if (property.getMeshItemType() == MeshLib::MeshItemType::Node) diff --git a/NumLib/DOF/ComputeSparsityPattern.cpp b/NumLib/DOF/ComputeSparsityPattern.cpp index fe67cc7f30fe3cdf493cfa559a4d225c2cbe2499..3488a3808953bf94e43b640508b7c5dfe5946591 100644 --- a/NumLib/DOF/ComputeSparsityPattern.cpp +++ b/NumLib/DOF/ComputeSparsityPattern.cpp @@ -26,8 +26,8 @@ GlobalSparsityPattern computeSparsityPatternPETSc( auto const& npmesh = *static_cast<MeshLib::NodePartitionedMesh const*>(&mesh); - auto const max_nonzeroes = dof_table.getNumberOfComponents() - * npmesh.getMaximumNConnectedNodesToNode(); + auto const max_nonzeroes = dof_table.getNumberOfGlobalComponents() * + npmesh.getMaximumNConnectedNodesToNode(); // The sparsity pattern is misused here in the sense that it will only // contain a single value. diff --git a/NumLib/DOF/DOFTableUtil.cpp b/NumLib/DOF/DOFTableUtil.cpp index 98cf783fa8f45c893b66a8d9227ea607189e6007..04f1e9e4f017a471f49d07fd0bf037704f8302ab 100644 --- a/NumLib/DOF/DOFTableUtil.cpp +++ b/NumLib/DOF/DOFTableUtil.cpp @@ -130,7 +130,7 @@ std::vector<GlobalIndexType> getIndices( // Local matrices and vectors will always be ordered by component // no matter what the order of the global matrix is. - for (int c = 0; c < dof_table.getNumberOfComponents(); ++c) + for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c) { auto const& idcs = dof_table(mesh_item_id, c).rows; indices.reserve(indices.size() + idcs.size()); @@ -150,7 +150,7 @@ NumLib::LocalToGlobalIndexMap::RowColumnIndices getRowColumnIndices( // Local matrices and vectors will always be ordered by component, // no matter what the order of the global matrix is. - for (int c = 0; c < dof_table.getNumberOfComponents(); ++c) + for (int c = 0; c < dof_table.getNumberOfGlobalComponents(); ++c) { auto const& idcs = dof_table(id, c).rows; indices.reserve(indices.size() + idcs.size()); diff --git a/NumLib/DOF/LocalToGlobalIndexMap.cpp b/NumLib/DOF/LocalToGlobalIndexMap.cpp index dffd9c1efe111cfa3bd9ed0fd892bc8f030b6a8d..8644d435817cc3c5c091b0c01918020aa2604a52 100644 --- a/NumLib/DOF/LocalToGlobalIndexMap.cpp +++ b/NumLib/DOF/LocalToGlobalIndexMap.cpp @@ -278,7 +278,7 @@ LocalToGlobalIndexMap::deriveBoundaryConstrainedMap( // Create a subset of the current mesh component map. std::vector<int> global_component_ids; - for (int i = 0; i < getNumberOfComponents(); ++i) + for (int i = 0; i < getNumberOfGlobalComponents(); ++i) { global_component_ids.push_back(i); } @@ -327,7 +327,7 @@ int LocalToGlobalIndexMap::getNumberOfVariableComponents(int variable_id) const _variable_component_offsets[variable_id]; } -int LocalToGlobalIndexMap::getNumberOfComponents() const +int LocalToGlobalIndexMap::getNumberOfGlobalComponents() const { return _mesh_subsets.size(); } @@ -454,7 +454,7 @@ std::ostream& operator<<(std::ostream& os, LocalToGlobalIndexMap const& map) for (std::size_t e=0; e<map.size(); ++e) { os << "== e " << e << " ==\n"; - for (int c = 0; c < map.getNumberOfComponents(); ++c) + for (int c = 0; c < map.getNumberOfGlobalComponents(); ++c) { auto const& line = map._rows(e, c); diff --git a/NumLib/DOF/LocalToGlobalIndexMap.h b/NumLib/DOF/LocalToGlobalIndexMap.h index a05df32aab480cb5df5dcc5acb87f7b49d6653b4..60ea873fa2dedfbae93789132d750f982d179451 100644 --- a/NumLib/DOF/LocalToGlobalIndexMap.h +++ b/NumLib/DOF/LocalToGlobalIndexMap.h @@ -121,7 +121,7 @@ public: int getNumberOfVariableComponents(int variable_id) const; - int getNumberOfComponents() const; + int getNumberOfGlobalComponents() const; RowColumnIndices operator()(std::size_t const mesh_item_id, const int component_id) const; diff --git a/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp b/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp index 9319ed1165792a833f717d0f9c0251a44d3b504c..1b260acfce11ee63fcfffd2674d73abe91ae8795 100644 --- a/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp +++ b/NumLib/Extrapolation/LocalLinearLeastSquaresExtrapolator.cpp @@ -33,7 +33,7 @@ LocalLinearLeastSquaresExtrapolator::LocalLinearLeastSquaresExtrapolator( * likely too simplistic. You better adapt the extrapolation code from * some more advanced process, like the TES process. */ - if (dof_table.getNumberOfComponents() != 1) + if (dof_table.getNumberOfGlobalComponents() != 1) { OGS_FATAL( "The d.o.f. table passed must be for one variable that has " diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp b/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp index 24ed7af779cc16fd0ac1e02c75808a9395471dcd..0dc492ec55ad510d6bc60a0043e507a7e4442025 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponentDeltaX.cpp @@ -81,7 +81,7 @@ void ConvergenceCriterionPerComponentDeltaX::setDOFTable( _dof_table = &dof_table; _mesh = &mesh; - if (_dof_table->getNumberOfComponents() != + if (_dof_table->getNumberOfGlobalComponents() != static_cast<int>(_abstols.size())) { OGS_FATAL( diff --git a/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp b/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp index d266ec8ec80a0c6bac5ffbc8f8f9951f9595e105..e6fcb6929f59280494861afe91779405a36d147f 100644 --- a/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp +++ b/NumLib/ODESolver/ConvergenceCriterionPerComponentResidual.cpp @@ -119,7 +119,7 @@ void ConvergenceCriterionPerComponentResidual::setDOFTable( _dof_table = &dof_table; _mesh = &mesh; - if (_dof_table->getNumberOfComponents() != + if (_dof_table->getNumberOfGlobalComponents() != static_cast<int>(_abstols.size())) { OGS_FATAL( diff --git a/ParameterLib/ConstantParameter.h b/ParameterLib/ConstantParameter.h index 0bd7380f0105871f7805268ea21526f8ba96e961..349349c48aeeb1ad40b1bedc8757b20d6e7a01a7 100644 --- a/ParameterLib/ConstantParameter.h +++ b/ParameterLib/ConstantParameter.h @@ -34,7 +34,7 @@ struct ConstantParameter final : public Parameter<T> bool isTimeDependent() const override { return false; } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { return static_cast<int>(_values.size()); } @@ -55,7 +55,7 @@ struct ConstantParameter final : public Parameter<T> { auto const n_nodes = element.getNumberOfNodes(); Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result( - n_nodes, getNumberOfComponents()); + n_nodes, getNumberOfGlobalComponents()); // Column vector of values, copied for each node. auto const row_values = diff --git a/ParameterLib/CoordinateSystem.cpp b/ParameterLib/CoordinateSystem.cpp index 510e8172971bdf44a291d2ce11f417d6ddf0c146..1b9d0e548a698d7601eb84f19a17c3e6f7c1ad22 100644 --- a/ParameterLib/CoordinateSystem.cpp +++ b/ParameterLib/CoordinateSystem.cpp @@ -33,8 +33,8 @@ CoordinateSystem::CoordinateSystem(Parameter<double> const& e0, { OGS_FATAL("The parameters for the basis must not be time dependent."); } - if (_base[0]->getNumberOfComponents() != 2 || - _base[1]->getNumberOfComponents() != 2) + if (_base[0]->getNumberOfGlobalComponents() != 2 || + _base[1]->getNumberOfGlobalComponents() != 2) { OGS_FATAL("The parameters for the 2D basis must have two components."); } @@ -61,9 +61,9 @@ CoordinateSystem::CoordinateSystem(Parameter<double> const& e0, { OGS_FATAL("The parameters for the basis must not be time dependent."); } - if (_base[0]->getNumberOfComponents() != 3 || - _base[1]->getNumberOfComponents() != 3 || - _base[2]->getNumberOfComponents() != 3) + if (_base[0]->getNumberOfGlobalComponents() != 3 || + _base[1]->getNumberOfGlobalComponents() != 3 || + _base[2]->getNumberOfGlobalComponents() != 3) { OGS_FATAL( "The parameters for the 3D basis must have three components."); diff --git a/ParameterLib/CurveScaledParameter.h b/ParameterLib/CurveScaledParameter.h index 29d2905d44d224dde42fa2ec11a7ba60346e443d..b6fdbaebb071290c54d4aec56c7047465c2dadf2 100644 --- a/ParameterLib/CurveScaledParameter.h +++ b/ParameterLib/CurveScaledParameter.h @@ -39,9 +39,9 @@ struct CurveScaledParameter final : public Parameter<T> ParameterBase::_mesh = _parameter->mesh(); } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { - return _parameter->getNumberOfComponents(); + return _parameter->getNumberOfGlobalComponents(); } std::vector<T> operator()(double const t, @@ -56,7 +56,7 @@ struct CurveScaledParameter final : public Parameter<T> auto const& tup = (*_parameter)(t, pos); auto const scaling = _curve.getValue(t); - auto const num_comp = _parameter->getNumberOfComponents(); + auto const num_comp = _parameter->getNumberOfGlobalComponents(); std::vector<T> cache(num_comp); for (int c = 0; c < num_comp; ++c) { diff --git a/ParameterLib/FunctionParameter.h b/ParameterLib/FunctionParameter.h index 2dbb884c894e78f6a35e677e53bcfee8710850d2..202a255dbc4a58c36cb344dd01f5ecbe9caad8e2 100644 --- a/ParameterLib/FunctionParameter.h +++ b/ParameterLib/FunctionParameter.h @@ -101,7 +101,7 @@ struct FunctionParameter final : public Parameter<T> bool isTimeDependent() const override { return true; } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { return _vec_expression.size(); } @@ -109,7 +109,7 @@ struct FunctionParameter final : public Parameter<T> std::vector<T> operator()(double const t, SpatialPosition const& pos) const override { - std::vector<T> cache(getNumberOfComponents()); + std::vector<T> cache(getNumberOfGlobalComponents()); auto& x = _symbol_table.get_variable("x")->ref(); auto& y = _symbol_table.get_variable("y")->ref(); auto& z = _symbol_table.get_variable("z")->ref(); diff --git a/ParameterLib/GroupBasedParameter.h b/ParameterLib/GroupBasedParameter.h index 833ab79289edc37b9386a3708f300204262b88c0..71bf31cdaabf531e4058467016c4ea921162aaa8 100644 --- a/ParameterLib/GroupBasedParameter.h +++ b/ParameterLib/GroupBasedParameter.h @@ -51,7 +51,7 @@ struct GroupBasedParameter final : public Parameter<T> bool isTimeDependent() const override { return false; } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { return _vec_values.empty() ? 0 diff --git a/ParameterLib/MeshElementParameter.h b/ParameterLib/MeshElementParameter.h index 19bfb1484525109212fdb9356a1d27722d87bba8..528519fbe5e10ba76659f7fad4a3c02f2fe7f3a6 100644 --- a/ParameterLib/MeshElementParameter.h +++ b/ParameterLib/MeshElementParameter.h @@ -33,9 +33,9 @@ struct MeshElementParameter final : public Parameter<T> bool isTimeDependent() const override { return false; } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { - return _property.getNumberOfComponents(); + return _property.getNumberOfGlobalComponents(); } std::vector<T> operator()(double const /*t*/, @@ -48,7 +48,7 @@ struct MeshElementParameter final : public Parameter<T> "Trying to access a MeshElementParameter but the element id is " "not specified."); } - auto const num_comp = _property.getNumberOfComponents(); + auto const num_comp = _property.getNumberOfGlobalComponents(); std::vector<T> cache(num_comp); for (int c = 0; c < num_comp; ++c) { @@ -68,7 +68,7 @@ struct MeshElementParameter final : public Parameter<T> { auto const n_nodes = element.getNumberOfNodes(); Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result( - n_nodes, getNumberOfComponents()); + n_nodes, getNumberOfGlobalComponents()); // Column vector of values, copied for each node. SpatialPosition x_position; diff --git a/ParameterLib/MeshNodeParameter.h b/ParameterLib/MeshNodeParameter.h index 9d09ef8484220d55894bb92bd197f5553b3c6052..1609fdc1cb4dd167db8bc406280a882b3aff3977 100644 --- a/ParameterLib/MeshNodeParameter.h +++ b/ParameterLib/MeshNodeParameter.h @@ -37,9 +37,9 @@ struct MeshNodeParameter final : public Parameter<T> bool isTimeDependent() const override { return false; } - int getNumberOfComponents() const override + int getNumberOfGlobalComponents() const override { - return _property.getNumberOfComponents(); + return _property.getNumberOfGlobalComponents(); } std::vector<T> operator()(double const /*t*/, @@ -52,7 +52,7 @@ struct MeshNodeParameter final : public Parameter<T> "Trying to access a MeshNodeParameter but the node id is not " "specified."); } - auto const num_comp = _property.getNumberOfComponents(); + auto const num_comp = _property.getNumberOfGlobalComponents(); std::vector<T> cache(num_comp); for (int c = 0; c < num_comp; ++c) { @@ -72,7 +72,7 @@ struct MeshNodeParameter final : public Parameter<T> { auto const n_nodes = element.getNumberOfNodes(); Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result( - n_nodes, getNumberOfComponents()); + n_nodes, getNumberOfGlobalComponents()); SpatialPosition x_position; auto const nodes = element.getNodes(); diff --git a/ParameterLib/Parameter.h b/ParameterLib/Parameter.h index f8f4521b7c8a808522f03d3e2270aa3e8ea9af80..fd302d5f5262adb3c4a25b7c24f2f9312fc95c66 100644 --- a/ParameterLib/Parameter.h +++ b/ParameterLib/Parameter.h @@ -146,7 +146,7 @@ struct Parameter : public ParameterBase //! Returns the number of components this Parameter has at every position //! and point in time. - virtual int getNumberOfComponents() const = 0; + virtual int getNumberOfGlobalComponents() const = 0; //! Returns the parameter value at the given time and position. virtual std::vector<T> operator()(double const t, @@ -166,7 +166,7 @@ struct Parameter : public ParameterBase double const t) const { auto const n_nodes = static_cast<int>(element.getNumberOfNodes()); - auto const n_components = getNumberOfComponents(); + auto const n_components = getNumberOfGlobalComponents(); Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> result(n_nodes, n_components); diff --git a/ParameterLib/TimeDependentHeterogeneousParameter.cpp b/ParameterLib/TimeDependentHeterogeneousParameter.cpp index 7c3e3be59d915012771c9876a0320e29adef74f9..a8645bfecd7a649e114ab6dc21d02a4a3a485772 100644 --- a/ParameterLib/TimeDependentHeterogeneousParameter.cpp +++ b/ParameterLib/TimeDependentHeterogeneousParameter.cpp @@ -25,9 +25,9 @@ TimeDependentHeterogeneousParameter::TimeDependentHeterogeneousParameter( { } -int TimeDependentHeterogeneousParameter::getNumberOfComponents() const +int TimeDependentHeterogeneousParameter::getNumberOfGlobalComponents() const { - return _time_parameter_mapping[0].second->getNumberOfComponents(); + return _time_parameter_mapping[0].second->getNumberOfGlobalComponents(); } bool TimeDependentHeterogeneousParameter::isTimeDependent() const @@ -89,11 +89,12 @@ void TimeDependentHeterogeneousParameter::initialize( } // check that all parameters have the same number of components - auto const n = _time_parameter_mapping[0].second->getNumberOfComponents(); + auto const n = + _time_parameter_mapping[0].second->getNumberOfGlobalComponents(); if (!std::all_of(_time_parameter_mapping.begin(), _time_parameter_mapping.end(), [n](auto const p) { - return n == p.second->getNumberOfComponents(); + return n == p.second->getNumberOfGlobalComponents(); })) { OGS_FATAL( diff --git a/ParameterLib/TimeDependentHeterogeneousParameter.h b/ParameterLib/TimeDependentHeterogeneousParameter.h index 98e07ac09926fb7731084826f140c094136d9c9a..b62cfc22b123b8fe203e4e0238cce5b746998217 100644 --- a/ParameterLib/TimeDependentHeterogeneousParameter.h +++ b/ParameterLib/TimeDependentHeterogeneousParameter.h @@ -29,8 +29,8 @@ public: std::vector<PairTimeParameterName> time_parameter_name_mapping); - /// @copydoc Parameter::getNumberOfComponents() - int getNumberOfComponents() const override; + /// @copydoc Parameter::getNumberOfGlobalComponents() + int getNumberOfGlobalComponents() const override; bool isTimeDependent() const override; diff --git a/ParameterLib/Utils.h b/ParameterLib/Utils.h index 2243b1466e3dea5a61cbee5f2668f8ed3abffcb1..f0d06851d4a365874e4eefd4c380d130e305c67b 100644 --- a/ParameterLib/Utils.h +++ b/ParameterLib/Utils.h @@ -62,12 +62,13 @@ Parameter<ParameterDataType>* findParameterOptional( } if (num_components != 0 && - parameter->getNumberOfComponents() != num_components) + parameter->getNumberOfGlobalComponents() != num_components) { OGS_FATAL( "The read parameter `{:s}' has the wrong number of components " "({:d} instead of {:d}).", - parameter_name, parameter->getNumberOfComponents(), num_components); + parameter_name, parameter->getNumberOfGlobalComponents(), + num_components); } // Test the parameter's mesh only if there is a "test"-mesh provided. diff --git a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h index c567a55de2c4a8d97f2023b3e5ad615a46a3bdbf..07a79b7d89ed9df4aea85a6602e75f28ca235822 100644 --- a/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h +++ b/ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h @@ -62,7 +62,7 @@ public: auto const num_var = _data.dof_table_bulk.getNumberOfVariables(); auto const num_nodes = Base::_element.getNumberOfNodes(); auto const num_comp_total = - _data.dof_table_bulk.getNumberOfComponents(); + _data.dof_table_bulk.getNumberOfGlobalComponents(); auto const& bulk_node_ids_map = *_data.boundary_mesh.getProperties() diff --git a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp index d824b58ebc6362b1f37040d0048bd7bbd7b580dc..9126416136b580ba823a66ed369321c759539c74 100644 --- a/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/ComponentTransportProcess.cpp @@ -264,8 +264,8 @@ void ComponentTransportProcess::extrapolateIntegrationPointValuesToNodes( auto const& int_pt_C = integration_point_values_vectors[transport_process_id]; - extrapolator.extrapolate(pv.getNumberOfComponents(), extrapolatables, t, - {int_pt_C}, + extrapolator.extrapolate(pv.getNumberOfGlobalComponents(), + extrapolatables, t, {int_pt_C}, {_local_to_global_index_map.get()}); auto const& nodal_values = extrapolator.getNodalValues(); diff --git a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp index 2c549d84290993be57c66b44849f2c236dabd6fa..a6e596ea2f2e2fc98ffbe8dda65928bfb2071811 100644 --- a/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp +++ b/ProcessLib/ComponentTransport/CreateComponentTransportProcess.cpp @@ -119,7 +119,7 @@ std::unique_ptr<Process> createComponentTransportProcess( collected_process_variables.cbegin(), collected_process_variables.cend(), [](std::reference_wrapper<ProcessLib::ProcessVariable> const& pv) { - return pv.get().getNumberOfComponents() != 1; + return pv.get().getNumberOfGlobalComponents() != 1; }); if (it != collected_process_variables.end()) @@ -129,7 +129,7 @@ std::unique_ptr<Process> createComponentTransportProcess( "rather " "than {:d}.", it->get().getName(), - it->get().getNumberOfComponents()); + it->get().getNumberOfGlobalComponents()); } // Allocate the collected process variables into a two-dimensional vector, diff --git a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp index 9bd395f0a4d96f39068ca72308409b520c037895..ac01b18d22bc364cfcfe65c1b9469fd80a8bffe1 100644 --- a/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -87,25 +87,25 @@ std::unique_ptr<Process> createHydroMechanicsProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName()); - if (variable_p->getNumberOfComponents() != 1) + if (variable_p->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Pressure process variable '{:s}' is not a scalar variable but has " "{:d} components.", variable_p->getName(), - variable_p->getNumberOfComponents()); + variable_p->getNumberOfGlobalComponents()); } auto solid_constitutive_relations = diff --git a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp index b88b97c1d5e30e39799f30c47ff42c284a464d6c..79b20998e980ee0afdbfb690c6805f92828ed248 100644 --- a/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp +++ b/ProcessLib/HydroMechanics/HydroMechanicsProcess.cpp @@ -145,7 +145,7 @@ void HydroMechanicsProcess<DisplacementDim>::constructDofTable() std::generate_n(std::back_inserter(all_mesh_subsets), getProcessVariables(monolithic_process_id)[1] .get() - .getNumberOfComponents(), + .getNumberOfGlobalComponents(), [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{1, DisplacementDim}; @@ -160,10 +160,11 @@ void HydroMechanicsProcess<DisplacementDim>::constructDofTable() // For displacement equation. const int process_id = 1; std::vector<MeshLib::MeshSubset> all_mesh_subsets; - std::generate_n( - std::back_inserter(all_mesh_subsets), - getProcessVariables(process_id)[0].get().getNumberOfComponents(), - [&]() { return *_mesh_subset_all_nodes; }); + std::generate_n(std::back_inserter(all_mesh_subsets), + getProcessVariables(process_id)[0] + .get() + .getNumberOfGlobalComponents(), + [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{DisplacementDim}; _local_to_global_index_map = @@ -322,13 +323,14 @@ void HydroMechanicsProcess<DisplacementDim>::initializeConcreteProcess( auto const ip_meta_data = getIntegrationPointMetaData(mesh, name); // Check the number of components. - if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) + if (ip_meta_data.n_components != + mesh_property.getNumberOfGlobalComponents()) { OGS_FATAL( "Different number of components in meta data ({:d}) than in " "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name, - mesh_property.getNumberOfComponents()); + mesh_property.getNumberOfGlobalComponents()); } // Now we have a properly named vtk's field data array and the diff --git a/ProcessLib/LIE/Common/PostUtils.cpp b/ProcessLib/LIE/Common/PostUtils.cpp index d48be472e7d74a150e2b3be192dd4dc3eec1e420..fc0efcbc8136f88b2770b15c1a17ea19a3caa19f 100644 --- a/ProcessLib/LIE/Common/PostUtils.cpp +++ b/ProcessLib/LIE/Common/PostUtils.cpp @@ -277,7 +277,7 @@ MeshLib::PropertyVector<T>* PostProcessTool::createProperty( MeshLib::PropertyVector<T> const& property) { auto const item_type = property.getMeshItemType(); - auto const n_src_comp = property.getNumberOfComponents(); + auto const n_src_comp = property.getNumberOfGlobalComponents(); // convert 2D vector to 3D. Otherwise Paraview Calculator filter does // not recognize it as a vector auto const n_dest_comp = (n_src_comp == 2) ? 3 : n_src_comp; @@ -322,8 +322,9 @@ void PostProcessTool::copyPropertyValues( auto const item_type = source_property.getMeshItemType(); if (item_type == MeshLib::MeshItemType::Node) { - auto const n_src_comp = source_property.getNumberOfComponents(); - auto const n_dest_comp = destination_property->getNumberOfComponents(); + auto const n_src_comp = source_property.getNumberOfGlobalComponents(); + auto const n_dest_comp = + destination_property->getNumberOfGlobalComponents(); // copy existing for (unsigned i = 0; i < _org_mesh.getNumberOfNodes(); i++) { @@ -366,7 +367,7 @@ void PostProcessTool::calculateTotalDisplacement(unsigned const n_fractures, { auto const& u = *_output_mesh->getProperties().getPropertyVector<double>( "displacement"); - auto const n_u_comp = u.getNumberOfComponents(); + auto const n_u_comp = u.getNumberOfGlobalComponents(); assert(u.size() == _output_mesh->getNodes().size() * 3); auto& total_u = *_output_mesh->getProperties().createNewPropertyVector<double>( diff --git a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp index 5d5924d59569a73fd9a67d8c37724dc3ded1049d..ef13d20a80addc0806863570158ca826e235aaec 100644 --- a/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/CreateHydroMechanicsProcess.cpp @@ -86,14 +86,14 @@ std::unique_ptr<Process> createHydroMechanicsProcess( variable->getName(), "process_variable"); if (pv_name.find("displacement") != std::string::npos && - variable->getNumberOfComponents() != GlobalDim) + variable->getNumberOfGlobalComponents() != GlobalDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is " "different " "from the displacement dimension: got {:d}, expected {:d}", variable->getName(), - variable->getNumberOfComponents(), + variable->getNumberOfGlobalComponents(), GlobalDim); } diff --git a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp index 75f2dac295c6eecd9d20c58244184572807c437a..b33b4648547f6c75e6f5fdd4dfa62140ef3c97f0 100644 --- a/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp +++ b/ProcessLib/LIE/HydroMechanics/HydroMechanicsProcess.cpp @@ -498,7 +498,7 @@ void HydroMechanicsProcess<GlobalDim>::postTimestepConcreteProcess( const int monolithic_process_id = 0; ProcessVariable& pv_g = this->getProcessVariables(monolithic_process_id)[g_variable_id]; - auto const num_comp = pv_g.getNumberOfComponents(); + auto const num_comp = pv_g.getNumberOfGlobalComponents(); auto& mesh_prop_g = *MeshLib::getOrCreateMeshProperty<double>( _mesh, pv_g.getName(), MeshLib::MeshItemType::Node, num_comp); for (int component_id = 0; component_id < num_comp; ++component_id) diff --git a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp index 994c6d690c110e84cd38dd27a46d6c22a08e586c..e5c3e67920231902323f197382c011bc2087d2ff 100644 --- a/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/LIE/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -94,14 +94,14 @@ std::unique_ptr<Process> createSmallDeformationProcess( DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName()); - if (per_process_variables.back().get().getNumberOfComponents() != + if (per_process_variables.back().get().getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName(), - per_process_variables.back().get().getNumberOfComponents(), + per_process_variables.back().get().getNumberOfGlobalComponents(), DisplacementDim); } std::vector<std::vector<std::reference_wrapper<ProcessVariable>>> diff --git a/ProcessLib/Output/ProcessOutput.cpp b/ProcessLib/Output/ProcessOutput.cpp index 09e5e2c068e62109a564c9eea1e0d80e402970cd..ae067ab9f937d6cfee92e0218ba9a8fc2fca4a67 100644 --- a/ProcessLib/Output/ProcessOutput.cpp +++ b/ProcessLib/Output/ProcessOutput.cpp @@ -174,7 +174,7 @@ void addProcessDataToMesh( ++variable_id) { ProcessVariable& pv = process_variables[variable_id]; - int const n_components = pv.getNumberOfComponents(); + int const n_components = pv.getNumberOfGlobalComponents(); // If (number_of_dof_variables==1), the case is either the staggered // scheme being applied or a single PDE being solved. const int sub_meshset_id = @@ -195,7 +195,7 @@ void addProcessDataToMesh( DBUG(" process variable {:s}", pv.getName()); - auto const num_comp = pv.getNumberOfComponents(); + auto const num_comp = pv.getNumberOfGlobalComponents(); auto& output_data = *MeshLib::getOrCreateMeshProperty<double>( mesh, pv.getName(), MeshLib::MeshItemType::Node, num_comp); diff --git a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp index 0e65b84fe8cdfe394423e8ced80130ed7414e64e..dd5bec442dc803406929c4c1a35bb24dfe888ee9 100644 --- a/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp +++ b/ProcessLib/PhaseField/CreatePhaseFieldProcess.cpp @@ -81,26 +81,26 @@ std::unique_ptr<Process> createPhaseFieldProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate phase field with process variable '{:s}'.", variable_ph->getName()); - if (variable_ph->getNumberOfComponents() != 1) + if (variable_ph->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Phasefield process variable '{:s}' is not a scalar variable but " "has " "{:d} components.", variable_ph->getName(), - variable_ph->getNumberOfComponents()); + variable_ph->getNumberOfGlobalComponents()); } auto solid_constitutive_relations = diff --git a/ProcessLib/Process.cpp b/ProcessLib/Process.cpp index 6782aeece1e45bc60273f09392aaec9d740fa374..4322cfde8b95d20510fec92ab98824e8927bc9bf 100644 --- a/ProcessLib/Process.cpp +++ b/ProcessLib/Process.cpp @@ -128,7 +128,7 @@ void Process::setInitialConditions(const int process_id, double const t, auto const& ic = pv.get().getInitialCondition(); - auto const num_comp = pv.get().getNumberOfComponents(); + auto const num_comp = pv.get().getNumberOfGlobalComponents(); for (int component_id = 0; component_id < num_comp; ++component_id) { @@ -262,15 +262,16 @@ void Process::constructMonolithicProcessDofTable() for (ProcessVariable const& pv : _process_variables[0]) { std::generate_n(std::back_inserter(all_mesh_subsets), - pv.getNumberOfComponents(), + pv.getNumberOfGlobalComponents(), [&]() { return *_mesh_subset_all_nodes; }); } // Create a vector of the number of variable components - transform( - cbegin(_process_variables[0]), cend(_process_variables[0]), - back_inserter(vec_var_n_components), - [](ProcessVariable const& pv) { return pv.getNumberOfComponents(); }); + transform(cbegin(_process_variables[0]), cend(_process_variables[0]), + back_inserter(vec_var_n_components), + [](ProcessVariable const& pv) { + return pv.getNumberOfGlobalComponents(); + }); _local_to_global_index_map = std::make_unique<NumLib::LocalToGlobalIndexMap>( @@ -296,13 +297,13 @@ void Process::constructDofTableOfSpecifiedProsessStaggerdScheme( std::generate_n(std::back_inserter(all_mesh_subsets), _process_variables[specified_prosess_id][0] .get() - .getNumberOfComponents(), + .getNumberOfGlobalComponents(), [&]() { return *_mesh_subset_all_nodes; }); // Create a vector of the number of variable components. vec_var_n_components.push_back(_process_variables[specified_prosess_id][0] .get() - .getNumberOfComponents()); + .getNumberOfGlobalComponents()); _local_to_global_index_map = std::make_unique<NumLib::LocalToGlobalIndexMap>( std::move(all_mesh_subsets), vec_var_n_components, @@ -314,7 +315,7 @@ void Process::constructDofTableOfSpecifiedProsessStaggerdScheme( std::tuple<NumLib::LocalToGlobalIndexMap*, bool> Process::getDOFTableForExtrapolatorData() const { - if (_local_to_global_index_map->getNumberOfComponents() == 1) + if (_local_to_global_index_map->getNumberOfGlobalComponents() == 1) { // For single-variable-single-component processes reuse the existing DOF // table. diff --git a/ProcessLib/ProcessVariable.h b/ProcessLib/ProcessVariable.h index a7199512c8ac32d82473cc4ef5b8733b452986e1..48b01050bf286a8a3c63d0ccfa7d83f948d596ef 100644 --- a/ProcessLib/ProcessVariable.h +++ b/ProcessLib/ProcessVariable.h @@ -73,7 +73,7 @@ public: } /// Returns the number of components of the process variable. - int getNumberOfComponents() const { return _n_components; } + int getNumberOfGlobalComponents() const { return _n_components; } std::vector<std::unique_ptr<BoundaryCondition>> createBoundaryConditions( const NumLib::LocalToGlobalIndexMap& dof_table, const int variable_id, unsigned const integration_order, diff --git a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp index 79f753e524cbc5768f76faa0d439847235f0f3d5..25527acc90ffd90a33596da3622d690ceea7c806 100644 --- a/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp +++ b/ProcessLib/RichardsMechanics/CreateRichardsMechanicsProcess.cpp @@ -112,25 +112,25 @@ std::unique_ptr<Process> createRichardsMechanicsProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName()); - if (variable_p->getNumberOfComponents() != 1) + if (variable_p->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Pressure process variable '{:s}' is not a scalar variable but has " "{:d} components.", variable_p->getName(), - variable_p->getNumberOfComponents()); + variable_p->getNumberOfGlobalComponents()); } auto solid_constitutive_relations = diff --git a/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp b/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp index af10c00d487af9c8e4753620420d583ee4f32673..141b4f72c6a7f1eac0504e12928614b9d6dec005 100644 --- a/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp +++ b/ProcessLib/RichardsMechanics/RichardsMechanicsProcess.cpp @@ -218,7 +218,7 @@ void RichardsMechanicsProcess<DisplacementDim>::constructDofTable() std::generate_n(std::back_inserter(all_mesh_subsets), getProcessVariables(monolithic_process_id)[1] .get() - .getNumberOfComponents(), + .getNumberOfGlobalComponents(), [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{1, DisplacementDim}; @@ -233,10 +233,11 @@ void RichardsMechanicsProcess<DisplacementDim>::constructDofTable() // For displacement equation. const int process_id = 1; std::vector<MeshLib::MeshSubset> all_mesh_subsets; - std::generate_n( - std::back_inserter(all_mesh_subsets), - getProcessVariables(process_id)[0].get().getNumberOfComponents(), - [&]() { return *_mesh_subset_all_nodes; }); + std::generate_n(std::back_inserter(all_mesh_subsets), + getProcessVariables(process_id)[0] + .get() + .getNumberOfGlobalComponents(), + [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{DisplacementDim}; _local_to_global_index_map = @@ -371,13 +372,14 @@ void RichardsMechanicsProcess<DisplacementDim>::initializeConcreteProcess( auto const ip_meta_data = getIntegrationPointMetaData(mesh, name); // Check the number of components. - if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) + if (ip_meta_data.n_components != + mesh_property.getNumberOfGlobalComponents()) { OGS_FATAL( "Different number of components in meta data ({:d}) than in " "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name, - mesh_property.getNumberOfComponents()); + mesh_property.getNumberOfGlobalComponents()); } // Now we have a properly named vtk's field data array and the diff --git a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp index 20023100d3879fa663812c57604eae395d41115c..19dd200691e8ebcc9562a05f89c04d3cfc01632e 100644 --- a/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/CreateSmallDeformationProcess.cpp @@ -53,14 +53,14 @@ std::unique_ptr<Process> createSmallDeformationProcess( DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName()); - if (per_process_variables.back().get().getNumberOfComponents() != + if (per_process_variables.back().get().getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName(), - per_process_variables.back().get().getNumberOfComponents(), + per_process_variables.back().get().getNumberOfGlobalComponents(), DisplacementDim); } std::vector<std::vector<std::reference_wrapper<ProcessVariable>>> diff --git a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp index cb9879ba0fe786e1706487a901692488dc01514c..d97735275e8d344bbcb973c9ca7aa07079cfcd58 100644 --- a/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp +++ b/ProcessLib/SmallDeformation/SmallDeformationProcess.cpp @@ -161,13 +161,14 @@ void SmallDeformationProcess<DisplacementDim>::initializeConcreteProcess( auto const ip_meta_data = getIntegrationPointMetaData(mesh, name); // Check the number of components. - if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) + if (ip_meta_data.n_components != + mesh_property.getNumberOfGlobalComponents()) { OGS_FATAL( "Different number of components in meta data ({:d}) than in " "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name, - mesh_property.getNumberOfComponents()); + mesh_property.getNumberOfGlobalComponents()); } // Now we have a properly named vtk's field data array and the diff --git a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp index 845286841027c125d6aee3e39cc9350c91701d3d..4dacf629734c7ca85e96f928f421bd56f16fc671 100644 --- a/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp +++ b/ProcessLib/SmallDeformationNonlocal/CreateSmallDeformationNonlocalProcess.cpp @@ -53,14 +53,14 @@ std::unique_ptr<Process> createSmallDeformationNonlocalProcess( DBUG("Associate displacement with process variable '{:s}'.", per_process_variables.back().get().getName()); - if (per_process_variables.back().get().getNumberOfComponents() != + if (per_process_variables.back().get().getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", per_process_variables.back().get().getName(), - per_process_variables.back().get().getNumberOfComponents(), + per_process_variables.back().get().getNumberOfGlobalComponents(), DisplacementDim); } std::vector<std::vector<std::reference_wrapper<ProcessVariable>>> diff --git a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp index 3695cb59872aabc8066cd6ac99037ad56528bda8..71d34779bc424530068d513dbba1fbe115edae4a 100644 --- a/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp +++ b/ProcessLib/SmallDeformationNonlocal/SmallDeformationNonlocalProcess.cpp @@ -164,14 +164,14 @@ void SmallDeformationNonlocalProcess<DisplacementDim>:: // Check the number of components. if (ip_meta_data.n_components != - mesh_property.getNumberOfComponents()) + mesh_property.getNumberOfGlobalComponents()) { OGS_FATAL( "Different number of components in meta data ({:d}) than " "in " "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name, - mesh_property.getNumberOfComponents()); + mesh_property.getNumberOfGlobalComponents()); } // Now we have a properly named vtk's field data array and the @@ -214,7 +214,8 @@ void SmallDeformationNonlocalProcess<DisplacementDim>:: std::vector<double> value( &mesh_property[i], - &mesh_property[i] + mesh_property.getNumberOfComponents()); + &mesh_property[i] + + mesh_property.getNumberOfGlobalComponents()); // TODO (naumov) Check sizes / read size / etc. // OR reconstruct dimensions from size / component = // ip_points diff --git a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h index 379ebd37d508423f5bf52ad73aa8d9799f261d0b..7305f534a3bd20d01a1d6282290c4ad3b24a82bb 100644 --- a/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h +++ b/ProcessLib/SourceTerms/Python/PythonSourceTermLocalAssembler.h @@ -100,7 +100,7 @@ public: auto const num_var = dof_table_source_term.getNumberOfVariables(); auto const num_nodes = ShapeFunction::NPOINTS; auto const num_comp_total = - dof_table_source_term.getNumberOfComponents(); + dof_table_source_term.getNumberOfGlobalComponents(); // gather primary variables typename ShapeMatricesType::template MatrixType<ShapeFunction::NPOINTS, diff --git a/ProcessLib/SurfaceFlux/SurfaceFluxData.h b/ProcessLib/SurfaceFlux/SurfaceFluxData.h index 2acaf64460c0d037f6303dafd84f518097ae22ae..491e2d5af2c733213cad694f46bb5d354c7183a2 100644 --- a/ProcessLib/SurfaceFlux/SurfaceFluxData.h +++ b/ProcessLib/SurfaceFlux/SurfaceFluxData.h @@ -85,10 +85,12 @@ struct SurfaceFluxData surface_mesh, property_vector_name, MeshLib::MeshItemType::Cell, 1); // initialise the PropertyVector pv with zero values std::fill(surfaceflux_pv->begin(), surfaceflux_pv->end(), 0.0); - auto surfaceflux_process = ProcessLib::SurfaceFlux( - surface_mesh, - p.getProcessVariables(process_id)[0].get().getNumberOfComponents(), - integration_order); + auto surfaceflux_process = + ProcessLib::SurfaceFlux(surface_mesh, + p.getProcessVariables(process_id)[0] + .get() + .getNumberOfGlobalComponents(), + integration_order); surfaceflux_process.integrate( x, *surfaceflux_pv, t, bulk_mesh, active_element_ids, diff --git a/ProcessLib/SurfaceFlux/SurfaceFluxLocalAssembler.h b/ProcessLib/SurfaceFlux/SurfaceFluxLocalAssembler.h index 49c33741bc2e04a13c8d57f1150e74467ad2f523..f1de6d115c13ee331e3ec533a7b8bac3d633a007 100644 --- a/ProcessLib/SurfaceFlux/SurfaceFluxLocalAssembler.h +++ b/ProcessLib/SurfaceFlux/SurfaceFluxLocalAssembler.h @@ -150,7 +150,7 @@ public: auto const bulk_flux = getFlux(_bulk_element_id, bulk_element_point, t, x); for (int component_id(0); - component_id < specific_flux.getNumberOfComponents(); + component_id < specific_flux.getNumberOfGlobalComponents(); ++component_id) { // TODO find solution for 2d case @@ -167,7 +167,7 @@ public: element_area += _detJ_times_integralMeasure[ip] * wp.getWeight(); } for (int component_id(0); - component_id < specific_flux.getNumberOfComponents(); + component_id < specific_flux.getNumberOfGlobalComponents(); ++component_id) { specific_flux.getComponent(element_id, component_id) /= diff --git a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp index fafa042aa772bf9aa99a2e8357784b3bf6ea5ea9..a00c3e92a27a02a077c2a55f41b2cf8d5c0bbb0d 100644 --- a/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp +++ b/ProcessLib/ThermoHydroMechanics/CreateThermoHydroMechanicsProcess.cpp @@ -92,36 +92,36 @@ std::unique_ptr<Process> createThermoHydroMechanicsProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate pressure with process variable '{:s}'.", variable_p->getName()); - if (variable_p->getNumberOfComponents() != 1) + if (variable_p->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Pressure process variable '{:s}' is not a scalar variable but has " "{:d} components.", variable_p->getName(), - variable_p->getNumberOfComponents()); + variable_p->getNumberOfGlobalComponents()); } DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName()); - if (variable_T->getNumberOfComponents() != 1) + if (variable_T->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "temperature process variable '{:s}' is not a scalar variable but " "has {:d} components.", variable_T->getName(), - variable_T->getNumberOfComponents()); + variable_T->getNumberOfGlobalComponents()); } auto solid_constitutive_relations = diff --git a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp index 56c6a367a297fe5c1b3b354fda859e0ea839c3d7..75f05a79ab3503a6237b68a9bdfbaadb224d50b5 100644 --- a/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp +++ b/ProcessLib/ThermoHydroMechanics/ThermoHydroMechanicsProcess.cpp @@ -109,7 +109,7 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::constructDofTable() std::generate_n(std::back_inserter(all_mesh_subsets), getProcessVariables(monolithic_process_id)[2] .get() - .getNumberOfComponents(), + .getNumberOfGlobalComponents(), [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{1, 1, DisplacementDim}; @@ -124,10 +124,11 @@ void ThermoHydroMechanicsProcess<DisplacementDim>::constructDofTable() // For displacement equation. const int process_id = 2; std::vector<MeshLib::MeshSubset> all_mesh_subsets; - std::generate_n( - std::back_inserter(all_mesh_subsets), - getProcessVariables(process_id)[0].get().getNumberOfComponents(), - [&]() { return *_mesh_subset_all_nodes; }); + std::generate_n(std::back_inserter(all_mesh_subsets), + getProcessVariables(process_id)[0] + .get() + .getNumberOfGlobalComponents(), + [&]() { return *_mesh_subset_all_nodes; }); std::vector<int> const vec_n_components{DisplacementDim}; _local_to_global_index_map = diff --git a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp index ffbf2bd55554fca1d74548df814a3569132766d7..5300866eb8b8dfcb330de40ef8f9651b5b73b1fa 100644 --- a/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp +++ b/ProcessLib/ThermoMechanicalPhaseField/CreateThermoMechanicalPhaseFieldProcess.cpp @@ -81,38 +81,38 @@ std::unique_ptr<Process> createThermoMechanicalPhaseFieldProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate phase field with process variable '{:s}'.", variable_ph->getName()); - if (variable_ph->getNumberOfComponents() != 1) + if (variable_ph->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Phasefield process variable '{:s}' is not a scalar variable but " "has " "{:d} components.", variable_ph->getName(), - variable_ph->getNumberOfComponents()); + variable_ph->getNumberOfGlobalComponents()); } DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName()); - if (variable_T->getNumberOfComponents() != 1) + if (variable_T->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Temperature process variable '{:s}' is not a scalar variable but " "has " "{:d} components.", variable_T->getName(), - variable_T->getNumberOfComponents()); + variable_T->getNumberOfGlobalComponents()); } auto solid_constitutive_relations = diff --git a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp index 5d6e41799f4415c757d2d87d1130c17684e10173..9bb37f0f0e4a5742092a9fe7184a8fbef7a600f0 100644 --- a/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp +++ b/ProcessLib/ThermoMechanics/CreateThermoMechanicsProcess.cpp @@ -91,25 +91,25 @@ std::unique_ptr<Process> createThermoMechanicsProcess( DBUG("Associate displacement with process variable '{:s}'.", variable_u->getName()); - if (variable_u->getNumberOfComponents() != DisplacementDim) + if (variable_u->getNumberOfGlobalComponents() != DisplacementDim) { OGS_FATAL( "Number of components of the process variable '{:s}' is different " "from the displacement dimension: got {:d}, expected {:d}", variable_u->getName(), - variable_u->getNumberOfComponents(), + variable_u->getNumberOfGlobalComponents(), DisplacementDim); } DBUG("Associate temperature with process variable '{:s}'.", variable_T->getName()); - if (variable_T->getNumberOfComponents() != 1) + if (variable_T->getNumberOfGlobalComponents() != 1) { OGS_FATAL( "Pressure process variable '{:s}' is not a scalar variable but has " "{:d} components.", variable_T->getName(), - variable_T->getNumberOfComponents()); + variable_T->getNumberOfGlobalComponents()); } //! \ogs_file_param{prj__processes__process__THERMO_MECHANICS__constitutive_relation} diff --git a/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp b/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp index caa44c0aa5b67ebe59c05a6e04ec83358c514083..48b0f30b1bf76434782a2f2b627107c05f8c6458 100644 --- a/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp +++ b/ProcessLib/ThermoMechanics/ThermoMechanicsProcess.cpp @@ -227,13 +227,14 @@ void ThermoMechanicsProcess<DisplacementDim>::initializeConcreteProcess( auto const ip_meta_data = getIntegrationPointMetaData(mesh, name); // Check the number of components. - if (ip_meta_data.n_components != mesh_property.getNumberOfComponents()) + if (ip_meta_data.n_components != + mesh_property.getNumberOfGlobalComponents()) { OGS_FATAL( "Different number of components in meta data ({:d}) than in " "the integration point field data for '{:s}': {:d}.", ip_meta_data.n_components, name, - mesh_property.getNumberOfComponents()); + mesh_property.getNumberOfGlobalComponents()); } // Now we have a properly named vtk's field data array and the diff --git a/Tests/MeshLib/MeshProperties.cpp b/Tests/MeshLib/MeshProperties.cpp index ff6d94fce7fc9ab58f7692bf12caa9dc0794f0d1..8b0114212c54b87f4df9e9c8710a33ec467296ac 100644 --- a/Tests/MeshLib/MeshProperties.cpp +++ b/Tests/MeshLib/MeshProperties.cpp @@ -42,7 +42,7 @@ TEST_F(MeshLibProperties, PropertyVectorTestMetaData) ASSERT_EQ(0u, p->getPropertyName().compare(prop_name)); ASSERT_EQ(MeshLib::MeshItemType::Cell, p->getMeshItemType()); - ASSERT_EQ(1u, p->getNumberOfComponents()); + ASSERT_EQ(1u, p->getNumberOfGlobalComponents()); ASSERT_EQ(0u, p->size()); } @@ -61,7 +61,7 @@ TEST_F(MeshLibProperties, PropertyVectorTestIntegrationPoint) auto& p = *p_ptr; ASSERT_EQ(p.getPropertyName(), prop_name); ASSERT_EQ(MeshLib::MeshItemType::IntegrationPoint, p.getMeshItemType()); - ASSERT_EQ(vector_length, p.getNumberOfComponents()); + ASSERT_EQ(vector_length, p.getNumberOfGlobalComponents()); ASSERT_EQ(0u, p.size()); // Fill the property vector with double data in following pattern: @@ -461,7 +461,7 @@ TEST_F(MeshLibProperties, AddDoublePropertiesTupleSize2) ASSERT_EQ(0u, pv->getPropertyName().compare(prop_name)); ASSERT_EQ(MeshLib::MeshItemType::Cell, pv->getMeshItemType()); - ASSERT_EQ(2u, pv->getNumberOfComponents()); + ASSERT_EQ(2u, pv->getNumberOfGlobalComponents()); ASSERT_EQ(0u, pv->getNumberOfTuples()); ASSERT_EQ(0u, pv->size()); @@ -472,7 +472,8 @@ TEST_F(MeshLibProperties, AddDoublePropertiesTupleSize2) } // check the number of tuples ASSERT_EQ(number_of_tuples, pv->getNumberOfTuples()); - ASSERT_EQ(pv->getNumberOfTuples()*pv->getNumberOfComponents(), pv->size()); + ASSERT_EQ(pv->getNumberOfTuples() * pv->getNumberOfGlobalComponents(), + pv->size()); // check the values for (std::size_t k(0); k<number_of_tuples; k++) { ASSERT_EQ(static_cast<double>(k), (*pv)[2*k]); diff --git a/Tests/MeshLib/TestVtkMappedMeshSource.cpp b/Tests/MeshLib/TestVtkMappedMeshSource.cpp index ac67bcdd5676a3942889d77d60ef8f175b1d42bf..85605d99b0377887f3cf968fee4e3dc4ee70033e 100644 --- a/Tests/MeshLib/TestVtkMappedMeshSource.cpp +++ b/Tests/MeshLib/TestVtkMappedMeshSource.cpp @@ -323,8 +323,8 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) auto const* const newDoubleProps = newMeshProperties.getPropertyVector<double>( "PointDoubleProperty"); - ASSERT_EQ(newDoubleProps->getNumberOfComponents(), - doubleProps->getNumberOfComponents()); + ASSERT_EQ(newDoubleProps->getNumberOfGlobalComponents(), + doubleProps->getNumberOfGlobalComponents()); ASSERT_EQ(newDoubleProps->getNumberOfTuples(), doubleProps->getNumberOfTuples()); ASSERT_EQ(newDoubleProps->size(), doubleProps->size()); @@ -338,8 +338,8 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) auto newUnsignedIds = newMeshProperties.getPropertyVector<unsigned>( "CellUnsignedProperty"); - ASSERT_EQ(newUnsignedIds->getNumberOfComponents(), - unsignedProps->getNumberOfComponents()); + ASSERT_EQ(newUnsignedIds->getNumberOfGlobalComponents(), + unsignedProps->getNumberOfGlobalComponents()); ASSERT_EQ(newUnsignedIds->getNumberOfTuples(), unsignedProps->getNumberOfTuples()); ASSERT_EQ(newUnsignedIds->size(), unsignedProps->size()); @@ -354,8 +354,8 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) auto new_p = newMeshProperties.getPropertyVector<int>( "FieldIntProperty"); - ASSERT_EQ(new_p->getNumberOfComponents(), - p->getNumberOfComponents()); + ASSERT_EQ(new_p->getNumberOfGlobalComponents(), + p->getNumberOfGlobalComponents()); ASSERT_EQ(new_p->getNumberOfTuples(), p->getNumberOfTuples()); ASSERT_EQ(new_p->size(), p->size()); for (std::size_t i = 0; i < unsignedProps->size(); i++) @@ -368,8 +368,8 @@ TEST_F(InSituMesh, DISABLED_MappedMeshSourceRoundtrip) meshProperties.getPropertyVector<int>("MaterialIDs"); auto const* const newMaterialIds = newMeshProperties.getPropertyVector<int>("MaterialIDs"); - ASSERT_EQ(newMaterialIds->getNumberOfComponents(), - materialIds->getNumberOfComponents()); + ASSERT_EQ(newMaterialIds->getNumberOfGlobalComponents(), + materialIds->getNumberOfGlobalComponents()); ASSERT_EQ(newMaterialIds->getNumberOfTuples(), materialIds->getNumberOfTuples()); ASSERT_EQ(newMaterialIds->size(), materialIds->size()); diff --git a/Tests/NumLib/LocalToGlobalIndexMap.cpp b/Tests/NumLib/LocalToGlobalIndexMap.cpp index a3a38c72e86fceac7b12ad7330fa3c40eaf68db0..b9bd0a5ebc2efe0d27acada7d694fac5445793a9 100644 --- a/Tests/NumLib/LocalToGlobalIndexMap.cpp +++ b/Tests/NumLib/LocalToGlobalIndexMap.cpp @@ -138,7 +138,7 @@ TEST_F(NumLibLocalToGlobalIndexMapTest, DISABLED_MultipleVariablesMultipleCompon NumLib::ComponentOrder::BY_COMPONENT); ASSERT_EQ(30, dof_map->dofSizeWithGhosts()); - ASSERT_EQ(3, dof_map->getNumberOfComponents()); + ASSERT_EQ(3, dof_map->getNumberOfGlobalComponents()); ASSERT_EQ(2u, dof_map->getNumberOfVariables()); ASSERT_EQ(1, dof_map->getNumberOfVariableComponents(0)); ASSERT_EQ(2, dof_map->getNumberOfVariableComponents(1)); @@ -167,7 +167,7 @@ TEST_F(NumLibLocalToGlobalIndexMapTest, DISABLED_MultipleVariablesMultipleCompon NumLib::ComponentOrder::BY_COMPONENT); ASSERT_EQ(30, dof_map->dofSizeWithGhosts()); - ASSERT_EQ(3, dof_map->getNumberOfComponents()); + ASSERT_EQ(3, dof_map->getNumberOfGlobalComponents()); ASSERT_EQ(2u, dof_map->getNumberOfVariables()); ASSERT_EQ(2, dof_map->getNumberOfVariableComponents(0)); ASSERT_EQ(1, dof_map->getNumberOfVariableComponents(1)); @@ -206,7 +206,7 @@ TEST_F(NumLibLocalToGlobalIndexMapTest, DISABLED_MultipleVariablesMultipleCompon NumLib::ComponentOrder::BY_COMPONENT); ASSERT_EQ(22u, dof_map->dofSizeWithGhosts()); - ASSERT_EQ(3, dof_map->getNumberOfComponents()); + ASSERT_EQ(3, dof_map->getNumberOfGlobalComponents()); ASSERT_EQ(2u, dof_map->getNumberOfVariables()); ASSERT_EQ(2, dof_map->getNumberOfVariableComponents(0)); ASSERT_EQ(1, dof_map->getNumberOfVariableComponents(1)); @@ -258,7 +258,7 @@ TEST_F(NumLibLocalToGlobalIndexMapTest, DISABLED_MultipleVariablesMultipleCompon NumLib::ComponentOrder::BY_COMPONENT); ASSERT_EQ(21u, dof_map->dofSizeWithGhosts()); - ASSERT_EQ(3, dof_map->getNumberOfComponents()); + ASSERT_EQ(3, dof_map->getNumberOfGlobalComponents()); ASSERT_EQ(2u, dof_map->getNumberOfVariables()); ASSERT_EQ(2, dof_map->getNumberOfVariableComponents(0)); ASSERT_EQ(1, dof_map->getNumberOfVariableComponents(1)); diff --git a/Tests/NumLib/LocalToGlobalIndexMapMultiComponent.cpp b/Tests/NumLib/LocalToGlobalIndexMapMultiComponent.cpp index f32dd35078e1d005e2dab5a93c3aee4cce66cf6f..bd625cca63b403390bdebddf345de7c0d2c90bb1 100644 --- a/Tests/NumLib/LocalToGlobalIndexMapMultiComponent.cpp +++ b/Tests/NumLib/LocalToGlobalIndexMapMultiComponent.cpp @@ -177,10 +177,10 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( { initComponents(num_components, selected_component, ComponentOrder); - ASSERT_EQ(dof_map->getNumberOfComponents(), num_components); + ASSERT_EQ(dof_map->getNumberOfGlobalComponents(), num_components); ASSERT_EQ(dof_map->size(), mesh->getNumberOfElements()); - ASSERT_EQ(dof_map_boundary->getNumberOfComponents(), 1); + ASSERT_EQ(dof_map_boundary->getNumberOfGlobalComponents(), 1); ASSERT_EQ(dof_map_boundary->size(), boundary_mesh->getNumberOfElements()); // check mesh elements @@ -189,7 +189,7 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( auto const element_nodes_size = mesh->getElement(e)->getNumberOfNodes(); auto const ptr_element_nodes = mesh->getElement(e)->getNodes(); - for (int c = 0; c < dof_map->getNumberOfComponents(); ++c) + for (int c = 0; c < dof_map->getNumberOfGlobalComponents(); ++c) { auto const& global_idcs = (*dof_map)(e, c).rows; ASSERT_EQ(element_nodes_size, global_idcs.size()); @@ -206,7 +206,7 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( // check boundary elements for (unsigned e=0; e<dof_map_boundary->size(); ++e) { - ASSERT_EQ(1, dof_map_boundary->getNumberOfComponents()); + ASSERT_EQ(1, dof_map_boundary->getNumberOfGlobalComponents()); for (int c = 0; c < 1; ++c) { @@ -238,10 +238,10 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( { initComponents(num_components, selected_components, ComponentOrder); - ASSERT_EQ(dof_map->getNumberOfComponents(), num_components); + ASSERT_EQ(dof_map->getNumberOfGlobalComponents(), num_components); ASSERT_EQ(dof_map->size(), mesh->getNumberOfElements()); - ASSERT_EQ(dof_map_boundary->getNumberOfComponents(), + ASSERT_EQ(dof_map_boundary->getNumberOfGlobalComponents(), selected_components.size()); ASSERT_EQ(dof_map_boundary->size(), boundary_mesh->getNumberOfElements()); @@ -251,7 +251,7 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( auto const element_nodes_size = mesh->getElement(e)->getNumberOfNodes(); auto const ptr_element_nodes = mesh->getElement(e)->getNodes(); - for (int c = 0; c < dof_map->getNumberOfComponents(); ++c) + for (int c = 0; c < dof_map->getNumberOfGlobalComponents(); ++c) { auto const& global_idcs = (*dof_map)(e, c).rows; ASSERT_EQ(element_nodes_size, global_idcs.size()); @@ -269,7 +269,7 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( for (unsigned e = 0; e < dof_map_boundary->size(); ++e) { ASSERT_EQ(selected_components.size(), - dof_map_boundary->getNumberOfComponents()); + dof_map_boundary->getNumberOfGlobalComponents()); for (int c = 0; c < static_cast<int>(selected_components.size()); ++c) { @@ -296,11 +296,12 @@ void NumLibLocalToGlobalIndexMapMultiDOFTest::test( void assert_equal(NL::LocalToGlobalIndexMap const& dof1, NL::LocalToGlobalIndexMap const& dof2) { ASSERT_EQ(dof1.size(), dof2.size()); - ASSERT_EQ(dof1.getNumberOfComponents(), dof2.getNumberOfComponents()); + ASSERT_EQ(dof1.getNumberOfGlobalComponents(), + dof2.getNumberOfGlobalComponents()); for (unsigned e=0; e<dof1.size(); ++e) { - for (int c = 0; c < dof1.getNumberOfComponents(); ++c) + for (int c = 0; c < dof1.getNumberOfGlobalComponents(); ++c) { EXPECT_EQ(dof1(e, c).rows, dof2(e, c).rows); EXPECT_EQ(dof1(e, c).columns, dof2(e, c).columns);