Skip to content

Commit

Permalink
OpenSeesNETCore
Browse files Browse the repository at this point in the history
  • Loading branch information
imeg committed Feb 28, 2020
1 parent b7eea7f commit 2869268
Show file tree
Hide file tree
Showing 42 changed files with 1,841 additions and 7,850 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ static void Main(string[] args)
tclInterp1.ClearAllUniaxialMaterialEventHandler += TclInterp1_ClearAllUniaxialMaterialEventHandler;
domain.AddNodeEventHandler += Domain_AddNodeEventHandler1;
domain.AddElementEventHandler += Domain_AddElementEventHandler;
domain.AddLoadPatternEventHandler += Domain_AddLoadPatternEventHandler;
var ret = tclInterp1.Execute("source ../m2.txt");
var disp = domain.GetNode(1).GetCommitDisp();
var resp = domain.GetElement(1).GetDoubleResponse(40);
Expand Down Expand Up @@ -109,6 +110,11 @@ static void Main(string[] args)
#endregion
}

private static void Domain_AddLoadPatternEventHandler(object sender, OpenSees.Components.DomainAddLoadPatternEventArgs e)
{
var nodalloads = e.LoadPattern.GetNodalLoads();
}

private static void TclInterp1_ClearAllUniaxialMaterialEventHandler(object sender, OpenSees.Tcl.ModelBuilder.ModelBuilderClearAllUniaxialMaterialArgs e)
{
Console.WriteLine("clear all mats");
Expand Down
42 changes: 33 additions & 9 deletions SRC/domain/domain/Domain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -882,8 +882,11 @@ Domain::addSP_Constraint(SP_Constraint* spConstraint, int pattern)
}

spConstraint->setDomain(this);
#if _DLL
if (this->_DomainEvent_AddSP_Constraint)
this->_DomainEvent_AddSP_Constraint(spConstraint, pattern);
#endif
this->domainChange();

return true;
}

Expand Down Expand Up @@ -917,7 +920,10 @@ Domain::addNodalLoad(NodalLoad* load, int pattern)

load->setDomain(this); // done in LoadPattern::addNodalLoad()
this->domainChange();

#if _DLL
if (this->_DomainEvent_AddNodalLoad)
this->_DomainEvent_AddNodalLoad(load, pattern);
#endif
return result;
}

Expand All @@ -941,7 +947,10 @@ Domain::addElementalLoad(ElementalLoad* load, int pattern)
return false;
}


#if _DLL
if (this->_DomainEvent_AddElementalLoad)
this->_DomainEvent_AddElementalLoad(load, pattern);
#endif
// load->setDomain(this); // done in LoadPattern::addElementalLoad()
this->domainChange();
return result;
Expand Down Expand Up @@ -1340,16 +1349,17 @@ Domain::removeLoadPattern(int tag)
// theSP_Constraint->setDomain(0);
}

#if _DLL
if (this->_DomainEvent_RemoveLoadPattern)
this->_DomainEvent_RemoveLoadPattern(result);
#endif

// mark the domain has having changed if numSPs > 0
// as the constraint handlers have to be redone
if (numSPs > 0)
this->domainChange();

// finally return the load pattern
#if _DLL
if (this->_DomainEvent_RemoveLoadPattern)
this->_DomainEvent_RemoveLoadPattern(result);
#endif

return result;
}
Expand All @@ -1367,8 +1377,13 @@ Domain::removeNodalLoad(int tag, int loadPattern)
// if not there return 0
if (theLoadPattern == 0)
return 0;
NodalLoad* removedItem = theLoadPattern->removeNodalLoad(tag);
#if _DLL
if (this->_DomainEvent_RemoveNodalLoad)
this->_DomainEvent_RemoveNodalLoad(removedItem);
#endif

return theLoadPattern->removeNodalLoad(tag);
return removedItem;
}


Expand All @@ -1382,7 +1397,12 @@ Domain::removeElementalLoad(int tag, int loadPattern)
if (theLoadPattern == 0)
return 0;

return theLoadPattern->removeElementalLoad(tag);
ElementalLoad* removedItem = theLoadPattern->removeElementalLoad(tag);
#if _DLL
if (this->_DomainEvent_RemoveElementalLoad)
this->_DomainEvent_RemoveElementalLoad(removedItem);
#endif
return removedItem;
}


Expand All @@ -1397,6 +1417,10 @@ Domain::removeSP_Constraint(int tag, int loadPattern)
return 0;

SP_Constraint* theSP = theLoadPattern->removeSP_Constraint(tag);
#if _DLL
if (this->_DomainEvent_RemoveSP_Constraint)
this->_DomainEvent_RemoveSP_Constraint(theSP);
#endif
if (theSP != 0)
this->domainChange();

Expand Down
12 changes: 12 additions & 0 deletions SRC/domain/domain/Domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ typedef int(__stdcall* DomainEvent_AddLoadPattern) (LoadPattern* lp);
typedef int(__stdcall* DomainEvent_RemoveLoadPattern) (LoadPattern* lp);
typedef int(__stdcall* DomainEvent_AddRecorder) (Recorder* rec);
typedef int(__stdcall* DomainEvent_RemoveRecorder) (Recorder* rec);
typedef int(__stdcall* DomainEvent_AddNodalLoad) (NodalLoad* nl,int pat);
typedef int(__stdcall* DomainEvent_RemoveNodalLoad) (NodalLoad* nl);
typedef int(__stdcall* DomainEvent_AddElementalLoad) (ElementalLoad* el,int pat);
typedef int(__stdcall* DomainEvent_RemoveElementalLoad) (ElementalLoad* el);
typedef int(__stdcall* DomainEvent_AddSP_Constraint) (SP_Constraint* sp, int pat);
typedef int(__stdcall* DomainEvent_RemoveSP_Constraint) (SP_Constraint* rec);
typedef int(__stdcall* DomainEvent_ClearAll) ();

class Domain
Expand Down Expand Up @@ -262,6 +268,12 @@ class Domain
DomainEvent_AddRecorder _DomainEvent_AddRecorder;
DomainEvent_RemoveRecorder _DomainEvent_RemoveRecorder;
DomainEvent_ClearAll _DomainEvent_ClearAll;
DomainEvent_AddNodalLoad _DomainEvent_AddNodalLoad;
DomainEvent_RemoveNodalLoad _DomainEvent_RemoveNodalLoad;
DomainEvent_AddElementalLoad _DomainEvent_AddElementalLoad;
DomainEvent_RemoveElementalLoad _DomainEvent_RemoveElementalLoad;
DomainEvent_AddSP_Constraint _DomainEvent_AddSP_Constraint;
DomainEvent_RemoveSP_Constraint _DomainEvent_RemoveSP_Constraint;
Recorder** theRecorders;
int numRecorders;
#endif
Expand Down
5 changes: 5 additions & 0 deletions SRC/domain/node/NodalLoad.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class NodalLoad : public Load
virtual void applyLoad(Vector& loadFactors);
virtual const Vector &getData(int& type);
//Change made by Liming for NodalThermalAction [SIF]
#if _DLL
virtual inline Vector* getLoadVector() {
return load;
};
#endif

protected:

Expand Down
18 changes: 18 additions & 0 deletions SRC/tcl/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ OPS_Stream *opserrPtr = &sserr;
#include <HSConstraint.h>
#include <MinUnbalDispNorm.h>
#include <DisplacementControl.h>
#include <EQPath.h>

#include <PFEMIntegrator.h>
#include <Integrator.h>//Abbas
Expand Down Expand Up @@ -4320,6 +4321,23 @@ specifyIntegrator(ClientData clientData, Tcl_Interp *interp, int argc,
if (theStaticAnalysis != 0)
theStaticAnalysis->setIntegrator(*theStaticIntegrator);
}
else if (strcmp(argv[1], "eqpath") == 0) {
double arcLength;
int method;
if (argc != 4) {
opserr << "WARNING integrator eqpath arcLength method \n";
return TCL_ERROR;
}
if (Tcl_GetDouble(interp, argv[2], &arcLength) != TCL_OK)
return TCL_ERROR;
if (Tcl_GetInt(interp, argv[3], &method) != TCL_OK)
return TCL_ERROR;
theStaticIntegrator = new EQPath(arcLength, method);

// if the analysis exists - we want to change the Integrator
if (theStaticAnalysis != 0)
theStaticAnalysis->setIntegrator(*theStaticIntegrator);
}
/************************added for HSConstraint*************************************/

else if (strcmp(argv[1],"HSConstraint") == 0) {
Expand Down
55 changes: 53 additions & 2 deletions Win64/OpenSees.sln
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,35 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenSeesNET", "proj\OpenSee
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestTclInterp", "..\EXAMPLES\OpenSees.NET Examples\Test Tcl Interp\TestTclInterp\TestTclInterp.csproj", "{DB461C73-9C14-4A8E-912B-AD69C1AA2863}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "OpenSeesNETCore", "proj\OpenSeesNETCore\OpenSeesNETCore.vcxproj", "{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}"
ProjectSection(ProjectDependencies) = postProject
{767A7605-A645-C010-DCDD-F981DD6E0A61} = {767A7605-A645-C010-DCDD-F981DD6E0A61}
{8062B50D-A609-33D0-8223-81D898DE05D5} = {8062B50D-A609-33D0-8223-81D898DE05D5}
{5BB0E918-CE81-7129-15F5-2A3470E92427} = {5BB0E918-CE81-7129-15F5-2A3470E92427}
{63511522-EBEF-1468-AD6B-0F365CA756A9} = {63511522-EBEF-1468-AD6B-0F365CA756A9}
{A2422B53-1A88-CBC2-AAA3-3A727C91E852} = {A2422B53-1A88-CBC2-AAA3-3A727C91E852}
{10BE1D68-585D-6B54-0C7F-0CF2962C52F1} = {10BE1D68-585D-6B54-0C7F-0CF2962C52F1}
{72CEB368-613B-3977-7BE6-0155A5F1DDBC} = {72CEB368-613B-3977-7BE6-0155A5F1DDBC}
{0384B869-E55C-43F9-919C-9DB5E9F1D2D4} = {0384B869-E55C-43F9-919C-9DB5E9F1D2D4}
{D4304671-12AD-A3AB-E4C8-90005C96311C} = {D4304671-12AD-A3AB-E4C8-90005C96311C}
{C7780C72-E360-AB77-79D6-F5CEB52C2F00} = {C7780C72-E360-AB77-79D6-F5CEB52C2F00}
{D1C15272-E650-4BE0-9DAF-B79F984D623D} = {D1C15272-E650-4BE0-9DAF-B79F984D623D}
{A6947A93-DFD1-060E-F426-AE10230F7861} = {A6947A93-DFD1-060E-F426-AE10230F7861}
{2B908396-B6B4-C511-D0E2-87620530AAA2} = {2B908396-B6B4-C511-D0E2-87620530AAA2}
{B3B28EAB-160F-635A-CD8A-4C4BAA55CF78} = {B3B28EAB-160F-635A-CD8A-4C4BAA55CF78}
{71832CB0-ED48-1CAF-ECB3-B9AD954D38E5} = {71832CB0-ED48-1CAF-ECB3-B9AD954D38E5}
{0775A4B2-93D2-4440-83B7-C1DF58021602} = {0775A4B2-93D2-4440-83B7-C1DF58021602}
{771CF0B5-A9ED-0CBA-DCC2-94EE2FF499E8} = {771CF0B5-A9ED-0CBA-DCC2-94EE2FF499E8}
{B4F48ABB-2789-4753-AA82-7E2C1954D31A} = {B4F48ABB-2789-4753-AA82-7E2C1954D31A}
{D9026BC0-B5BF-3BE9-E9CB-3491638F2C38} = {D9026BC0-B5BF-3BE9-E9CB-3491638F2C38}
{542B4EC8-400F-4BE5-A0A1-A53E8830606C} = {542B4EC8-400F-4BE5-A0A1-A53E8830606C}
{E68180C9-479C-A9C1-3832-CEF06B7F9D8C} = {E68180C9-479C-A9C1-3832-CEF06B7F9D8C}
{931A4DE5-3AF2-18C7-6370-37E5DEDA392A} = {931A4DE5-3AF2-18C7-6370-37E5DEDA392A}
{3285D0EF-7169-F5BE-C3AC-3752AAEBB765} = {3285D0EF-7169-F5BE-C3AC-3752AAEBB765}
{85F9E3F0-A6E0-6A77-9683-7150B4BE5A09} = {85F9E3F0-A6E0-6A77-9683-7150B4BE5A09}
{310DC5FA-1613-D953-4008-15056952E467} = {310DC5FA-1613-D953-4008-15056952E467}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug.DLL|Any CPU = Debug.DLL|Any CPU
Expand Down Expand Up @@ -558,8 +587,8 @@ Global
{0384B869-E55C-43F9-919C-9DB5E9F1D2D4}.Release|x86.ActiveCfg = Release|Win32
{0384B869-E55C-43F9-919C-9DB5E9F1D2D4}.Release|x86.Build.0 = Release|Win32
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|Any CPU.ActiveCfg = Debug.DLL|Win32
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x64.ActiveCfg = Debug|x64
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x64.Build.0 = Debug|x64
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x64.Build.0 = Debug.DLL|x64
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x86.ActiveCfg = Debug|Win32
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug.DLL|x86.Build.0 = Debug|Win32
{AEE65078-1C94-4379-8A03-E6E820239F51}.Debug|Any CPU.ActiveCfg = Debug|Win32
Expand Down Expand Up @@ -601,6 +630,28 @@ Global
{DB461C73-9C14-4A8E-912B-AD69C1AA2863}.Release|x64.Build.0 = Release|x64
{DB461C73-9C14-4A8E-912B-AD69C1AA2863}.Release|x86.ActiveCfg = Release|Any CPU
{DB461C73-9C14-4A8E-912B-AD69C1AA2863}.Release|x86.Build.0 = Release|Any CPU
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|Any CPU.ActiveCfg = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|Any CPU.Build.0 = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|x64.ActiveCfg = Debug.DLL|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|x64.Build.0 = Debug.DLL|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|x86.ActiveCfg = Debug|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug.DLL|x86.Build.0 = Debug|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug|Any CPU.ActiveCfg = Debug|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug|x64.ActiveCfg = Debug|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug|x64.Build.0 = Debug|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug|x86.ActiveCfg = Debug|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Debug|x86.Build.0 = Debug|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|Any CPU.ActiveCfg = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|Any CPU.Build.0 = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|x64.ActiveCfg = Release.DLL|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|x64.Build.0 = Release.DLL|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|x86.ActiveCfg = Release|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release.DLL|x86.Build.0 = Release|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release|Any CPU.ActiveCfg = Release|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release|x64.ActiveCfg = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release|x64.Build.0 = Release|x64
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release|x86.ActiveCfg = Release|Win32
{486E32B5-EEA1-4C5F-87CD-02F54CBD15AA}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Loading

0 comments on commit 2869268

Please sign in to comment.