Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Model v3 - third iteration of the model redesign #2417

Merged
merged 215 commits into from
Oct 18, 2018
Merged
Show file tree
Hide file tree
Changes from 81 commits
Commits
Show all changes
215 commits
Select commit Hold shift + click to select a range
b2fd8e9
changes in the model to make it to own the root modelparts but not th…
RiccardoRossi May 6, 2018
f989851
adding Model as a static of the kernel
RiccardoRossi May 6, 2018
403743a
first attempt to export the model as a static variable of the kernel
RiccardoRossi May 6, 2018
74d7647
making the test_model to work - still other tests fail
RiccardoRossi May 7, 2018
79eacc3
adding back the default holder
RiccardoRossi May 7, 2018
001cf85
making the scope of the model local, while still registering it in th…
RiccardoRossi May 7, 2018
01783b7
Revert "making the scope of the model local, while still registering …
RiccardoRossi May 20, 2018
f89e9a9
adding a reset method and improving printing
RiccardoRossi May 20, 2018
07a9914
making model to live as long as kernel and exposing reset function
RiccardoRossi May 20, 2018
f3efe41
modifications to kernel to make it owner of the model
RiccardoRossi May 20, 2018
5fa90e0
adding tear down function which calls Model.Reset()
RiccardoRossi May 20, 2018
066c3fb
adding KRATOS_INFO and KRATOS_WARNING instead of cout
RiccardoRossi May 21, 2018
e0cf9a6
making the modelpart to require variables list given at construction …
RiccardoRossi May 23, 2018
7750aea
making tests to use Model in ModelPart construction
RiccardoRossi May 23, 2018
3c46075
some corrections to make modelpart constructed through model
RiccardoRossi May 23, 2018
5187e0c
using model in modelpart contruction
RiccardoRossi May 23, 2018
13757f3
modifying to take into account modelpart construction via model
RiccardoRossi May 24, 2018
0ed262e
modifying to take into account modelpart construction via model
RiccardoRossi May 24, 2018
9ee2e9d
modifying for modelpart construction via model
RiccardoRossi May 24, 2018
1d48f6e
adding DeleteModelPart function
RiccardoRossi May 24, 2018
d0f4fa4
adding tearDown to tests
RiccardoRossi May 25, 2018
63ade9b
removing call to AddModelPart
RiccardoRossi May 25, 2018
9c675e6
automatically calling Model().Reset() for c++ tests
RiccardoRossi May 25, 2018
50efad8
aking model reset automatic between one text and the next
RiccardoRossi May 25, 2018
1d07caf
removing explicit call of Reset in teardown
RiccardoRossi May 25, 2018
de67478
adding include of kernel and of model
RiccardoRossi May 25, 2018
fd0c7de
removing reset from tearDown
RiccardoRossi May 25, 2018
a79911e
missing includes.
jcotela May 25, 2018
6033add
updating tests in HDF5Application.
jcotela May 25, 2018
02ca9f7
some more Reset functions added
RiccardoRossi May 25, 2018
5e56567
bumping up version
RiccardoRossi May 25, 2018
305dcce
Merge branch 'master' into model_in_kernel
RiccardoRossi May 26, 2018
4639851
solving compilation problems
RiccardoRossi May 26, 2018
791e17f
adding a first attempt of serialization - yet to be checked
RiccardoRossi May 26, 2018
54d3c16
avoiding to return Pointer to submodelparts, to avoid a memory error …
RiccardoRossi May 26, 2018
0090b26
removing modelpart pointers
RiccardoRossi May 26, 2018
f63ea87
avoiding using modelpart::Pointer
RiccardoRossi May 26, 2018
6e72964
avoiding ModelPArt::Pointer
RiccardoRossi May 26, 2018
e7e40f9
removing usage of ModelPart::Pointer
RiccardoRossi May 26, 2018
54729c1
removing usage of ModelPart::Pointer
RiccardoRossi May 26, 2018
c020430
removing usage of ModelPart::Pointer
RiccardoRossi May 26, 2018
4a5be43
removing usage of ModelPart::Pointer and resolving small problem in p…
RiccardoRossi May 26, 2018
30e4b4f
fixing serialization and deserialization of modelpart - MILESTONE 100…
RiccardoRossi May 27, 2018
b6cd6f9
Merge branch 'model_in_kernel' of https://github.com/KratosMultiphysi…
jcotela May 28, 2018
1b80b39
Merge branch 'master' into model_in_kernel
jcotela May 28, 2018
ad028b5
Moving some serializer methods to cpp so solve an include issue.
jcotela May 28, 2018
fcc32a4
Correcting python type.
jcotela May 28, 2018
f733349
small modifications required for compilation
RiccardoRossi May 28, 2018
df9db3c
small modifications required for compilation
RiccardoRossi May 28, 2018
8abc514
Correcting pointer model part in conv-diff
loumalouomega May 28, 2018
1f6bbfa
Fixing initialization order warning.
jcotela May 28, 2018
3549ff8
solving conflicts
RiccardoRossi May 28, 2018
4d3d896
small python corrections
RiccardoRossi May 28, 2018
f4af2e9
correction to adapt to model behaviour
RiccardoRossi May 28, 2018
0ce2380
minor correction
RiccardoRossi May 28, 2018
eba5b67
Merge branch 'model_in_kernel' of https://github.com/KratosMultiphysi…
RiccardoRossi May 28, 2018
d05e592
Bugfix: non-threadsafe access to processinfo in vms.
jcotela May 28, 2018
7cb604c
Some Doxygen doc
loumalouomega May 28, 2018
717291e
Minor
loumalouomega May 28, 2018
b63547c
Merge branch 'model_in_kernel' of https://github.com/KratosMultiphysi…
jcotela May 28, 2018
01c78d9
Forcing Model reset in a test that solves the same problem recursively.
jcotela May 28, 2018
6921db9
Replacing ModelpArt by ModelPartInterface (WIP)
loumalouomega May 28, 2018
9d7a670
Updating test and temporally disabling it (requires changes in hdf5).
jcotela May 28, 2018
d9e63f6
Merge branch 'model_in_kernel' of https://github.com/KratosMultiphysi…
jcotela May 28, 2018
a41be02
Merge branch 'master' into model_in_kernel
loumalouomega May 29, 2018
749274f
Merge branch 'master' into model_in_kernel
RiccardoRossi May 29, 2018
896a31c
solving some problems due to the merging of the master
RiccardoRossi May 29, 2018
557affd
solving problems related to merging of the master
RiccardoRossi May 29, 2018
bc1d9c9
correcting error in runnign the tests
RiccardoRossi May 29, 2018
2cfcb8e
pretty important chane from ptr_iterator to iterator. problem is that…
RiccardoRossi Jul 1, 2018
2bb136e
fixing interface to have Model as a normal object, not registered in …
RiccardoRossi Jul 1, 2018
fc24668
modifying c++ tests to correctly construct the model once
RiccardoRossi Jul 1, 2018
5318737
model interface polished a little
RiccardoRossi Jul 1, 2018
6cca824
avoiding registering model in kernel
RiccardoRossi Jul 1, 2018
8035f24
giving to the modelpart a pointer to the owner model
RiccardoRossi Jul 1, 2018
cfb12f9
making a correct use of the model in the processes
RiccardoRossi Jul 1, 2018
1107d64
avoiding registering model in kernel
RiccardoRossi Jul 1, 2018
25e6d02
modifying creation of new modelparts using the model function
RiccardoRossi Jul 1, 2018
eb00e60
making use of the Model in creating modelparts
RiccardoRossi Jul 1, 2018
082cc74
modifications to avoid registration of kernel in model
RiccardoRossi Jul 1, 2018
26757e4
making the Model friend of the modelpart and making private the model…
RiccardoRossi Jul 1, 2018
34cc8be
correction
RiccardoRossi Jul 2, 2018
4c6c690
cleaning up
RiccardoRossi Jul 2, 2018
e3b7b14
removing an unneeded include
RiccardoRossi Jul 2, 2018
0e41673
Fix compile error.
Jul 2, 2018
1ba0ffc
Fix error message.
Jul 2, 2018
4123c67
Update gid io test.
Jul 2, 2018
5393a0d
Update FluidDynamicsApplication to model.
Jul 2, 2018
a060b57
finishing merging
RiccardoRossi Jul 14, 2018
cac5f2d
changes for model v3 to update to latest master
RiccardoRossi Jul 14, 2018
ef9be69
changes for model v3
RiccardoRossi Jul 14, 2018
2a6b996
fixing tests for model v3
RiccardoRossi Jul 14, 2018
eff3cbc
essential fixes for model v3
RiccardoRossi Jul 14, 2018
2431820
preparing for model v3
RiccardoRossi Jul 15, 2018
f8deddb
reverting switch to iterators
RiccardoRossi Jul 15, 2018
6bb95b7
solving conflicts
RiccardoRossi Jul 21, 2018
0ee4faa
using wrapper
RiccardoRossi Jul 21, 2018
fc0c89a
merging master
RiccardoRossi Jul 21, 2018
6737a50
throwing an error since i cannot do this right
RiccardoRossi Jul 21, 2018
3fbe8ff
using modelpart wrapper
RiccardoRossi Jul 21, 2018
8581a55
using a static list for variable_lists
RiccardoRossi Jul 21, 2018
0424539
using modelpart wrapper
RiccardoRossi Jul 21, 2018
240a9af
using modelpart wrapper
RiccardoRossi Jul 21, 2018
7578738
updating for model v3
RiccardoRossi Jul 21, 2018
9e171fc
ensuring ModelPart constructor is not used
RiccardoRossi Jul 21, 2018
309b500
resolving a conflict in merging
RiccardoRossi Jul 21, 2018
e6fe9c7
correcting a minor problem with two root modelparts called the same
RiccardoRossi Jul 21, 2018
8f5072f
Fixing MMG process
loumalouomega Jul 22, 2018
816dfd3
Fixing tests
loumalouomega Jul 22, 2018
b4a66ac
Fixing CPP test HDF5
loumalouomega Jul 22, 2018
8bc9ebc
Fixing cpp tests
loumalouomega Jul 22, 2018
f896f54
Creating model_part from Model in UPw solver
ipouplana Jul 23, 2018
d4111f5
Merge pull request #2552 from KratosMultiphysics/poro-model_v3
ipouplana Jul 23, 2018
c853689
Merge pull request #2545 from KratosMultiphysics/meshing/model_v3-mmg…
loumalouomega Jul 24, 2018
93a1c8b
Merge pull request #2547 from KratosMultiphysics/contact/adapting-to-…
loumalouomega Jul 24, 2018
98184f8
Merge pull request #2546 from KratosMultiphysics/hdf5/model_v3-test-fix
loumalouomega Jul 25, 2018
a60c4db
Merge branch 'master' into model_v3
RiccardoRossi Oct 3, 2018
1933ac1
correction to structural mechanics application to adapt to model
RiccardoRossi Oct 3, 2018
3be251e
changes in applications to adapt to model
RiccardoRossi Oct 3, 2018
5f755cf
changes in kratos to adapt to model
RiccardoRossi Oct 3, 2018
d93587c
removing unnecessary include
RiccardoRossi Oct 3, 2018
10173c4
removing unnecessary include
RiccardoRossi Oct 3, 2018
a2db341
leftover
RiccardoRossi Oct 3, 2018
eb57d45
back to the original version
RiccardoRossi Oct 3, 2018
0d47fb6
preparing for model
RiccardoRossi Oct 3, 2018
ead6dc0
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 3, 2018
fab6cef
preparing for model
RiccardoRossi Oct 3, 2018
a0ebffd
removing unnecessary include
RiccardoRossi Oct 3, 2018
07db811
removing a ordering of initialization warning
RiccardoRossi Oct 3, 2018
58df741
removing unnecessary include
RiccardoRossi Oct 3, 2018
344a221
Merge branch 'master' into model_v3
loumalouomega Oct 3, 2018
3937c75
Missing include
loumalouomega Oct 3, 2018
9a0304a
Fixing model parts mmg_process
loumalouomega Oct 3, 2018
a298f51
Fixing metric test
loumalouomega Oct 3, 2018
1c7a2a0
Fix meshing tests
loumalouomega Oct 3, 2018
e80b0df
Correcting HDF5 tests
loumalouomega Oct 3, 2018
46e25ba
Removing warning: moving a temporary object prevents copy elision [-W…
loumalouomega Oct 3, 2018
be4f8eb
Fix process
loumalouomega Oct 3, 2018
32870dc
Fix structure reponse
loumalouomega Oct 3, 2018
48c20fe
Fixing tests in ContactStructuralMechanicsApplication
loumalouomega Oct 3, 2018
dc38b53
Tests HDF5
loumalouomega Oct 3, 2018
6d3964e
Relative path
loumalouomega Oct 3, 2018
bd97784
fix merge conflict
armingeiser Oct 4, 2018
dae83fc
adding serialization of variable list
RiccardoRossi Oct 4, 2018
c4c9f56
fmaking restart to work
RiccardoRossi Oct 4, 2018
b1d0fd1
fixing the restart utility
RiccardoRossi Oct 4, 2018
f7a3f7f
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 4, 2018
ac0b8d6
removing leftover Reset
RiccardoRossi Oct 4, 2018
d771db2
cleaning and reverting some minor changes
philbucher Oct 4, 2018
d3a5be8
removing remaining "AddModelPart"
philbucher Oct 4, 2018
569e616
more cleaning
philbucher Oct 4, 2018
09f7431
fix trilinos app compilation
philbucher Oct 4, 2018
8eca375
fix mapping app compilation
philbucher Oct 4, 2018
f3f93f6
removing kernel.h from serializer
philbucher Oct 4, 2018
077dbca
cleaning more includes
philbucher Oct 4, 2018
5b38e06
minor cleaning
philbucher Oct 4, 2018
47ee8c9
reverting changes in ConnectivityPreserveModeler => #2982
philbucher Oct 4, 2018
bfdb400
fixing tests MappingApp
philbucher Oct 4, 2018
e910d90
revert some renamings
philbucher Oct 4, 2018
36b015c
revert in KratoUnittest
philbucher Oct 5, 2018
2c6deb1
minor revert
philbucher Oct 5, 2018
f964e8c
added test for missing ModelPart Constructor (Python)
philbucher Oct 5, 2018
3d22d65
minor
philbucher Oct 5, 2018
e10be54
getting the clean version and redoing the changes to minimize differe…
RiccardoRossi Oct 5, 2018
e2840ff
getting clean version
RiccardoRossi Oct 5, 2018
8ce29b7
removing commented code
RiccardoRossi Oct 5, 2018
ec5d913
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 5, 2018
c2b9e96
Merge remote-tracking branch 'origin/master' into model_v3
philbucher Oct 5, 2018
1f4b9e9
Corrected model redesign changes to hdf5 test.
Oct 8, 2018
6c19fbf
adding model.h include to resolve a compilation issue when not using …
RiccardoRossi Oct 8, 2018
35ebae8
Merge branch 'master' into model_v3
RiccardoRossi Oct 8, 2018
56bbddf
Solving compilation issue
Oct 9, 2018
3a37c5d
Adapting DEM app to Model v3
Oct 9, 2018
7bf9dd4
adding use of Model
RiccardoRossi Oct 9, 2018
68f0c6d
Merge branch 'master' into model_v3
philbucher Oct 9, 2018
bf59e93
Merge branch 'master' into model_v3
philbucher Oct 9, 2018
6385211
Merge branch 'master' into model_v3
loumalouomega Oct 9, 2018
789c0d8
Adaptation of DEM and SwimmingDEM to Model
Oct 10, 2018
8bb6bb0
More fixes. Now Candelier test runs ok. But FAILS!
Oct 10, 2018
17eadaa
retrocompatibility hack with warning - this change will be removed on…
RiccardoRossi Oct 10, 2018
d4c3121
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 10, 2018
f63e9fe
Merge branch 'master' into model_v3
loumalouomega Oct 10, 2018
c4e9fcd
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 11, 2018
c8ccde0
marking test as expected failure since the modelpart constructor is T…
RiccardoRossi Oct 11, 2018
3e91bc0
Merge remote-tracking branch 'origin' into model_v3
RiccardoRossi Oct 11, 2018
3c864d8
correcting a problematic use of ModelPart creation
RiccardoRossi Oct 11, 2018
87b5c31
Merge pull request #3029 from KratosMultiphysics/dem-and-sdem-model
Oct 11, 2018
794d699
removing unneeded model.h include
RiccardoRossi Oct 15, 2018
5d4c1f2
using kratos info in error message and reducing its size
RiccardoRossi Oct 15, 2018
bfb90cb
removing spurious comment
RiccardoRossi Oct 15, 2018
44eb625
merging
RiccardoRossi Oct 16, 2018
aca4bd9
changing variable name
RiccardoRossi Oct 16, 2018
0fb3d52
adding Delete,Rename and GetOwnerModel tests
RiccardoRossi Oct 16, 2018
e16bd21
making it to run with the model
RiccardoRossi Oct 16, 2018
4509a04
make DeleteModelPart not to fail if modelpart does not exist any longer
RiccardoRossi Oct 16, 2018
1684523
removing test that is faling
RiccardoRossi Oct 16, 2018
d50fea7
give a warning instead of an error if trying to delete an existing mo…
RiccardoRossi Oct 16, 2018
1dbbb9e
Adaptation to model of PfemFluid
AFranci Oct 16, 2018
dba53ff
Updating old format files to Model v3
ipouplana Oct 16, 2018
5501903
Update applications/PfemFluidDynamicsApplication/python_scripts/MainF…
Oct 17, 2018
ec751d7
add model.h
RiccardoRossi Oct 17, 2018
9f9c81e
Merge remote-tracking branch 'origin' into model_v3
RiccardoRossi Oct 17, 2018
75a78e1
trying to fix DEM tests
Oct 17, 2018
b33150f
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 17, 2018
e1d5790
Merge pull request #3079 from KratosMultiphysics/poro-model_v3-new-up…
ipouplana Oct 17, 2018
e10cdb4
Fixing DEM tests
Oct 17, 2018
1482a5c
Merge pull request #3076 from KratosMultiphysics/feature_pfem_fluid_m…
RiccardoRossi Oct 17, 2018
42c1d62
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 17, 2018
00cb971
Merge branch 'master' into model_v3
philbucher Oct 17, 2018
3831866
Adapting test to model
philbucher Oct 17, 2018
e9c5302
adding missing model.h include
RiccardoRossi Oct 17, 2018
65f46c4
Merge branch 'model_v3' of https://github.com/KratosMultiphysics/Krat…
RiccardoRossi Oct 17, 2018
5a9a9f8
correcting a buffer size to 3
RiccardoRossi Oct 17, 2018
a1066d0
adding missing model.h include
RiccardoRossi Oct 17, 2018
5085148
Merge branch 'master' into model_v3
ipouplana Oct 17, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ namespace Kratos {

~ExplicitSolverSettings() {
}
ModelPart::Pointer r_model_part;
ModelPart::Pointer contact_model_part;
ModelPart::Pointer fem_model_part;
ModelPart::Pointer cluster_model_part;
ModelPart::Pointer inlet_model_part;
ModelPart* r_model_part;
ModelPart* contact_model_part;
ModelPart* fem_model_part;
ModelPart* cluster_model_part;
ModelPart* inlet_model_part;
};

class KRATOS_API(DEM_APPLICATION) ExplicitSolverStrategy {
Expand Down
6 changes: 4 additions & 2 deletions applications/FluidDynamicsApplication/custom_elements/vms.h
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ class VMS : public Element
this->AddMomentumRHS(rRightHandSideVector, Density, N, Area);

// For OSS: Add projection of residuals to RHS
if (rCurrentProcessInfo[OSS_SWITCH] == 1)
const ProcessInfo& r_const_process_info = rCurrentProcessInfo;
if (r_const_process_info[OSS_SWITCH] == 1)
{
array_1d<double, 3 > AdvVel;
this->GetAdvectiveVel(AdvVel, N);
Expand Down Expand Up @@ -353,7 +354,8 @@ class VMS : public Element
These terms are not used in OSS, as they belong to the finite element
space and cancel out with their projections.
*/
if (rCurrentProcessInfo[OSS_SWITCH] != 1)
const ProcessInfo& r_const_process_info = rCurrentProcessInfo;
if (r_const_process_info[OSS_SWITCH] != 1)
{
double ElemSize = this->ElementSize(Area);
double Viscosity = this->EffectiveViscosity(Density,N,DN_DX,ElemSize,rCurrentProcessInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Kratos
{
/* Public functions *******************************************************/
BoussinesqForceProcess::BoussinesqForceProcess(
ModelPart::Pointer pModelPart,
ModelPart* pModelPart,
Parameters& rParameters):
mpModelPart(pModelPart),
mrGravity(array_1d<double,3>(3,0.0))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ namespace Kratos
///@{

/// Constructor
BoussinesqForceProcess(ModelPart::Pointer pModelPart, Parameters& rParameters);
BoussinesqForceProcess(ModelPart* pModelPart, Parameters& rParameters);

/// Destructor.
~BoussinesqForceProcess() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

// Project includes
#include "includes/define.h"
#include "includes/kernel.h"
#include "containers/model.h"
#include "processes/process.h"
#include "includes/cfd_variables.h"
#include "solving_strategies/strategies/solving_strategy.h"
Expand Down Expand Up @@ -103,7 +105,13 @@ class SpalartAllmarasTurbulenceModel : public Process
unsigned int MaxIter,
bool ReformDofSet,
unsigned int TimeOrder)
: mr_model_part(rModelPart), mdomain_size(DomainSize), mtol(NonLinearTol), mmax_it(MaxIter), mtime_order(TimeOrder),madapt_for_fractional_step(false)
: mr_model_part(rModelPart),
mrspalart_model_part(Kernel::GetModel().CreateModelPart("SpalartModelPart")),
mdomain_size(DomainSize),
mtol(NonLinearTol),
mmax_it(MaxIter),
mtime_order(TimeOrder),
madapt_for_fractional_step(false)
{
//************************************************************************************************
//check that the variables needed are in the model part
Expand All @@ -129,11 +137,11 @@ class SpalartAllmarasTurbulenceModel : public Process

//************************************************************************************************
//construct a new auxiliary model part
mspalart_model_part.GetNodalSolutionStepVariablesList() = mr_model_part.GetNodalSolutionStepVariablesList();
mspalart_model_part.SetBufferSize(3);
mspalart_model_part.Nodes() = mr_model_part.Nodes();
mspalart_model_part.SetProcessInfo(mr_model_part.pGetProcessInfo());
mspalart_model_part.SetProperties(mr_model_part.pProperties());
mrspalart_model_part.GetNodalSolutionStepVariablesList() = mr_model_part.GetNodalSolutionStepVariablesList();
mrspalart_model_part.SetBufferSize(3);
mrspalart_model_part.Nodes() = mr_model_part.Nodes();
mrspalart_model_part.SetProcessInfo(mr_model_part.pGetProcessInfo());
mrspalart_model_part.SetProperties(mr_model_part.pProperties());

std::string ElementName;
if (DomainSize == 2)
Expand All @@ -148,7 +156,7 @@ class SpalartAllmarasTurbulenceModel : public Process
{
Properties::Pointer properties = iii->pGetProperties();
Element::Pointer p_element = rReferenceElement.Create(iii->Id(), iii->GetGeometry(), properties);
mspalart_model_part.Elements().push_back(p_element);
mrspalart_model_part.Elements().push_back(p_element);
}

// pointer types for the solution strategy construcion
Expand All @@ -173,7 +181,7 @@ class SpalartAllmarasTurbulenceModel : public Process
bool CalculateReactions = false;
bool MoveMesh = false;

mpSolutionStrategy = StrategyPointerType( new ResidualBasedNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(mspalart_model_part,pScheme,pLinearSolver,pConvCriteria,pBuildAndSolver,MaxIter,CalculateReactions,ReformDofSet,MoveMesh));
mpSolutionStrategy = StrategyPointerType( new ResidualBasedNewtonRaphsonStrategy<TSparseSpace, TDenseSpace, TLinearSolver>(mrspalart_model_part,pScheme,pLinearSolver,pConvCriteria,pBuildAndSolver,MaxIter,CalculateReactions,ReformDofSet,MoveMesh));
mpSolutionStrategy->SetEchoLevel(0);
mpSolutionStrategy->Check();
}
Expand All @@ -182,6 +190,7 @@ class SpalartAllmarasTurbulenceModel : public Process

~SpalartAllmarasTurbulenceModel() override
{
Kernel::GetModel().DeleteModelPart("SpalartModelPart");
}


Expand All @@ -201,22 +210,22 @@ class SpalartAllmarasTurbulenceModel : public Process

if(madapt_for_fractional_step == true)
{
if (!(mspalart_model_part.NodesBegin()->SolutionStepsDataHas(FRACT_VEL)))
if (!(mrspalart_model_part.NodesBegin()->SolutionStepsDataHas(FRACT_VEL)))
KRATOS_THROW_ERROR(std::logic_error, "Variable is not in the model part:", FRACT_VEL);

#pragma omp parallel for
for (int i = 0; i < static_cast<int>(mspalart_model_part.Nodes().size()); i++)
for (int i = 0; i < static_cast<int>(mrspalart_model_part.Nodes().size()); i++)
{
ModelPart::NodesContainerType::iterator it = mspalart_model_part.NodesBegin() + i;
ModelPart::NodesContainerType::iterator it = mrspalart_model_part.NodesBegin() + i;
it->FastGetSolutionStepValue(VELOCITY) = it->FastGetSolutionStepValue(FRACT_VEL);
}
}

AuxSolve();

//update viscosity on the nodes
for (ModelPart::NodeIterator i = mspalart_model_part.NodesBegin();
i != mspalart_model_part.NodesEnd(); ++i)
for (ModelPart::NodeIterator i = mrspalart_model_part.NodesBegin();
i != mrspalart_model_part.NodesEnd(); ++i)
{
double molecular_viscosity = i->FastGetSolutionStepValue(MOLECULAR_VISCOSITY);
double turbulent_viscosity = i->FastGetSolutionStepValue(TURBULENT_VISCOSITY);
Expand Down Expand Up @@ -264,11 +273,11 @@ class SpalartAllmarasTurbulenceModel : public Process
{
KRATOS_TRY;

mspalart_model_part.GetProcessInfo()[C_DES] = CDES;
mrspalart_model_part.GetProcessInfo()[C_DES] = CDES;
/*
//update viscosity on the nodes
for (ModelPart::NodeIterator i = mspalart_model_part.NodesBegin();
i != mspalart_model_part.NodesEnd(); ++i)
for (ModelPart::NodeIterator i = mrspalart_model_part.NodesBegin();
i != mrspalart_model_part.NodesEnd(); ++i)
{
double distance = i->FastGetSolutionStepValue(DISTANCE);
const array_1d<double,3>& xc = i->Coordinates();
Expand Down Expand Up @@ -353,7 +362,7 @@ class SpalartAllmarasTurbulenceModel : public Process
///@{

ModelPart& mr_model_part;
ModelPart mspalart_model_part;
ModelPart& mrspalart_model_part;
unsigned int mdomain_size;
double mtol;
unsigned int mmax_it;
Expand Down Expand Up @@ -390,7 +399,7 @@ class SpalartAllmarasTurbulenceModel : public Process
:
Process(),
mr_model_part(rModelPart),
mspalart_model_part()
mrspalart_model_part(Kernel::GetModel().CreateModelPart("SpalartModelPart"))
{}

///@}
Expand Down Expand Up @@ -422,7 +431,7 @@ class SpalartAllmarasTurbulenceModel : public Process
KRATOS_TRY

//calculate the BDF coefficients
ProcessInfo& rCurrentProcessInfo = mspalart_model_part.GetProcessInfo();
ProcessInfo& rCurrentProcessInfo = mrspalart_model_part.GetProcessInfo();
double Dt = rCurrentProcessInfo[DELTA_TIME];

if (mtime_order == 2)
Expand Down Expand Up @@ -509,8 +518,8 @@ class SpalartAllmarasTurbulenceModel : public Process



for (ModelPart::NodeIterator i = mspalart_model_part.NodesBegin();
i != mspalart_model_part.NodesEnd(); ++i)
for (ModelPart::NodeIterator i = mrspalart_model_part.NodesBegin();
i != mrspalart_model_part.NodesEnd(); ++i)
{
norm += pow(i->FastGetSolutionStepValue(TURBULENT_VISCOSITY), 2);
}
Expand All @@ -526,11 +535,11 @@ class SpalartAllmarasTurbulenceModel : public Process
{
KRATOS_TRY;

ProcessInfo& rCurrentProcessInfo = mspalart_model_part.GetProcessInfo();
ProcessInfo& rCurrentProcessInfo = mrspalart_model_part.GetProcessInfo();

//first of all set to zero the nodal variables to be updated nodally
for (ModelPart::NodeIterator i = mspalart_model_part.NodesBegin();
i != mspalart_model_part.NodesEnd(); ++i)
for (ModelPart::NodeIterator i = mrspalart_model_part.NodesBegin();
i != mrspalart_model_part.NodesEnd(); ++i)
{
(i)->FastGetSolutionStepValue(TEMP_CONV_PROJ) = 0.00;
(i)->FastGetSolutionStepValue(NODAL_AREA) = 0.00;
Expand All @@ -540,20 +549,20 @@ class SpalartAllmarasTurbulenceModel : public Process
//and the determination of the nodal area


for (ModelPart::ElementIterator i = mspalart_model_part.ElementsBegin();
i != mspalart_model_part.ElementsEnd(); ++i)
for (ModelPart::ElementIterator i = mrspalart_model_part.ElementsBegin();
i != mrspalart_model_part.ElementsEnd(); ++i)
{
(i)->InitializeSolutionStep(rCurrentProcessInfo);
}

Communicator& rComm = mspalart_model_part.GetCommunicator();
Communicator& rComm = mrspalart_model_part.GetCommunicator();

rComm.AssembleCurrentData(NODAL_AREA);
rComm.AssembleCurrentData(TEMP_CONV_PROJ);

// Obtain nodal projection of the residual
for (ModelPart::NodeIterator i = mspalart_model_part.NodesBegin();
i != mspalart_model_part.NodesEnd(); ++i)
for (ModelPart::NodeIterator i = mrspalart_model_part.NodesBegin();
i != mrspalart_model_part.NodesEnd(); ++i)
{
const double NodalArea = i->FastGetSolutionStepValue(NODAL_AREA);
if(NodalArea > 0.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

// Project includes
#include "includes/define.h"
#include "includes/kernel.h"
#include "containers/model.h"
#include "includes/model_part.h"
#include "processes/process.h"
#include "solving_strategies/strategies/solving_strategy.h"
Expand Down Expand Up @@ -66,24 +68,24 @@ class StokesInitializationProcess : public Process
///@name Life Cycle
///@{

StokesInitializationProcess(const ModelPart::Pointer pModelPart,
StokesInitializationProcess(ModelPart& rModelPart,
typename TLinearSolver::Pointer pLinearSolver,
unsigned int DomainSize,
const Variable<int>& PeriodicPairIndicesVar):
Process(),
mpReferenceModelPart(pModelPart),
mrReferenceModelPart(rModelPart),
mpLinearSolver(pLinearSolver),
mDomainSize(DomainSize)
{
KRATOS_TRY;

// Initialize new model part (same nodes, new elements, no conditions)
mpStokesModelPart = ModelPart::Pointer(new ModelPart("StokesModelPart"));
mpStokesModelPart->GetNodalSolutionStepVariablesList() = mpReferenceModelPart->GetNodalSolutionStepVariablesList();
mpStokesModelPart = &(Kernel::GetModel().CreateModelPart("StokesModelPart"));
mpStokesModelPart->GetNodalSolutionStepVariablesList() = mrReferenceModelPart.GetNodalSolutionStepVariablesList();
mpStokesModelPart->SetBufferSize(1);
mpStokesModelPart->SetNodes( mpReferenceModelPart->pNodes() );
mpStokesModelPart->SetProcessInfo(mpReferenceModelPart->pGetProcessInfo());
mpStokesModelPart->SetProperties(mpReferenceModelPart->pProperties());
mpStokesModelPart->SetNodes( mrReferenceModelPart.pNodes() );
mpStokesModelPart->SetProcessInfo(mrReferenceModelPart.pGetProcessInfo());
mpStokesModelPart->SetProperties(mrReferenceModelPart.pProperties());

// Retrieve Stokes element model
std::string ElementName;
Expand All @@ -95,7 +97,7 @@ class StokesInitializationProcess : public Process
const Element& rReferenceElement = KratosComponents<Element>::Get(ElementName);

// Generate Stokes elements
for (ModelPart::ElementsContainerType::iterator itElem = mpReferenceModelPart->ElementsBegin(); itElem != mpReferenceModelPart->ElementsEnd(); itElem++)
for (ModelPart::ElementsContainerType::const_iterator itElem = mrReferenceModelPart.ElementsBegin(); itElem != mrReferenceModelPart.ElementsEnd(); itElem++)
{
Element::Pointer pElem = rReferenceElement.Create(itElem->Id(), itElem->GetGeometry(), itElem->pGetProperties() );
mpStokesModelPart->Elements().push_back(pElem);
Expand Down Expand Up @@ -232,13 +234,13 @@ class StokesInitializationProcess : public Process
///@name Protected member Variables
///@{

const ModelPart::Pointer mpReferenceModelPart;
ModelPart& mrReferenceModelPart;

typename TLinearSolver::Pointer mpLinearSolver;

unsigned int mDomainSize;

ModelPart::Pointer mpStokesModelPart;
ModelPart* mpStokesModelPart;

typename SolvingStrategy<TSparseSpace, TDenseSpace, TLinearSolver>::Pointer mpSolutionStrategy;

Expand All @@ -249,12 +251,12 @@ class StokesInitializationProcess : public Process
///@{

/// Protected constructor to be used by derived classes
StokesInitializationProcess(const ModelPart::Pointer pModelPart,
StokesInitializationProcess(ModelPart& rModelPart,
typename TLinearSolver::Pointer pLinearSolver,
unsigned int DomainSize,
const StokesInitializationProcess* pThis):
Process(),
mpReferenceModelPart(pModelPart),
mrReferenceModelPart(rModelPart),
mpLinearSolver(pLinearSolver),
mDomainSize(DomainSize)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ void AddCustomProcessesToPython(pybind11::module& m)

class_<StokesInitializationProcess< SparseSpaceType, LocalSpaceType, LinearSolverType >, StokesInitializationProcess< SparseSpaceType, LocalSpaceType, LinearSolverType >::Pointer, Process>
(m,"StokesInitializationProcess")
.def(init<ModelPart::Pointer, LinearSolverType::Pointer, unsigned int, const Kratos::Variable<int>& >())
.def(init<ModelPart&, LinearSolverType::Pointer, unsigned int, const Kratos::Variable<int>& >())
.def("SetConditions",&StokesInitializationProcess<SparseSpaceType, LocalSpaceType, LinearSolverType>::SetConditions)
;

class_<BoussinesqForceProcess, BoussinesqForceProcess::Pointer, Process>
(m,"BoussinesqForceProcess")
.def(init<ModelPart::Pointer, Parameters& >())
.def(init<ModelPart*, Parameters& >())
;

class_<WindkesselModel, WindkesselModel::Pointer, Process>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ def Initialize(self):
self.solver.ImportModelPart()
self.solver.AddDofs()

self.model.AddModelPart(self.main_model_part)

# this should let eventual derived stages modify the model after reading.
self.ModifyInitialProperties()
self.ModifyInitialGeometry()
Expand Down Expand Up @@ -226,6 +224,5 @@ def _SetUpRestart(self):
primal_simulation = FluidDynamicsAnalysis(model,parameters["primal_settings"])
primal_simulation.Run()

adjoint_model = Kratos.Model()
adjoint_simulation = AdjointFluidAnalysis(adjoint_model,parameters["adjoint_settings"])
adjoint_simulation = AdjointFluidAnalysis(model,parameters["adjoint_settings"])
adjoint_simulation.Run()
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def Initialize(self):
self.solver.ImportModelPart()
self.solver.AddDofs()

self.model.AddModelPart(self.main_model_part)

# this should let eventual derived stages modify the model after reading.
self.ModifyInitialProperties()
self.ModifyInitialGeometry()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

def CreateSolver(main_model_part, custom_settings):

if (type(main_model_part) != KratosMultiphysics.ModelPart):
if (type(main_model_part) != KratosMultiphysics.ModelPartInterface):
raise Exception("input is expected to be provided as a Kratos ModelPart object")

if (type(custom_settings) != KratosMultiphysics.Parameters):
Expand Down
Loading