Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cm3Libraries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm3
cm3Libraries
Commits
5af95953
Commit
5af95953
authored
9 months ago
by
mohib
Browse files
Options
Downloads
Patches
Plain Diff
[GenericCrackPhaseField] - Creation of mlaw
parent
26fc537c
No related branches found
No related tags found
1 merge request
!427
[GenericCrackPhaseField] - Feature | Benchmark
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.cpp
+87
-0
87 additions, 0 deletions
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.cpp
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.h
+48
-0
48 additions, 0 deletions
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.h
with
135 additions
and
0 deletions
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.cpp
0 → 100644
+
87
−
0
View file @
5af95953
//
// C++ Interface: material law
//
// Description: Generic Crack Phase Field
//
// Mohib Mustafa
// 03/12/24
#include
"mlawNonLocalDamage.h"
#include
"mlawGenericCrackPhaseField.h"
mlawGenericCrackPhaseField
::
mlawGenericCrackPhaseField
(
const
int
num
,
const
double
rho
,
const
double
lc
,
const
double
gc
)
:
materialLaw
(
num
,
true
),
_rho
(
rho
),
_lc
(
lc
),
_gc
(
gc
){
_matlaw
=
NULL
;
}
mlawGenericCrackPhaseField
::
mlawGenericCrackPhaseField
(
const
mlawGenericCrackPhaseField
&
source
)
:
materialLaw
(
source
),
_matlaw
(
NULL
),
_rho
(
source
.
_rho
),
_lc
(
source
.
_lc
),
_gc
(
source
.
_gc
)
{
if
(
source
.
_matlaw
!=
NULL
)
{
if
(
_matlaw
!=
NULL
)
{
delete
_matlaw
;
_matlaw
=
NULL
;
}
_matlaw
=
source
.
_matlaw
->
clone
();
}
}
void
mlawGenericCrackPhaseField
::
setMechanicalMaterialLaw
(
const
materialLaw
*
matlaw
)
{
if
(
_matlaw
!=
NULL
)
{
delete
_matlaw
;
_matlaw
=
NULL
;
}
_matlaw
=
matlaw
->
clone
();
}
const
materialLaw
&
mlawGenericCrackPhaseField
::
getConstRefMechanicalMaterialLaw
()
const
{
if
(
_matlaw
==
NULL
)
{
Msg
::
Error
(
"getConstRefMechanicalMaterialLaw: Mechanic law is null"
);
}
return
*
_matlaw
;
}
materialLaw
&
mlawGenericCrackPhaseField
::
getRefMechanicalMaterialLaw
()
{
if
(
_matlaw
==
NULL
)
{
Msg
::
Error
(
"getRefMechanicalMaterialLaw: Mechanic law is null"
);
}
return
*
_matlaw
;
}
void
mlawGenericCrackPhaseField
::
setTime
(
const
double
ctime
,
const
double
dtime
)
{
materialLaw
::
setTime
(
ctime
,
dtime
);
if
(
_matlaw
==
NULL
)
{
Msg
::
Error
(
"setTime: Mechanic law is null"
);
}
_matlaw
->
setTime
(
ctime
,
dtime
);
}
void
mlawGenericCrackPhaseField
::
setMacroSolver
(
const
nonLinearMechSolver
*
sv
)
{
materialLaw
::
setMacroSolver
(
sv
);
if
(
_matlaw
==
NULL
)
{
Msg
::
Error
(
"setMacroSolver: Mechanic law is null"
);
}
_matlaw
->
setMacroSolver
(
sv
);
}
mlawGenericCrackPhaseField
&
mlawGenericCrackPhaseField
::
operator
=
(
const
materialLaw
&
source
){
materialLaw
::
operator
=
(
source
);
const
mlawGenericCrackPhaseField
*
src
=
static_cast
<
const
mlawGenericCrackPhaseField
*>
(
&
source
);
_rho
=
src
->
_rho
;
_lc
=
src
->
_lc
;
_gc
=
src
->
_gc
;
return
*
this
;
}
mlawGenericCrackPhaseField
::~
mlawGenericCrackPhaseField
()
{
if
(
_matlaw
!=
NULL
)
{
delete
_matlaw
;
_matlaw
=
NULL
;
}
}
This diff is collapsed.
Click to expand it.
NonLinearSolver/materialLaw/mlawGenericCrackPhaseField.h
0 → 100644
+
48
−
0
View file @
5af95953
//
// C++ Interface: material law
//
// Description: Generic Crack Phase Field
//
// Mohib Mustafa
// 03/12/24
#ifndef MLAWGENERICCRACKPHASEFIELD_H
#define MLAWGENERICCRACKPHASEFIELD_H
#include
"mlaw.h"
#include
"mlawNonLocalDamage.h"
#include
"material.h"
#include
"../../../gmsh/contrib/domhex/cross3D.h"
#include
"../../../gmsh/contrib/untangle/mat.h"
class
mlawGenericCrackPhaseField
:
public
materialLaw
{
protected:
materialLaw
*
_matlaw
;
double
_rho
;
double
_lc
;
double
_gc
;
public:
mlawGenericCrackPhaseField
(
int
num
,
double
rho
,
double
lc
,
double
gc
);
virtual
void
setMechanicalMaterialLaw
(
const
materialLaw
*
matlaw
);
const
materialLaw
&
getConstRefMechanicalMaterialLaw
()
const
;
materialLaw
&
getRefMechanicalMaterialLaw
();
virtual
void
setTime
(
const
double
ctime
,
const
double
dtime
);
virtual
void
setMacroSolver
(
const
nonLinearMechSolver
*
sv
);
#ifndef SWIG
mlawGenericCrackPhaseField
(
const
mlawGenericCrackPhaseField
&
source
);
virtual
~
mlawGenericCrackPhaseField
();
mlawGenericCrackPhaseField
&
operator
=
(
const
materialLaw
&
source
);
//irtual materialLaw* clone() const {return new mlawGenericCrackPhaseField(*this);}
#endif //SWIG
};
#endif //MLAWGENERICCRACKPHASEFIELD_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment