Skip to content

Commit 09a8a3f

Browse files
authored
Merge pull request #666 from bwirthl/merge-porofluidmulti-namespaces
Merge porofluidmulti namespaces
2 parents 722b214 + 4931670 commit 09a8a3f

File tree

90 files changed

+1418
-1703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+1418
-1703
lines changed

src/adapter/4C_adapter_porofluid_pressure_based.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Core::FE
2626
class Discretization;
2727
} // namespace Core::FE
2828

29-
namespace POROFLUIDMULTIPHASE
29+
namespace PoroPressureBased
3030
{
3131
class TimIntImpl;
3232
}

src/adapter/4C_adapter_porofluid_pressure_based_wrapper.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Core::FE
2222
class Discretization;
2323
} // namespace Core::FE
2424

25-
namespace POROFLUIDMULTIPHASE
25+
namespace PoroPressureBased
2626
{
2727
class TimIntImpl;
2828
}

src/global_legacy_module/4C_global_legacy_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ namespace
289289
Discret::Utils::add_valid_combust_functions(function_manager);
290290
Discret::Utils::add_valid_xfluid_functions(function_manager);
291291
add_valid_library_functions(function_manager);
292-
PoroMultiPhaseScaTra::add_valid_poro_functions(function_manager);
292+
PoroPressureBased::add_valid_poro_functions(function_manager);
293293
ScaTra::add_valid_scatra_functions(function_manager);
294294
}
295295

src/inpar/4C_inpar_validconditions.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ std::vector<Core::Conditions::ConditionDefinition> Input::valid_conditions()
846846
Inpar::RveMpc::set_valid_conditions(condlist);
847847
Inpar::BeamInteraction::set_valid_conditions(condlist);
848848
EHL::set_valid_conditions(condlist);
849-
PoroMultiPhaseScaTra::set_valid_conditions(condlist);
849+
PoroPressureBased::set_valid_conditions_porofluid_elast_scatra(condlist);
850850

851851
// finally some conditions that do not have their own files yet are problem-specific
852852
set_miscellaneous_conditions(condlist);

src/inpar/4C_inpar_validparameters.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,9 @@ std::map<std::string, Core::IO::InputSpec> Input::valid_parameters()
214214
Inpar::FS3I::set_valid_parameters(specs);
215215
Inpar::PoroElast::set_valid_parameters(specs);
216216
Inpar::PoroScaTra::set_valid_parameters(specs);
217-
POROMULTIPHASE::set_valid_parameters(specs);
218-
PoroMultiPhaseScaTra::set_valid_parameters(specs);
219-
POROFLUIDMULTIPHASE::set_valid_parameters(specs);
217+
PoroPressureBased::set_valid_parameters_porofluid(specs);
218+
PoroPressureBased::set_valid_parameters_porofluid_elast_scatra(specs);
219+
PoroPressureBased::set_valid_parameters_porofluid_elast(specs);
220220
EHL::set_valid_parameters(specs);
221221
Inpar::SSI::set_valid_parameters(specs);
222222
Inpar::SSTI::set_valid_parameters(specs);

src/mat/4C_mat_fluidporo_multiphase.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ void Mat::FluidPoroMultiPhase::evaluate_gen_pressure(
311311
{
312312
// get the single phase material
313313
const Mat::FluidPoroSinglePhase& singlephasemat =
314-
POROFLUIDMULTIPHASE::ElementUtils::get_single_phase_mat_from_multi_material(*this, iphase);
314+
PoroPressureBased::ElementUtils::get_single_phase_mat_from_multi_material(*this, iphase);
315315

316316
// evaluate generalized pressure (i.e. some kind of linear combination of the true pressures)
317317
genpressure[iphase] = singlephasemat.evaluate_gen_pressure(iphase, phinp);
@@ -336,8 +336,7 @@ void Mat::FluidPoroMultiPhase::evaluate_saturation(std::vector<double>& saturati
336336
{
337337
// get the single phase material
338338
const Mat::FluidPoroSinglePhase& singlephasemat =
339-
POROFLUIDMULTIPHASE::ElementUtils::get_single_phase_mat_from_multi_material(
340-
*this, iphase);
339+
PoroPressureBased::ElementUtils::get_single_phase_mat_from_multi_material(*this, iphase);
341340

342341
saturation[iphase] = singlephasemat.evaluate_saturation(iphase, phinp, pressure);
343342
// the saturation of the last phase is 1.0- (sum of all saturations)

src/porofluid_pressure_based/4C_porofluid_pressure_based_dyn.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ void porofluidmultiphase_dyn(int restart)
3838
// access the problem
3939
Global::Problem* problem = Global::Problem::instance();
4040

41-
// print problem type and logo
41+
// print problem type
4242
if (Core::Communication::my_mpi_rank(comm) == 0)
4343
{
44-
POROFLUIDMULTIPHASE::print_logo();
4544
std::cout << "###################################################" << std::endl;
4645
std::cout << "# YOUR PROBLEM TYPE: " << Global::Problem::instance()->problem_name()
4746
<< std::endl;
@@ -86,7 +85,7 @@ void porofluidmultiphase_dyn(int restart)
8685
case Inpar::ArteryNetwork::ArteryPoroMultiphaseScatraCouplingMethod::ntp:
8786
{
8887
actdis->fill_complete();
89-
nearbyelepairs = POROFLUIDMULTIPHASE::Utils::extended_ghosting_artery_discretization(
88+
nearbyelepairs = PoroPressureBased::extended_ghosting_artery_discretization(
9089
*actdis, arterydis, evaluate_on_lateral_surface, arterycoupl);
9190
break;
9291
}
@@ -120,10 +119,10 @@ void porofluidmultiphase_dyn(int restart)
120119
// time-integration (or stationary) scheme
121120
// -------------------------------------------------------------------
122121
auto timintscheme =
123-
Teuchos::getIntegralValue<POROFLUIDMULTIPHASE::TimeIntegrationScheme>(porodyn, "TIMEINTEGR");
122+
Teuchos::getIntegralValue<PoroPressureBased::TimeIntegrationScheme>(porodyn, "TIMEINTEGR");
124123

125124
// build poro fluid time integrator
126-
std::shared_ptr<Adapter::PoroFluidMultiphase> algo = POROFLUIDMULTIPHASE::Utils::create_algorithm(
125+
std::shared_ptr<Adapter::PoroFluidMultiphase> algo = PoroPressureBased::create_algorithm(
127126
timintscheme, actdis, linsolvernumber, porodyn, porodyn, output);
128127

129128
// initialize
@@ -140,7 +139,7 @@ void porofluidmultiphase_dyn(int restart)
140139
// assign poro material for evaluation of porosity
141140
// note: to be done after potential restart, as in read_restart()
142141
// the secondary material is destroyed
143-
POROFLUIDMULTIPHASE::Utils::setup_material(comm, struct_disname, fluid_disname);
142+
PoroPressureBased::setup_material(comm, struct_disname, fluid_disname);
144143

145144
// 4.- Run of the actual problem.
146145
algo->time_loop();

src/porofluid_pressure_based/4C_porofluid_pressure_based_input.cpp

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010
#include "4C_inpar_bio.hpp"
1111
#include "4C_io_input_spec_builders.hpp"
1212

13+
#include <Teuchos_Time.hpp>
14+
1315
FOUR_C_NAMESPACE_OPEN
1416

15-
void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::InputSpec>& list)
17+
void PoroPressureBased::set_valid_parameters_porofluid(
18+
std::map<std::string, Core::IO::InputSpec>& list)
1619
{
1720
using namespace Core::IO::InputSpecBuilders;
1821

@@ -36,17 +39,18 @@ void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::I
3639

3740
deprecated_selection<TimeIntegrationScheme>("TIMEINTEGR",
3841
{
39-
{"One_Step_Theta", timeint_one_step_theta},
42+
{"One_Step_Theta", TimeIntegrationScheme::one_step_theta},
4043
},
41-
{.description = "Time Integration Scheme", .default_value = timeint_one_step_theta}),
44+
{.description = "Time Integration Scheme",
45+
.default_value = TimeIntegrationScheme::one_step_theta}),
4246

4347
deprecated_selection<CalcError>("CALCERROR",
4448
{
45-
{"No", calcerror_no},
46-
{"error_by_function", calcerror_byfunction},
49+
{"No", CalcError::no},
50+
{"error_by_function", CalcError::by_function},
4751
},
4852
{.description = "compute error compared to analytical solution",
49-
.default_value = calcerror_no}),
53+
.default_value = CalcError::no}),
5054

5155
parameter<int>("CALCERRORNO",
5256
{.description = "function number for porofluidmultiphase error computation",
@@ -76,11 +80,11 @@ void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::I
7680
// parameters for finite difference check
7781
deprecated_selection<FdCheck>("FDCHECK",
7882
{
79-
{"none", fdcheck_none},
80-
{"global", fdcheck_global},
83+
{"none", FdCheck::none},
84+
{"global", FdCheck::global},
8185
},
8286
{.description = "flag for finite difference check: none, local, or global",
83-
.default_value = fdcheck_none}),
87+
.default_value = FdCheck::none}),
8488
parameter<double>("FDCHECKEPS",
8589
{.description = "dof perturbation magnitude for finite difference check (1.e-6 "
8690
"seems to work very well, whereas smaller values don't)",
@@ -114,25 +118,25 @@ void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::I
114118

115119
deprecated_selection<VectorNorm>("VECTORNORM_RESF",
116120
{
117-
{"L1", POROFLUIDMULTIPHASE::norm_l1},
118-
{"L1_Scaled", POROFLUIDMULTIPHASE::norm_l1_scaled},
119-
{"L2", POROFLUIDMULTIPHASE::norm_l2},
120-
{"Rms", POROFLUIDMULTIPHASE::norm_rms},
121-
{"Inf", POROFLUIDMULTIPHASE::norm_inf},
121+
{"L1", VectorNorm::l1},
122+
{"L1_Scaled", VectorNorm::l1_scaled},
123+
{"L2", VectorNorm::l2},
124+
{"Rms", VectorNorm::rms},
125+
{"Inf", VectorNorm::inf},
122126
},
123127
{.description = "type of norm to be applied to residuals",
124-
.default_value = POROFLUIDMULTIPHASE::norm_l2}),
128+
.default_value = VectorNorm::l2}),
125129

126130
deprecated_selection<VectorNorm>("VECTORNORM_INC",
127131
{
128-
{"L1", POROFLUIDMULTIPHASE::norm_l1},
129-
{"L1_Scaled", POROFLUIDMULTIPHASE::norm_l1_scaled},
130-
{"L2", POROFLUIDMULTIPHASE::norm_l2},
131-
{"Rms", POROFLUIDMULTIPHASE::norm_rms},
132-
{"Inf", POROFLUIDMULTIPHASE::norm_inf},
132+
{"L1", VectorNorm::l1},
133+
{"L1_Scaled", VectorNorm::l1_scaled},
134+
{"L2", VectorNorm::l2},
135+
{"Rms", VectorNorm::rms},
136+
{"Inf", VectorNorm::inf},
133137
},
134138
{.description = "type of norm to be applied to residuals",
135-
.default_value = POROFLUIDMULTIPHASE::norm_l2}),
139+
.default_value = VectorNorm::l2}),
136140

137141
// Iterationparameters
138142
parameter<double>(
@@ -144,25 +148,25 @@ void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::I
144148

145149
deprecated_selection<InitialField>("INITIALFIELD",
146150
{
147-
{"zero_field", initfield_zero_field},
148-
{"field_by_function", initfield_field_by_function},
149-
{"field_by_condition", initfield_field_by_condition},
151+
{"zero_field", InitialField::zero},
152+
{"field_by_function", InitialField::by_function},
153+
{"field_by_condition", InitialField::by_condition},
150154
},
151-
{.description = "Initial Field for transport problem",
152-
.default_value = initfield_zero_field}),
155+
{.description = "Initial Field for the porofluid problem",
156+
.default_value = InitialField::zero}),
153157

154158
parameter<int>(
155159
"INITFUNCNO", {.description = "function number for scalar transport initial field",
156160
.default_value = -1}),
157161

158-
deprecated_selection<DivContAct>("DIVERCONT",
162+
deprecated_selection<DivergenceAction>("DIVERCONT",
159163
{
160-
{"stop", divcont_stop},
161-
{"continue", divcont_continue},
164+
{"stop", DivergenceAction::stop},
165+
{"continue", DivergenceAction::continue_anyway},
162166
},
163167
{.description =
164168
"What to do with time integration when Newton-Raphson iteration failed",
165-
.default_value = divcont_stop}),
169+
.default_value = DivergenceAction::stop}),
166170

167171
parameter<int>(
168172
"FLUX_PROJ_SOLVER", {.description = "Number of linear solver used for L2 projection",
@@ -171,11 +175,11 @@ void POROFLUIDMULTIPHASE::set_valid_parameters(std::map<std::string, Core::IO::I
171175

172176
deprecated_selection<FluxReconstructionMethod>("FLUX_PROJ_METHOD",
173177
{
174-
{"none", gradreco_none},
175-
{"L2_projection", gradreco_l2},
178+
{"none", FluxReconstructionMethod::none},
179+
{"L2_projection", FluxReconstructionMethod::l2},
176180
},
177181
{.description = "Flag to (de)activate flux reconstruction.",
178-
.default_value = gradreco_none}),
182+
.default_value = FluxReconstructionMethod::none}),
179183

180184
// functions used for domain integrals
181185
parameter<std::string>("DOMAININT_FUNCT",

src/porofluid_pressure_based/4C_porofluid_pressure_based_input.hpp

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,74 +21,66 @@ FOUR_C_NAMESPACE_OPEN
2121
| |
2222
*----------------------------------------------------------------------*/
2323

24-
namespace POROFLUIDMULTIPHASE
24+
namespace PoroPressureBased
2525
{
2626
/// time integration schemes
27-
enum TimeIntegrationScheme
27+
enum class TimeIntegrationScheme
2828
{
29-
timeint_one_step_theta
29+
one_step_theta
3030
};
3131

3232
/// compute error compared to analytical solution
33-
enum CalcError
33+
enum class CalcError
3434
{
35-
calcerror_no,
36-
calcerror_byfunction
37-
};
38-
39-
//! type of norm to check for convergence
40-
enum ConvNorm
41-
{
42-
convnorm_abs, //!< absolute norm
43-
convnorm_rel, //!< relative norm
44-
convnorm_mix //!< mixed absolute-relative norm
35+
no,
36+
by_function
4537
};
4638

4739
//! type of vector norm used for error/residual vectors
48-
enum VectorNorm
40+
enum class VectorNorm
4941
{
50-
norm_undefined,
51-
norm_l1, //!< L1/linear norm
52-
norm_l1_scaled, //!< L1/linear norm scaled by length of vector
53-
norm_l2, //!< L2/Euclidean norm
54-
norm_rms, //!< root mean square (RMS) norm
55-
norm_inf //!< Maximum/infinity norm
42+
undefined,
43+
l1, //!< L1/linear norm
44+
l1_scaled, //!< L1/linear norm scaled by length of vector
45+
l2, //!< L2/Euclidean norm
46+
rms, //!< root mean square (RMS) norm
47+
inf //!< Maximum/infinity norm
5648
};
5749

5850
/// type of finite difference check
59-
enum FdCheck
51+
enum class FdCheck
6052
{
61-
fdcheck_none,
62-
fdcheck_global
53+
none,
54+
global
6355
};
6456

65-
/// initial field for scalar transport problem
66-
enum InitialField
57+
/// initial field
58+
enum class InitialField
6759
{
68-
initfield_zero_field,
69-
initfield_field_by_function,
70-
initfield_field_by_condition
60+
zero,
61+
by_function,
62+
by_condition
7163
};
7264

7365
/// Handling of non-converged nonlinear solver
74-
enum DivContAct
66+
enum class DivergenceAction
7567
{
76-
divcont_stop, ///< abort simulation
77-
divcont_continue ///< continue nevertheless
68+
stop, ///< abort simulation
69+
continue_anyway ///< continue anyway
7870
};
7971

8072
//! reconstruction type of gradients (e.g. velocity gradient)
81-
enum FluxReconstructionMethod
73+
enum class FluxReconstructionMethod
8274
{
83-
gradreco_none,
75+
none,
8476
// gradreco_spr, super-convergent patch recovery not activated yet
85-
gradreco_l2
77+
l2
8678
};
8779

88-
/// set the lubrication parameters
89-
void set_valid_parameters(std::map<std::string, Core::IO::InputSpec>& list);
80+
/// set the valid parameters
81+
void set_valid_parameters_porofluid(std::map<std::string, Core::IO::InputSpec>& list);
9082

91-
} // namespace POROFLUIDMULTIPHASE
83+
} // namespace PoroPressureBased
9284

9385

9486

0 commit comments

Comments
 (0)