Skip to content
Permalink
Browse files

Merge pull request #2376 from endJunction/ParameterDomainOfDefinition

Add domain of definition for parameters.
  • Loading branch information...
endJunction committed Mar 1, 2019
2 parents a1a5b47 + 7bd4c73 commit de33efd37b5a11c64063f2ea3d7e5001fcdd5e3d
Showing with 386 additions and 919 deletions.
  1. +0 −16 Applications/DataHolderLib/BoundaryCondition.cpp
  2. +0 −2 Applications/DataHolderLib/BoundaryCondition.h
  3. +1 −1 Applications/FileIO/XmlIO/OpenGeoSysProject.xsd
  4. +6 −0 Documentation/ProjectFile/prj/parameters/parameter/t_mesh.md
  5. +0 −2 ...cess_variable/boundary_conditions/boundary_condition/NonuniformDirichlet/c_NonuniformDirichlet.md
  6. +0 −3 ...ables/process_variable/boundary_conditions/boundary_condition/NonuniformDirichlet/t_field_name.md
  7. +0 −1 .../process_variable/boundary_conditions/boundary_condition/NonuniformNeumann/c_NonuniformNeumann.md
  8. +0 −5 ...riables/process_variable/boundary_conditions/boundary_condition/NonuniformNeumann/t_field_name.md
  9. 0 ...iformVariableDependentNeumann → VariableDependentNeumann}/c_NonuniformVariableDependentNeumann.md
  10. 0 ...niformVariableDependentNeumann → VariableDependentNeumann}/t_coefficient_current_variable_name.md
  11. 0 ...uniformVariableDependentNeumann → VariableDependentNeumann}/t_coefficient_mixed_variables_name.md
  12. 0 ...nuniformVariableDependentNeumann → VariableDependentNeumann}/t_coefficient_other_variable_name.md
  13. 0 ...dary_condition/{NonuniformVariableDependentNeumann → VariableDependentNeumann}/t_constant_name.md
  14. +10 −0 MeshLib/Mesh.h
  15. +4 −21 ProcessLib/BoundaryCondition/CreateBoundaryCondition.cpp
  16. +11 −2 ProcessLib/BoundaryCondition/DirichletBoundaryCondition.cpp
  17. +41 −7 ProcessLib/BoundaryCondition/GenericNaturalBoundaryConditionLocalAssembler.h
  18. +0 −87 ProcessLib/BoundaryCondition/GenericNonuniformNaturalBoundaryCondition-impl.h
  19. +0 −59 ProcessLib/BoundaryCondition/GenericNonuniformNaturalBoundaryCondition.h
  20. +0 −96 ProcessLib/BoundaryCondition/GenericNonuniformNaturalBoundaryConditionLocalAssembler.h
  21. +10 −17 ProcessLib/BoundaryCondition/NeumannBoundaryConditionLocalAssembler.h
  22. +0 −63 ProcessLib/BoundaryCondition/NonuniformDirichletBoundaryCondition.cpp
  23. +0 −129 ProcessLib/BoundaryCondition/NonuniformDirichletBoundaryCondition.h
  24. +0 −92 ProcessLib/BoundaryCondition/NonuniformNeumannBoundaryCondition.cpp
  25. +0 −95 ProcessLib/BoundaryCondition/NonuniformNeumannBoundaryConditionLocalAssembler.h
  26. +0 −30 ProcessLib/BoundaryCondition/NonuniformVariableDependentNeumannBoundaryCondition.h
  27. +39 −43 ProcessLib/BoundaryCondition/NormalTractionBoundaryConditionLocalAssembler.h
  28. +12 −16 ProcessLib/BoundaryCondition/Python/PythonBoundaryConditionLocalAssembler.h
  29. +9 −12 ProcessLib/BoundaryCondition/RobinBoundaryConditionLocalAssembler.h
  30. +24 −36 ...ormVariableDependentNeumannBoundaryCondition.cpp → VariableDependentNeumannBoundaryCondition.cpp}
  31. +10 −9 ...aryCondition/{NonuniformNeumannBoundaryCondition.h → VariableDependentNeumannBoundaryCondition.h}
  32. +18 −26 ...annBoundaryConditionLocalAssembler.h → VariableDependentNeumannBoundaryConditionLocalAssembler.h}
  33. +1 −0 ProcessLib/Parameter/CurveScaledParameter.h
  34. +9 −9 ProcessLib/Parameter/FunctionParameter.h
  35. +2 −2 ProcessLib/Parameter/GroupBasedParameter.cpp
  36. +3 −1 ProcessLib/Parameter/GroupBasedParameter.h
  37. +2 −1 ProcessLib/Parameter/MeshElementParameter.cpp
  38. +2 −2 ProcessLib/Parameter/MeshElementParameter.h
  39. +1 −1 ProcessLib/Parameter/MeshNodeParameter.cpp
  40. +2 −2 ProcessLib/Parameter/MeshNodeParameter.h
  41. +15 −4 ProcessLib/Parameter/Parameter.cpp
  42. +15 −2 ProcessLib/Parameter/Parameter.h
  43. +8 −2 Tests/Data/Elliptic/nonuniform_bc_Groundwaterflow/dirichlet_nonuniform.prj
  44. +8 −2 Tests/Data/Elliptic/nonuniform_bc_Groundwaterflow/inhomogeneous_permeability.prj
  45. +8 −2 Tests/Data/Elliptic/nonuniform_bc_Groundwaterflow/neumann_nonuniform.prj
  46. +66 −6 Tests/Data/Parabolic/ComponentTransport/VariableNeumannBoundary/vdbc_input.prj
  47. +32 −8 Tests/Data/Parabolic/ComponentTransport/goswami/goswami_input.prj
  48. +16 −4 Tests/Data/Parabolic/ComponentTransport/heterogeneous/ogs5_H_3D/ogs5_H_3d.prj
  49. +1 −1 Tests/Data/ThermoMechanics/CreepBGRa/Verification/m2_2Dloadbt/m2_2Dloadbt.prj
@@ -28,18 +28,10 @@ BoundaryCondition::ConditionType BoundaryCondition::convertStringToType(
{
return ConditionType::DIRICHLET;
}
if (str == "NonuniformDirichlet")
{
return ConditionType::NONUNIFORMDIRICHLET;
}
else if (str == "Neumann")
{
return ConditionType::NEUMANN;
}
else if (str == "NonuniformNeumann")
{
return ConditionType::NONUNIFORMNEUMANN;
}
else if (str == "Robin")
{
return ConditionType::ROBIN;
@@ -54,18 +46,10 @@ std::string BoundaryCondition::convertTypeToString(ConditionType type)
{
return "Dirichlet";
}
if (type == ConditionType::NONUNIFORMDIRICHLET)
{
return "NonuniformDirichlet";
}
else if (type == ConditionType::NEUMANN)
{
return "Neumann";
}
else if (type == ConditionType::NONUNIFORMNEUMANN)
{
return "NonuniformNeumann";
}
else if (type == ConditionType::ROBIN)
{
return "Robin";
@@ -21,9 +21,7 @@ class BoundaryCondition final : public FemCondition
{
NONE,
DIRICHLET,
NONUNIFORMDIRICHLET,
NEUMANN,
NONUNIFORMNEUMANN,
ROBIN
};

@@ -27,6 +27,7 @@
<xs:sequence>
<xs:element ref="name" minOccurs="1" maxOccurs="1" />
<xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="1" />
<xs:element name="mesh" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="value" minOccurs="0" maxOccurs="1" />
<xs:element name="field_name" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
@@ -38,7 +39,6 @@
<xs:element name="geometry" type="xs:string" minOccurs="0" />
<xs:element name="type" type="xs:string" />
<xs:element name="mesh" type="xs:string" minOccurs="0" />
<xs:element name="field_name" type="xs:string" minOccurs="0" />
<xs:element name="parameter" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
@@ -0,0 +1,6 @@
The domain of definition of the parameter.

The parameter's domain of definition is implicitly the main mesh.
It needs to be specified explicitly for parameters defined on boundary
or subdomain meshes. A notable exception is the Constant parameter,
which has an arbitrary domain of definition.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
@@ -188,6 +188,16 @@ class Mesh : BaseLib::Counter<Mesh>
}; /* class */


/// Meshes are equal if their id's are equal.
inline bool operator==(Mesh const& a, Mesh const& b)
{
return a.getID() == b.getID();
}

inline bool operator!=(Mesh const& a, Mesh const& b)
{
return !(a == b);
}

/// Scales the mesh property with name \c property_name by given \c factor.
/// \note The property must be a "double" property.
@@ -15,12 +15,10 @@
#include "DirichletBoundaryCondition.h"
#include "DirichletBoundaryConditionWithinTimeInterval.h"
#include "NeumannBoundaryCondition.h"
#include "NonuniformDirichletBoundaryCondition.h"
#include "NonuniformNeumannBoundaryCondition.h"
#include "NonuniformVariableDependentNeumannBoundaryCondition.h"
#include "NormalTractionBoundaryCondition.h"
#include "PhaseFieldIrreversibleDamageOracleBoundaryCondition.h"
#include "RobinBoundaryCondition.h"
#include "VariableDependentNeumannBoundaryCondition.h"

#include "BaseLib/TimeInterval.h"

@@ -78,27 +76,12 @@ std::unique_ptr<BoundaryCondition> createBoundaryCondition(
*config.component_id, integration_order, shapefunction_order,
bulk_mesh.getDimension(), parameters);
}
if (type == "NonuniformDirichlet")
if (type == "VariableDependentNeumann")
{
return ProcessLib::createNonuniformDirichletBoundaryCondition(
config.config, config.boundary_mesh, dof_table, variable_id,
*config.component_id);
}
if (type == "NonuniformNeumann")
{
return ProcessLib::createNonuniformNeumannBoundaryCondition(
return ProcessLib::createVariableDependentNeumannBoundaryCondition(
config.config, config.boundary_mesh, dof_table, variable_id,
*config.component_id, integration_order, shapefunction_order,
bulk_mesh);
}

if (type == "NonuniformVariableDependentNeumann")
{
return ProcessLib::
createNonuniformVariableDependentNeumannBoundaryCondition(
config.config, config.boundary_mesh, dof_table, variable_id,
*config.component_id, integration_order, shapefunction_order,
bulk_mesh);
bulk_mesh.getDimension(), parameters);
}

if (type == "Python")
@@ -67,7 +67,16 @@ std::unique_ptr<DirichletBoundaryCondition> createDirichletBoundaryCondition(
auto const param_name = config.getConfigParameter<std::string>("parameter");
DBUG("Using parameter %s", param_name.c_str());

auto& param = findParameter<double>(param_name, parameters, 1);
auto& parameter = findParameter<double>(param_name, parameters, 1);

if (parameter.mesh() && *parameter.mesh() != bc_mesh)
{
OGS_FATAL(
"The boundary condition is defined on a different domain than the "
"parameter: boundary condition is defined on mesh '%s', parameter "
"is defined on mesh '%s'.",
bc_mesh.getName().c_str(), parameter.mesh()->getName().c_str());
}

// In case of partitioned mesh the boundary could be empty, i.e. there is no
// boundary condition.
@@ -84,7 +93,7 @@ std::unique_ptr<DirichletBoundaryCondition> createDirichletBoundaryCondition(
#endif // USE_PETSC

return std::make_unique<DirichletBoundaryCondition>(
param, bc_mesh, dof_table_bulk, variable_id, component_id);
parameter, bc_mesh, dof_table_bulk, variable_id, component_id);
}

} // namespace ProcessLib
@@ -38,24 +38,58 @@ class GenericNaturalBoundaryConditionLocalAssembler
using NodalMatrixType = typename ShapeMatricesType::NodalMatrixType;
using NodalVectorType = typename ShapeMatricesType::NodalVectorType;

struct NAndWeight
{
NAndWeight(typename ShapeMatricesType::ShapeMatrices::ShapeType&& N_,
double const weight_)
: N(std::move(N_)), weight(weight_)
{
}
typename ShapeMatricesType::ShapeMatrices::ShapeType const N;
double const weight;
};

private:
static std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
initNsAndWeights(MeshLib::Element const& e, bool is_axially_symmetric,
unsigned const integration_order)
{
IntegrationMethod const integration_method(integration_order);
std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>>
ns_and_weights;
ns_and_weights.reserve(integration_method.getNumberOfPoints());

auto sms = initShapeMatrices<ShapeFunction, ShapeMatricesType,
IntegrationMethod, GlobalDim>(
e, is_axially_symmetric, integration_method);
for (unsigned ip = 0; ip < sms.size(); ++ip)
{
auto& sm = sms[ip];
double const w =
sm.detJ * sm.integralMeasure *
integration_method.getWeightedPoint(ip).getWeight();

ns_and_weights.emplace_back(std::move(sm.N), w);
}

return ns_and_weights;
}

public:
GenericNaturalBoundaryConditionLocalAssembler(
MeshLib::Element const& e, bool is_axially_symmetric,
unsigned const integration_order)
: _integration_method(integration_order),
_shape_matrices(initShapeMatrices<ShapeFunction, ShapeMatricesType,
IntegrationMethod, GlobalDim>(
e, is_axially_symmetric, _integration_method)),
_ns_and_weights(
initNsAndWeights(e, is_axially_symmetric, integration_order)),
_element(e)
{
}

protected:
IntegrationMethod const _integration_method;
std::vector<typename ShapeMatricesType::ShapeMatrices,
Eigen::aligned_allocator<
typename ShapeMatricesType::ShapeMatrices>> const
_shape_matrices;
std::vector<NAndWeight, Eigen::aligned_allocator<NAndWeight>> const
_ns_and_weights;
MeshLib::Element const& _element;
};

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit de33efd

Please sign in to comment.
You can’t perform that action at this time.